Doc: Fix examples (#2355)
This commit is contained in:
@@ -94,8 +94,8 @@ You can fetch all the memories at any point in time using the following code:
|
||||
|
||||
```python
|
||||
memories = support_agent.get_memories(user_id=customer_id)
|
||||
for m in memories:
|
||||
print(m['text'])
|
||||
for m in memories['results']:
|
||||
print(m['memory'])
|
||||
```
|
||||
|
||||
### Key Points
|
||||
|
||||
@@ -96,8 +96,8 @@ You can fetch all the memories at any point in time using the following code:
|
||||
|
||||
```python
|
||||
memories = ai_tutor.get_memories(user_id=user_id)
|
||||
for m in memories:
|
||||
print(m['text'])
|
||||
for m in memories['results']:
|
||||
print(m['memory'])
|
||||
```
|
||||
|
||||
### Key Points
|
||||
|
||||
@@ -82,11 +82,11 @@ class PersonalTravelAssistant:
|
||||
|
||||
def get_memories(self, user_id):
|
||||
memories = self.memory.get_all(user_id=user_id)
|
||||
return [m['memory'] for m in memories['memories']]
|
||||
return [m['memory'] for m in memories['results']]
|
||||
|
||||
def search_memories(self, query, user_id):
|
||||
memories = self.memory.search(query, user_id=user_id)
|
||||
return [m['memory'] for m in memories['memories']]
|
||||
return [m['memory'] for m in memories['results']]
|
||||
|
||||
# Usage example
|
||||
user_id = "traveler_123"
|
||||
|
||||
Reference in New Issue
Block a user