跳转到内容

DuckDB

DuckDB文档存储 #

基类:EventKVDocumentStore

DuckDB 文档(节点)存储。

一个用于文档和节点对象的 DuckDB 存储。

参数:

名称 类型 描述 默认
duckdb_kvstore DuckDBKVStore

DuckDB 键值存储

required
namespace str

文档存储的命名空间

None
workflows/handler.py 中的源代码llama_index/storage/docstore/duckdb/base.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
class DuckDBDocumentStore(KVDocumentStore):
    """
    DuckDB Document (Node) store.

    A DuckDB store for Document and Node objects.

    Args:
        duckdb_kvstore (DuckDBKVStore): DuckDB key-value store
        namespace (str): namespace for the docstore

    """

    def __init__(
        self,
        duckdb_kvstore: DuckDBKVStore,
        namespace: Optional[str] = None,
        batch_size: int = DEFAULT_BATCH_SIZE,
    ) -> None:
        """Init a DuckDBDocumentStore."""
        super().__init__(duckdb_kvstore, namespace=namespace, batch_size=batch_size)
        # avoid conflicts with duckdb index store
        self._node_collection = f"{self._namespace}/doc"

选项: 成员:- DuckDBDocumentStore