Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2ae5251
chore: Fix fact ratings table
paul-paliychuk Apr 16, 2025
791352a
Merge branch 'main' of github.com:getzep/zep-python
paul-paliychuk May 13, 2025
be6b1b7
Merge branch 'main' of github.com:getzep/zep-python
paul-paliychuk May 26, 2025
e2adc9f
chore: Bump version
paul-paliychuk May 26, 2025
c80c78c
SDK regeneration
fern-api[bot] May 26, 2025
cd968d7
SDK regeneration
fern-api[bot] May 26, 2025
3e75648
SDK regeneration
fern-api[bot] May 26, 2025
96ad439
feat: Add support for custom entity edges
paul-paliychuk May 27, 2025
cc47bdf
Merge branch 'v2' of github.com:getzep/zep-python into v2
paul-paliychuk May 27, 2025
6a5be5e
simplify ontology client
paul-paliychuk May 27, 2025
1c23a19
SDK regeneration
fern-api[bot] May 28, 2025
626ca50
SDK regeneration
fern-api[bot] May 29, 2025
1d958ad
chore: Update doc string
paul-paliychuk Jun 2, 2025
0ec9e36
Merge branch 'main' of github.com:getzep/zep-python into v2
paul-paliychuk Jun 3, 2025
6e9c331
feat: Update sync version of set entity type method
paul-paliychuk Jun 3, 2025
bb5382a
SDK regeneration
fern-api[bot] Jun 4, 2025
ecb706e
SDK regeneration
fern-api[bot] Jun 4, 2025
a341d16
chore: Bump version
paul-paliychuk Jun 4, 2025
3d5ced0
Merge branch 'main' of github.com:getzep/zep-python into v2
paul-paliychuk Jun 4, 2025
32a3342
SDK regeneration
fern-api[bot] Jun 5, 2025
47bb410
SDK regeneration
fern-api[bot] Jun 5, 2025
3990f92
SDK regeneration
fern-api[bot] Jun 5, 2025
368e86c
SDK regeneration
fern-api[bot] Jun 5, 2025
daa52bd
SDK regeneration
fern-api[bot] Jun 5, 2025
365dceb
Merge branch 'main' of github.com:getzep/zep-python into v2
paul-paliychuk Jun 6, 2025
f666371
chore: Set up set ontology method
paul-paliychuk Jun 6, 2025
1bea866
Merge branch 'main' of github.com:getzep/zep-python into v2
paul-paliychuk Jun 18, 2025
574e606
chore: Bump version
paul-paliychuk Jun 18, 2025
8a6d79b
SDK regeneration
fern-api[bot] Jun 18, 2025
dee4a4c
SDK regeneration
fern-api[bot] Jun 18, 2025
f7f8708
Merge branch 'main' of github.com:getzep/zep-python into v2
paul-paliychuk Jun 18, 2025
29f0858
Merge branch 'v2' of github.com:getzep/zep-python into v2
paul-paliychuk Jun 20, 2025
ceabe94
chore: Bump version
paul-paliychuk Jun 20, 2025
62d14ef
SDK regeneration
fern-api[bot] Jun 20, 2025
f091d80
SDK regeneration
fern-api[bot] Jun 20, 2025
2b556a2
SDK regeneration
fern-api[bot] Jun 20, 2025
38806fd
chore: Add deprecation notice to structured data extraction
paul-paliychuk Jun 20, 2025
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.15.0"
version = "2.16.0"
description = ""
readme = "README.md"
authors = []
Expand Down
96 changes: 94 additions & 2 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,98 @@ client.graph.add_fact_triple(
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.graph.<a href="src/zep_cloud/graph/client.py">clone</a>(...)</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Clone a user or group graph.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```python
from zep_cloud.client import Zep

client = Zep(
api_key="YOUR_API_KEY",
)
client.graph.clone()

```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**source_group_id:** `typing.Optional[str]` — group_id of the group whose graph is being cloned. Required if user_id is not provided
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: The description for source_group_id mentions "Required if user_id is not provided". For consistency, it should probably read "Required if source_user_id is not provided".

Suggested change
**source_group_id:** `typing.Optional[str]` — group_id of the group whose graph is being cloned. Required if user_id is not provided
**source_group_id:** `typing.Optional[str]` — group_id of the group whose graph is being cloned. Required if source_user_id is not provided

This comment was generated because it violated a code review rule: mrule_akx655bcesz2pGU1.


</dd>
</dl>

<dl>
<dd>

**source_user_id:** `typing.Optional[str]` — user_id of the user whose graph is being cloned. Required if group_id is not provided
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: The description for source_user_id mentions "Required if group_id is not provided". For consistency, it should probably read "Required if source_group_id is not provided".

Suggested change
**source_user_id:** `typing.Optional[str]` — user_id of the user whose graph is being cloned. Required if group_id is not provided
**source_user_id:** `typing.Optional[str]` — user_id of the user whose graph is being cloned. Required if source_group_id is not provided

This comment was generated because it violated a code review rule: mrule_akx655bcesz2pGU1.


</dd>
</dl>

<dl>
<dd>

**target_group_id:** `typing.Optional[str]` — group_id to be set on the cloned group. Must not point to an existing group. Required if target_user_id is not provided.

</dd>
</dl>

<dl>
<dd>

**target_user_id:** `typing.Optional[str]` — user_id to be set on the cloned user. Must not point to an existing user. Required if target_group_id is not provided.

</dd>
</dl>

<dl>
<dd>

**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>
Expand Down Expand Up @@ -2478,7 +2570,7 @@ Fact rating instructions can not be unset.
<dl>
<dd>

Classifies a session.
Deprecated: Classifies a session.
</dd>
</dl>
</dd>
Expand Down Expand Up @@ -2676,7 +2768,7 @@ client.memory.end_session(
<dl>
<dd>

extract data from a session by session id
Deprecated: extract data from a session by session id
</dd>
</dl>
</dd>
Expand Down
2 changes: 2 additions & 0 deletions src/zep_cloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
ApidataDocumentSearchResponse,
ApidataDocumentWithScore,
ClassifySessionRequest,
CloneGraphResponse,
CreateDocumentRequest,
EdgeType,
EndSessionResponse,
Expand Down Expand Up @@ -75,6 +76,7 @@
"ApidataDocumentWithScore",
"BadRequestError",
"ClassifySessionRequest",
"CloneGraphResponse",
"ConflictError",
"CreateDocumentRequest",
"EdgeType",
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.15.0",
"X-Fern-SDK-Version": "2.16.0",
}
headers["Authorization"] = f"Api-Key {self.api_key}"
return headers
Expand Down
4 changes: 2 additions & 2 deletions src/zep_cloud/external_clients/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def extract(
last_n: int = 4,
validate: bool = False,
):
"""Extracts structured data from a session based on a ZepModel schema.
"""Deprecated: Extracts structured data from a session based on a ZepModel schema.
This method retrieves data based on a given model and session details.
It then returns the extracted and validated data as an instance of the given ZepModel.

Expand Down Expand Up @@ -94,7 +94,7 @@ async def extract(
last_n: int = 4,
validate: bool = False,
):
"""Extracts structured data from a session based on a ZepModel schema.
"""Deprecated: Extracts structured data from a session based on a ZepModel schema.
This method retrieves data based on a given model and session details.
It then returns the extracted and validated data as an instance of the given ZepModel.

Expand Down
151 changes: 151 additions & 0 deletions src/zep_cloud/graph/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from ..errors.not_found_error import NotFoundError
from ..types.add_triple_response import AddTripleResponse
from ..types.api_error import ApiError as types_api_error_ApiError
from ..types.clone_graph_response import CloneGraphResponse
from ..types.edge_type import EdgeType
from ..types.entity_type import EntityType
from ..types.entity_type_response import EntityTypeResponse
Expand Down Expand Up @@ -409,6 +410,77 @@ def add_fact_triple(
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 clone(
self,
*,
source_group_id: typing.Optional[str] = OMIT,
source_user_id: typing.Optional[str] = OMIT,
target_group_id: typing.Optional[str] = OMIT,
target_user_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None
) -> CloneGraphResponse:
"""
Clone a user or group graph.

Parameters
----------
source_group_id : typing.Optional[str]
group_id of the group whose graph is being cloned. Required if user_id is not provided

source_user_id : typing.Optional[str]
user_id of the user whose graph is being cloned. Required if group_id is not provided

target_group_id : typing.Optional[str]
group_id to be set on the cloned group. Must not point to an existing group. Required if target_user_id is not provided.

target_user_id : typing.Optional[str]
user_id to be set on the cloned user. Must not point to an existing user. Required if target_group_id is not provided.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Returns
-------
CloneGraphResponse
Response object containing group_id or user_id pointing to the new graph

Examples
--------
from zep_cloud.client import Zep

client = Zep(
api_key="YOUR_API_KEY",
)
client.graph.clone()
"""
_response = self._client_wrapper.httpx_client.request(
"graph/clone",
method="POST",
json={
"source_group_id": source_group_id,
"source_user_id": source_user_id,
"target_group_id": target_group_id,
"target_user_id": target_user_id,
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
return pydantic_v1.parse_obj_as(CloneGraphResponse, _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,
*,
Expand Down Expand Up @@ -941,6 +1013,85 @@ 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 clone(
self,
*,
source_group_id: typing.Optional[str] = OMIT,
source_user_id: typing.Optional[str] = OMIT,
target_group_id: typing.Optional[str] = OMIT,
target_user_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None
) -> CloneGraphResponse:
"""
Clone a user or group graph.

Parameters
----------
source_group_id : typing.Optional[str]
group_id of the group whose graph is being cloned. Required if user_id is not provided

source_user_id : typing.Optional[str]
user_id of the user whose graph is being cloned. Required if group_id is not provided

target_group_id : typing.Optional[str]
group_id to be set on the cloned group. Must not point to an existing group. Required if target_user_id is not provided.

target_user_id : typing.Optional[str]
user_id to be set on the cloned user. Must not point to an existing user. Required if target_group_id is not provided.

request_options : typing.Optional[RequestOptions]
Request-specific configuration.

Returns
-------
CloneGraphResponse
Response object containing group_id or user_id pointing to the new graph

Examples
--------
import asyncio

from zep_cloud.client import AsyncZep

client = AsyncZep(
api_key="YOUR_API_KEY",
)


async def main() -> None:
await client.graph.clone()


asyncio.run(main())
"""
_response = await self._client_wrapper.httpx_client.request(
"graph/clone",
method="POST",
json={
"source_group_id": source_group_id,
"source_user_id": source_user_id,
"target_group_id": target_group_id,
"target_user_id": target_user_id,
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
return pydantic_v1.parse_obj_as(CloneGraphResponse, _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,
*,
Expand Down
8 changes: 4 additions & 4 deletions src/zep_cloud/memory/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ def classify_session(
request_options: typing.Optional[RequestOptions] = None,
) -> SessionClassification:
"""
Classifies a session.
Deprecated: Classifies a session.

Parameters
----------
Expand Down Expand Up @@ -716,7 +716,7 @@ def extract_data(
request_options: typing.Optional[RequestOptions] = None,
) -> typing.Dict[str, str]:
"""
extract data from a session by session id
Deprecated: extract data from a session by session id

Parameters
----------
Expand Down Expand Up @@ -2091,7 +2091,7 @@ async def classify_session(
request_options: typing.Optional[RequestOptions] = None,
) -> SessionClassification:
"""
Classifies a session.
Deprecated: Classifies a session.

Parameters
----------
Expand Down Expand Up @@ -2250,7 +2250,7 @@ async def extract_data(
request_options: typing.Optional[RequestOptions] = None,
) -> typing.Dict[str, str]:
"""
extract data from a session by session id
Deprecated: extract data from a session by session id

Parameters
----------
Expand Down
2 changes: 2 additions & 0 deletions src/zep_cloud/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from .apidata_document_search_response import ApidataDocumentSearchResponse
from .apidata_document_with_score import ApidataDocumentWithScore
from .classify_session_request import ClassifySessionRequest
from .clone_graph_response import CloneGraphResponse
from .create_document_request import CreateDocumentRequest
from .edge_type import EdgeType
from .end_session_response import EndSessionResponse
Expand Down Expand Up @@ -68,6 +69,7 @@
"ApidataDocumentSearchResponse",
"ApidataDocumentWithScore",
"ClassifySessionRequest",
"CloneGraphResponse",
"CreateDocumentRequest",
"EdgeType",
"EndSessionResponse",
Expand Down
Loading