Skip to content

Commit 885f585

Browse files
Revert "SDK regeneration"
This reverts commit c647733.
1 parent c647733 commit 885f585

File tree

121 files changed

+12464
-9502
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+12464
-9502
lines changed

reference.md

Lines changed: 3227 additions & 321 deletions
Large diffs are not rendered by default.

requirements.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/zep_cloud/__init__.py

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

3-
# isort: skip_file
4-
53
from .types import (
6-
AddThreadMessagesResponse,
4+
AddMemoryResponse,
75
AddTripleResponse,
86
ApiError,
7+
ApidataDocument,
8+
ApidataDocumentCollection,
9+
ApidataDocumentSearchResponse,
10+
ApidataDocumentWithScore,
11+
ClassifySessionRequest,
912
CloneGraphResponse,
1013
ComparisonOperator,
14+
CreateDocumentRequest,
1115
DateFilter,
1216
EdgeType,
17+
EndSessionResponse,
18+
EndSessionsResponse,
1319
EntityEdge,
1420
EntityEdgeSourceTarget,
1521
EntityNode,
@@ -21,45 +27,65 @@
2127
EpisodeData,
2228
EpisodeMentions,
2329
EpisodeResponse,
30+
Fact,
2431
FactRatingExamples,
2532
FactRatingInstruction,
26-
Graph,
33+
FactResponse,
34+
FactsResponse,
2735
GraphDataType,
2836
GraphEdgesRequest,
2937
GraphNodesRequest,
3038
GraphSearchResults,
3139
GraphSearchScope,
40+
Group,
41+
GroupListResponse,
42+
Memory,
43+
MemorySearchResult,
3244
Message,
3345
MessageListResponse,
34-
ModelsFactRatingExamples,
35-
ModelsFactRatingInstruction,
46+
NewFact,
47+
Question,
3648
Reranker,
3749
RoleType,
3850
SearchFilters,
51+
SearchScope,
52+
SearchType,
53+
Session,
54+
SessionClassification,
55+
SessionListResponse,
56+
SessionSearchResponse,
57+
SessionSearchResult,
3958
SuccessResponse,
40-
Thread,
41-
ThreadContextResponse,
42-
ThreadListResponse,
59+
Summary,
60+
SummaryListResponse,
61+
UpdateDocumentListRequest,
4362
User,
4463
UserListResponse,
4564
UserNodeResponse,
4665
)
47-
from .errors import BadRequestError, InternalServerError, NotFoundError
48-
from . import graph, thread, user
49-
from .client import AsyncZep, Zep
66+
from .errors import BadRequestError, ConflictError, InternalServerError, NotFoundError, UnauthorizedError
67+
from . import document, graph, group, memory, user
5068
from .environment import ZepEnvironment
5169
from .version import __version__
5270

5371
__all__ = [
54-
"AddThreadMessagesResponse",
72+
"AddMemoryResponse",
5573
"AddTripleResponse",
5674
"ApiError",
57-
"AsyncZep",
75+
"ApidataDocument",
76+
"ApidataDocumentCollection",
77+
"ApidataDocumentSearchResponse",
78+
"ApidataDocumentWithScore",
5879
"BadRequestError",
80+
"ClassifySessionRequest",
5981
"CloneGraphResponse",
6082
"ComparisonOperator",
83+
"ConflictError",
84+
"CreateDocumentRequest",
6185
"DateFilter",
6286
"EdgeType",
87+
"EndSessionResponse",
88+
"EndSessionsResponse",
6389
"EntityEdge",
6490
"EntityEdgeSourceTarget",
6591
"EntityNode",
@@ -71,34 +97,49 @@
7197
"EpisodeData",
7298
"EpisodeMentions",
7399
"EpisodeResponse",
100+
"Fact",
74101
"FactRatingExamples",
75102
"FactRatingInstruction",
76-
"Graph",
103+
"FactResponse",
104+
"FactsResponse",
77105
"GraphDataType",
78106
"GraphEdgesRequest",
79107
"GraphNodesRequest",
80108
"GraphSearchResults",
81109
"GraphSearchScope",
110+
"Group",
111+
"GroupListResponse",
82112
"InternalServerError",
113+
"Memory",
114+
"MemorySearchResult",
83115
"Message",
84116
"MessageListResponse",
85-
"ModelsFactRatingExamples",
86-
"ModelsFactRatingInstruction",
117+
"NewFact",
87118
"NotFoundError",
119+
"Question",
88120
"Reranker",
89121
"RoleType",
90122
"SearchFilters",
123+
"SearchScope",
124+
"SearchType",
125+
"Session",
126+
"SessionClassification",
127+
"SessionListResponse",
128+
"SessionSearchResponse",
129+
"SessionSearchResult",
91130
"SuccessResponse",
92-
"Thread",
93-
"ThreadContextResponse",
94-
"ThreadListResponse",
131+
"Summary",
132+
"SummaryListResponse",
133+
"UnauthorizedError",
134+
"UpdateDocumentListRequest",
95135
"User",
96136
"UserListResponse",
97137
"UserNodeResponse",
98-
"Zep",
99138
"ZepEnvironment",
100139
"__version__",
140+
"document",
101141
"graph",
102-
"thread",
142+
"group",
143+
"memory",
103144
"user",
104145
]

