Skip to content

Commit

Permalink
chore: remove formatted files outside of scope
Browse files Browse the repository at this point in the history
chore: remove formatted files outside of scope
  • Loading branch information
MrunmayS committed Feb 12, 2025
1 parent c997a35 commit 33a0ab4
Show file tree
Hide file tree
Showing 28 changed files with 46 additions and 50 deletions.
2 changes: 2 additions & 0 deletions cookbook/agent_concepts/hybrid_search/lancedb/agent.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Optional

import typer
from agno.agent import Agent
from agno.knowledge.pdf_url import PDFUrlKnowledgeBase
Expand Down
1 change: 1 addition & 0 deletions cookbook/agent_concepts/hybrid_search/pinecone/agent.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from typing import Optional

import nltk # type: ignore
import typer
Expand Down
2 changes: 2 additions & 0 deletions cookbook/agent_concepts/multimodal/audio_input_output.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import base64

import requests
from agno.agent import Agent
from agno.media import Audio
Expand Down
2 changes: 1 addition & 1 deletion cookbook/examples/apps/agentic_rag/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def display_tool_calls(tool_calls_container, tools):
st.markdown("**Results:**")
try:
st.json(_content)
except Exception:
except Exception as e:
st.markdown(_content)

if _metrics:
Expand Down
2 changes: 1 addition & 1 deletion cookbook/examples/apps/answer_engine/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def display_tool_calls(tool_calls_container, tools):
st.markdown("**Results:**")
try:
st.json(content)
except Exception:
except Exception as e:
st.markdown(content)

except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion cookbook/examples/apps/chess_team/chess_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def get_board_state(self) -> str:

for i, row in enumerate(self.board):
# Add rank number and row
html_output.append('<div class="chess-row">')
html_output.append(f'<div class="chess-row">')
html_output.append(f'<div class="chess-rank">{8 - i}</div>')

for piece in row:
Expand Down
2 changes: 1 addition & 1 deletion cookbook/examples/apps/llm_os/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def main() -> None:
st.session_state["llm_os_run_id"] = None
else:
st.session_state["llm_os_run_id"] = llm_os.new_session()
except Exception:
except Exception as e:
st.session_state["llm_os_run_id"] = None

# Modify the chat history loading to work without storage
Expand Down
2 changes: 2 additions & 0 deletions cookbook/examples/apps/parallel_world_builder/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Optional

import streamlit as st
from agents import World, get_world_builder
from agno.agent import Agent
Expand Down
2 changes: 1 addition & 1 deletion cookbook/examples/apps/parallel_world_builder/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def display_tool_calls(tool_calls_container, tools):
st.markdown("**Results:**")
try:
st.json(_content)
except Exception:
except Exception as e:
st.markdown(_content)

