fix: address mypy type errors in multiple files

- Fix return type and argument handling in cache_tools.py
- Add missing return statements in agent.py
- Fix _inject_date_to_task signature to accept Task object
- Remove unused type:ignore comments in tool_usage.py
- Add type annotations to internal methods in mem0_storage.py
This commit is contained in:
Greyson LaLonde
2025-09-03 23:05:07 -04:00
parent 06d5c3f170
commit 90ca02b9dc
4 changed files with 17 additions and 10 deletions

View File

@@ -21,7 +21,11 @@ class CacheTools(BaseModel):
)
def hit_cache(self, key: str) -> str:
import json
split = key.split("tool:")
tool = split[1].split("|input:")[0].strip()
tool_input = split[1].split("|input:")[1].strip()
return self.cache_handler.read(tool, tool_input)
tool_input_str = split[1].split("|input:")[1].strip()
tool_input = json.loads(tool_input_str) if tool_input_str else None
result = self.cache_handler.read(tool, tool_input)
return result if result is not None else ""