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:
2026-04-10 13:03:49 +02:00
parent ece2cd02f0
commit 7dc7e03280
2 changed files with 15 additions and 40 deletions
+9 -3
View File
@@ -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()