Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test_on_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ jobs:
python -m pytest ./libs/agno/tests/integration/models/xai

test-ibm-watsonx:
if: false # Our account is not working
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
tools=[YFinanceTools(enable_all=True)],
show_tool_calls=True,
markdown=True,
debug_mode=True
)

# Print the response in the terminal
Expand Down
Empty file.
2 changes: 2 additions & 0 deletions libs/agno/agno/models/deepinfra/deepinfra.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ class DeepInfra(OpenAILike):

api_key: Optional[str] = getenv("DEEPINFRA_API_KEY", None)
base_url: str = "https://api.deepinfra.com/v1/openai"

supports_native_structured_outputs: bool = False
3 changes: 3 additions & 0 deletions libs/agno/agno/models/deepseek/deepseek.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ class DeepSeek(OpenAILike):

api_key: Optional[str] = getenv("DEEPSEEK_API_KEY", None)
base_url: str = "https://api.deepseek.com"

# Their support for structured outputs is currently broken
supports_native_structured_outputs: bool = False
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 @@ -317,7 +317,7 @@ def invoke(self, messages: List[Message]) -> Union[ChatCompletion, ParsedChatCom
)
else:
raise ValueError("response_format must be a subclass of BaseModel if structured_outputs=True")

return self.get_client().chat.completions.create(
model=self.id,
messages=[self._format_message(m) for m in messages], # type: ignore
Expand Down
2 changes: 1 addition & 1 deletion libs/agno/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "agno"
version = "1.1.13"
version = "1.1.14"
description = "Agno: a lightweight framework for building multi-modal Agents"
requires-python = ">=3.7,<4"
readme = "README.md"
Expand Down
25 changes: 0 additions & 25 deletions libs/agno/tests/integration/models/google/test_tool_use.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,31 +117,6 @@ class StockPrice(BaseModel):
tools=[YFinanceTools()],
show_tool_calls=True,
markdown=True,
exponential_backoff=True,
response_model=StockPrice,
structured_outputs=True,
telemetry=False,
monitoring=False,
)
# Gemini does not support structured outputs for tool calls at this time
response = agent.run("What is the current price of TSLA?")
assert isinstance(response.content, StockPrice)
assert response.content is not None
assert response.content.price is not None
assert response.content.currency is not None


def test_tool_use_with_response_model():
class StockPrice(BaseModel):
price: float = Field(..., description="The price of the stock")
currency: str = Field(..., description="The currency of the stock")

agent = Agent(
model=Gemini(id="gemini-2.0-flash-exp"),
tools=[YFinanceTools()],
show_tool_calls=True,
markdown=True,
exponential_backoff=True,
response_model=StockPrice,
telemetry=False,
monitoring=False,
Expand Down
23 changes: 23 additions & 0 deletions libs/agno/tests/integration/models/groq/test_tool_use.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Optional

import pytest
from pydantic import BaseModel, Field

from agno.agent import Agent, RunResponse # noqa
from agno.models.groq import Groq
Expand Down Expand Up @@ -126,6 +127,28 @@ def test_parallel_tool_calls():
assert "TSLA" in response.content and "AAPL" in response.content


@pytest.mark.skip(reason="Groq does not support native structured outputs for tool calls at this time.")
def test_tool_use_with_native_structured_outputs():
class StockPrice(BaseModel):
price: float = Field(..., description="The price of the stock")
currency: str = Field(..., description="The currency of the stock")

agent = Agent(
model=Groq(id="llama-3.3-70b-versatile"),
tools=[YFinanceTools()],
show_tool_calls=True,
markdown=True,
response_model=StockPrice,
telemetry=False,
monitoring=False,
)
response = agent.run("What is the current price of TSLA?")
assert isinstance(response.content, StockPrice)
assert response.content is not None
assert response.content.price is not None
assert response.content.currency is not None


def test_multiple_tool_calls():
agent = Agent(
model=Groq(id="llama-3.3-70b-versatile"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ class StockPrice(BaseModel):
show_tool_calls=True,
markdown=True,
response_model=StockPrice,
structured_outputs=True,
telemetry=False,
monitoring=False,
)
response = agent.run("What is the current price of TSLA?")
assert isinstance(response.content, StockPrice)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ class StockPrice(BaseModel):
show_tool_calls=True,
markdown=True,
response_model=StockPrice,
structured_outputs=True,
telemetry=False,
monitoring=False,
)
Expand Down
3 changes: 2 additions & 1 deletion libs/agno/tests/integration/teams/test_collaborate.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def test_collaborate_team_basic():
assert response.content is not None
assert isinstance(response.content, str)
assert len(response.content) > 0
assert len(response.tools) == 1
tools = response.tools
assert len(tools) == 1
member_responses = response.member_responses
assert len(member_responses) == 2

Expand Down
Loading