if _metrics:
Expand Down
2 changes: 1 addition & 1 deletion cookbook/examples/apps/sql_agent/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def get_sql_agent(
- Race strategy evaluation
You combine deep F1 knowledge with advanced SQL expertise to uncover insights from decades of racing data."""),
instructions=dedent("""\
instructions=dedent(f"""\
You are a SQL expert focused on writing precise, efficient queries.
When a user messages you, determine if you need query the database or can respond directly.
Expand Down
2 changes: 1 addition & 1 deletion cookbook/examples/apps/sql_agent/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def display_tool_calls(tool_calls_container, tools):
st.markdown("**Results:**")
try:
st.json(_content)
except Exception:
except Exception as e:
st.markdown(_content)

if _metrics:
Expand Down
1 change: 1 addition & 0 deletions cookbook/models/anthropic/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from agno.memory.db.postgres import PgMemoryDb
from agno.models.anthropic import Claude
from agno.storage.agent.postgres import PostgresAgentStorage
from rich.pretty import pprint

db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai"
agent = Agent(
Expand Down
3 changes: 3 additions & 0 deletions cookbook/models/huggingface/llama_essay_writer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import os
from getpass import getpass

from agno.agent import Agent
from agno.models.huggingface import HuggingFace

Expand Down
2 changes: 2 additions & 0 deletions cookbook/models/mistral/basic_stream.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

from agno.agent import Agent, RunResponse # noqa
from agno.models.mistral import MistralChat

Expand Down
1 change: 1 addition & 0 deletions cookbook/models/mistral/structured_output.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from typing import List

from agno.agent import Agent, RunResponse # noqa
Expand Down
2 changes: 2 additions & 0 deletions cookbook/models/nvidia/tool_use.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Run `pip install duckduckgo-search` to install dependencies."""

import os

from agno.agent import Agent
from agno.models.nvidia import Nvidia
from agno.tools.duckduckgo import DuckDuckGoTools
Expand Down
1 change: 1 addition & 0 deletions cookbook/models/ollama/demo_phi4.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from agno.agent import Agent, RunResponse # noqa
from agno.models.ollama import Ollama
from agno.tools.duckduckgo import DuckDuckGoTools

agent = Agent(model=Ollama(id="phi4"), markdown=True)

Expand Down
2 changes: 2 additions & 0 deletions cookbook/models/openai/audio_input_agent.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import base64

import requests
from agno.agent import Agent, RunResponse # noqa
from agno.media import Audio
Expand Down
2 changes: 2 additions & 0 deletions cookbook/models/openai/audio_input_output_output.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import base64

import requests
from agno.agent import Agent
from agno.media import Audio
Expand Down
4 changes: 1 addition & 3 deletions evals/performance/instantiation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
from agno.agent import Agent
from agno.eval.perf import PerfEval


def instantiate_agent():
return Agent(system_message="Be concise, reply with one sentence.")

return Agent(system_message='Be concise, reply with one sentence.')

instantiation_perf = PerfEval(func=instantiate_agent, num_iterations=1000)

Expand Down
6 changes: 1 addition & 5 deletions evals/performance/instantiation_with_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from agno.models.openai import OpenAIChat
from agno.eval.perf import PerfEval


def get_weather(city: Literal["nyc", "sf"]):
"""Use this to get weather information."""
if city == "nyc":
Expand All @@ -16,13 +15,10 @@ def get_weather(city: Literal["nyc", "sf"]):
else:
raise AssertionError("Unknown city")


tools = [get_weather]


def instantiate_agent():
return Agent(model=OpenAIChat(id="gpt-4o"), tools=tools)

return Agent(model=OpenAIChat(id='gpt-4o'), tools=tools)

instantiation_perf = PerfEval(func=instantiate_agent, num_iterations=1000)

Expand Down
16 changes: 5 additions & 11 deletions evals/performance/other/crewai_instantiation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Run `pip install openai memory_profiler crewai crewai[tools]` to install dependencies."""

from typing import Literal

from crewai.agent import Agent
Expand All @@ -17,19 +16,14 @@ def get_weather(city: Literal["nyc", "sf"]):
else:
raise AssertionError("Unknown city")


tools = [get_weather]


def instantiate_agent():
return Agent(
llm="gpt-4o",
role="Test Agent",
goal="Be concise, reply with one sentence.",
tools=tools,
backstory="Test",
)

return Agent(llm='gpt-4o',
role='Test Agent',
goal='Be concise, reply with one sentence.',
tools=tools,
backstory='Test')

crew_instantiation = PerfEval(func=instantiate_agent, num_iterations=1000)

Expand Down
4 changes: 0 additions & 4 deletions evals/performance/other/langgraph_instantiation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from agno.eval.perf import PerfEval


@tool
def get_weather(city: Literal["nyc", "sf"]):
"""Use this to get weather information."""
Expand All @@ -19,14 +18,11 @@ def get_weather(city: Literal["nyc", "sf"]):
else:
raise AssertionError("Unknown city")


tools = [get_weather]


def instantiate_agent():
return create_react_agent(model=ChatOpenAI(model="gpt-4o"), tools=tools)


langgraph_instantiation = PerfEval(func=instantiate_agent, num_iterations=1000)

if __name__ == "__main__":
Expand Down
4 changes: 1 addition & 3 deletions evals/performance/other/pydantic_ai_instantiation.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
"""Run `pip install openai pydantic-ai` to install dependencies."""

from typing import Literal

from pydantic_ai import Agent
from agno.eval.perf import PerfEval


def instantiate_agent():
agent = Agent("openai:gpt-4o", system_prompt="Be concise, reply with one sentence.")
agent = Agent('openai:gpt-4o', system_prompt='Be concise, reply with one sentence.')

@agent.tool_plain
def get_weather(city: Literal["nyc", "sf"]):
Expand All @@ -21,7 +20,6 @@ def get_weather(city: Literal["nyc", "sf"]):

return agent


pydantic_instantiation = PerfEval(func=instantiate_agent, num_iterations=1000)

if __name__ == "__main__":
Expand Down
8 changes: 3 additions & 5 deletions evals/performance/other/smolagents_instantiation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Run `pip install memory_profiler smolagents` to install dependencies."""
from typing import Literal

from agno.eval.perf import PerfEval
from smolagents import ToolCallingAgent, HfApiModel, Tool
Expand Down Expand Up @@ -26,12 +27,9 @@ def forward(self, city: str):
raise AssertionError("Unknown city")


def instantiate_agent():
return ToolCallingAgent(
tools=[WeatherTool()],
model=HfApiModel(model_id="meta-llama/Llama-3.3-70B-Instruct"),
)

def instantiate_agent():
return ToolCallingAgent(tools=[WeatherTool()], model=HfApiModel(model_id="meta-llama/Llama-3.3-70B-Instruct"))

smolagents_instantiation = PerfEval(func=instantiate_agent, num_iterations=1000)

Expand Down
9 changes: 2 additions & 7 deletions evals/performance/simple_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,12 @@
from agno.models.openai import OpenAIChat
from agno.eval.perf import PerfEval


def simple_response():
agent = Agent(
model=OpenAIChat(id="gpt-4o-mini"),
system_message="Be concise, reply with one sentence.",
)
response = agent.run("What is the capital of France?")
agent = Agent(model=OpenAIChat(id='gpt-4o-mini'), system_message='Be concise, reply with one sentence.')
response = agent.run('What is the capital of France?')
print(response.content)
return response


simple_response_perf = PerfEval(func=simple_response, num_iterations=10)

if __name__ == "__main__":
Expand Down
7 changes: 3 additions & 4 deletions evals/reliability/multiple_tool_calls/openai/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@


def multiply_and_exponentiate():
agent = Agent(

agent=Agent(
model=OpenAIChat(id="gpt-4o-mini"),
tools=[CalculatorTools(add=True, multiply=True, exponentiate=True)],
)
response: RunResponse = agent.run(
"What is 10*5 then to the power of 2? do it step by step"
)
response: RunResponse = agent.run("What is 10*5 then to the power of 2? do it step by step")
evaluation = ReliabilityEval(
agent_response=response,
expected_tool_calls=["multiply", "exponentiate"],
Expand Down
3 changes: 2 additions & 1 deletion evals/reliability/single_tool_calls/openai/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@


def factorial():
agent = Agent(

agent=Agent(
model=OpenAIChat(id="gpt-4o-mini"),
tools=[CalculatorTools(factorial=True)],
)
Expand Down

0 comments on commit 33a0ab4

Please sign in to comment.