Skip to content

Commit c228901

Browse files
User summary methods (#293)
* 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 --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
1 parent 3d22bf4 commit c228901

File tree

10 files changed

+1005
-4
lines changed

10 files changed

+1005
-4
lines changed

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.9.0"
6+
version = "3.10.0"
77
description = ""
88
readme = "README.md"
99
authors = []

reference.md

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,6 +1900,233 @@ that are added to a user's graph.
19001900
</details>
19011901

19021902
## User
1903+
<details><summary><code>client.user.<a href="src/zep_cloud/user/client.py">list_user_summary_instructions</a>(...)</code></summary>
1904+
<dl>
1905+
<dd>
1906+
1907+
#### 📝 Description
1908+
1909+
<dl>
1910+
<dd>
1911+
1912+
<dl>
1913+
<dd>
1914+
1915+
Lists all user summary instructions for a project, user.
1916+
</dd>
1917+
</dl>
1918+
</dd>
1919+
</dl>
1920+
1921+
#### 🔌 Usage
1922+
1923+
<dl>
1924+
<dd>
1925+
1926+
<dl>
1927+
<dd>
1928+
1929+
```python
1930+
from zep_cloud import Zep
1931+
1932+
client = Zep(
1933+
api_key="YOUR_API_KEY",
1934+
)
1935+
client.user.list_user_summary_instructions()
1936+
1937+
```
1938+
</dd>
1939+
</dl>
1940+
</dd>
1941+
</dl>
1942+
1943+
#### ⚙️ Parameters
1944+
1945+
<dl>
1946+
<dd>
1947+
1948+
<dl>
1949+
<dd>
1950+
1951+
**user_id:** `typing.Optional[str]` — User ID to get user-specific instructions
1952+
1953+
</dd>
1954+
</dl>
1955+
1956+
<dl>
1957+
<dd>
1958+
1959+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
1960+
1961+
</dd>
1962+
</dl>
1963+
</dd>
1964+
</dl>
1965+
1966+
1967+
</dd>
1968+
</dl>
1969+
</details>
1970+
1971+
<details><summary><code>client.user.<a href="src/zep_cloud/user/client.py">add_user_summary_instructions</a>(...)</code></summary>
1972+
<dl>
1973+
<dd>
1974+
1975+
#### 📝 Description
1976+
1977+
<dl>
1978+
<dd>
1979+
1980+
<dl>
1981+
<dd>
1982+
1983+
Adds new summary instructions for users graphs without removing existing ones. If user_ids is empty, adds to project-wide default instructions.
1984+
</dd>
1985+
</dl>
1986+
</dd>
1987+
</dl>
1988+
1989+
#### 🔌 Usage
1990+
1991+
<dl>
1992+
<dd>
1993+
1994+
<dl>
1995+
<dd>
1996+
1997+
```python
1998+
from zep_cloud import UserInstruction, Zep
1999+
2000+
client = Zep(
2001+
api_key="YOUR_API_KEY",
2002+
)
2003+
client.user.add_user_summary_instructions(
2004+
instructions=[
2005+
UserInstruction(
2006+
name="name",
2007+
text="text",
2008+
)
2009+
],
2010+
)
2011+
2012+
```
2013+
</dd>
2014+
</dl>
2015+
</dd>
2016+
</dl>
2017+
2018+
#### ⚙️ Parameters
2019+
2020+
<dl>
2021+
<dd>
2022+
2023+
<dl>
2024+
<dd>
2025+
2026+
**instructions:** `typing.Sequence[UserInstruction]` — Instructions to add to the user summary generation.
2027+
2028+
</dd>
2029+
</dl>
2030+
2031+
<dl>
2032+
<dd>
2033+
2034+
**user_ids:** `typing.Optional[typing.Sequence[str]]` — User IDs to add the instructions to. If empty, the instructions are added to the project-wide default.
2035+
2036+
</dd>
2037+
</dl>
2038+
2039+
<dl>
2040+
<dd>
2041+
2042+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
2043+
2044+
</dd>
2045+
</dl>
2046+
</dd>
2047+
</dl>
2048+
2049+
2050+
</dd>
2051+
</dl>
2052+
</details>
2053+
2054+
<details><summary><code>client.user.<a href="src/zep_cloud/user/client.py">delete_user_summary_instructions</a>(...)</code></summary>
2055+
<dl>
2056+
<dd>
2057+
2058+
#### 📝 Description
2059+
2060+
<dl>
2061+
<dd>
2062+
2063+
<dl>
2064+
<dd>
2065+
2066+
Deletes user summary/instructions for users or project wide defaults.
2067+
</dd>
2068+
</dl>
2069+
</dd>
2070+
</dl>
2071+
2072+
#### 🔌 Usage
2073+
2074+
<dl>
2075+
<dd>
2076+
2077+
<dl>
2078+
<dd>
2079+
2080+
```python
2081+
from zep_cloud import Zep
2082+
2083+
client = Zep(
2084+
api_key="YOUR_API_KEY",
2085+
)
2086+
client.user.delete_user_summary_instructions()
2087+
2088+
```
2089+
</dd>
2090+
</dl>
2091+
</dd>
2092+
</dl>
2093+
2094+
#### ⚙️ Parameters
2095+
2096+
<dl>
2097+
<dd>
2098+
2099+
<dl>
2100+
<dd>
2101+
2102+
**instruction_names:** `typing.Optional[typing.Sequence[str]]` — Unique identifier for the instructions to be deleted. If empty deletes all instructions.
2103+
2104+
</dd>
2105+
</dl>
2106+
2107+
<dl>
2108+
<dd>
2109+
2110+
**user_ids:** `typing.Optional[typing.Sequence[str]]` — Determines which users will have their custom instructions deleted. If no users are provided, the project-wide custom instructions will be effected.
2111+
2112+
</dd>
2113+
</dl>
2114+
2115+
<dl>
2116+
<dd>
2117+
2118+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
2119+
2120+
</dd>
2121+
</dl>
2122+
</dd>
2123+
</dl>
2124+
2125+
2126+
</dd>
2127+
</dl>
2128+
</details>
2129+
19032130
<details><summary><code>client.user.<a href="src/zep_cloud/user/client.py">add</a>(...)</code></summary>
19042131
<dl>
19052132
<dd>

src/zep_cloud/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
GraphNodesRequest,
3232
GraphSearchResults,
3333
GraphSearchScope,
34+
ListUserInstructionsResponse,
3435
Message,
3536
MessageListResponse,
3637
ModelsFactRatingExamples,
@@ -45,6 +46,7 @@
4546
ThreadContextResponse,
4647
ThreadListResponse,
4748
User,
49+
UserInstruction,
4850
UserListResponse,
4951
UserNodeResponse,
5052
)
@@ -87,6 +89,7 @@
8789
"GraphSearchResults",
8890
"GraphSearchScope",
8991
"InternalServerError",
92+
"ListUserInstructionsResponse",
9093
"Message",
9194
"MessageListResponse",
9295
"ModelsFactRatingExamples",
@@ -103,6 +106,7 @@
103106
"ThreadGetUserContextRequestMode",
104107
"ThreadListResponse",
105108
"User",
109+
"UserInstruction",
106110
"UserListResponse",
107111
"UserNodeResponse",
108112
"Zep",

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.9.0",
25+
"User-Agent": "zep-cloud/3.10.0",
2626
"X-Fern-Language": "Python",
2727
"X-Fern-SDK-Name": "zep-cloud",
28-
"X-Fern-SDK-Version": "3.9.0",
28+
"X-Fern-SDK-Version": "3.10.0",
2929
**(self.get_custom_headers() or {}),
3030
}
3131
headers["Authorization"] = f"Api-Key {self.api_key}"

