docs: fix search method return value handling in integration and example docs (#3208)

This commit is contained in:
cnScarb
2025-08-11 12:16:01 -05:00
committed by GitHub
parent 2307dc8613
commit c2792c6558
15 changed files with 25 additions and 25 deletions
+2 -2
View File
@@ -119,9 +119,9 @@ class MemoryEnabledAgent(Agent):
user_id=RAG_USER_ID,
)
logger.info(f"mem0_client.search returned: {search_results}")
if search_results and isinstance(search_results, list):
if search_results and search_results.get('results', []):
context_parts = []
for result in search_results:
for result in search_results.get('results', []):
paragraph = result.get("memory") or result.get("text")
if paragraph:
source = "mem0 Memories"