Skip to content

Commit

Permalink
v1.0.7 (#200)
Browse files Browse the repository at this point in the history
* SDK regeneration

* SDK regeneration

* SDK regeneration

* chore: Bump version

* chore: Bump version

* SDK regeneration

* SDK regeneration

* SDK regeneration

* feat: Update memory example to include latest api

* fix: Decrease sleep in example

---------

Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
  • Loading branch information
paul-paliychuk and fern-api[bot] authored Jul 18, 2024
1 parent 4d34635 commit c4b72d1
Show file tree
Hide file tree
Showing 12 changed files with 528 additions and 9 deletions.
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

0 comments on commit c4b72d1

Please sign in to comment.