Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zep Authentication #6725

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions langchain/memory/chat_message_histories/zep.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class ZepChatMessageHistory(BaseChatMessageHistory):
zep_chat_history = ZepChatMessageHistory(
session_id=session_id,
url=ZEP_API_URL,
api_key=<your_api_key>,
)

# Use a standard ConversationBufferMemory to encapsulate the Zep chat history
Expand All @@ -37,7 +38,8 @@ class ZepChatMessageHistory(BaseChatMessageHistory):
summarizes, embeds, indexes, and enriches conversational AI chat
histories, and exposes them via simple, low-latency APIs.

For server installation instructions and more, see: https://getzep.github.io/
For server installation instructions and more, see:
https://docs.getzep.com/deployment/quickstart/

This class is a thin wrapper around the zep-python package. Additional
Zep functionality is exposed via the `zep_summary` and `zep_messages`
Expand All @@ -51,6 +53,7 @@ def __init__(
self,
session_id: str,
url: str = "http://localhost:8000",
api_key: Optional[str] = None,
) -> None:
try:
from zep_python import ZepClient
Expand All @@ -60,7 +63,7 @@ def __init__(
"Please install it with `pip install zep-python`."
)

self.zep_client = ZepClient(base_url=url)
self.zep_client = ZepClient(base_url=url, api_key=api_key)
self.session_id = session_id

@property
Expand Down
5 changes: 3 additions & 2 deletions langchain/retrievers/zep.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ class ZepRetriever(BaseRetriever):
histories, and exposes them via simple, low-latency APIs.

For server installation instructions, see:
https://getzep.github.io/deployment/quickstart/
https://docs.getzep.com/deployment/quickstart/
"""

def __init__(
self,
session_id: str,
url: str,
api_key: Optional[str] = None,
top_k: Optional[int] = None,
):
try:
Expand All @@ -37,7 +38,7 @@ def __init__(
"Please install it with `pip install zep-python`."
)

self.zep_client = ZepClient(base_url=url)
self.zep_client = ZepClient(base_url=url, api_key=api_key)
self.session_id = session_id
self.top_k = top_k

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pandas = {version = "^2.0.1", optional = true}
telethon = {version = "^1.28.5", optional = true}
neo4j = {version = "^5.8.1", optional = true}
psychicapi = {version = "^0.5", optional = true}
zep-python = {version=">=0.31", optional=true}
zep-python = {version=">=0.32", optional=true}
langkit = {version = ">=0.0.1.dev3, <0.1.0", optional = true}
chardet = {version="^5.1.0", optional=true}
requests-toolbelt = {version = "^1.0.0", optional = true}
Expand Down