src/zep_cloud/base_client.py

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
import typing
55

66
import httpx
7+
78
from .core.api_error import ApiError
89
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
10+
from .document.client import AsyncDocumentClient, DocumentClient
911
from .environment import ZepEnvironment
1012
from .graph.client import AsyncGraphClient, GraphClient
11-
from .thread.client import AsyncThreadClient, ThreadClient
13+
from .group.client import AsyncGroupClient, GroupClient
14+
from .memory.client import AsyncMemoryClient, MemoryClient
1215
from .user.client import AsyncUserClient, UserClient
1316

1417

@@ -31,9 +34,6 @@ class BaseClient:
3134
3235
3336
api_key : typing.Optional[str]
34-
headers : typing.Optional[typing.Dict[str, str]]
35-
Additional headers to send with every request.
36-
3737
timeout : typing.Optional[float]
3838
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
3939
@@ -45,7 +45,7 @@ class BaseClient:
4545
4646
Examples
4747
--------
48-
from zep_cloud import Zep
48+
from zep_cloud.client import Zep
4949
5050
client = Zep(
5151
api_key="YOUR_API_KEY",
@@ -58,29 +58,27 @@ def __init__(
5858
base_url: typing.Optional[str] = None,
5959
environment: ZepEnvironment = ZepEnvironment.DEFAULT,
6060
api_key: typing.Optional[str] = os.getenv("ZEP_API_KEY"),
61-
headers: typing.Optional[typing.Dict[str, str]] = None,
6261
timeout: typing.Optional[float] = None,
6362
follow_redirects: typing.Optional[bool] = True,
64-
httpx_client: typing.Optional[httpx.Client] = None,
63+
httpx_client: typing.Optional[httpx.Client] = None
6564
):
66-
_defaulted_timeout = (
67-
timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
68-
)
65+
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
6966
if api_key is None:
7067
raise ApiError(body="The client must be instantiated be either passing in api_key or setting ZEP_API_KEY")
7168
self._client_wrapper = SyncClientWrapper(
7269
base_url=_get_base_url(base_url=base_url, environment=environment),
7370
api_key=api_key,
74-
headers=headers,
7571
httpx_client=httpx_client
7672
if httpx_client is not None
7773
else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
7874
if follow_redirects is not None
7975
else httpx.Client(timeout=_defaulted_timeout),
8076
timeout=_defaulted_timeout,
8177
)
78+
self.document = DocumentClient(client_wrapper=self._client_wrapper)
8279
self.graph = GraphClient(client_wrapper=self._client_wrapper)
83-
self.thread = ThreadClient(client_wrapper=self._client_wrapper)
80+
self.memory = MemoryClient(client_wrapper=self._client_wrapper)
81+
self.group = GroupClient(client_wrapper=self._client_wrapper)
8482
self.user = UserClient(client_wrapper=self._client_wrapper)
8583

8684

@@ -103,9 +101,6 @@ class AsyncBaseClient:
103101
104102
105103
api_key : typing.Optional[str]
106-
headers : typing.Optional[typing.Dict[str, str]]
107-
Additional headers to send with every request.
108-
109104
timeout : typing.Optional[float]
110105
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
111106
@@ -117,7 +112,7 @@ class AsyncBaseClient:
117112
118113
Examples
119114
--------
120-
from zep_cloud import AsyncZep
115+
from zep_cloud.client import AsyncZep
121116
122117
client = AsyncZep(
123118
api_key="YOUR_API_KEY",
@@ -130,29 +125,27 @@ def __init__(
130125
base_url: typing.Optional[str] = None,
131126
environment: ZepEnvironment = ZepEnvironment.DEFAULT,
132127
api_key: typing.Optional[str] = os.getenv("ZEP_API_KEY"),
133-
headers: typing.Optional[typing.Dict[str, str]] = None,
134128
timeout: typing.Optional[float] = None,
135129
follow_redirects: typing.Optional[bool] = True,
136-
httpx_client: typing.Optional[httpx.AsyncClient] = None,
130+
httpx_client: typing.Optional[httpx.AsyncClient] = None
137131
):
138-
_defaulted_timeout = (
139-
timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
140-
)
132+
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
141133
if api_key is None:
142134
raise ApiError(body="The client must be instantiated be either passing in api_key or setting ZEP_API_KEY")
143135
self._client_wrapper = AsyncClientWrapper(
144136
base_url=_get_base_url(base_url=base_url, environment=environment),
145137
api_key=api_key,
146-
headers=headers,
147138
httpx_client=httpx_client
148139
if httpx_client is not None
149140
else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
150141
if follow_redirects is not None
151142
else httpx.AsyncClient(timeout=_defaulted_timeout),
152143
timeout=_defaulted_timeout,
153144
)
145+
self.document = AsyncDocumentClient(client_wrapper=self._client_wrapper)
154146
self.graph = AsyncGraphClient(client_wrapper=self._client_wrapper)
155-
self.thread = AsyncThreadClient(client_wrapper=self._client_wrapper)
147+
self.memory = AsyncMemoryClient(client_wrapper=self._client_wrapper)
148+
self.group = AsyncGroupClient(client_wrapper=self._client_wrapper)
156149
self.user = AsyncUserClient(client_wrapper=self._client_wrapper)
157150

158151

src/zep_cloud/core/__init__.py

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,30 @@
11
# This file was auto-generated by Fern from our API Definition.
22

3-
# isort: skip_file
4-
53
from .api_error import ApiError
64
from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper
75
from .datetime_utils import serialize_datetime
8-
from .file import File, convert_file_dict_to_httpx_tuples, with_content_type
6+
from .file import File, convert_file_dict_to_httpx_tuples
97
from .http_client import AsyncHttpClient, HttpClient
10-
from .http_response import AsyncHttpResponse, HttpResponse
118
from .jsonable_encoder import jsonable_encoder
12-
from .pydantic_utilities import (
13-
IS_PYDANTIC_V2,
14-
UniversalBaseModel,
15-
UniversalRootModel,
16-
parse_obj_as,
17-
universal_field_validator,
18-
universal_root_validator,
19-
update_forward_refs,
20-
)
9+
from .pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
2110
from .query_encoder import encode_query
2211
from .remove_none_from_dict import remove_none_from_dict
2312
from .request_options import RequestOptions
24-
from .serialization import FieldMetadata, convert_and_respect_annotation_metadata
2513

2614
__all__ = [
2715
"ApiError",
2816
"AsyncClientWrapper",
2917
"AsyncHttpClient",
30-
"AsyncHttpResponse",
3118
"BaseClientWrapper",
32-
"FieldMetadata",
3319
"File",
3420
"HttpClient",
35-
"HttpResponse",
36-
"IS_PYDANTIC_V2",
3721
"RequestOptions",
3822
"SyncClientWrapper",
39-
"UniversalBaseModel",
40-
"UniversalRootModel",
41-
"convert_and_respect_annotation_metadata",
4223
"convert_file_dict_to_httpx_tuples",
24+
"deep_union_pydantic_dicts",
4325
"encode_query",
4426
"jsonable_encoder",
45-
"parse_obj_as",
27+
"pydantic_v1",
4628
"remove_none_from_dict",
4729
"serialize_datetime",
48-
"universal_field_validator",
49-
"universal_root_validator",
50-
"update_forward_refs",
51-
"with_content_type",
5230
]

src/zep_cloud/core/api_error.py

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

3-
from typing import Any, Dict, Optional
3+
import typing
44

55

66
class ApiError(Exception):
7-
headers: Optional[Dict[str, str]]
8-
status_code: Optional[int]
9-
body: Any
7+
status_code: typing.Optional[int]
8+
body: typing.Any
109

11-
def __init__(
12-
self,
13-
*,
14-
headers: Optional[Dict[str, str]] = None,
15-
status_code: Optional[int] = None,
16-
body: Any = None,
17-
) -> None:
18-
self.headers = headers
10+
def __init__(self, *, status_code: typing.Optional[int] = None, body: typing.Any = None):
1911
self.status_code = status_code
2012
self.body = body
2113

2214
def __str__(self) -> str:
23-
return f"headers: {self.headers}, status_code: {self.status_code}, body: {self.body}"
15+
return f"status_code: {self.status_code}, body: {self.body}"

0 commit comments

Comments
 (0)