Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 14 additions & 1 deletion examples/chat_history/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ async def main() -> None:
print(f"\n---Creating session: {session_id}")

await client.memory.add_session(
session_id=session_id, user_id=user_id, metadata={"foo": "bar"}
session_id=session_id,
user_id=user_id,
metadata={"foo": "bar"},
)

# Update session metadata
Expand Down Expand Up @@ -92,6 +94,10 @@ async def main() -> None:
)
print(f"Classification: {classification}")

all_session_facts = await client.memory.get_session_facts(session_id)
for f in all_session_facts.facts:
print(f"{f.fact}\n")

# Get Memory for session
print(f"\n---Get Perpetual Memory for Session: {session_id}")
memory = await client.memory.get(session_id, memory_type="perpetual")
Expand All @@ -106,6 +112,13 @@ async def main() -> None:
)
print("summaryResult: ", summary_result)

query = "What are Jane's favorite shoe brands?"
print(f"\n---Searching over facts for: '{query}'")
facts_result = await client.memory.search_sessions(
session_ids=[session_id], text=query, search_scope="facts"
)
print("facts_result: ", facts_result)

print("\n---Searching over summaries with MMR Reranking")
summary_mmr_result = await client.memory.search_sessions(
session_ids=[session_id], text=query, search_scope="summary", search_type="mmr"
Expand Down
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 = "1.0.6"
version = "1.0.7"
description = ""
readme = "README.md"
authors = []
Expand Down
8 changes: 8 additions & 0 deletions src/zep_cloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
EndSessionResponse,
EndSessionsResponse,
Fact,
FactRatingExamples,
FactRatingInstruction,
FactResponse,
FactsResponse,
Memory,
MemorySearchResult,
MemoryType,
Expand Down Expand Up @@ -51,6 +55,10 @@
"EndSessionResponse",
"EndSessionsResponse",
"Fact",
"FactRatingExamples",
"FactRatingInstruction",
"FactResponse",
"FactsResponse",
"InternalServerError",
"Memory",
"MemorySearchResult",
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": "1.0.6",
"X-Fern-SDK-Version": "1.0.7",
}
headers["Authorization"] = f"Api-Key {self.api_key}"
return headers
Expand Down
Loading