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

V2 #230

Merged
merged 22 commits into from
Dec 10, 2024
Merged

V2 #230

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9e8217b
chore: Add quickstart notebook
paul-paliychuk Oct 18, 2024
c3d99a3
Merge branch 'main' of github.com:getzep/zep-python into v2
paul-paliychuk Oct 30, 2024
07c7d6f
SDK regeneration
fern-api[bot] Oct 30, 2024
4cd8fee
Merge branch 'v2' of github.com:getzep/zep-python into v2
paul-paliychuk Oct 30, 2024
7670b44
chore: Version bump
paul-paliychuk Oct 30, 2024
6d5e8c1
Merge branch 'main' of github.com:getzep/zep-python into v2
paul-paliychuk Oct 31, 2024
427a8b4
chore: Add license
paul-paliychuk Oct 31, 2024
8531257
Merge branch 'main' of github.com:getzep/zep-python into v2
paul-paliychuk Nov 1, 2024
2a17a6b
chore: Version bump
paul-paliychuk Nov 1, 2024
76fd93c
SDK regeneration
fern-api[bot] Nov 1, 2024
d77b775
chore: Bump version and add memory context to the example
paul-paliychuk Nov 1, 2024
c0b7b59
chore: version bump
paul-paliychuk Nov 15, 2024
b9ac6c3
SDK regeneration
fern-api[bot] Nov 15, 2024
ee89d83
chore: revert example changes
paul-paliychuk Nov 15, 2024
c88ab01
wip
paul-paliychuk Nov 15, 2024
f807147
chore: revert autogen example changes
paul-paliychuk Nov 15, 2024
9b8a32b
chore: remove autogen cache
paul-paliychuk Nov 15, 2024
9b24b99
Merge branch 'main' of github.com:getzep/zep-python into v2
paul-paliychuk Nov 15, 2024
1b971eb
Merge branch 'main' of github.com:getzep/zep-python into v2
paul-paliychuk Dec 10, 2024
f07abcc
chore: Version bump
paul-paliychuk Dec 10, 2024
da4fbc1
SDK regeneration
fern-api[bot] Dec 10, 2024
612d6bc
SDK regeneration
fern-api[bot] Dec 10, 2024
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-cloud"
version = "2.1.1"
version = "2.2.0"
description = ""
readme = "README.md"
authors = []
Expand Down
2 changes: 2 additions & 0 deletions src/zep_cloud/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This file was auto-generated by Fern from our API Definition.

