Skip to content

Commit 23c8c69

Browse files
Add ignore roles argument to memory.add (#237)
* SDK regeneration * SDK regeneration * chore: Version bump * SDK regeneration * SDK regeneration * SDK regeneration * SDK regeneration * SDK regeneration * SDK regeneration * SDK regeneration * SDK regeneration * chore: Version bump * poetry lock * chore: version bump * SDK regeneration --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
1 parent 5736674 commit 23c8c69

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "zep-cloud"
3-
version = "2.5.0"
3+
version = "2.6.0"
44
description = ""
55
readme = "README.md"
66
authors = []

reference.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2412,6 +2412,18 @@ client.memory.add(
24122412
<dl>
24132413
<dd>
24142414

2415+
**ignore_roles:** `typing.Optional[typing.Sequence[RoleType]]`
2416+
2417+
Optional list of role types to ignore when adding messages to graph memory.
2418+
The message itself will still be added retained and used as context for messages
2419+
that are added to a user's graph.
2420+
2421+
</dd>
2422+
</dl>
2423+
2424+
<dl>
2425+
<dd>
2426+
24152427
**return_context:** `typing.Optional[bool]` — Optionally return memory context relevant to the most recent messages.
24162428

24172429
</dd>

src/zep_cloud/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def get_headers(self) -> typing.Dict[str, str]:
1717
headers: typing.Dict[str, str] = {
1818
"X-Fern-Language": "Python",
1919
"X-Fern-SDK-Name": "zep-cloud",
20-
"X-Fern-SDK-Version": "2.5.0",
20+
"X-Fern-SDK-Version": "2.6.0",
2121
}
2222
headers["Authorization"] = f"Api-Key {self.api_key}"
2323
return headers

src/zep_cloud/memory/client.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from ..types.message_list_response import MessageListResponse
2727
from ..types.new_fact import NewFact
2828
from ..types.question import Question
29+
from ..types.role_type import RoleType
2930
from ..types.search_scope import SearchScope
3031
from ..types.search_type import SearchType
3132
from ..types.session import Session
@@ -975,6 +976,7 @@ def add(
975976
*,
976977
messages: typing.Sequence[Message],
977978
fact_instruction: typing.Optional[str] = OMIT,
979+
ignore_roles: typing.Optional[typing.Sequence[RoleType]] = OMIT,
978980
return_context: typing.Optional[bool] = OMIT,
979981
summary_instruction: typing.Optional[str] = OMIT,
980982
request_options: typing.Optional[RequestOptions] = None,
@@ -993,6 +995,11 @@ def add(
993995
fact_instruction : typing.Optional[str]
994996
Deprecated
995997
998+
ignore_roles : typing.Optional[typing.Sequence[RoleType]]
999+
Optional list of role types to ignore when adding messages to graph memory.
1000+
The message itself will still be added retained and used as context for messages
1001+
that are added to a user's graph.
1002+
9961003
return_context : typing.Optional[bool]
9971004
Optionally return memory context relevant to the most recent messages.
9981005
@@ -1030,6 +1037,7 @@ def add(
10301037
method="POST",
10311038
json={
10321039
"fact_instruction": fact_instruction,
1040+
"ignore_roles": ignore_roles,
10331041
"messages": messages,
10341042
"return_context": return_context,
10351043
"summary_instruction": summary_instruction,
@@ -2528,6 +2536,7 @@ async def add(
25282536
*,
25292537
messages: typing.Sequence[Message],
25302538
fact_instruction: typing.Optional[str] = OMIT,
2539+
ignore_roles: typing.Optional[typing.Sequence[RoleType]] = OMIT,
25312540
return_context: typing.Optional[bool] = OMIT,
25322541
summary_instruction: typing.Optional[str] = OMIT,
25332542
request_options: typing.Optional[RequestOptions] = None,
@@ -2546,6 +2555,11 @@ async def add(
25462555
fact_instruction : typing.Optional[str]
25472556
Deprecated
25482557
2558+
ignore_roles : typing.Optional[typing.Sequence[RoleType]]
2559+
Optional list of role types to ignore when adding messages to graph memory.
2560+
The message itself will still be added retained and used as context for messages
2561+
that are added to a user's graph.
2562+
25492563
return_context : typing.Optional[bool]
25502564
Optionally return memory context relevant to the most recent messages.
25512565
@@ -2591,6 +2605,7 @@ async def main() -> None:
25912605
method="POST",
25922606
json={
25932607
"fact_instruction": fact_instruction,
2608+
"ignore_roles": ignore_roles,
25942609
"messages": messages,
25952610
"return_context": return_context,
25962611
"summary_instruction": summary_instruction,

0 commit comments

Comments
 (0)