Skip to content

Commit 2cd77a5

Browse files
ashvin-aashvin-anilefriisccurme
authored
docs: Add docstrings for CassandraChatMessageHistory class and package namespace function. (langchain-ai#24222)
- Modified docstring for CassandraChatMessageHistory in libs/community/langchain_community/chat_message_history/cassandra.py. - Added docstring for _package_namespace function in docs/api_reference/create_api_rst.py --------- Co-authored-by: ashvin <ashvin.anilkumar@qburst.com> Co-authored-by: Erick Friis <erick@langchain.dev> Co-authored-by: ccurme <chester.curme@gmail.com>
1 parent 8788a34 commit 2cd77a5

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

docs/api_reference/create_api_rst.py

+8
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,14 @@ def _build_rst_file(package_name: str = "langchain") -> None:
471471

472472

473473
def _package_namespace(package_name: str) -> str:
474+
"""Returns the package name used.
475+
476+
Args:
477+
package_name: Can be either "langchain" or "core" or "experimental".
478+
479+
Returns:
480+
modified package_name: Can be either "langchain" or "langchain_{package_name}"
481+
"""
474482
return (
475483
package_name
476484
if package_name == "langchain"

libs/community/langchain_community/chat_message_histories/cassandra.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ def _rows_to_messages(rows: Iterable[RowType]) -> List[BaseMessage]:
3131

3232

3333
class CassandraChatMessageHistory(BaseChatMessageHistory):
34+
"""Chat message history that is backed by Cassandra."""
35+
3436
def __init__(
3537
self,
3638
session_id: str,
@@ -41,7 +43,8 @@ def __init__(
4143
*,
4244
setup_mode: SetupMode = SetupMode.SYNC,
4345
) -> None:
44-
"""Chat message history that stores history in Cassandra.
46+
"""
47+
Initialize a new instance of CassandraChatMessageHistory.
4548
4649
Args:
4750
session_id: arbitrary key that is used to store the messages

0 commit comments

Comments
 (0)