src/zep_cloud/types/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from .graph_nodes_request import GraphNodesRequest
3131
from .graph_search_results import GraphSearchResults
3232
from .graph_search_scope import GraphSearchScope
33+
from .list_user_instructions_response import ListUserInstructionsResponse
3334
from .message import Message
3435
from .message_list_response import MessageListResponse
3536
from .models_fact_rating_examples import ModelsFactRatingExamples
@@ -44,6 +45,7 @@
4445
from .thread_context_response import ThreadContextResponse
4546
from .thread_list_response import ThreadListResponse
4647
from .user import User
48+
from .user_instruction import UserInstruction
4749
from .user_list_response import UserListResponse
4850
from .user_node_response import UserNodeResponse
4951

@@ -76,6 +78,7 @@
7678
"GraphNodesRequest",
7779
"GraphSearchResults",
7880
"GraphSearchScope",
81+
"ListUserInstructionsResponse",
7982
"Message",
8083
"MessageListResponse",
8184
"ModelsFactRatingExamples",
@@ -90,6 +93,7 @@
9093
"ThreadContextResponse",
9194
"ThreadListResponse",
9295
"User",
96+
"UserInstruction",
9397
"UserListResponse",
9498
"UserNodeResponse",
9599
]

src/zep_cloud/types/comparison_operator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
import typing
44

5-
ComparisonOperator = typing.Union[typing.Literal["=", "<>", ">", "<", ">=", "<="], typing.Any]
5+
ComparisonOperator = typing.Union[typing.Literal["=", "<>", ">", "<", ">=", "<=", "IS NULL", "IS NOT NULL"], typing.Any]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import typing
4+
5+
import pydantic
6+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7+
from .user_instruction import UserInstruction
8+
9+
10+
class ListUserInstructionsResponse(UniversalBaseModel):
11+
instructions: typing.Optional[typing.List[UserInstruction]] = None
12+
13+
if IS_PYDANTIC_V2:
14+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15+
else:
16+
17+
class Config:
18+
frozen = True
19+
smart_union = True
20+
extra = pydantic.Extra.allow
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import typing
4+
5+
import pydantic
6+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7+
8+
9+
class UserInstruction(UniversalBaseModel):
10+
name: str
11+
text: str
12+
13+
if IS_PYDANTIC_V2:
14+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15+
else:
16+
17+
class Config:
18+
frozen = True
19+
smart_union = True
20+
extra = pydantic.Extra.allow

0 commit comments

Comments
 (0)