Skip to content

Commit

Permalink
remove check for Google parts
Browse files Browse the repository at this point in the history
  • Loading branch information
ysolanky committed Feb 12, 2025
1 parent b5d3477 commit 60cea57
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions libs/agno/agno/storage/agent/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,6 @@ def to_dict(self) -> Dict[str, Any]:
return asdict(self)

def monitoring_data(self) -> Dict[str, Any]:
# Google Gemini adds a "parts" field to the messages, which is not serializable
# If the provider is Google, remove the "parts" from the messages
if self.agent_data is not None:
if self.agent_data.get("model", {}).get("provider") == "Google" and self.memory is not None:
# Remove parts from runs' response messages
if "runs" in self.memory:
for _run in self.memory["runs"]:
if "response" in _run and "messages" in _run["response"]:
for m in _run["response"]["messages"]:
if isinstance(m, dict):
m.pop("parts", None)

# Remove parts from top-level memory messages
if "messages" in self.memory:
for m in self.memory["messages"]:
if isinstance(m, dict):
m.pop("parts", None)

monitoring_data = asdict(self)
return monitoring_data

Expand Down

0 comments on commit 60cea57

Please sign in to comment.