Skip to content

Commit 8e38e9f

Browse files
SDK regeneration
1 parent d26ef0c commit 8e38e9f

28 files changed

Lines changed: 1793 additions & 71 deletions

reference.md

Lines changed: 397 additions & 1 deletion
Large diffs are not rendered by default.

src/zep_cloud/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# isort: skip_file
44

55
from .types import (
6+
AddNodeItem,
7+
AddNodesResponse,
68
AddThreadMessagesRequest,
79
AddThreadMessagesResponse,
810
AddTripleResponse,
@@ -61,6 +63,8 @@
6163
Message,
6264
MessageListResponse,
6365
MetadataFilterGroup,
66+
ObservationSteeringConfig,
67+
ObservationType,
6468
PathDetectConfig,
6569
PatternMetadata,
6670
PatternResult,
@@ -92,6 +96,8 @@
9296
from .version import __version__
9397

9498
__all__ = [
99+
"AddNodeItem",
100+
"AddNodesResponse",
95101
"AddThreadMessagesRequest",
96102
"AddThreadMessagesResponse",
97103
"AddTripleResponse",
@@ -156,6 +162,8 @@
156162
"MessageListResponse",
157163
"MetadataFilterGroup",
158164
"NotFoundError",
165+
"ObservationSteeringConfig",
166+
"ObservationType",
159167
"PathDetectConfig",
160168
"PatternMetadata",
161169
"PatternResult",

src/zep_cloud/core/client_wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ def __init__(
2222

2323
def get_headers(self) -> typing.Dict[str, str]:
2424
headers: typing.Dict[str, str] = {
25-
"User-Agent": "zep-cloud/3.24.0",
25+
"User-Agent": "zep-cloud/3.25.0",
2626
"X-Fern-Language": "Python",
2727
"X-Fern-SDK-Name": "zep-cloud",
28-
"X-Fern-SDK-Version": "3.24.0",
28+
"X-Fern-SDK-Version": "3.25.0",
2929
**(self.get_custom_headers() or {}),
3030
}
3131
headers["Authorization"] = f"Api-Key {self.api_key}"

src/zep_cloud/graph/client.py

Lines changed: 154 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
66
from ..core.request_options import RequestOptions
7+
from ..types.add_node_item import AddNodeItem
8+
from ..types.add_nodes_response import AddNodesResponse
79
from ..types.add_triple_response import AddTripleResponse
810
from ..types.clone_graph_response import CloneGraphResponse
911
from ..types.custom_instruction import CustomInstruction
@@ -298,6 +300,7 @@ def add(
298300
graph_id: typing.Optional[str] = OMIT,
299301
metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
300302
source_description: typing.Optional[str] = OMIT,
303+
strict_ontology: typing.Optional[bool] = OMIT,
301304
user_id: typing.Optional[str] = OMIT,
302305
request_options: typing.Optional[RequestOptions] = None,
303306
) -> Episode:
@@ -320,6 +323,9 @@ def add(
320323
321324
source_description : typing.Optional[str]
322325
326+
strict_ontology : typing.Optional[bool]
327+
When true, prevents extraction of generic Entity nodes that do not match the configured ontology.
328+
323329
user_id : typing.Optional[str]
324330
User ID is the ID of the user to which the data will be added. If not adding to a user graph, please use graph_id field instead.
325331
@@ -350,6 +356,7 @@ def add(
350356
graph_id=graph_id,
351357
metadata=metadata,
352358
source_description=source_description,
359+
strict_ontology=strict_ontology,
353360
user_id=user_id,
354361
request_options=request_options,
355362
)
@@ -360,6 +367,7 @@ def add_batch(
360367
*,
361368
episodes: typing.Sequence[EpisodeData],
362369
graph_id: typing.Optional[str] = OMIT,
370+
strict_ontology: typing.Optional[bool] = OMIT,
363371
user_id: typing.Optional[str] = OMIT,
364372
request_options: typing.Optional[RequestOptions] = None,
365373
) -> typing.List[Episode]:
@@ -375,6 +383,9 @@ def add_batch(
375383
graph_id : typing.Optional[str]
376384
graph_id is the ID of the graph to which the data will be added. If adding to the user graph, please use user_id field instead.
377385
386+
strict_ontology : typing.Optional[bool]
387+
When true, prevents extraction of generic Entity nodes that do not match the configured ontology.
388+
378389
user_id : typing.Optional[str]
379390
User ID is the ID of the user to which the data will be added. If not adding to a user graph, please use graph_id field instead.
380391
@@ -403,7 +414,11 @@ def add_batch(
403414
)
404415
"""
405416
_response = self._raw_client.add_batch(
406-
episodes=episodes, graph_id=graph_id, user_id=user_id, request_options=request_options
417+
episodes=episodes,
418+
graph_id=graph_id,
419+
strict_ontology=strict_ontology,
420+
user_id=user_id,
421+
request_options=request_options,
407422
)
408423
return _response.data
409424

@@ -615,6 +630,7 @@ def create(
615630
graph_id: str,
616631
description: typing.Optional[str] = OMIT,
617632
name: typing.Optional[str] = OMIT,
633+
time_zone: typing.Optional[str] = OMIT,
618634
request_options: typing.Optional[RequestOptions] = None,
619635
) -> Graph:
620636
"""
@@ -628,6 +644,9 @@ def create(
628644
629645
name : typing.Optional[str]
630646
647+
time_zone : typing.Optional[str]
648+
The graph's IANA time zone. Stored on its group-backed subject.
649+
631650
request_options : typing.Optional[RequestOptions]
632651
Request-specific configuration.
633652
@@ -648,7 +667,7 @@ def create(
648667
)
649668
"""
650669
_response = self._raw_client.create(
651-
graph_id=graph_id, description=description, name=name, request_options=request_options
670+
graph_id=graph_id, description=description, name=name, time_zone=time_zone, request_options=request_options
652671
)
653672
return _response.data
654673

@@ -715,6 +734,54 @@ def list_all(
715734
)
716735
return _response.data
717736

737+
def add_nodes(
738+
self,
739+
*,
740+
nodes: typing.Sequence[AddNodeItem],
741+
graph_id: typing.Optional[str] = OMIT,
742+
user_id: typing.Optional[str] = OMIT,
743+
request_options: typing.Optional[RequestOptions] = None,
744+
) -> AddNodesResponse:
745+
"""
746+
Add entity nodes to a user or graph directly, without episode ingestion. Up to 100 nodes per request.
747+
748+
Parameters
749+
----------
750+
nodes : typing.Sequence[AddNodeItem]
751+
The nodes to add. 1 to 100 items.
752+
753+
graph_id : typing.Optional[str]
754+
755+
user_id : typing.Optional[str]
756+
757+
request_options : typing.Optional[RequestOptions]
758+
Request-specific configuration.
759+
760+
Returns
761+
-------
762+
AddNodesResponse
763+
Accepted
764+
765+
Examples
766+
--------
767+
from zep_cloud import AddNodeItem, Zep
768+
769+
client = Zep(
770+
api_key="YOUR_API_KEY",
771+
)
772+
client.graph.add_nodes(
773+
nodes=[
774+
AddNodeItem(
775+
name="name",
776+
)
777+
],
778+
)
779+
"""
780+
_response = self._raw_client.add_nodes(
781+
nodes=nodes, graph_id=graph_id, user_id=user_id, request_options=request_options
782+
)
783+
return _response.data
784+
718785
def detect_patterns(
719786
self,
720787
*,
@@ -975,6 +1042,7 @@ def update(
9751042
*,
9761043
description: typing.Optional[str] = OMIT,
9771044
name: typing.Optional[str] = OMIT,
1045+
time_zone: typing.Optional[str] = OMIT,
9781046
request_options: typing.Optional[RequestOptions] = None,
9791047
) -> Graph:
9801048
"""
@@ -989,6 +1057,9 @@ def update(
9891057
9901058
name : typing.Optional[str]
9911059
1060+
time_zone : typing.Optional[str]
1061+
The graph's IANA time zone. Stored on its group-backed subject.
1062+
9921063
request_options : typing.Optional[RequestOptions]
9931064
Request-specific configuration.
9941065
@@ -1009,7 +1080,7 @@ def update(
10091080
)
10101081
"""
10111082
_response = self._raw_client.update(
1012-
graph_id, description=description, name=name, request_options=request_options
1083+
graph_id, description=description, name=name, time_zone=time_zone, request_options=request_options
10131084
)
10141085
return _response.data
10151086

@@ -1347,6 +1418,7 @@ async def add(
13471418
graph_id: typing.Optional[str] = OMIT,
13481419
metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
13491420
source_description: typing.Optional[str] = OMIT,
1421+
strict_ontology: typing.Optional[bool] = OMIT,
13501422
user_id: typing.Optional[str] = OMIT,
13511423
request_options: typing.Optional[RequestOptions] = None,
13521424
) -> Episode:
@@ -1369,6 +1441,9 @@ async def add(
13691441
13701442
source_description : typing.Optional[str]
13711443
1444+
strict_ontology : typing.Optional[bool]
1445+
When true, prevents extraction of generic Entity nodes that do not match the configured ontology.
1446+
13721447
user_id : typing.Optional[str]
13731448
User ID is the ID of the user to which the data will be added. If not adding to a user graph, please use graph_id field instead.
13741449
@@ -1407,6 +1482,7 @@ async def main() -> None:
14071482
graph_id=graph_id,
14081483
metadata=metadata,
14091484
source_description=source_description,
1485+
strict_ontology=strict_ontology,
14101486
user_id=user_id,
14111487
request_options=request_options,
14121488
)
@@ -1417,6 +1493,7 @@ async def add_batch(
14171493
*,
14181494
episodes: typing.Sequence[EpisodeData],
14191495
graph_id: typing.Optional[str] = OMIT,
1496+
strict_ontology: typing.Optional[bool] = OMIT,
14201497
user_id: typing.Optional[str] = OMIT,
14211498
request_options: typing.Optional[RequestOptions] = None,
14221499
) -> typing.List[Episode]:
@@ -1432,6 +1509,9 @@ async def add_batch(
14321509
graph_id : typing.Optional[str]
14331510
graph_id is the ID of the graph to which the data will be added. If adding to the user graph, please use user_id field instead.
14341511
1512+
strict_ontology : typing.Optional[bool]
1513+
When true, prevents extraction of generic Entity nodes that do not match the configured ontology.
1514+
14351515
user_id : typing.Optional[str]
14361516
User ID is the ID of the user to which the data will be added. If not adding to a user graph, please use graph_id field instead.
14371517
@@ -1468,7 +1548,11 @@ async def main() -> None:
14681548
asyncio.run(main())
14691549
"""
14701550
_response = await self._raw_client.add_batch(
1471-
episodes=episodes, graph_id=graph_id, user_id=user_id, request_options=request_options
1551+
episodes=episodes,
1552+
graph_id=graph_id,
1553+
strict_ontology=strict_ontology,
1554+
user_id=user_id,
1555+
request_options=request_options,
14721556
)
14731557
return _response.data
14741558

@@ -1696,6 +1780,7 @@ async def create(
16961780
graph_id: str,
16971781
description: typing.Optional[str] = OMIT,
16981782
name: typing.Optional[str] = OMIT,
1783+
time_zone: typing.Optional[str] = OMIT,
16991784
request_options: typing.Optional[RequestOptions] = None,
17001785
) -> Graph:
17011786
"""
@@ -1709,6 +1794,9 @@ async def create(
17091794
17101795
name : typing.Optional[str]
17111796
1797+
time_zone : typing.Optional[str]
1798+
The graph's IANA time zone. Stored on its group-backed subject.
1799+
17121800
request_options : typing.Optional[RequestOptions]
17131801
Request-specific configuration.
17141802
@@ -1737,7 +1825,7 @@ async def main() -> None:
17371825
asyncio.run(main())
17381826
"""
17391827
_response = await self._raw_client.create(
1740-
graph_id=graph_id, description=description, name=name, request_options=request_options
1828+
graph_id=graph_id, description=description, name=name, time_zone=time_zone, request_options=request_options
17411829
)
17421830
return _response.data
17431831

@@ -1812,6 +1900,62 @@ async def main() -> None:
18121900
)
18131901
return _response.data
18141902

1903+
async def add_nodes(
1904+
self,
1905+
*,
1906+
nodes: typing.Sequence[AddNodeItem],
1907+
graph_id: typing.Optional[str] = OMIT,
1908+
user_id: typing.Optional[str] = OMIT,
1909+
request_options: typing.Optional[RequestOptions] = None,
1910+
) -> AddNodesResponse:
1911+
"""
1912+
Add entity nodes to a user or graph directly, without episode ingestion. Up to 100 nodes per request.
1913+
1914+
Parameters
1915+
----------
1916+
nodes : typing.Sequence[AddNodeItem]
1917+
The nodes to add. 1 to 100 items.
1918+
1919+
graph_id : typing.Optional[str]
1920+
1921+
user_id : typing.Optional[str]
1922+
1923+
request_options : typing.Optional[RequestOptions]
1924+
Request-specific configuration.
1925+
1926+
Returns
1927+
-------
1928+
AddNodesResponse
1929+
Accepted
1930+
1931+
Examples
1932+
--------
1933+
import asyncio
1934+
1935+
from zep_cloud import AddNodeItem, AsyncZep
1936+
1937+
client = AsyncZep(
1938+
api_key="YOUR_API_KEY",
1939+
)
1940+
1941+
1942+
async def main() -> None:
1943+
await client.graph.add_nodes(
1944+
nodes=[
1945+
AddNodeItem(
1946+
name="name",
1947+
)
1948+
],
1949+
)
1950+
1951+
1952+
asyncio.run(main())
1953+
"""
1954+
_response = await self._raw_client.add_nodes(
1955+
nodes=nodes, graph_id=graph_id, user_id=user_id, request_options=request_options
1956+
)
1957+
return _response.data
1958+
18151959
async def detect_patterns(
18161960
self,
18171961
*,
@@ -2106,6 +2250,7 @@ async def update(
21062250
*,
21072251
description: typing.Optional[str] = OMIT,
21082252
name: typing.Optional[str] = OMIT,
2253+
time_zone: typing.Optional[str] = OMIT,
21092254
request_options: typing.Optional[RequestOptions] = None,
21102255
) -> Graph:
21112256
"""
@@ -2120,6 +2265,9 @@ async def update(
21202265
21212266
name : typing.Optional[str]
21222267
2268+
time_zone : typing.Optional[str]
2269+
The graph's IANA time zone. Stored on its group-backed subject.
2270+
21232271
request_options : typing.Optional[RequestOptions]
21242272
Request-specific configuration.
21252273
@@ -2148,7 +2296,7 @@ async def main() -> None:
21482296
asyncio.run(main())
21492297
"""
21502298
_response = await self._raw_client.update(
2151-
graph_id, description=description, name=name, request_options=request_options
2299+
graph_id, description=description, name=name, time_zone=time_zone, request_options=request_options
21522300
)
21532301
return _response.data
21542302

0 commit comments

Comments
 (0)