Astra db
AstraDBReader #
Bases: BaseReader
Astra DB 读取器。
从 Astra DB 实例中检索文档。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection_name |
str
|
要使用的集合名称。如果不存在,将被创建。 |
required |
token |
str
|
要使用的 Astra DB 应用程序令牌。 |
required |
api_endpoint |
str
|
数据库的 Astra DB JSON API 端点。 |
required |
embedding_dimension |
int
|
使用的嵌入向量的长度。 |
required |
namespace |
Optional[str]
|
要使用的命名空间。如果未提供,则为 'default_keyspace'。 |
None
|
client |
Optional[Any]
|
要使用的 Astra DB 客户端。如果未提供,将创建一个。 |
None
|
Source code in 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 |
|
load_data #
load_data(
vector: List[float], limit: int = 10, **kwargs: Any
) -> Any
从Astra DB加载数据。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vector |
Any
|
查询 |
required |
limit |
int
|
要返回的结果数量。 |
10
|
kwargs |
Any
|
传递给Astra DB查询的其他参数。 |
{}
|
Returns:
Type | Description |
---|---|
Any
|
List[Document]: 文档列表。 |
Source code in llama_index/readers/astra_db/base.py
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 |
|