Skip to content

Dynamodb

DynamoDBIndexStore #

Bases: KVIndexStore

Source code in llama_index/storage/index_store/dynamodb/base.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
class DynamoDBIndexStore(KVIndexStore):
    def __init__(self, dynamodb_kvstore: DynamoDBKVStore, namespace: str | None = None):
        """初始化一个DynamoDBIndexStore。"""
        super().__init__(kvstore=dynamodb_kvstore, namespace=namespace)

    @classmethod
    def from_table_name(
        cls, table_name: str, namespace: str | None = None
    ) -> DynamoDBIndexStore:
        """从DynamoDB表名加载DynamoDBIndexStore。"""
        ddb_kvstore = DynamoDBKVStore.from_table_name(table_name=table_name)
        return cls(dynamodb_kvstore=ddb_kvstore, namespace=namespace)

from_table_name classmethod #

from_table_name(
    table_name: str, namespace: str | None = None
) -> DynamoDBIndexStore

从DynamoDB表名加载DynamoDBIndexStore。

Source code in llama_index/storage/index_store/dynamodb/base.py
12
13
14
15
16
17
18
@classmethod
def from_table_name(
    cls, table_name: str, namespace: str | None = None
) -> DynamoDBIndexStore:
    """从DynamoDB表名加载DynamoDBIndexStore。"""
    ddb_kvstore = DynamoDBKVStore.from_table_name(table_name=table_name)
    return cls(dynamodb_kvstore=ddb_kvstore, namespace=namespace)