Skip to content

Commit

Permalink
Add reasoning param
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpreetbedi committed Jan 31, 2025
1 parent aaf7be3 commit bca7ba3
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 40 deletions.
7 changes: 0 additions & 7 deletions cookbook/models/openai/o1/basic.py

This file was deleted.

8 changes: 0 additions & 8 deletions cookbook/models/openai/o1/basic_stream.py

This file was deleted.

7 changes: 0 additions & 7 deletions cookbook/models/openai/o1/o1_mini.py

This file was deleted.

7 changes: 0 additions & 7 deletions cookbook/models/openai/o1/o1_preview.py

This file was deleted.

8 changes: 0 additions & 8 deletions cookbook/models/openai/o1/o1_preview_stream.py

This file was deleted.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from typing import Iterator # noqa
from agno.agent import Agent, RunResponse # noqa
from agno.agent import Agent
from agno.models.openai import OpenAIChat

agent = Agent(model=OpenAIChat(id="o1-mini"))
agent = Agent(model=OpenAIChat(id="o3-mini"))

# Print the response in the terminal
agent.print_response("What is the closest galaxy to milky way?", stream=True)
14 changes: 14 additions & 0 deletions cookbook/models/openai/reasoning/o3_mini_tool_use.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from typing import Iterator # noqa
from agno.agent import Agent, RunResponse # noqa
from agno.models.openai import OpenAIChat
from agno.tools.duckduckgo import DuckDuckGoTools

agent = Agent(
model=OpenAIChat(id="o3-mini"),
tools=[DuckDuckGoTools()],
show_tool_calls=True,
markdown=True,
)

# Print the response in the terminal
agent.print_response("Whats happening in France?", stream=True)
2 changes: 2 additions & 0 deletions libs/agno/agno/models/openai/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class OpenAIChat(Model):

# Request parameters
store: Optional[bool] = None
reasoning_effort: Optional[bool] = None
metadata: Optional[Dict[str, Any]] = None
frequency_penalty: Optional[float] = None
logit_bias: Optional[Any] = None
Expand Down Expand Up @@ -168,6 +169,7 @@ def request_kwargs(self) -> Dict[str, Any]:
request_params.update(
{
"store": self.store,
"reasoning_effort": self.reasoning_effort,
"frequency_penalty": self.frequency_penalty,
"logit_bias": self.logit_bias,
"logprobs": self.logprobs,
Expand Down

0 comments on commit bca7ba3

Please sign in to comment.