Chroma
ChromaReader #
基类: BaseReader
Chroma 阅读器。
从现有持久化 Chroma 集合中检索文档。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
collection_name
|
str
|
持久化集合的名称。 |
必需 |
可选[str] persist_directory
|
persist_directory
|
集合持久化的目录。 |
无
|
源代码位于 llama-index-integrations/readers/llama-index-readers-chroma/llama_index/readers/chroma/base.py
9 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 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 |
|
create_documents #
create_documents(results: Any) -> List[Document]
从结果创建文档。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
results
|
任意
|
查询结果。 |
必需 |
返回
类型 | 描述 |
---|---|
列表[Document]
|
文档列表。 |
源代码位于 llama-index-integrations/readers/llama-index-readers-chroma/llama_index/readers/chroma/base.py
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 |
|
load_data #
load_data(query_embedding: Optional[List[float]] = None, limit: int = 10, where: Optional[dict] = None, where_document: Optional[dict] = None, query: Optional[Union[str, List[str]]] = None) -> Any
从集合中加载数据。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
limit
|
整型
|
要返回的结果数量。 |
10
|
where
|
可选[字典]
|
按元数据过滤结果。{"metadata_field": "is_equal_to_this"} |
无
|
where_document
|
可选[字典]
|
按文档过滤结果。{"$contains":"search_string"} |
无
|
返回
类型 | 描述 |
---|---|
任意
|
文档列表。 |
源代码位于 llama-index-integrations/readers/llama-index-readers-chroma/llama_index/readers/chroma/base.py
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 |
|