llama-index storage-chat-store aws dynamodb integration
Project description
LlamaIndex Chat_Store Integration: DynamoDB Chat Store
This enables AWS DynamoDB to be used as a chat store.
Installation
pip install llama-index-storage-chat-store-dynamodb
Usage
Assumptions
-
SessionID, a string, is used as the partition key. -
The table used for the chat store already exists. Here is an example for that:
import boto3 dynamodb = boto3.resource("dynamodb") # Create the DynamoDB table. table = dynamodb.create_table( TableName="EXAMPLE_TABLE", KeySchema=[{"AttributeName": "SessionId", "KeyType": "HASH"}], AttributeDefinitions=[ {"AttributeName": "SessionId", "AttributeType": "S"} ], BillingMode="PAY_PER_REQUEST", )
Using an AWS IAM Role
You can use any of the following AWS arguments to setup the required boto3 resource connection:
profile_nameaws_access_key_idaws_secret_access_keyaws_session_tokenbotocore_session- A pre-existing existing Botocore session.botocore_config
As an example, if you have already assumed an AWS profile in your local environment or within an AWS compute environment, you can simply do the following:
import os
from llama_index.storage.chat_store.dynamodb.base import DynamoDBChatStore
store = DynamoDBChatStore(
profile_name=os.getenv("AWS_PROFILE"),
table_name="EXAMPLE_TABLE",
session_id="123",
)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_storage_chat_store_dynamodb-0.2.0.tar.gz.
File metadata
- Download URL: llama_index_storage_chat_store_dynamodb-0.2.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.8.0-1014-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
616236c69454f1dc123bcc54236b872312bc6f346e687ce27142dc9bba046bd2
|
|
| MD5 |
1d8310314c002364b33c8fb801dc63fc
|
|
| BLAKE2b-256 |
a68a755078831bd99f5c69be167205e7d0aafea1a2439bab6965f5559bfa7d50
|
File details
Details for the file llama_index_storage_chat_store_dynamodb-0.2.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_storage_chat_store_dynamodb-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.8.0-1014-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c7b2a5fcb96f7287b2b7fb7f326eda73f25967f57bf1c0b8a050c241f3cc1d2
|
|
| MD5 |
ae2aa8fec43100bf64855760550f0fcc
|
|
| BLAKE2b-256 |
e5f338da7b88c8eff535f473e8df4ea30bf4bb72e0c6e55195990b46c804abd6
|