Fix indentation and linting issues
- Fixed tab/space inconsistencies in client.py and __init__.py - Renamed ambiguous variable 'l' to 'line' - All ruff checks now passing
This commit is contained in:
+9
-3
@@ -284,7 +284,7 @@ class Mem0LocalMemoryProvider(MemoryProvider):
|
||||
if r.get("text") or r.get("memory")
|
||||
]
|
||||
with self._prefetch_lock:
|
||||
self._prefetch_result = "\n".join(f"- {l}" for l in lines)
|
||||
self._prefetch_result = "\n".join(f"- {line}" for line in lines)
|
||||
self._record_success()
|
||||
except Exception as e:
|
||||
self._record_failure()
|
||||
@@ -353,7 +353,7 @@ class Mem0LocalMemoryProvider(MemoryProvider):
|
||||
return json.dumps({"result": "\n".join(lines), "count": len(lines)})
|
||||
except Exception as e:
|
||||
self._record_failure()
|
||||
return tool_error(f"Failed to fetch profile: {e}")
|
||||
return tool_error(f"Failed to fetch profile: {e}")
|
||||
|
||||
elif tool_name == "mem0_search":
|
||||
query = args.get("query", "")
|
||||
@@ -371,7 +371,13 @@ class Mem0LocalMemoryProvider(MemoryProvider):
|
||||
self._record_success()
|
||||
if not results:
|
||||
return json.dumps({"result": "No relevant memories found."})
|
||||
items = [{"memory": r.get("text") or r.get("memory", ""), "score": r.get("score", 0)} for r in results]
|
||||
items = [
|
||||
{
|
||||
"memory": r.get("text") or r.get("memory", ""),
|
||||
"score": r.get("score", 0),
|
||||
}
|
||||
for r in results
|
||||
]
|
||||
return json.dumps({"results": items, "count": len(items)})
|
||||
except Exception as e:
|
||||
self._record_failure()
|
||||
|
||||
Reference in New Issue
Block a user