Skip to content

Commit f1a2076

Browse files
authored
fix(chat_history): correct query string and add new parameter to function call (#167)
* fix search query * time.sleep async
1 parent b3a4cbc commit f1a2076

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/chat_history/memory.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def main() -> None:
196196
print(f"Classification: {classification}")
197197

198198
# Search Memory for session
199-
query = "What are Jane's favorite show brands?"
199+
query = "What are Jane's favorite shoe brands?"
200200
print(f"\n---Searching over summaries for: '{query}'")
201201
search_payload = MemorySearchPayload(
202202
text=query,

examples/chat_history/memory_async.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ async def get_memory_from_session(client, session_id):
114114
try:
115115
while memory.facts is None and memory.summary is None:
116116
memory = await client.memory.aget_memory(
117-
session_id, memory_type="perpetual"
117+
session_id, memory_type="perpetual", lastn=3
118118
)
119-
time.sleep(5)
119+
await asyncio.sleep(5)
120120

121121
print(f"Fact Table: {memory.facts}")
122122
if memory.summary:
@@ -201,7 +201,7 @@ async def main() -> None:
201201
print("\n---End of Memory")
202202

203203
# Search Memory for session
204-
query = "What are Jane's favorite show brands?"
204+
query = "What are Jane's favorite shoe brands?"
205205
print(f"\n---Searching over summaries for: '{query}'")
206206
search_payload = MemorySearchPayload(
207207
text=query,

0 commit comments

Comments
 (0)