Skip to content
Merged
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "zep-python"
version = "2.0.0"
version = "2.0.1"
description = ""
readme = "README.md"
authors = []
Expand Down
54 changes: 30 additions & 24 deletions src/zep_python/client.py
Original file line number Diff line number Diff line change
@@ -1,56 +1,62 @@
from .base_client import \
BaseClient, AsyncBaseClient
from .base_client import BaseClient, AsyncBaseClient
import typing
import os
import httpx
from .environment import ZepEnvironment
from .external_clients.memory import MemoryClient, AsyncMemoryClient
from .external_clients.user import UserClient, AsyncUserClient

api_suffix = "api/v2"


class Zep(BaseClient):
def __init__(
self,
*,
base_url: str = None,
api_key: typing.Optional[str] = os.getenv("ZEP_API_KEY"),
timeout: typing.Optional[float] = None,
follow_redirects: typing.Optional[bool] = None,
httpx_client: typing.Optional[httpx.Client] = None
self,
*,
base_url: str = None,
api_key: typing.Optional[str] = os.getenv("ZEP_API_KEY"),
timeout: typing.Optional[float] = None,
follow_redirects: typing.Optional[bool] = None,
httpx_client: typing.Optional[httpx.Client] = None,
):
api_url = ""
env_api_url = os.getenv("ZEP_API_URL")
if env_api_url:
base_url = f"{env_api_url}/api/v2"
api_url = f"{env_api_url}/{api_suffix}"
else:
api_url = f"${base_url}/{api_suffix}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string interpolation here is incorrect. It should be an f-string without the dollar sign.

Suggested change
api_url = f"${base_url}/{api_suffix}"
api_url = f"{base_url}/{api_suffix}"

super().__init__(
base_url=base_url,
base_url=api_url,
api_key=api_key,
timeout=timeout,
follow_redirects=follow_redirects,
httpx_client=httpx_client
httpx_client=httpx_client,
)
self.memory = MemoryClient(client_wrapper=self._client_wrapper)
self.user = UserClient(client_wrapper=self._client_wrapper)


class AsyncZep(AsyncBaseClient):
def __init__(
self,
*,
base_url: str = None,
api_key: typing.Optional[str] = os.getenv("ZEP_API_KEY"),
timeout: typing.Optional[float] = None,
follow_redirects: typing.Optional[bool] = None,
httpx_client: typing.Optional[httpx.AsyncClient] = None
self,
*,
base_url: str = None,
api_key: typing.Optional[str] = os.getenv("ZEP_API_KEY"),
timeout: typing.Optional[float] = None,
follow_redirects: typing.Optional[bool] = None,
httpx_client: typing.Optional[httpx.AsyncClient] = None,
):
api_url = ""
env_api_url = os.getenv("ZEP_API_URL")
if env_api_url:
base_url = f"{env_api_url}/api/v2"
api_url = f"{env_api_url}/{api_suffix}"
else:
api_url = f"${base_url}/{api_suffix}"
super().__init__(
base_url=base_url,
base_url=api_url,
api_key=api_key,
timeout=timeout,
follow_redirects=follow_redirects,
httpx_client=httpx_client
httpx_client=httpx_client,
)
self.memory = AsyncMemoryClient(client_wrapper=self._client_wrapper)
self.user = AsyncUserClient(client_wrapper=self._client_wrapper)
self.user = AsyncUserClient(client_wrapper=self._client_wrapper)
8 changes: 4 additions & 4 deletions src/zep_python/memory/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,10 +549,10 @@ def add(
A list of message objects, where each message contains a role and content.

fact_instruction : typing.Optional[str]
Additional instruction for generating the facts.
Additional instruction for generating the facts. Zep Cloud Only, will be ignored on Community Edition.

summary_instruction : typing.Optional[str]
Additional instruction for generating the summary.
Additional instruction for generating the summary. Zep Cloud Only, will be ignored on Community Edition.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand Down Expand Up @@ -1344,10 +1344,10 @@ async def add(
A list of message objects, where each message contains a role and content.

fact_instruction : typing.Optional[str]
Additional instruction for generating the facts.
Additional instruction for generating the facts. Zep Cloud Only, will be ignored on Community Edition.

summary_instruction : typing.Optional[str]
Additional instruction for generating the summary.
Additional instruction for generating the summary. Zep Cloud Only, will be ignored on Community Edition.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand Down
Loading