zep-cloud 2.3.1__tar.gz → 2.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/PKG-INFO +1 -1
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/pyproject.toml +5 -7
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/__init__.py +2 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/core/client_wrapper.py +1 -1
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/graph/episode/client.py +112 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/__init__.py +2 -0
- zep_cloud-2.4.0/src/zep_cloud/types/user_node_response.py +30 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/user/client.py +105 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/LICENSE +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/README.md +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/base_client.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/client.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/core/__init__.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/core/api_error.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/core/datetime_utils.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/core/file.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/core/http_client.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/core/jsonable_encoder.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/core/pydantic_utilities.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/core/query_encoder.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/core/remove_none_from_dict.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/core/request_options.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/document/__init__.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/document/client.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/environment.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/errors/__init__.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/errors/bad_request_error.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/errors/conflict_error.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/errors/internal_server_error.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/errors/not_found_error.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/errors/unauthorized_error.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/external_clients/document.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/external_clients/memory.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/external_clients/user.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/extractor/__init__.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/extractor/models.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/graph/__init__.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/graph/client.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/graph/edge/__init__.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/graph/edge/client.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/graph/episode/__init__.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/graph/node/__init__.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/graph/node/client.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/group/__init__.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/group/client.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/memory/__init__.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/memory/client.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/py.typed +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/add_memory_response.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/api_error.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/apidata_document.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/apidata_document_collection.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/apidata_document_search_response.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/apidata_document_with_score.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/classify_session_request.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/create_document_request.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/end_session_response.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/end_sessions_response.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/entity_edge.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/entity_node.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/episode.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/episode_response.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/fact.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/fact_rating_examples.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/fact_rating_instruction.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/fact_response.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/facts_response.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/graph_data_type.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/graph_search_results.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/graph_search_scope.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/group.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/group_list_response.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/memory.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/memory_search_result.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/message.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/message_list_response.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/new_fact.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/question.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/reranker.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/role_type.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/search_scope.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/search_type.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/session.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/session_classification.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/session_list_response.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/session_search_response.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/session_search_result.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/success_response.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/summary.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/summary_list_response.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/update_document_list_request.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/user.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/types/user_list_response.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/user/__init__.py +0 -0
- {zep_cloud-2.3.1 → zep_cloud-2.4.0}/src/zep_cloud/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "zep-cloud"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.4.0"
|
|
4
4
|
description = ""
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = []
|
|
@@ -17,12 +17,10 @@ mypy = "1.9.0"
|
|
|
17
17
|
pytest = "^7.4.0"
|
|
18
18
|
pytest-asyncio = "^0.23.5"
|
|
19
19
|
python-dateutil = "^2.9.0"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
langchain-openai = "^0.
|
|
23
|
-
|
|
24
|
-
ruff = "^0.4.8"
|
|
25
|
-
ipykernel = "^6.29.4"
|
|
20
|
+
black = "^24.10.0"
|
|
21
|
+
ruff = "^0.9.3"
|
|
22
|
+
langchain-openai = "^0.3.2"
|
|
23
|
+
langgraph = "^0.2.67"
|
|
26
24
|
|
|
27
25
|
[tool.pytest.ini_options]
|
|
28
26
|
testpaths = ["tests"]
|
|
@@ -46,6 +46,7 @@ from .types import (
|
|
|
46
46
|
UpdateDocumentListRequest,
|
|
47
47
|
User,
|
|
48
48
|
UserListResponse,
|
|
49
|
+
UserNodeResponse,
|
|
49
50
|
)
|
|
50
51
|
from .errors import BadRequestError, ConflictError, InternalServerError, NotFoundError, UnauthorizedError
|
|
51
52
|
from . import document, graph, group, memory, user
|
|
@@ -103,6 +104,7 @@ __all__ = [
|
|
|
103
104
|
"UpdateDocumentListRequest",
|
|
104
105
|
"User",
|
|
105
106
|
"UserListResponse",
|
|
107
|
+
"UserNodeResponse",
|
|
106
108
|
"ZepEnvironment",
|
|
107
109
|
"__version__",
|
|
108
110
|
"document",
|
|
@@ -17,7 +17,7 @@ class BaseClientWrapper:
|
|
|
17
17
|
headers: typing.Dict[str, str] = {
|
|
18
18
|
"X-Fern-Language": "Python",
|
|
19
19
|
"X-Fern-SDK-Name": "zep-cloud",
|
|
20
|
-
"X-Fern-SDK-Version": "2.
|
|
20
|
+
"X-Fern-SDK-Version": "2.4.0",
|
|
21
21
|
}
|
|
22
22
|
headers["Authorization"] = f"Api-Key {self.api_key}"
|
|
23
23
|
return headers
|
|
@@ -10,9 +10,11 @@ from ...core.pydantic_utilities import pydantic_v1
|
|
|
10
10
|
from ...core.request_options import RequestOptions
|
|
11
11
|
from ...errors.bad_request_error import BadRequestError
|
|
12
12
|
from ...errors.internal_server_error import InternalServerError
|
|
13
|
+
from ...errors.not_found_error import NotFoundError
|
|
13
14
|
from ...types.api_error import ApiError as types_api_error_ApiError
|
|
14
15
|
from ...types.episode import Episode
|
|
15
16
|
from ...types.episode_response import EpisodeResponse
|
|
17
|
+
from ...types.success_response import SuccessResponse
|
|
16
18
|
|
|
17
19
|
|
|
18
20
|
class EpisodeClient:
|
|
@@ -184,6 +186,57 @@ class EpisodeClient:
|
|
|
184
186
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text)
|
|
185
187
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json)
|
|
186
188
|
|
|
189
|
+
def delete(self, uuid_: str, *, request_options: typing.Optional[RequestOptions] = None) -> SuccessResponse:
|
|
190
|
+
"""
|
|
191
|
+
Delete an episode by its UUID
|
|
192
|
+
|
|
193
|
+
Parameters
|
|
194
|
+
----------
|
|
195
|
+
uuid_ : str
|
|
196
|
+
Episode UUID
|
|
197
|
+
|
|
198
|
+
request_options : typing.Optional[RequestOptions]
|
|
199
|
+
Request-specific configuration.
|
|
200
|
+
|
|
201
|
+
Returns
|
|
202
|
+
-------
|
|
203
|
+
SuccessResponse
|
|
204
|
+
Episode deleted
|
|
205
|
+
|
|
206
|
+
Examples
|
|
207
|
+
--------
|
|
208
|
+
from zep_cloud.client import Zep
|
|
209
|
+
|
|
210
|
+
client = Zep(
|
|
211
|
+
api_key="YOUR_API_KEY",
|
|
212
|
+
)
|
|
213
|
+
client.graph.episode.delete(
|
|
214
|
+
uuid_="uuid",
|
|
215
|
+
)
|
|
216
|
+
"""
|
|
217
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
218
|
+
f"graph/episodes/{jsonable_encoder(uuid_)}", method="DELETE", request_options=request_options
|
|
219
|
+
)
|
|
220
|
+
try:
|
|
221
|
+
if 200 <= _response.status_code < 300:
|
|
222
|
+
return pydantic_v1.parse_obj_as(SuccessResponse, _response.json()) # type: ignore
|
|
223
|
+
if _response.status_code == 400:
|
|
224
|
+
raise BadRequestError(
|
|
225
|
+
pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore
|
|
226
|
+
)
|
|
227
|
+
if _response.status_code == 404:
|
|
228
|
+
raise NotFoundError(
|
|
229
|
+
pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore
|
|
230
|
+
)
|
|
231
|
+
if _response.status_code == 500:
|
|
232
|
+
raise InternalServerError(
|
|
233
|
+
pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore
|
|
234
|
+
)
|
|
235
|
+
_response_json = _response.json()
|
|
236
|
+
except JSONDecodeError:
|
|
237
|
+
raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text)
|
|
238
|
+
raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json)
|
|
239
|
+
|
|
187
240
|
|
|
188
241
|
class AsyncEpisodeClient:
|
|
189
242
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -377,3 +430,62 @@ class AsyncEpisodeClient:
|
|
|
377
430
|
except JSONDecodeError:
|
|
378
431
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text)
|
|
379
432
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json)
|
|
433
|
+
|
|
434
|
+
async def delete(self, uuid_: str, *, request_options: typing.Optional[RequestOptions] = None) -> SuccessResponse:
|
|
435
|
+
"""
|
|
436
|
+
Delete an episode by its UUID
|
|
437
|
+
|
|
438
|
+
Parameters
|
|
439
|
+
----------
|
|
440
|
+
uuid_ : str
|
|
441
|
+
Episode UUID
|
|
442
|
+
|
|
443
|
+
request_options : typing.Optional[RequestOptions]
|
|
444
|
+
Request-specific configuration.
|
|
445
|
+
|
|
446
|
+
Returns
|
|
447
|
+
-------
|
|
448
|
+
SuccessResponse
|
|
449
|
+
Episode deleted
|
|
450
|
+
|
|
451
|
+
Examples
|
|
452
|
+
--------
|
|
453
|
+
import asyncio
|
|
454
|
+
|
|
455
|
+
from zep_cloud.client import AsyncZep
|
|
456
|
+
|
|
457
|
+
client = AsyncZep(
|
|
458
|
+
api_key="YOUR_API_KEY",
|
|
459
|
+
)
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
async def main() -> None:
|
|
463
|
+
await client.graph.episode.delete(
|
|
464
|
+
uuid_="uuid",
|
|
465
|
+
)
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
asyncio.run(main())
|
|
469
|
+
"""
|
|
470
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
471
|
+
f"graph/episodes/{jsonable_encoder(uuid_)}", method="DELETE", request_options=request_options
|
|
472
|
+
)
|
|
473
|
+
try:
|
|
474
|
+
if 200 <= _response.status_code < 300:
|
|
475
|
+
return pydantic_v1.parse_obj_as(SuccessResponse, _response.json()) # type: ignore
|
|
476
|
+
if _response.status_code == 400:
|
|
477
|
+
raise BadRequestError(
|
|
478
|
+
pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore
|
|
479
|
+
)
|
|
480
|
+
if _response.status_code == 404:
|
|
481
|
+
raise NotFoundError(
|
|
482
|
+
pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore
|
|
483
|
+
)
|
|
484
|
+
if _response.status_code == 500:
|
|
485
|
+
raise InternalServerError(
|
|
486
|
+
pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore
|
|
487
|
+
)
|
|
488
|
+
_response_json = _response.json()
|
|
489
|
+
except JSONDecodeError:
|
|
490
|
+
raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text)
|
|
491
|
+
raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json)
|
|
@@ -45,6 +45,7 @@ from .summary_list_response import SummaryListResponse
|
|
|
45
45
|
from .update_document_list_request import UpdateDocumentListRequest
|
|
46
46
|
from .user import User
|
|
47
47
|
from .user_list_response import UserListResponse
|
|
48
|
+
from .user_node_response import UserNodeResponse
|
|
48
49
|
|
|
49
50
|
__all__ = [
|
|
50
51
|
"AddMemoryResponse",
|
|
@@ -92,4 +93,5 @@ __all__ = [
|
|
|
92
93
|
"UpdateDocumentListRequest",
|
|
93
94
|
"User",
|
|
94
95
|
"UserListResponse",
|
|
96
|
+
"UserNodeResponse",
|
|
95
97
|
]
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
from .entity_node import EntityNode
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class UserNodeResponse(pydantic_v1.BaseModel):
|
|
12
|
+
node: typing.Optional[EntityNode] = None
|
|
13
|
+
|
|
14
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
15
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
16
|
+
return super().json(**kwargs_with_defaults)
|
|
17
|
+
|
|
18
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
19
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
20
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
|
21
|
+
|
|
22
|
+
return deep_union_pydantic_dicts(
|
|
23
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
class Config:
|
|
27
|
+
frozen = True
|
|
28
|
+
smart_union = True
|
|
29
|
+
extra = pydantic_v1.Extra.allow
|
|
30
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
@@ -18,6 +18,7 @@ from ..types.session import Session
|
|
|
18
18
|
from ..types.success_response import SuccessResponse
|
|
19
19
|
from ..types.user import User
|
|
20
20
|
from ..types.user_list_response import UserListResponse
|
|
21
|
+
from ..types.user_node_response import UserNodeResponse
|
|
21
22
|
|
|
22
23
|
# this is used as the default value for optional parameters
|
|
23
24
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -392,6 +393,53 @@ class UserClient:
|
|
|
392
393
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text)
|
|
393
394
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json)
|
|
394
395
|
|
|
396
|
+
def get_node(self, user_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> UserNodeResponse:
|
|
397
|
+
"""
|
|
398
|
+
Get user node.
|
|
399
|
+
|
|
400
|
+
Parameters
|
|
401
|
+
----------
|
|
402
|
+
user_id : str
|
|
403
|
+
The user_id of the user to get the node for.
|
|
404
|
+
|
|
405
|
+
request_options : typing.Optional[RequestOptions]
|
|
406
|
+
Request-specific configuration.
|
|
407
|
+
|
|
408
|
+
Returns
|
|
409
|
+
-------
|
|
410
|
+
UserNodeResponse
|
|
411
|
+
Response object containing the User node.
|
|
412
|
+
|
|
413
|
+
Examples
|
|
414
|
+
--------
|
|
415
|
+
from zep_cloud.client import Zep
|
|
416
|
+
|
|
417
|
+
client = Zep(
|
|
418
|
+
api_key="YOUR_API_KEY",
|
|
419
|
+
)
|
|
420
|
+
client.user.get_node(
|
|
421
|
+
user_id="userId",
|
|
422
|
+
)
|
|
423
|
+
"""
|
|
424
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
425
|
+
f"users/{jsonable_encoder(user_id)}/node", method="GET", request_options=request_options
|
|
426
|
+
)
|
|
427
|
+
try:
|
|
428
|
+
if 200 <= _response.status_code < 300:
|
|
429
|
+
return pydantic_v1.parse_obj_as(UserNodeResponse, _response.json()) # type: ignore
|
|
430
|
+
if _response.status_code == 404:
|
|
431
|
+
raise NotFoundError(
|
|
432
|
+
pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore
|
|
433
|
+
)
|
|
434
|
+
if _response.status_code == 500:
|
|
435
|
+
raise InternalServerError(
|
|
436
|
+
pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore
|
|
437
|
+
)
|
|
438
|
+
_response_json = _response.json()
|
|
439
|
+
except JSONDecodeError:
|
|
440
|
+
raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text)
|
|
441
|
+
raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json)
|
|
442
|
+
|
|
395
443
|
def get_sessions(
|
|
396
444
|
self, user_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
397
445
|
) -> typing.List[Session]:
|
|
@@ -857,6 +905,63 @@ class AsyncUserClient:
|
|
|
857
905
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text)
|
|
858
906
|
raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json)
|
|
859
907
|
|
|
908
|
+
async def get_node(
|
|
909
|
+
self, user_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
910
|
+
) -> UserNodeResponse:
|
|
911
|
+
"""
|
|
912
|
+
Get user node.
|
|
913
|
+
|
|
914
|
+
Parameters
|
|
915
|
+
----------
|
|
916
|
+
user_id : str
|
|
917
|
+
The user_id of the user to get the node for.
|
|
918
|
+
|
|
919
|
+
request_options : typing.Optional[RequestOptions]
|
|
920
|
+
Request-specific configuration.
|
|
921
|
+
|
|
922
|
+
Returns
|
|
923
|
+
-------
|
|
924
|
+
UserNodeResponse
|
|
925
|
+
Response object containing the User node.
|
|
926
|
+
|
|
927
|
+
Examples
|
|
928
|
+
--------
|
|
929
|
+
import asyncio
|
|
930
|
+
|
|
931
|
+
from zep_cloud.client import AsyncZep
|
|
932
|
+
|
|
933
|
+
client = AsyncZep(
|
|
934
|
+
api_key="YOUR_API_KEY",
|
|
935
|
+
)
|
|
936
|
+
|
|
937
|
+
|
|
938
|
+
async def main() -> None:
|
|
939
|
+
await client.user.get_node(
|
|
940
|
+
user_id="userId",
|
|
941
|
+
)
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
asyncio.run(main())
|
|
945
|
+
"""
|
|
946
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
947
|
+
f"users/{jsonable_encoder(user_id)}/node", method="GET", request_options=request_options
|
|
948
|
+
)
|
|
949
|
+
try:
|
|
950
|
+
if 200 <= _response.status_code < 300:
|
|
951
|
+
return pydantic_v1.parse_obj_as(UserNodeResponse, _response.json()) # type: ignore
|
|
952
|
+
if _response.status_code == 404:
|
|
953
|
+
raise NotFoundError(
|
|
954
|
+
pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore
|
|
955
|
+
)
|
|
956
|
+
if _response.status_code == 500:
|
|
957
|
+
raise InternalServerError(
|
|
958
|
+
pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore
|
|
959
|
+
)
|
|
960
|
+
_response_json = _response.json()
|
|
961
|
+
except JSONDecodeError:
|
|
962
|
+
raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text)
|
|
963
|
+
raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json)
|
|
964
|
+
|
|
860
965
|
async def get_sessions(
|
|
861
966
|
self, user_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
862
967
|
) -> typing.List[Session]:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|