Skip to content

Commit a4866b1

Browse files
Task management API (#298)
* chore: Fix fact ratings table * SDK regeneration * chore: Version bump * chore: Version bump * SDK regeneration * chore: Add support for user/graph ontology targets * SDK regeneration * chore: Add support for setting entity/edges on a list of users/graphs * SDK regeneration * chore: Bump version * SDK regeneration * feat: Update compose context string util to include episodes and display entity attributes * chore: Bump version * fix: tests * chore: Remove redundant timestamp conversion branch * SDK regeneration * chore: Version bump * SDK regeneration * SDK regeneration * fix: tests * chore: Version bump * SDK regeneration * chore: Simplify date parsing in string composition utility * chore: Add python date util dep * chore: Bump version * SDK regeneration * SDK regeneration * chore: Bump version * SDK regeneration * chore: Remove langchain dependency * chore: Bump version * SDK regeneration * SDK regeneration * SDK regeneration * chore: Bump version * SDK regeneration * SDK regeneration * SDK regeneration * SDK regeneration * SDK regeneration * SDK regeneration * SDK regeneration * SDK regeneration * SDK regeneration * chore: Bump version * SDK regeneration * SDK regeneration * SDK regeneration * chore: Bump version * SDK regeneration * SDK regeneration * SDK regeneration * SDK regeneration * SDK regeneration * chore: Bump version * SDK regeneration * SDK regeneration * SDK regeneration * SDK regeneration * SDK regeneration * chore: Bump version * SDK regeneration * chore: Bump version * SDK regeneration * SDK regeneration * SDK regeneration --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
1 parent 8b95e6f commit a4866b1

18 files changed

Lines changed: 473 additions & 29 deletions

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "zep-cloud"
33

44
[tool.poetry]
55
name = "zep-cloud"
6-
version = "3.12.0"
6+
version = "3.13.0"
77
description = ""
88
readme = "README.md"
99
authors = []

reference.md

Lines changed: 79 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,7 @@ client = Zep(
767767
client.graph.add_fact_triple(
768768
fact="fact",
769769
fact_name="fact_name",
770+
source_node_name="source_node_name",
770771
target_node_name="target_node_name",
771772
)
772773

@@ -800,55 +801,55 @@ client.graph.add_fact_triple(
800801
<dl>
801802
<dd>
802803

803-
**target_node_name:** `str` — The name of the target node to add
804+
**source_node_name:** `str` — The name of the source node to add
804805

805806
</dd>
806807
</dl>
807808

808809
<dl>
809810
<dd>
810811

811-
**created_at:** `typing.Optional[str]` — The timestamp of the message
812+
**target_node_name:** `str` — The name of the target node to add
812813

813814
</dd>
814815
</dl>
815816

816817
<dl>
817818
<dd>
818819

819-
**expired_at:** `typing.Optional[str]` — The time (if any) at which the edge expires
820+
**created_at:** `typing.Optional[str]` — The timestamp of the message
820821

821822
</dd>
822823
</dl>
823824

824825
<dl>
825826
<dd>
826827

827-
**fact_uuid:** `typing.Optional[str]` — The uuid of the edge to add
828+
**expired_at:** `typing.Optional[str]` — The time (if any) at which the edge expires
828829

829830
</dd>
830831
</dl>
831832

832833
<dl>
833834
<dd>
834835

835-
**graph_id:** `typing.Optional[str]`
836+
**fact_uuid:** `typing.Optional[str]` — The uuid of the edge to add
836837

837838
</dd>
838839
</dl>
839840

840841
<dl>
841842
<dd>
842843

843-
**invalid_at:** `typing.Optional[str]` — The time (if any) at which the fact stops being true
844+
**graph_id:** `typing.Optional[str]`
844845

845846
</dd>
846847
</dl>
847848

848849
<dl>
849850
<dd>
850851

851-
**source_node_name:** `typing.Optional[str]` — The name of the source node to add
852+
**invalid_at:** `typing.Optional[str]` — The time (if any) at which the fact stops being true
852853

853854
</dd>
854855
</dl>
@@ -1630,6 +1631,77 @@ client.project.get()
16301631
</dl>
16311632

16321633

1634+
</dd>
1635+
</dl>
1636+
</details>
1637+
1638+
## Task
1639+
<details><summary><code>client.task.<a href="src/zep_cloud/task/client.py">get</a>(...)</code></summary>
1640+
<dl>
1641+
<dd>
1642+
1643+
#### 📝 Description
1644+
1645+
<dl>
1646+
<dd>
1647+
1648+
<dl>
1649+
<dd>
1650+
1651+
Gets a task by its ID
1652+
</dd>
1653+
</dl>
1654+
</dd>
1655+
</dl>
1656+
1657+
#### 🔌 Usage
1658+
1659+
<dl>
1660+
<dd>
1661+
1662+
<dl>
1663+
<dd>
1664+
1665+
```python
1666+
from zep_cloud import Zep
1667+
1668+
client = Zep(
1669+
api_key="YOUR_API_KEY",
1670+
)
1671+
client.task.get(
1672+
task_id="task_id",
1673+
)
1674+
1675+
```
1676+
</dd>
1677+
</dl>
1678+
</dd>
1679+
</dl>
1680+
1681+
#### ⚙️ Parameters
1682+
1683+
<dl>
1684+
<dd>
1685+
1686+
<dl>
1687+
<dd>
1688+
1689+
**task_id:** `str` — Task ID
1690+
1691+
</dd>
1692+
</dl>
1693+
1694+
<dl>
1695+
<dd>
1696+
1697+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
1698+
1699+
</dd>
1700+
</dl>
1701+
</dd>
1702+
</dl>
1703+
1704+
16331705
</dd>
16341706
</dl>
16351707
</details>

src/zep_cloud/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
EpisodeResponse,
2626
FactRatingExamples,
2727
FactRatingInstruction,
28+
GetTaskResponse,
2829
Graph,
2930
GraphDataType,
3031
GraphEdgesRequest,
@@ -44,6 +45,8 @@
4445
RoleType,
4546
SearchFilters,
4647
SuccessResponse,
48+
TaskErrorResponse,
49+
TaskProgress,
4750
Thread,
4851
ThreadContextResponse,
4952
ThreadListResponse,
@@ -53,7 +56,7 @@
5356
UserNodeResponse,
5457
)
5558
from .errors import BadRequestError, InternalServerError, NotFoundError
56-
from . import context, graph, project, thread, user
59+
from . import context, graph, project, task, thread, user
5760
from .client import AsyncZep, Zep
5861
from .environment import ZepEnvironment
5962
from .thread import ThreadGetUserContextRequestMode
@@ -84,6 +87,7 @@
8487
"EpisodeResponse",
8588
"FactRatingExamples",
8689
"FactRatingInstruction",
90+
"GetTaskResponse",
8791
"Graph",
8892
"GraphDataType",
8993
"GraphEdgesRequest",
@@ -105,6 +109,8 @@
105109
"RoleType",
106110
"SearchFilters",
107111
"SuccessResponse",
112+
"TaskErrorResponse",
113+
"TaskProgress",
108114
"Thread",
109115
"ThreadContextResponse",
110116
"ThreadGetUserContextRequestMode",
@@ -119,6 +125,7 @@
119125
"context",
120126
"graph",
121127
"project",
128+
"task",
122129
"thread",
123130
"user",
124131
]

src/zep_cloud/base_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from .environment import ZepEnvironment
1111
from .graph.client import AsyncGraphClient, GraphClient
1212
from .project.client import AsyncProjectClient, ProjectClient
13+
from .task.client import AsyncTaskClient, TaskClient
1314
from .thread.client import AsyncThreadClient, ThreadClient
1415
from .user.client import AsyncUserClient, UserClient
1516

@@ -84,6 +85,7 @@ def __init__(
8485
self.context = ContextClient(client_wrapper=self._client_wrapper)
8586
self.graph = GraphClient(client_wrapper=self._client_wrapper)
8687
self.project = ProjectClient(client_wrapper=self._client_wrapper)
88+
self.task = TaskClient(client_wrapper=self._client_wrapper)
8789
self.thread = ThreadClient(client_wrapper=self._client_wrapper)
8890
self.user = UserClient(client_wrapper=self._client_wrapper)
8991

@@ -158,6 +160,7 @@ def __init__(
158160
self.context = AsyncContextClient(client_wrapper=self._client_wrapper)
159161
self.graph = AsyncGraphClient(client_wrapper=self._client_wrapper)
160162
self.project = AsyncProjectClient(client_wrapper=self._client_wrapper)
163+
self.task = AsyncTaskClient(client_wrapper=self._client_wrapper)
161164
self.thread = AsyncThreadClient(client_wrapper=self._client_wrapper)
162165
self.user = AsyncUserClient(client_wrapper=self._client_wrapper)
163166

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.12.0",
25+
"User-Agent": "zep-cloud/3.13.0",
2626
"X-Fern-Language": "Python",
2727
"X-Fern-SDK-Name": "zep-cloud",
28-
"X-Fern-SDK-Version": "3.12.0",
28+
"X-Fern-SDK-Version": "3.13.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: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,13 @@ def add_fact_triple(
256256
*,
257257
fact: str,
258258
fact_name: str,
259+
source_node_name: str,
259260
target_node_name: str,
260261
created_at: typing.Optional[str] = OMIT,
261262
expired_at: typing.Optional[str] = OMIT,
262263
fact_uuid: typing.Optional[str] = OMIT,
263264
graph_id: typing.Optional[str] = OMIT,
264265
invalid_at: typing.Optional[str] = OMIT,
265-
source_node_name: typing.Optional[str] = OMIT,
266266
source_node_summary: typing.Optional[str] = OMIT,
267267
source_node_uuid: typing.Optional[str] = OMIT,
268268
target_node_summary: typing.Optional[str] = OMIT,
@@ -282,6 +282,9 @@ def add_fact_triple(
282282
fact_name : str
283283
The name of the edge to add. Should be all caps using snake case (eg RELATES_TO)
284284
285+
source_node_name : str
286+
The name of the source node to add
287+
285288
target_node_name : str
286289
The name of the target node to add
287290
@@ -299,9 +302,6 @@ def add_fact_triple(
299302
invalid_at : typing.Optional[str]
300303
The time (if any) at which the fact stops being true
301304
302-
source_node_name : typing.Optional[str]
303-
The name of the source node to add
304-
305305
source_node_summary : typing.Optional[str]
306306
The summary of the source node to add
307307
@@ -337,19 +337,20 @@ def add_fact_triple(
337337
client.graph.add_fact_triple(
338338
fact="fact",
339339
fact_name="fact_name",
340+
source_node_name="source_node_name",
340341
target_node_name="target_node_name",
341342
)
342343
"""
343344
_response = self._raw_client.add_fact_triple(
344345
fact=fact,
345346
fact_name=fact_name,
347+
source_node_name=source_node_name,
346348
target_node_name=target_node_name,
347349
created_at=created_at,
348350
expired_at=expired_at,
349351
fact_uuid=fact_uuid,
350352
graph_id=graph_id,
351353
invalid_at=invalid_at,
352-
source_node_name=source_node_name,
353354
source_node_summary=source_node_summary,
354355
source_node_uuid=source_node_uuid,
355356
target_node_summary=target_node_summary,
@@ -972,13 +973,13 @@ async def add_fact_triple(
972973
*,
973974
fact: str,
974975
fact_name: str,
976+
source_node_name: str,
975977
target_node_name: str,
976978
created_at: typing.Optional[str] = OMIT,
977979
expired_at: typing.Optional[str] = OMIT,
978980
fact_uuid: typing.Optional[str] = OMIT,
979981
graph_id: typing.Optional[str] = OMIT,
980982
invalid_at: typing.Optional[str] = OMIT,
981-
source_node_name: typing.Optional[str] = OMIT,
982983
source_node_summary: typing.Optional[str] = OMIT,
983984
source_node_uuid: typing.Optional[str] = OMIT,
984985
target_node_summary: typing.Optional[str] = OMIT,
@@ -998,6 +999,9 @@ async def add_fact_triple(
998999
fact_name : str
9991000
The name of the edge to add. Should be all caps using snake case (eg RELATES_TO)
10001001
1002+
source_node_name : str
1003+
The name of the source node to add
1004+
10011005
target_node_name : str
10021006
The name of the target node to add
10031007
@@ -1015,9 +1019,6 @@ async def add_fact_triple(
10151019
invalid_at : typing.Optional[str]
10161020
The time (if any) at which the fact stops being true
10171021
1018-
source_node_name : typing.Optional[str]
1019-
The name of the source node to add
1020-
10211022
source_node_summary : typing.Optional[str]
10221023
The summary of the source node to add
10231024
@@ -1058,6 +1059,7 @@ async def main() -> None:
10581059
await client.graph.add_fact_triple(
10591060
fact="fact",
10601061
fact_name="fact_name",
1062+
source_node_name="source_node_name",
10611063
target_node_name="target_node_name",
10621064
)
10631065
@@ -1067,13 +1069,13 @@ async def main() -> None:
10671069
_response = await self._raw_client.add_fact_triple(
10681070
fact=fact,
10691071
fact_name=fact_name,
1072+
source_node_name=source_node_name,
10701073
target_node_name=target_node_name,
10711074
created_at=created_at,
10721075
expired_at=expired_at,
10731076
fact_uuid=fact_uuid,
10741077
graph_id=graph_id,
10751078
invalid_at=invalid_at,
1076-
source_node_name=source_node_name,
10771079
source_node_summary=source_node_summary,
10781080
source_node_uuid=source_node_uuid,
10791081
target_node_summary=target_node_summary,

0 commit comments

Comments
 (0)