Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpreetbedi committed Jan 25, 2025
1 parent 550a4a0 commit 331b8ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libs/agno/agno/models/anthropic/claude.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def format_messages(self, messages: List[Message]) -> Tuple[List[Dict[str, str]]
for idx, message in enumerate(messages):
content = message.content or ""
if message.role == "system" or (message.role != "user" and idx in [0, 1]):
if content:
if content is not None:
system_messages.append(content) # type: ignore
continue
elif message.role == "user":
Expand Down
2 changes: 1 addition & 1 deletion libs/agno/agno/models/openai/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def format_message(self, message: Message) -> Dict[str, Any]:
logger.warning("Video input is currently unsupported.")

# OpenAI expects the tool_calls to be None if empty, not an empty list
if message.tool_calls == []:
if message.tool_calls is not None and len(message.tool_calls) == 0:
message.tool_calls = None

return message.to_dict()
Expand Down

0 comments on commit 331b8ef

Please sign in to comment.