Skip to content

Commit 7b3397e

Browse files
V2 (#230)
* chore: Add quickstart notebook * SDK regeneration * chore: Version bump * chore: Add license * chore: Version bump * SDK regeneration * chore: Bump version and add memory context to the example * chore: version bump * SDK regeneration * chore: revert example changes * wip * chore: revert autogen example changes * chore: remove autogen cache * chore: Version bump * SDK regeneration * SDK regeneration --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
1 parent deb6288 commit 7b3397e

File tree

9 files changed

+74
-24
lines changed

9 files changed

+74
-24
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "zep-cloud"
3-
version = "2.1.1"
3+
version = "2.2.0"
44
description = ""
55
readme = "README.md"
66
authors = []

src/zep_cloud/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This file was auto-generated by Fern from our API Definition.
22

33
from .types import (
4+
AddMemoryResponse,
45
ApiError,
56
ApidataDocument,
67
ApidataDocumentCollection,
@@ -53,6 +54,7 @@
5354
from .version import __version__
5455

5556
__all__ = [
57+
"AddMemoryResponse",
5658
"ApiError",
5759
"ApidataDocument",
5860
"ApidataDocumentCollection",

src/zep_cloud/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def get_headers(self) -> typing.Dict[str, str]:
1717
headers: typing.Dict[str, str] = {
1818
"X-Fern-Language": "Python",
1919
"X-Fern-SDK-Name": "zep-cloud",
20-
"X-Fern-SDK-Version": "2.1.1",
20+
"X-Fern-SDK-Version": "2.2.0",
2121
}
2222
headers["Authorization"] = f"Api-Key {self.api_key}"
2323
return headers

src/zep_cloud/graph/client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def search(
105105
request_options: typing.Optional[RequestOptions] = None
106106
) -> GraphSearchResults:
107107
"""
108-
Perform a graph search query
108+
Perform a graph search query.
109109
110110
Parameters
111111
----------
@@ -119,7 +119,7 @@ def search(
119119
one of user_id or group_id must be provided
120120
121121
limit : typing.Optional[int]
122-
The maximum number of facts to retrieve
122+
The maximum number of facts to retrieve. Defaults to 10. Limited to 50.
123123
124124
min_score : typing.Optional[float]
125125
minimum similarity score for a result to be returned
@@ -131,7 +131,7 @@ def search(
131131
Defaults to RRF
132132
133133
scope : typing.Optional[GraphSearchScope]
134-
Defaults to Edges. Nodes and Communities will be added in the future.
134+
Defaults to Edges. Communities will be added in the future.
135135
136136
user_id : typing.Optional[str]
137137
one of user_id or group_id must be provided
@@ -269,7 +269,7 @@ async def search(
269269
request_options: typing.Optional[RequestOptions] = None
270270
) -> GraphSearchResults:
271271
"""
272-
Perform a graph search query
272+
Perform a graph search query.
273273
274274
Parameters
275275
----------
@@ -283,7 +283,7 @@ async def search(
283283
one of user_id or group_id must be provided
284284
285285
limit : typing.Optional[int]
286-
The maximum number of facts to retrieve
286+
The maximum number of facts to retrieve. Defaults to 10. Limited to 50.
287287
288288
min_score : typing.Optional[float]
289289
minimum similarity score for a result to be returned
@@ -295,7 +295,7 @@ async def search(
295295
Defaults to RRF
296296
297297
scope : typing.Optional[GraphSearchScope]
298-
Defaults to Edges. Nodes and Communities will be added in the future.
298+
Defaults to Edges. Communities will be added in the future.
299299
300300
user_id : typing.Optional[str]
301301
one of user_id or group_id must be provided

src/zep_cloud/group/client.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ def __init__(self, *, client_wrapper: SyncClientWrapper):
2727
def add(
2828
self,
2929
*,
30+
group_id: str,
3031
description: typing.Optional[str] = OMIT,
3132
fact_rating_instruction: typing.Optional[ApidataFactRatingInstruction] = OMIT,
32-
group_id: typing.Optional[str] = OMIT,
3333
name: typing.Optional[str] = OMIT,
3434
request_options: typing.Optional[RequestOptions] = None,
3535
) -> Group:
@@ -38,13 +38,13 @@ def add(
3838
3939
Parameters
4040
----------
41+
group_id : str
42+
4143
description : typing.Optional[str]
4244
4345
fact_rating_instruction : typing.Optional[ApidataFactRatingInstruction]
4446
UserIDs []string `json:"user_ids"`
4547
46-
group_id : typing.Optional[str]
47-
4848
name : typing.Optional[str]
4949
5050
request_options : typing.Optional[RequestOptions]
@@ -62,7 +62,9 @@ def add(
6262
client = Zep(
6363
api_key="YOUR_API_KEY",
6464
)
65-
client.group.add()
65+
client.group.add(
66+
group_id="group_id",
67+
)
6668
"""
6769
_response = self._client_wrapper.httpx_client.request(
6870
"groups",
@@ -145,9 +147,9 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper):
145147
async def add(
146148
self,
147149
*,
150+
group_id: str,
148151
description: typing.Optional[str] = OMIT,
149152
fact_rating_instruction: typing.Optional[ApidataFactRatingInstruction] = OMIT,
150-
group_id: typing.Optional[str] = OMIT,
151153
name: typing.Optional[str] = OMIT,
152154
request_options: typing.Optional[RequestOptions] = None,
153155
) -> Group:
@@ -156,13 +158,13 @@ async def add(
156158
157159
Parameters
158160
----------
161+
group_id : str
162+
159163
description : typing.Optional[str]
160164
161165
fact_rating_instruction : typing.Optional[ApidataFactRatingInstruction]
162166
UserIDs []string `json:"user_ids"`
163167
164-
group_id : typing.Optional[str]
165-
166168
name : typing.Optional[str]
167169
168170
request_options : typing.Optional[RequestOptions]
@@ -180,7 +182,9 @@ async def add(
180182
client = AsyncZep(
181183
api_key="YOUR_API_KEY",
182184
)
183-
await client.group.add()
185+
await client.group.add(
186+
group_id="group_id",
187+
)
184188
"""
185189
_response = await self._client_wrapper.httpx_client.request(
186190
"groups",

src/zep_cloud/memory/client.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from ..errors.conflict_error import ConflictError
1313
from ..errors.internal_server_error import InternalServerError
1414
from ..errors.not_found_error import NotFoundError
15+
from ..types.add_memory_response import AddMemoryResponse
1516
from ..types.api_error import ApiError as types_api_error_ApiError
1617
from ..types.classify_session_request import ClassifySessionRequest
1718
from ..types.end_session_response import EndSessionResponse
@@ -938,9 +939,10 @@ def add(
938939
*,
939940
messages: typing.Sequence[Message],
940941
fact_instruction: typing.Optional[str] = OMIT,
942+
return_context: typing.Optional[bool] = OMIT,
941943
summary_instruction: typing.Optional[str] = OMIT,
942944
request_options: typing.Optional[RequestOptions] = None,
943-
) -> SuccessResponse:
945+
) -> AddMemoryResponse:
944946
"""
945947
Add memory to the specified session.
946948
@@ -955,6 +957,9 @@ def add(
955957
fact_instruction : typing.Optional[str]
956958
Additional instruction for generating the facts. Zep Cloud Only, will be ignored on Community Edition.
957959
960+
return_context : typing.Optional[bool]
961+
Optionally return memory context relevant to the most recent messages.
962+
958963
summary_instruction : typing.Optional[str]
959964
Additional instruction for generating the summary. Zep Cloud Only, will be ignored on Community Edition.
960965
@@ -963,8 +968,8 @@ def add(
963968
964969
Returns
965970
-------
966-
SuccessResponse
967-
OK
971+
AddMemoryResponse
972+
An object, optionally containing memory context retrieved for the last message
968973
969974
Examples
970975
--------
@@ -990,13 +995,14 @@ def add(
990995
json={
991996
"fact_instruction": fact_instruction,
992997
"messages": messages,
998+
"return_context": return_context,
993999
"summary_instruction": summary_instruction,
9941000
},
9951001
request_options=request_options,
9961002
omit=OMIT,
9971003
)
9981004
if 200 <= _response.status_code < 300:
999-
return pydantic_v1.parse_obj_as(SuccessResponse, _response.json()) # type: ignore
1005+
return pydantic_v1.parse_obj_as(AddMemoryResponse, _response.json()) # type: ignore
10001006
if _response.status_code == 500:
10011007
raise InternalServerError(
10021008
pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore
@@ -2326,9 +2332,10 @@ async def add(
23262332
*,
23272333
messages: typing.Sequence[Message],
23282334
fact_instruction: typing.Optional[str] = OMIT,
2335+
return_context: typing.Optional[bool] = OMIT,
23292336
summary_instruction: typing.Optional[str] = OMIT,
23302337
request_options: typing.Optional[RequestOptions] = None,
2331-
) -> SuccessResponse:
2338+
) -> AddMemoryResponse:
23322339
"""
23332340
Add memory to the specified session.
23342341
@@ -2343,6 +2350,9 @@ async def add(
23432350
fact_instruction : typing.Optional[str]
23442351
Additional instruction for generating the facts. Zep Cloud Only, will be ignored on Community Edition.
23452352
2353+
return_context : typing.Optional[bool]
2354+
Optionally return memory context relevant to the most recent messages.
2355+
23462356
summary_instruction : typing.Optional[str]
23472357
Additional instruction for generating the summary. Zep Cloud Only, will be ignored on Community Edition.
23482358
@@ -2351,8 +2361,8 @@ async def add(
23512361
23522362
Returns
23532363
-------
2354-
SuccessResponse
2355-
OK
2364+
AddMemoryResponse
2365+
An object, optionally containing memory context retrieved for the last message
23562366
23572367
Examples
23582368
--------
@@ -2378,13 +2388,14 @@ async def add(
23782388
json={
23792389
"fact_instruction": fact_instruction,
23802390
"messages": messages,
2391+
"return_context": return_context,
23812392
"summary_instruction": summary_instruction,
23822393
},
23832394
request_options=request_options,
23842395
omit=OMIT,
23852396
)
23862397
if 200 <= _response.status_code < 300:
2387-
return pydantic_v1.parse_obj_as(SuccessResponse, _response.json()) # type: ignore
2398+
return pydantic_v1.parse_obj_as(AddMemoryResponse, _response.json()) # type: ignore
23882399
if _response.status_code == 500:
23892400
raise InternalServerError(
23902401
pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore

src/zep_cloud/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# This file was auto-generated by Fern from our API Definition.
22

3+
from .add_memory_response import AddMemoryResponse
34
from .api_error import ApiError
45
from .apidata_document import ApidataDocument
56
from .apidata_document_collection import ApidataDocumentCollection
@@ -47,6 +48,7 @@
4748
from .user_list_response import UserListResponse
4849

4950
__all__ = [
51+
"AddMemoryResponse",
5052
"ApiError",
5153
"ApidataDocument",
5254
"ApidataDocumentCollection",
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import datetime as dt
4+
import typing
5+
6+
from ..core.datetime_utils import serialize_datetime
7+
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8+
9+
10+
class AddMemoryResponse(pydantic_v1.BaseModel):
11+
context: typing.Optional[str] = None
12+
13+
def json(self, **kwargs: typing.Any) -> str:
14+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
15+
return super().json(**kwargs_with_defaults)
16+
17+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
18+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
19+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
20+
21+
return deep_union_pydantic_dicts(
22+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
23+
)
24+
25+
class Config:
26+
frozen = True
27+
smart_union = True
28+
extra = pydantic_v1.Extra.allow
29+
json_encoders = {dt.datetime: serialize_datetime}

src/zep_cloud/types/user.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55

66
from ..core.datetime_utils import serialize_datetime
77
from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8+
from .fact_rating_instruction import FactRatingInstruction
89

910

1011
class User(pydantic_v1.BaseModel):
1112
created_at: typing.Optional[str] = None
1213
deleted_at: typing.Optional[str] = None
1314
email: typing.Optional[str] = None
15+
fact_rating_instruction: typing.Optional[FactRatingInstruction] = None
1416
first_name: typing.Optional[str] = None
1517
id: typing.Optional[int] = None
1618
last_name: typing.Optional[str] = None

0 commit comments

Comments
 (0)