Skip to content

Commit

Permalink
Add missing async_astra_db_client param to AstraDBChatMessageHistory
Browse files Browse the repository at this point in the history
  • Loading branch information
cbornet committed Feb 19, 2024
1 parent 1d2aa19 commit 37ce781
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
)

if TYPE_CHECKING:
from astrapy.db import AstraDB
from astrapy.db import AstraDB, AsyncAstraDB

from langchain_core.chat_history import BaseChatMessageHistory
from langchain_core.messages import (
Expand All @@ -35,6 +35,8 @@ class AstraDBChatMessageHistory(BaseChatMessageHistory):
such as "https://<DB-ID>-us-east1.apps.astra.datastax.com".
astra_db_client (Optional[Any]): *alternative to token+api_endpoint*,
you can pass an already-created 'astrapy.db.AstraDB' instance.
async_astra_db_client: *alternative to token+api_endpoint*,
you can pass an already-created 'astrapy.db.AsyncAstraDB' instance.
namespace (Optional[str]): namespace (aka keyspace) where the
collection is created. Defaults to the database's "default namespace".
"""
Expand All @@ -47,6 +49,7 @@ def __init__(
token: Optional[str] = None,
api_endpoint: Optional[str] = None,
astra_db_client: Optional[AstraDB] = None,
async_astra_db_client: Optional[AsyncAstraDB] = None,
namespace: Optional[str] = None,
setup_mode: SetupMode = SetupMode.SYNC,
pre_delete_collection: bool = False,
Expand All @@ -57,6 +60,7 @@ def __init__(
token=token,
api_endpoint=api_endpoint,
astra_db_client=astra_db_client,
async_astra_db_client=async_astra_db_client,
namespace=namespace,
setup_mode=setup_mode,
pre_delete_collection=pre_delete_collection,
Expand Down

0 comments on commit 37ce781

Please sign in to comment.