from .types import (
AddMemoryResponse,
ApiError,
ApidataDocument,
ApidataDocumentCollection,
Expand Down Expand Up @@ -53,6 +54,7 @@
from .version import __version__

__all__ = [
"AddMemoryResponse",
"ApiError",
"ApidataDocument",
"ApidataDocumentCollection",
Expand Down
2 changes: 1 addition & 1 deletion src/zep_cloud/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def get_headers(self) -> typing.Dict[str, str]:
headers: typing.Dict[str, str] = {
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "zep-cloud",
"X-Fern-SDK-Version": "2.1.1",
"X-Fern-SDK-Version": "2.2.0",
}
headers["Authorization"] = f"Api-Key {self.api_key}"
return headers
Expand Down
12 changes: 6 additions & 6 deletions src/zep_cloud/graph/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def search(
request_options: typing.Optional[RequestOptions] = None
) -> GraphSearchResults:
"""
Perform a graph search query
Perform a graph search query.

Parameters
----------
Expand All @@ -119,7 +119,7 @@ def search(
one of user_id or group_id must be provided

limit : typing.Optional[int]
The maximum number of facts to retrieve
The maximum number of facts to retrieve. Defaults to 10. Limited to 50.

min_score : typing.Optional[float]
minimum similarity score for a result to be returned
Expand All @@ -131,7 +131,7 @@ def search(
Defaults to RRF

scope : typing.Optional[GraphSearchScope]
Defaults to Edges. Nodes and Communities will be added in the future.
Defaults to Edges. Communities will be added in the future.

user_id : typing.Optional[str]
one of user_id or group_id must be provided
Expand Down Expand Up @@ -269,7 +269,7 @@ async def search(
request_options: typing.Optional[RequestOptions] = None
) -> GraphSearchResults:
"""
Perform a graph search query
Perform a graph search query.

Parameters
----------
Expand All @@ -283,7 +283,7 @@ async def search(
one of user_id or group_id must be provided

limit : typing.Optional[int]
The maximum number of facts to retrieve
The maximum number of facts to retrieve. Defaults to 10. Limited to 50.

min_score : typing.Optional[float]
minimum similarity score for a result to be returned
Expand All @@ -295,7 +295,7 @@ async def search(
Defaults to RRF

scope : typing.Optional[GraphSearchScope]
Defaults to Edges. Nodes and Communities will be added in the future.
Defaults to Edges. Communities will be added in the future.

user_id : typing.Optional[str]
one of user_id or group_id must be provided
Expand Down
20 changes: 12 additions & 8 deletions src/zep_cloud/group/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ def __init__(self, *, client_wrapper: SyncClientWrapper):
def add(
self,
*,
group_id: str,
description: typing.Optional[str] = OMIT,
fact_rating_instruction: typing.Optional[ApidataFactRatingInstruction] = OMIT,
group_id: typing.Optional[str] = OMIT,
name: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> Group:
Expand All @@ -38,13 +38,13 @@ def add(

Parameters
----------
group_id : str

description : typing.Optional[str]

fact_rating_instruction : typing.Optional[ApidataFactRatingInstruction]
UserIDs []string `json:"user_ids"`

group_id : typing.Optional[str]

name : typing.Optional[str]

request_options : typing.Optional[RequestOptions]
Expand All @@ -62,7 +62,9 @@ def add(
client = Zep(
api_key="YOUR_API_KEY",
)
client.group.add()
client.group.add(
group_id="group_id",
)
"""
_response = self._client_wrapper.httpx_client.request(
"groups",
Expand Down Expand Up @@ -145,9 +147,9 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper):
async def add(
self,
*,
group_id: str,
description: typing.Optional[str] = OMIT,
fact_rating_instruction: typing.Optional[ApidataFactRatingInstruction] = OMIT,
group_id: typing.Optional[str] = OMIT,
name: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> Group:
Expand All @@ -156,13 +158,13 @@ async def add(

Parameters
----------
group_id : str

description : typing.Optional[str]

fact_rating_instruction : typing.Optional[ApidataFactRatingInstruction]
UserIDs []string `json:"user_ids"`

group_id : typing.Optional[str]

name : typing.Optional[str]

request_options : typing.Optional[RequestOptions]
Expand All @@ -180,7 +182,9 @@ async def add(
client = AsyncZep(
api_key="YOUR_API_KEY",
)
await client.group.add()
await client.group.add(
group_id="group_id",
)
"""
_response = await self._client_wrapper.httpx_client.request(
"groups",
Expand Down
27 changes: 19 additions & 8 deletions src/zep_cloud/memory/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from ..errors.conflict_error import ConflictError
from ..errors.internal_server_error import InternalServerError
from ..errors.not_found_error import NotFoundError
from ..types.add_memory_response import AddMemoryResponse
from ..types.api_error import ApiError as types_api_error_ApiError
from ..types.classify_session_request import ClassifySessionRequest
from ..types.end_session_response import EndSessionResponse
Expand Down Expand Up @@ -938,9 +939,10 @@ def add(
*,
messages: typing.Sequence[Message],
fact_instruction: typing.Optional[str] = OMIT,
return_context: typing.Optional[bool] = OMIT,
summary_instruction: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> SuccessResponse:
) -> AddMemoryResponse:
"""
Add memory to the specified session.

Expand All @@ -955,6 +957,9 @@ def add(
fact_instruction : typing.Optional[str]
Additional instruction for generating the facts. Zep Cloud Only, will be ignored on Community Edition.

return_context : typing.Optional[bool]
Optionally return memory context relevant to the most recent messages.

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

Expand All @@ -963,8 +968,8 @@ def add(

Returns
-------
SuccessResponse
OK
AddMemoryResponse
An object, optionally containing memory context retrieved for the last message

Examples
--------
Expand All @@ -990,13 +995,14 @@ def add(
json={
"fact_instruction": fact_instruction,
"messages": messages,
"return_context": return_context,
"summary_instruction": summary_instruction,
},
request_options=request_options,
omit=OMIT,
)
if 200 <= _response.status_code < 300:
return pydantic_v1.parse_obj_as(SuccessResponse, _response.json()) # type: ignore
return pydantic_v1.parse_obj_as(AddMemoryResponse, _response.json()) # type: ignore
if _response.status_code == 500:
raise InternalServerError(
pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore
Expand Down Expand Up @@ -2326,9 +2332,10 @@ async def add(
*,
messages: typing.Sequence[Message],
fact_instruction: typing.Optional[str] = OMIT,
return_context: typing.Optional[bool] = OMIT,
summary_instruction: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> SuccessResponse:
) -> AddMemoryResponse:
"""
Add memory to the specified session.

Expand All @@ -2343,6 +2350,9 @@ async def add(
fact_instruction : typing.Optional[str]
Additional instruction for generating the facts. Zep Cloud Only, will be ignored on Community Edition.

return_context : typing.Optional[bool]
Optionally return memory context relevant to the most recent messages.

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

Expand All @@ -2351,8 +2361,8 @@ async def add(

Returns
-------
SuccessResponse
OK
AddMemoryResponse
An object, optionally containing memory context retrieved for the last message

Examples
--------
Expand All @@ -2378,13 +2388,14 @@ async def add(
json={
"fact_instruction": fact_instruction,
"messages": messages,
"return_context": return_context,
"summary_instruction": summary_instruction,
},
request_options=request_options,
omit=OMIT,
)
if 200 <= _response.status_code < 300:
return pydantic_v1.parse_obj_as(SuccessResponse, _response.json()) # type: ignore
return pydantic_v1.parse_obj_as(AddMemoryResponse, _response.json()) # type: ignore
if _response.status_code == 500:
raise InternalServerError(
pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore
Expand Down
2 changes: 2 additions & 0 deletions src/zep_cloud/types/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This file was auto-generated by Fern from our API Definition.

from .add_memory_response import AddMemoryResponse
from .api_error import ApiError
from .apidata_document import ApidataDocument
from .apidata_document_collection import ApidataDocumentCollection
Expand Down Expand Up @@ -47,6 +48,7 @@
from .user_list_response import UserListResponse

__all__ = [
"AddMemoryResponse",
"ApiError",
"ApidataDocument",
"ApidataDocumentCollection",
Expand Down
29 changes: 29 additions & 0 deletions src/zep_cloud/types/add_memory_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

from ..core.datetime_utils import serialize_datetime
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1


class AddMemoryResponse(pydantic_v1.BaseModel):
context: typing.Optional[str] = None

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
return super().json(**kwargs_with_defaults)

def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}

return deep_union_pydantic_dicts(
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
)

class Config:
frozen = True
smart_union = True
extra = pydantic_v1.Extra.allow
json_encoders = {dt.datetime: serialize_datetime}
2 changes: 2 additions & 0 deletions src/zep_cloud/types/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@

from ..core.datetime_utils import serialize_datetime
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
from .fact_rating_instruction import FactRatingInstruction


class User(pydantic_v1.BaseModel):
created_at: typing.Optional[str] = None
deleted_at: typing.Optional[str] = None
email: typing.Optional[str] = None
fact_rating_instruction: typing.Optional[FactRatingInstruction] = None
first_name: typing.Optional[str] = None
id: typing.Optional[int] = None
last_name: typing.Optional[str] = None
Expand Down
Loading