diff --git a/reference.md b/reference.md index 602d1af..5725bda 100644 --- a/reference.md +++ b/reference.md @@ -3134,6 +3134,190 @@ client.graph.add() + + + + +
client.graph.add_fact_triple(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Add a fact triple for a user or group +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from zep_cloud.client import Zep + +client = Zep( + api_key="YOUR_API_KEY", +) +client.graph.add_fact_triple( + fact="fact", + fact_name="fact_name", + target_node_name="target_node_name", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fact:** `str` — The fact relating the two nodes that this edge represents + +
+
+ +
+
+ +**fact_name:** `str` — The name of the edge to add. Should be all caps using snake case (eg RELATES_TO) + +
+
+ +
+
+ +**target_node_name:** `str` — The name of the target node to add + +
+
+ +
+
+ +**created_at:** `typing.Optional[str]` — The timestamp of the message + +
+
+ +
+
+ +**expired_at:** `typing.Optional[str]` — The time (if any) at which the edge expires + +
+
+ +
+
+ +**fact_uuid:** `typing.Optional[str]` — The uuid of the edge to add + +
+
+ +
+
+ +**group_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**invalid_at:** `typing.Optional[str]` — The time (if any) at which the fact stops being true + +
+
+ +
+
+ +**source_node_name:** `typing.Optional[str]` — The name of the source node to add + +
+
+ +
+
+ +**source_node_summary:** `typing.Optional[str]` — The summary of the source node to add + +
+
+ +
+
+ +**source_node_uuid:** `typing.Optional[str]` — The source node uuid + +
+
+ +
+
+ +**target_node_summary:** `typing.Optional[str]` — The summary of the target node to add + +
+
+ +
+
+ +**target_node_uuid:** `typing.Optional[str]` — The target node uuid + +
+
+ +
+
+ +**user_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**valid_at:** `typing.Optional[str]` — The time at which the fact becomes true + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
@@ -4154,6 +4338,76 @@ client.user.get_facts( + + + + +
client.user.get_node(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get user node. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from zep_cloud.client import Zep + +client = Zep( + api_key="YOUR_API_KEY", +) +client.user.get_node( + user_id="userId", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**user_id:** `str` — The user_id of the user to get the node for. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
@@ -4732,6 +4986,76 @@ client.graph.episode.get( + + + + +
client.graph.episode.delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete an episode by its UUID +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from zep_cloud.client import Zep + +client = Zep( + api_key="YOUR_API_KEY", +) +client.graph.episode.delete( + uuid_="uuid", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**uuid_:** `str` — Episode UUID + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
diff --git a/src/zep_cloud/__init__.py b/src/zep_cloud/__init__.py index 8ce86e2..ee93cfc 100644 --- a/src/zep_cloud/__init__.py +++ b/src/zep_cloud/__init__.py @@ -2,6 +2,7 @@ from .types import ( AddMemoryResponse, + AddTripleResponse, ApiError, ApidataDocument, ApidataDocumentCollection, @@ -46,6 +47,7 @@ UpdateDocumentListRequest, User, UserListResponse, + UserNodeResponse, ) from .errors import BadRequestError, ConflictError, InternalServerError, NotFoundError, UnauthorizedError from . import document, graph, group, memory, user @@ -54,6 +56,7 @@ __all__ = [ "AddMemoryResponse", + "AddTripleResponse", "ApiError", "ApidataDocument", "ApidataDocumentCollection", @@ -103,6 +106,7 @@ "UpdateDocumentListRequest", "User", "UserListResponse", + "UserNodeResponse", "ZepEnvironment", "__version__", "document", diff --git a/src/zep_cloud/core/client_wrapper.py b/src/zep_cloud/core/client_wrapper.py index 3090a49..366bad7 100644 --- a/src/zep_cloud/core/client_wrapper.py +++ b/src/zep_cloud/core/client_wrapper.py @@ -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.3.1", + "X-Fern-SDK-Version": "2.4.0", } headers["Authorization"] = f"Api-Key {self.api_key}" return headers diff --git a/src/zep_cloud/graph/client.py b/src/zep_cloud/graph/client.py index 1c8200b..e7dfd96 100644 --- a/src/zep_cloud/graph/client.py +++ b/src/zep_cloud/graph/client.py @@ -9,6 +9,7 @@ from ..core.request_options import RequestOptions from ..errors.bad_request_error import BadRequestError from ..errors.internal_server_error import InternalServerError +from ..types.add_triple_response import AddTripleResponse from ..types.api_error import ApiError as types_api_error_ApiError from ..types.graph_data_type import GraphDataType from ..types.graph_search_results import GraphSearchResults @@ -92,6 +93,134 @@ def add( raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text) raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + def add_fact_triple( + self, + *, + fact: str, + fact_name: str, + target_node_name: str, + created_at: typing.Optional[str] = OMIT, + expired_at: typing.Optional[str] = OMIT, + fact_uuid: typing.Optional[str] = OMIT, + group_id: typing.Optional[str] = OMIT, + invalid_at: typing.Optional[str] = OMIT, + source_node_name: typing.Optional[str] = OMIT, + source_node_summary: typing.Optional[str] = OMIT, + source_node_uuid: typing.Optional[str] = OMIT, + target_node_summary: typing.Optional[str] = OMIT, + target_node_uuid: typing.Optional[str] = OMIT, + user_id: typing.Optional[str] = OMIT, + valid_at: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None + ) -> AddTripleResponse: + """ + Add a fact triple for a user or group + + Parameters + ---------- + fact : str + The fact relating the two nodes that this edge represents + + fact_name : str + The name of the edge to add. Should be all caps using snake case (eg RELATES_TO) + + target_node_name : str + The name of the target node to add + + created_at : typing.Optional[str] + The timestamp of the message + + expired_at : typing.Optional[str] + The time (if any) at which the edge expires + + fact_uuid : typing.Optional[str] + The uuid of the edge to add + + group_id : typing.Optional[str] + + invalid_at : typing.Optional[str] + The time (if any) at which the fact stops being true + + source_node_name : typing.Optional[str] + The name of the source node to add + + source_node_summary : typing.Optional[str] + The summary of the source node to add + + source_node_uuid : typing.Optional[str] + The source node uuid + + target_node_summary : typing.Optional[str] + The summary of the target node to add + + target_node_uuid : typing.Optional[str] + The target node uuid + + user_id : typing.Optional[str] + + valid_at : typing.Optional[str] + The time at which the fact becomes true + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AddTripleResponse + Resulting triple + + Examples + -------- + from zep_cloud.client import Zep + + client = Zep( + api_key="YOUR_API_KEY", + ) + client.graph.add_fact_triple( + fact="fact", + fact_name="fact_name", + target_node_name="target_node_name", + ) + """ + _response = self._client_wrapper.httpx_client.request( + "graph/add-fact-triple", + method="POST", + json={ + "created_at": created_at, + "expired_at": expired_at, + "fact": fact, + "fact_name": fact_name, + "fact_uuid": fact_uuid, + "group_id": group_id, + "invalid_at": invalid_at, + "source_node_name": source_node_name, + "source_node_summary": source_node_summary, + "source_node_uuid": source_node_uuid, + "target_node_name": target_node_name, + "target_node_summary": target_node_summary, + "target_node_uuid": target_node_uuid, + "user_id": user_id, + "valid_at": valid_at, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AddTripleResponse, _response.json()) # type: ignore + if _response.status_code == 400: + raise BadRequestError( + pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore + ) + if _response.status_code == 500: + raise InternalServerError( + pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text) + raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + def search( self, *, @@ -268,6 +397,142 @@ async def main() -> None: raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text) raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + async def add_fact_triple( + self, + *, + fact: str, + fact_name: str, + target_node_name: str, + created_at: typing.Optional[str] = OMIT, + expired_at: typing.Optional[str] = OMIT, + fact_uuid: typing.Optional[str] = OMIT, + group_id: typing.Optional[str] = OMIT, + invalid_at: typing.Optional[str] = OMIT, + source_node_name: typing.Optional[str] = OMIT, + source_node_summary: typing.Optional[str] = OMIT, + source_node_uuid: typing.Optional[str] = OMIT, + target_node_summary: typing.Optional[str] = OMIT, + target_node_uuid: typing.Optional[str] = OMIT, + user_id: typing.Optional[str] = OMIT, + valid_at: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None + ) -> AddTripleResponse: + """ + Add a fact triple for a user or group + + Parameters + ---------- + fact : str + The fact relating the two nodes that this edge represents + + fact_name : str + The name of the edge to add. Should be all caps using snake case (eg RELATES_TO) + + target_node_name : str + The name of the target node to add + + created_at : typing.Optional[str] + The timestamp of the message + + expired_at : typing.Optional[str] + The time (if any) at which the edge expires + + fact_uuid : typing.Optional[str] + The uuid of the edge to add + + group_id : typing.Optional[str] + + invalid_at : typing.Optional[str] + The time (if any) at which the fact stops being true + + source_node_name : typing.Optional[str] + The name of the source node to add + + source_node_summary : typing.Optional[str] + The summary of the source node to add + + source_node_uuid : typing.Optional[str] + The source node uuid + + target_node_summary : typing.Optional[str] + The summary of the target node to add + + target_node_uuid : typing.Optional[str] + The target node uuid + + user_id : typing.Optional[str] + + valid_at : typing.Optional[str] + The time at which the fact becomes true + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AddTripleResponse + Resulting triple + + Examples + -------- + import asyncio + + from zep_cloud.client import AsyncZep + + client = AsyncZep( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.graph.add_fact_triple( + fact="fact", + fact_name="fact_name", + target_node_name="target_node_name", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "graph/add-fact-triple", + method="POST", + json={ + "created_at": created_at, + "expired_at": expired_at, + "fact": fact, + "fact_name": fact_name, + "fact_uuid": fact_uuid, + "group_id": group_id, + "invalid_at": invalid_at, + "source_node_name": source_node_name, + "source_node_summary": source_node_summary, + "source_node_uuid": source_node_uuid, + "target_node_name": target_node_name, + "target_node_summary": target_node_summary, + "target_node_uuid": target_node_uuid, + "user_id": user_id, + "valid_at": valid_at, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AddTripleResponse, _response.json()) # type: ignore + if _response.status_code == 400: + raise BadRequestError( + pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore + ) + if _response.status_code == 500: + raise InternalServerError( + pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text) + raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + async def search( self, *, diff --git a/src/zep_cloud/graph/episode/client.py b/src/zep_cloud/graph/episode/client.py index 9b170a2..e5949f1 100644 --- a/src/zep_cloud/graph/episode/client.py +++ b/src/zep_cloud/graph/episode/client.py @@ -10,9 +10,11 @@ from ...core.request_options import RequestOptions from ...errors.bad_request_error import BadRequestError from ...errors.internal_server_error import InternalServerError +from ...errors.not_found_error import NotFoundError from ...types.api_error import ApiError as types_api_error_ApiError from ...types.episode import Episode from ...types.episode_response import EpisodeResponse +from ...types.success_response import SuccessResponse class EpisodeClient: @@ -184,6 +186,57 @@ def get(self, uuid_: str, *, request_options: typing.Optional[RequestOptions] = raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text) raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + def delete(self, uuid_: str, *, request_options: typing.Optional[RequestOptions] = None) -> SuccessResponse: + """ + Delete an episode by its UUID + + Parameters + ---------- + uuid_ : str + Episode UUID + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SuccessResponse + Episode deleted + + Examples + -------- + from zep_cloud.client import Zep + + client = Zep( + api_key="YOUR_API_KEY", + ) + client.graph.episode.delete( + uuid_="uuid", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"graph/episodes/{jsonable_encoder(uuid_)}", method="DELETE", request_options=request_options + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SuccessResponse, _response.json()) # type: ignore + if _response.status_code == 400: + raise BadRequestError( + pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore + ) + if _response.status_code == 404: + raise NotFoundError( + pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore + ) + if _response.status_code == 500: + raise InternalServerError( + pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text) + raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + class AsyncEpisodeClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): @@ -377,3 +430,62 @@ async def main() -> None: except JSONDecodeError: raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text) raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + + async def delete(self, uuid_: str, *, request_options: typing.Optional[RequestOptions] = None) -> SuccessResponse: + """ + Delete an episode by its UUID + + Parameters + ---------- + uuid_ : str + Episode UUID + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SuccessResponse + Episode deleted + + Examples + -------- + import asyncio + + from zep_cloud.client import AsyncZep + + client = AsyncZep( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.graph.episode.delete( + uuid_="uuid", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"graph/episodes/{jsonable_encoder(uuid_)}", method="DELETE", request_options=request_options + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SuccessResponse, _response.json()) # type: ignore + if _response.status_code == 400: + raise BadRequestError( + pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore + ) + if _response.status_code == 404: + raise NotFoundError( + pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore + ) + if _response.status_code == 500: + raise InternalServerError( + pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text) + raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/zep_cloud/types/__init__.py b/src/zep_cloud/types/__init__.py index 21425f9..e3c4610 100644 --- a/src/zep_cloud/types/__init__.py +++ b/src/zep_cloud/types/__init__.py @@ -1,6 +1,7 @@ # This file was auto-generated by Fern from our API Definition. from .add_memory_response import AddMemoryResponse +from .add_triple_response import AddTripleResponse from .api_error import ApiError from .apidata_document import ApidataDocument from .apidata_document_collection import ApidataDocumentCollection @@ -45,9 +46,11 @@ from .update_document_list_request import UpdateDocumentListRequest from .user import User from .user_list_response import UserListResponse +from .user_node_response import UserNodeResponse __all__ = [ "AddMemoryResponse", + "AddTripleResponse", "ApiError", "ApidataDocument", "ApidataDocumentCollection", @@ -92,4 +95,5 @@ "UpdateDocumentListRequest", "User", "UserListResponse", + "UserNodeResponse", ] diff --git a/src/zep_cloud/types/add_triple_response.py b/src/zep_cloud/types/add_triple_response.py new file mode 100644 index 0000000..58b1235 --- /dev/null +++ b/src/zep_cloud/types/add_triple_response.py @@ -0,0 +1,33 @@ +# 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 +from .entity_edge import EntityEdge +from .entity_node import EntityNode + + +class AddTripleResponse(pydantic_v1.BaseModel): + edge: typing.Optional[EntityEdge] = None + source_node: typing.Optional[EntityNode] = None + target_node: typing.Optional[EntityNode] = 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} diff --git a/src/zep_cloud/types/user_node_response.py b/src/zep_cloud/types/user_node_response.py new file mode 100644 index 0000000..ee252ec --- /dev/null +++ b/src/zep_cloud/types/user_node_response.py @@ -0,0 +1,30 @@ +# 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 +from .entity_node import EntityNode + + +class UserNodeResponse(pydantic_v1.BaseModel): + node: typing.Optional[EntityNode] = 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} diff --git a/src/zep_cloud/user/client.py b/src/zep_cloud/user/client.py index 1367a3f..5f8c6bb 100644 --- a/src/zep_cloud/user/client.py +++ b/src/zep_cloud/user/client.py @@ -18,6 +18,7 @@ from ..types.success_response import SuccessResponse from ..types.user import User from ..types.user_list_response import UserListResponse +from ..types.user_node_response import UserNodeResponse # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -392,6 +393,53 @@ def get_facts(self, user_id: str, *, request_options: typing.Optional[RequestOpt raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text) raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + def get_node(self, user_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> UserNodeResponse: + """ + Get user node. + + Parameters + ---------- + user_id : str + The user_id of the user to get the node for. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UserNodeResponse + Response object containing the User node. + + Examples + -------- + from zep_cloud.client import Zep + + client = Zep( + api_key="YOUR_API_KEY", + ) + client.user.get_node( + user_id="userId", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"users/{jsonable_encoder(user_id)}/node", method="GET", request_options=request_options + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UserNodeResponse, _response.json()) # type: ignore + if _response.status_code == 404: + raise NotFoundError( + pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore + ) + if _response.status_code == 500: + raise InternalServerError( + pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text) + raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + def get_sessions( self, user_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.List[Session]: @@ -857,6 +905,63 @@ async def main() -> None: raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text) raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + async def get_node( + self, user_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> UserNodeResponse: + """ + Get user node. + + Parameters + ---------- + user_id : str + The user_id of the user to get the node for. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UserNodeResponse + Response object containing the User node. + + Examples + -------- + import asyncio + + from zep_cloud.client import AsyncZep + + client = AsyncZep( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.user.get_node( + user_id="userId", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"users/{jsonable_encoder(user_id)}/node", method="GET", request_options=request_options + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UserNodeResponse, _response.json()) # type: ignore + if _response.status_code == 404: + raise NotFoundError( + pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore + ) + if _response.status_code == 500: + raise InternalServerError( + pydantic_v1.parse_obj_as(types_api_error_ApiError, _response.json()) # type: ignore + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text) + raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + async def get_sessions( self, user_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> typing.List[Session]: