Vertexai
VertexAIIndex #
基类:BaseManagedIndex
Vertex AI 索引。
Vertex AI RAG 索引实现了使用 Vertex AI 作为后端的托管索引。Vertex AI 在后端执行了传统索引中的许多功能: - 将文档分解成块(节点) - 为每个块(节点)创建嵌入 - 执行搜索以查找与查询最相似的 top k 个节点 - 可选地可以对 top k 个节点进行摘要
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
show_progress
|
bool
|
是否显示 tqdm 进度条。默认为 False。 |
False
|
源码位于 llama-index-integrations/indices/llama-index-indices-managed-vertexai/llama_index/indices/managed/vertexai/base.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
导入文件 #
import_files(uris: Sequence[str], chunk_size: Optional[int] = None, chunk_overlap: Optional[int] = None, timeout: Optional[int] = None, **kwargs: Any) -> ImportRagFilesResponse
将 Google Cloud Storage 或 Google Drive 文件导入索引。
源码位于 llama-index-integrations/indices/llama-index-indices-managed-vertexai/llama_index/indices/managed/vertexai/base.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|
插入文件 #
insert_file(file_path: str, metadata: Optional[dict] = None, **insert_kwargs: Any) -> Optional[str]
将本地文件插入索引。
源码位于 llama-index-integrations/indices/llama-index-indices-managed-vertexai/llama_index/indices/managed/vertexai/base.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
列出文件 #
list_files() -> Sequence[str]
列出索引中的所有文件。
源码位于 llama-index-integrations/indices/llama-index-indices-managed-vertexai/llama_index/indices/managed/vertexai/base.py
142 143 144 145 146 147 148 |
|
删除文件 #
delete_file(file_name: str) -> None
从索引中删除文件。
源码位于 llama-index-integrations/indices/llama-index-indices-managed-vertexai/llama_index/indices/managed/vertexai/base.py
150 151 152 153 |
|
作为检索器 #
as_retriever(**kwargs: Any) -> BaseRetriever
为此托管索引返回一个检索器。
源码位于 llama-index-integrations/indices/llama-index-indices-managed-vertexai/llama_index/indices/managed/vertexai/base.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
|
删除参考文档 #
delete_ref_doc(ref_doc_id: str, delete_from_docstore: bool = False, **delete_kwargs: Any) -> None
使用 ref_doc_id 删除文档及其节点。
源码位于 llama-index-integrations/indices/llama-index-indices-managed-vertexai/llama_index/indices/managed/vertexai/base.py
184 185 186 187 188 189 190 191 192 193 |
|
更新参考文档 #
update_ref_doc(document: Document, **update_kwargs: Any) -> None
更新文档及其对应的节点。
源码位于 llama-index-integrations/indices/llama-index-indices-managed-vertexai/llama_index/indices/managed/vertexai/base.py
195 196 197 |
|