Astra DB
AstraDBReader #
基类:BaseReader
Astra DB 阅读器。
从 Astra DB 实例检索文档。
参数
名称 | 类型 | 描述 | 默认 |
---|---|---|---|
collection_name
|
str
|
要使用的集合名称。如果不存在,则会自动创建。 |
必需 |
token
|
str
|
要使用的 Astra DB 应用程序令牌。 |
必需 |
api_endpoint
|
str
|
您的数据库的 Astra DB JSON API 端点。 |
必需 |
embedding_dimension
|
int
|
正在使用的嵌入向量的长度。 |
必需 |
namespace
|
可选[str]
|
要使用的命名空间。如果未提供,则使用 'default_keyspace' |
无
|
client
|
可选[Any]
|
要使用的 Astra DB 客户端。如果未提供,则会创建一个。 |
无
|
源代码位于 llama-index-integrations/readers/llama-index-readers-astra-db/llama_index/readers/astra_db/base.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 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 |
|
load_data #
load_data(vector: List[float], limit: int = 10, **kwargs: Any) -> Any
从 Astra DB 加载数据。
参数
名称 | 类型 | 描述 | 默认 |
---|---|---|---|
vector
|
Any
|
查询 |
必需 |
limit
|
int
|
要返回的结果数量。 |
10
|
kwargs
|
Any
|
要传递给 Astra DB 查询的附加参数。 |
{}
|
返回值
类型 | 描述 |
---|---|
Any
|
List[Document]:文档列表。 |
源代码位于 llama-index-integrations/readers/llama-index-readers-astra-db/llama_index/readers/astra_db/base.py
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 |
|