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