repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/gibsonai.py
cookbook/14_tools/mcp/gibsonai.py
"""🛢 GibsonAI MCP Server - Create and manage databases with prompts This example shows how to connect a local GibsonAI MCP to Agno agent. You can instantly generate, modify database schemas and chat with your relational database using natural language. From prompt to a serverless database (MySQL, PostgresQL, etc.), a...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/airbnb.py
cookbook/14_tools/mcp/airbnb.py
"""🏠 MCP Airbnb Agent - Search for Airbnb listings! This example shows how to create an agent that uses MCP and Gemini 2.5 Pro to search for Airbnb listings. Run: `pip install google-genai mcp agno` to install the dependencies """ import asyncio from agno.agent import Agent from agno.models.openai.chat import Open...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/oxylabs.py
cookbook/14_tools/mcp/oxylabs.py
import asyncio import os from agno.agent import Agent from agno.models.google import Gemini from agno.tools.mcp import MCPTools async def run_agent_prompt(): async with MCPTools( command="uvx oxylabs-mcp", env={ "OXYLABS_USERNAME": os.getenv("OXYLABS_USERNAME"), "OXYLABS_P...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/include_tools.py
cookbook/14_tools/mcp/include_tools.py
import asyncio from pathlib import Path from textwrap import dedent from agno.agent import Agent from agno.models.groq import Groq from agno.tools.mcp import MCPTools async def run_agent(message: str) -> None: file_path = str(Path(__file__).parents[3] / "libs/agno") # Initialize the MCP server async wit...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/cli.py
cookbook/14_tools/mcp/cli.py
"""Show how to run an interactive CLI to interact with an agent equipped with MCP tools. This example uses the MCP GitHub Agent. Example prompts to try: - "List open issues in the repository" - "Show me recent pull requests" - "What are the repository statistics?" - "Find issues labeled as bugs" - "Show me contributor...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/multiple_servers_allow_partial_failure.py
cookbook/14_tools/mcp/multiple_servers_allow_partial_failure.py
""" This example demonstrates how to use multiple MCP servers in a single agent, allowing for partial failure. This is useful if you are connecting to MCP servers that are not always available or prone to failure, but don't want to stop the execution if some of the servers fail to connect. Prerequisites: - Set the en...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/stagehand.py
cookbook/14_tools/mcp/stagehand.py
""" 🤖 Stagehand MCP Agent - Hacker News Reader's Digest This example demonstrates how to use Agno's agent to create a Hacker News content using the Stagehand MCP server. Features: - Scrapes current Hacker News headlines and metadata - Extracts top comments from popular stories - Creates a structured digest with key ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/groq_mcp.py
cookbook/14_tools/mcp/groq_mcp.py
"""📁 Groq + MCP = Lightning Fast Agents This example demonstrates how to create a high-performance filesystem agent by combining Groq's fast LLM inference with the Model Context Protocol (MCP). This combination delivers exceptional speed while maintaining powerful filesystem exploration capabilities. Example prompts...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/pipedream_auth.py
cookbook/14_tools/mcp/pipedream_auth.py
""" 🔒 Using Pipedream MCP servers with authentication This is an example of how to use Pipedream MCP servers with authentication. This is useful if your app is interfacing with the MCP servers in behalf of your users. 1. Get your access token. You can check how in Pipedream's docs: https://pipedream.com/docs/connect...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/agno_mcp.py
cookbook/14_tools/mcp/agno_mcp.py
import asyncio from agno.agent import Agent from agno.models.anthropic import Claude from agno.tools.mcp import MCPTools async def run_agent(message: str) -> None: async with MCPTools( transport="streamable-http", url="https://docs.agno.com/mcp" ) as agno_mcp_server: agent = Agent( ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/pipedream_slack.py
cookbook/14_tools/mcp/pipedream_slack.py
""" 💬 Pipedream Slack MCP This example shows how to use Pipedream MCP servers (in this case the Slack one) with Agno Agents. 1. Connect your Pipedream and Slack accounts: https://mcp.pipedream.com/app/slack 2. Get your Pipedream MCP server url: https://mcp.pipedream.com/app/slack 3. Set the MCP_SERVER_URL environmen...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/supabase.py
cookbook/14_tools/mcp/supabase.py
"""🔑 Supabase MCP Agent - Showcase Supabase MCP Capabilities This example demonstrates how to use the Supabase MCP server to create create projects, database schemas, edge functions, and more. Setup: 1. Install Python dependencies: ```bash pip install agno mcp ``` 2. Create a Supabase Access Token: https://supabas...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/mem0.py
cookbook/14_tools/mcp/mem0.py
""" 👩‍💻 Mem0 MCP - Personalized Code Reviewer This example demonstrates how to use Agno's MCP integration together with Mem0, to build a personalized code reviewer. - Run your Mem0 MCP server. Full instructions: https://github.com/mem0ai/mem0-mcp - Run: `pip install agno mcp` to install the dependencies """ import...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/stripe.py
cookbook/14_tools/mcp/stripe.py
"""💵 Stripe MCP Agent - Manage Your Stripe Operations This example demonstrates how to create an Agno agent that interacts with the Stripe API via the Model Context Protocol (MCP). This agent can create and manage Stripe objects like customers, products, prices, and payment links using natural language commands. Se...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/multiple_servers.py
cookbook/14_tools/mcp/multiple_servers.py
""" This example demonstrates how to use multiple MCP servers in a single agent. Prerequisites: - Set the environment variable "ACCUWEATHER_API_KEY" for the weather MCP tools. - You can get the API key from the AccuWeather website: https://developer.accuweather.com/ """ import asyncio from os import getenv from agno...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/mcp_toolbox_for_db.py
cookbook/14_tools/mcp/mcp_toolbox_for_db.py
"""Example code showcasing how to connect to the MCP toolbox server using the MCPToolbox Toolkit""" import asyncio from textwrap import dedent from agno.agent import Agent from agno.tools.mcp_toolbox import MCPToolbox url = "http://127.0.0.1:5001" async def run_agent(message: str = None) -> None: """Run an int...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/include_exclude_tools.py
cookbook/14_tools/mcp/include_exclude_tools.py
""" This example demonstrates how to use multiple MCP servers in a single agent. Prerequisites: - Google Maps: - Set the environment variable `GOOGLE_MAPS_API_KEY` with your Google Maps API key. You can obtain the API key from the Google Cloud Console: https://console.cloud.google.com/projectselector2/goog...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/notion_mcp_agent.py
cookbook/14_tools/mcp/notion_mcp_agent.py
""" Notion MCP Agent - Manages your documents This example shows how to use the Agno MCP tools to interact with your Notion workspace. 1. Start by setting up a new internal integration in Notion: https://www.notion.so/profile/integrations 2. Export your new Notion key: `export NOTION_API_KEY=ntn_****` 3. Connect your...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/graphiti.py
cookbook/14_tools/mcp/graphiti.py
""" 📔 MCP Graphiti Agent - A personal diary assistant This example demonstrates how to use Agno's MCP integration together with Graphiti, to build a personal diary assistant. - Run your Graphiti MCP server. Full instructions: https://github.com/getzep/graphiti/tree/main/mcp_server - Run: `pip install agno mcp openai...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/__init__.py
cookbook/14_tools/mcp/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/pipedream_linkedin.py
cookbook/14_tools/mcp/pipedream_linkedin.py
""" 💻 Pipedream LinkedIn MCP This example shows how to use Pipedream MCP servers (in this case the LinkedIn one) with Agno Agents. 1. Connect your Pipedream and LinkedIn accounts: https://mcp.pipedream.com/app/linkedin 2. Get your Pipedream MCP server url: https://mcp.pipedream.com/app/linkedin 3. Set the MCP_SERVER...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/tool_name_prefix.py
cookbook/14_tools/mcp/tool_name_prefix.py
"""This example demonstrates how to add a prefix to the name of your MCP tools. This is useful to avoid name collisions with other tools, especially when using multiple MCP servers.""" import asyncio from agno.agent.agent import Agent from agno.tools.mcp import MCPTools async def run_agent(): # Development envi...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/sequential_thinking.py
cookbook/14_tools/mcp/sequential_thinking.py
""" This example demonstrates how to use multiple MCP servers in a single agent. Prerequisites: - Google Maps: - Set the environment variable `GOOGLE_MAPS_API_KEY` with your Google Maps API key. You can obtain the API key from the Google Cloud Console: https://console.cloud.google.com/projectselector2/goog...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/github.py
cookbook/14_tools/mcp/github.py
"""🐙 MCP GitHub Agent - Your Personal GitHub Explorer! This example shows how to create a GitHub agent that uses MCP to explore, analyze, and provide insights about GitHub repositories. The agent leverages the Model Context Protocol (MCP) to interact with GitHub, allowing it to answer questions about issues, pull req...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/brave.py
cookbook/14_tools/mcp/brave.py
"""MCP Brave Agent - Search for Brave This example shows how to create an agent that uses Anthropic to search for information using the Brave MCP server. You can get the Brave API key from https://brave.com/search/api/ Run: `pip install anthropic mcp agno` to install the dependencies """ import asyncio from os impo...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/parallel.py
cookbook/14_tools/mcp/parallel.py
"""MCP Parallel Agent - Search for Parallel This example shows how to create an agent that uses Parallel to search for information using the Parallel MCP server. Run: `pip install anthropic mcp agno` to install the dependencies Prerequisites: - Set the environment variable "PARALLEL_API_KEY" with your Parallel API k...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/qdrant.py
cookbook/14_tools/mcp/qdrant.py
import asyncio from os import getenv from agno.agent import Agent from agno.models.google import Gemini from agno.tools.mcp import MCPTools from agno.utils.pprint import apprint_run_response QDRANT_URL = getenv("QDRANT_URL") QDRANT_API_KEY = getenv("QDRANT_API_KEY") COLLECTION_NAME = "qdrant_collection" EMBEDDING_MOD...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/sse_transport/client.py
cookbook/14_tools/mcp/sse_transport/client.py
""" Show how to connect to MCP servers that use the SSE transport using our MCPTools and MultiMCPTools classes. Check the README.md file for instructions on how to run these examples. """ import asyncio from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.tools.mcp import MCPTools, MultiMC...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/sse_transport/server.py
cookbook/14_tools/mcp/sse_transport/server.py
"""Start an example MCP server that uses the SSE transport.""" from mcp.server.fastmcp import FastMCP mcp = FastMCP("calendar_assistant") @mcp.tool() def get_events(day: str) -> str: return f"There are no events scheduled for {day}." @mcp.tool() def get_birthdays_this_week() -> str: return "It is your mom...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/streamable_http_transport/client.py
cookbook/14_tools/mcp/streamable_http_transport/client.py
""" Show how to connect to MCP servers that use either SSE or Streamable HTTP transport using our MCPTools and MultiMCPTools classes. Check the README.md file for instructions on how to run these examples. """ import asyncio from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.tools.mcp i...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/streamable_http_transport/server.py
cookbook/14_tools/mcp/streamable_http_transport/server.py
"""Start an example MCP server that uses the Streamable HTTP transport.""" from mcp.server.fastmcp import FastMCP mcp = FastMCP("calendar_assistant") @mcp.tool() def get_events(day: str) -> str: return f"There are no events scheduled for {day}." @mcp.tool() def get_birthdays_this_week() -> str: return "It...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/mcp_toolbox_demo/agent_os.py
cookbook/14_tools/mcp/mcp_toolbox_demo/agent_os.py
from textwrap import dedent from agno.agent import Agent from agno.os import AgentOS from agno.tools.mcp_toolbox import MCPToolbox url = "http://127.0.0.1:5001" mcp_database_tools = MCPToolbox( url=url, toolsets=["hotel-management", "booking-system"] ) agent = Agent( tools=[mcp_database_tools], instruct...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/mcp_toolbox_demo/hotel_management_workflows.py
cookbook/14_tools/mcp/mcp_toolbox_demo/hotel_management_workflows.py
#!/usr/bin/env python3 """Sequential Workflow Demo: Hotel Search → Hotel Booking""" import asyncio from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.models.openai import OpenAIChat from agno.tools.mcp_toolbox import MCPToolbox from agno.workflow.condition import Step from agno.workflow.workfl...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/mcp_toolbox_demo/hotel_management_typesafe.py
cookbook/14_tools/mcp/mcp_toolbox_demo/hotel_management_typesafe.py
import asyncio from datetime import date from textwrap import dedent from typing import List, Literal from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.tools.mcp_toolbox import MCPToolbox from pydantic import BaseModel, Field url = "http://127.0.0.1:5001" toolsets = ["hotel-management"...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/mcp_toolbox_demo/agent.py
cookbook/14_tools/mcp/mcp_toolbox_demo/agent.py
""" Simple test script that connects to the MCP toolbox server """ import asyncio from textwrap import dedent from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.tools.mcp_toolbox import MCPToolbox url = "http://127.0.0.1:5001" async def run_agent(message: str) -> None: """Run an i...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/local_server/client.py
cookbook/14_tools/mcp/local_server/client.py
import asyncio from agno.agent import Agent from agno.models.groq import Groq from agno.tools.mcp import MCPTools async def run_agent(message: str) -> None: # Initialize the MCP server async with ( MCPTools( "fastmcp run cookbook/tools/mcp/local_server/server.py", # Supply the command to...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/mcp/local_server/server.py
cookbook/14_tools/mcp/local_server/server.py
""" `fastmcp` is required for this demo. ```bash pip install fastmcp ``` Run this with `fastmcp run cookbook/tools/mcp/local_server/server.py` """ from fastmcp import FastMCP mcp = FastMCP("weather_tools") @mcp.tool() def get_weather(city: str) -> str: return f"The weather in {city} is sunny" @mcp.tool() de...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/other/human_in_the_loop.py
cookbook/14_tools/other/human_in_the_loop.py
"""🤝 Human-in-the-Loop: Adding User Confirmation to Tool Calls This example shows how to implement human-in-the-loop functionality in your Agno tools. It shows how to: - Add pre-hooks to tools for user confirmation - Handle user input during tool execution - Gracefully cancel operations based on user choice Some pra...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/other/cache_tool_calls.py
cookbook/14_tools/other/cache_tool_calls.py
import asyncio from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.tools.duckduckgo import DuckDuckGoTools from agno.tools.yfinance import YFinanceTools agent = Agent( model=OpenAIChat(id="gpt-4o-mini"), tools=[DuckDuckGoTools(cache_results=True), YFinanceTools(cache_results=True)...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/other/include_exclude_tools_custom_toolkit.py
cookbook/14_tools/other/include_exclude_tools_custom_toolkit.py
import asyncio import json from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.tools import Toolkit from agno.utils.log import logger class CustomerDBTools(Toolkit): def __init__(self, *args, **kwargs): super().__init__( name="customer_db", tools=[self...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/other/stop_after_tool_call_dual_inheritance.py
cookbook/14_tools/other/stop_after_tool_call_dual_inheritance.py
""" Example showing stop_after_tool_call_tools with dual inheritance. This demonstrates that stop_after_tool_call_tools works correctly even when the Toolkit class uses multiple inheritance. """ from agno.agent import Agent from agno.tools import Toolkit class BaseConfig: """Base configuration class for dual in...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/other/add_tool_after_initialization.py
cookbook/14_tools/other/add_tool_after_initialization.py
import random from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.tools import tool @tool(stop_after_tool_call=True) def get_weather(city: str) -> str: """Get the weather for a city.""" # In a real implementation, this would call a weather API weather_conditions = ["sunny", "...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/other/complex_input_types.py
cookbook/14_tools/other/complex_input_types.py
""" This example shows how to use complex input types with tools. Recommendations: - Specify fields with descriptions, these will be used in the JSON schema sent to the model and will increase accuracy. - Try not to nest the structures too deeply, the model will have a hard time understanding them. """ from datetime ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/other/stop_after_tool_call.py
cookbook/14_tools/other/stop_after_tool_call.py
from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.tools.duckduckgo import DuckDuckGoTools agent = Agent( model=OpenAIChat(id="gpt-5-mini"), tools=[ DuckDuckGoTools( stop_after_tool_call_tools=["duckduckgo_search"], show_result_tools=["duckduckgo_se...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/other/include_exclude_tools.py
cookbook/14_tools/other/include_exclude_tools.py
import asyncio from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.tools.calculator import CalculatorTools from agno.tools.duckduckgo import DuckDuckGoTools agent = Agent( model=OpenAIChat(id="gpt-4o-mini"), tools=[ CalculatorTools( exclude_tools=["exponentiate...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/other/__init__.py
cookbook/14_tools/other/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/other/session_state_tool.py
cookbook/14_tools/other/session_state_tool.py
"""Example demonstrating how to manipulate the session_state in a tool.""" from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.run import RunContext from agno.tools import tool from agno.tools.duckduckgo import DuckDuckGoTools from pydantic import BaseModel @tool() def answer_from_known_questi...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/other/stop_after_tool_call_in_toolkit.py
cookbook/14_tools/other/stop_after_tool_call_in_toolkit.py
""" Example showing how to use stop_after_tool_call_tools parameter in a Toolkit. This demonstrates using stop_after_tool_call_tools without the @tool decorator, which is the recommended approach for class methods that need to stop the agent after execution. """ from agno.agent import Agent from agno.tools import Too...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/tool_decorator/async_tool_decorator.py
cookbook/14_tools/tool_decorator/async_tool_decorator.py
import asyncio import json from typing import AsyncIterator import httpx from agno.agent import Agent from agno.tools import tool @tool(show_result=True) async def get_top_hackernews_stories(agent: Agent) -> AsyncIterator[str]: num_stories = agent.dependencies.get("num_stories", 5) if agent.dependencies else 5 ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/tool_decorator/cache_tool_calls.py
cookbook/14_tools/tool_decorator/cache_tool_calls.py
import json import httpx from agno.agent import Agent from agno.tools import tool @tool(stop_after_tool_call=True, cache_results=True) def get_top_hackernews_stories(num_stories: int = 5) -> str: # Fetch top story IDs response = httpx.get("https://hacker-news.firebaseio.com/v0/topstories.json") story_ids...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/tool_decorator/tool_decorator_on_class_method.py
cookbook/14_tools/tool_decorator/tool_decorator_on_class_method.py
from typing import Generator from agno.agent import Agent from agno.tools import Toolkit, tool class MyToolkit(Toolkit): def __init__(self, multiplier: int = 2): """Initialize the toolkit with a configurable multiplier.""" self.multiplier = multiplier # Initialize Toolkit with the decora...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/tool_decorator/tool_decorator_with_hook.py
cookbook/14_tools/tool_decorator/tool_decorator_with_hook.py
"""Show how to decorate a custom hook with a tool execution hook.""" import json import time from typing import Any, Callable, Dict import httpx from agno.agent import Agent from agno.tools import tool from agno.utils.log import logger def duration_logger_hook( function_name: str, function_call: Callable, argum...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/tool_decorator/tool_decorator_with_instructions.py
cookbook/14_tools/tool_decorator/tool_decorator_with_instructions.py
import httpx from agno.agent import Agent from agno.tools import tool @tool( name="fetch_hackernews_stories", description="Get top stories from Hacker News", show_result=True, instructions=""" Use this tool when: 1. The user wants to see recent popular tech news or discussions ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/tool_decorator/tool_decorator_async.py
cookbook/14_tools/tool_decorator/tool_decorator_async.py
import asyncio import json import httpx from agno.agent import Agent from agno.tools import tool class DemoTools: @tool(description="Get the top hackernews stories") @staticmethod async def get_top_hackernews_stories(agent: Agent): num_stories = ( agent.dependencies.get("num_stories",...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/tool_decorator/stop_after_tool_call.py
cookbook/14_tools/tool_decorator/stop_after_tool_call.py
from agno.agent import Agent from agno.tools import tool @tool(stop_after_tool_call=True) def get_answer_to_life_universe_and_everything() -> str: """ This returns the answer to the life, the universe and everything. """ return "42" agent = Agent( tools=[get_answer_to_life_universe_and_everythin...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/14_tools/tool_decorator/tool_decorator.py
cookbook/14_tools/tool_decorator/tool_decorator.py
import json from typing import Iterator import httpx from agno.agent import Agent from agno.tools import tool @tool(show_result=True) def get_top_hackernews_stories(agent: Agent) -> Iterator[str]: num_stories = agent.dependencies.get("num_stories", 5) if agent.dependencies else 5 # Fetch top story IDs r...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/__init__.py
cookbook/12_evals/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/instantiate_team.py
cookbook/12_evals/performance/instantiate_team.py
"""Run `pip install agno openai` to install dependencies.""" from agno.agent import Agent from agno.eval.performance import PerformanceEval from agno.models.openai import OpenAIChat from agno.team.team import Team team_member = Agent(model=OpenAIChat(id="gpt-4o")) def instantiate_team(): return Team(members=[te...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/response_with_storage.py
cookbook/12_evals/performance/response_with_storage.py
"""Run `pip install openai agno` to install dependencies.""" from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.eval.performance import PerformanceEval from agno.models.openai import OpenAIChat db = SqliteDb(db_file="tmp/storage.db") def run_agent(): agent = Agent( model=OpenAICh...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/team_response_with_memory_and_reasoning.py
cookbook/12_evals/performance/team_response_with_memory_and_reasoning.py
import asyncio import random import uuid from agno.agent import Agent from agno.db.postgres import PostgresDb from agno.eval.performance import PerformanceEval from agno.models.openai import OpenAIResponses from agno.team.team import Team from agno.tools.reasoning import ReasoningTools users = [ "abel@example.com...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
true
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/team_response_with_memory_simple.py
cookbook/12_evals/performance/team_response_with_memory_simple.py
import asyncio import random from agno.agent import Agent from agno.db.postgres import PostgresDb from agno.eval.performance import PerformanceEval from agno.models.openai import OpenAIChat from agno.team.team import Team cities = [ "New York", "Los Angeles", "Chicago", "Houston", "Miami", "Sa...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/simple_response.py
cookbook/12_evals/performance/simple_response.py
"""Run `pip install openai agno memory_profiler` to install dependencies.""" from agno.agent import Agent from agno.eval.performance import PerformanceEval from agno.models.openai import OpenAIChat def run_agent(): agent = Agent( model=OpenAIChat(id="gpt-4o-mini"), system_message="Be concise, rep...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/db_logging.py
cookbook/12_evals/performance/db_logging.py
"""Example showing how to store evaluation results in the database.""" from agno.agent import Agent from agno.db.postgres.postgres import PostgresDb from agno.eval.performance import PerformanceEval from agno.models.openai import OpenAIChat # Simple function to run an agent which performance we will evaluate def run...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/async_function.py
cookbook/12_evals/performance/async_function.py
"""This example shows how to run a Performance evaluation on an async function.""" import asyncio from agno.agent import Agent from agno.eval.performance import PerformanceEval from agno.models.openai import OpenAIChat # Simple async function to run an Agent. async def arun_agent(): agent = Agent( model...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/response_with_memory_updates.py
cookbook/12_evals/performance/response_with_memory_updates.py
"""Run `pip install openai agno memory_profiler` to install dependencies.""" from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.eval.performance import PerformanceEval from agno.models.openai import OpenAIChat # Memory creation requires a db to be provided db = SqliteDb(db_file="tmp/memory.db"...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/team_response_with_memory_multi_user.py
cookbook/12_evals/performance/team_response_with_memory_multi_user.py
import asyncio import random import uuid from agno.agent import Agent from agno.db.postgres import PostgresDb from agno.eval.performance import PerformanceEval from agno.models.openai import OpenAIChat from agno.team.team import Team users = [ "abel@example.com", "ben@example.com", "charlie@example.com", ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/__init__.py
cookbook/12_evals/performance/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/instantiate_agent_with_tool.py
cookbook/12_evals/performance/instantiate_agent_with_tool.py
"""Run `pip install agno openai memory_profiler` to install dependencies.""" from typing import Literal from agno.agent import Agent from agno.eval.performance import PerformanceEval from agno.models.openai import OpenAIChat def get_weather(city: Literal["nyc", "sf"]): """Use this to get weather information."""...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/instantiate_agent.py
cookbook/12_evals/performance/instantiate_agent.py
"""Run `pip install agno openai` to install dependencies.""" from agno.agent import Agent from agno.eval.performance import PerformanceEval def instantiate_agent(): return Agent(system_message="Be concise, reply with one sentence.") instantiation_perf = PerformanceEval( name="Instantiation Performance", fu...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/comparison/smolagents_instantiation.py
cookbook/12_evals/performance/comparison/smolagents_instantiation.py
"""Run `pip install smolagents` to install dependencies.""" from agno.eval.performance import PerformanceEval from smolagents import InferenceClientModel, Tool, ToolCallingAgent class WeatherTool(Tool): name = "weather_tool" description = """ This is a tool that tells the weather""" inputs = { ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/comparison/langgraph_instantiation.py
cookbook/12_evals/performance/comparison/langgraph_instantiation.py
"""Run `pip install langgraph langchain_openai` to install dependencies.""" from typing import Literal from agno.eval.performance import PerformanceEval from langchain_core.tools import tool from langchain_openai import ChatOpenAI from langgraph.prebuilt import create_react_agent @tool def get_weather(city: Literal...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/comparison/autogen_instantiation.py
cookbook/12_evals/performance/comparison/autogen_instantiation.py
"""Run `pip install autogen-agentchat "autogen-ext[openai]"` to install dependencies.""" from typing import Literal from agno.eval.performance import PerformanceEval from autogen_agentchat.agents import AssistantAgent from autogen_ext.models.openai import OpenAIChatCompletionClient def get_weather(city: Literal["ny...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/comparison/pydantic_ai_instantiation.py
cookbook/12_evals/performance/comparison/pydantic_ai_instantiation.py
"""Run `pip install openai pydantic-ai` to install dependencies.""" from typing import Literal from agno.eval.performance import PerformanceEval from pydantic_ai import Agent def instantiate_agent(): agent = Agent("openai:gpt-4o", system_prompt="Be concise, reply with one sentence.") @agent.tool_plain ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/comparison/crewai_instantiation.py
cookbook/12_evals/performance/comparison/crewai_instantiation.py
"""Run `pip install openai crewai` to install dependencies.""" from typing import Literal from agno.eval.performance import PerformanceEval from crewai.agent import Agent from crewai.tools import tool @tool("Tool Name") def get_weather(city: Literal["nyc", "sf"]): """Use this to get weather information.""" ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/comparison/openai_agents_instantiation.py
cookbook/12_evals/performance/comparison/openai_agents_instantiation.py
"""Run `pip install agents` to install dependencies.""" from typing import Literal from agno.eval.performance import PerformanceEval try: from agents import Agent, function_tool except ImportError: raise ImportError( "OpenAI agents not installed. Please install it using `pip install agents`." ) ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/performance/comparison/__init__.py
cookbook/12_evals/performance/comparison/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/accuracy/accuracy_with_given_answer.py
cookbook/12_evals/accuracy/accuracy_with_given_answer.py
from typing import Optional from agno.eval.accuracy import AccuracyEval, AccuracyResult from agno.models.openai import OpenAIChat evaluation = AccuracyEval( name="Given Answer Evaluation", model=OpenAIChat(id="o4-mini"), input="What is 10*5 then to the power of 2? do it step by step", expected_output=...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/accuracy/evaluator_agent.py
cookbook/12_evals/accuracy/evaluator_agent.py
"""Example showing how to use a custom evaluator agent to evaluate the accuracy of an Agent.""" from typing import Optional from agno.agent import Agent from agno.eval.accuracy import AccuracyAgentResponse, AccuracyEval, AccuracyResult from agno.models.openai import OpenAIChat from agno.tools.calculator import Calcul...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/accuracy/accuracy_9_11_bigger_or_9_99.py
cookbook/12_evals/accuracy/accuracy_9_11_bigger_or_9_99.py
from typing import Optional from agno.agent import Agent from agno.eval.accuracy import AccuracyEval, AccuracyResult from agno.models.openai import OpenAIChat from agno.tools.calculator import CalculatorTools evaluation = AccuracyEval( name="Comparison Evaluation", model=OpenAIChat(id="o4-mini"), agent=Ag...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/accuracy/db_logging.py
cookbook/12_evals/accuracy/db_logging.py
"""Example showing how to store evaluation results in the database.""" from typing import Optional from agno.agent import Agent from agno.db.postgres.postgres import PostgresDb from agno.eval.accuracy import AccuracyEval, AccuracyResult from agno.models.openai import OpenAIChat from agno.tools.calculator import Calcu...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/accuracy/accuracy_basic.py
cookbook/12_evals/accuracy/accuracy_basic.py
from typing import Optional from agno.agent import Agent from agno.eval.accuracy import AccuracyEval, AccuracyResult from agno.models.openai import OpenAIChat from agno.tools.calculator import CalculatorTools evaluation = AccuracyEval( name="Calculator Evaluation", model=OpenAIChat(id="o4-mini"), agent=Ag...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/accuracy/accuracy_with_tools.py
cookbook/12_evals/accuracy/accuracy_with_tools.py
from typing import Optional from agno.agent import Agent from agno.eval.accuracy import AccuracyEval, AccuracyResult from agno.models.openai import OpenAIChat from agno.tools.calculator import CalculatorTools evaluation = AccuracyEval( name="Tools Evaluation", model=OpenAIChat(id="o4-mini"), agent=Agent( ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/accuracy/__init__.py
cookbook/12_evals/accuracy/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/accuracy/accuracy_team.py
cookbook/12_evals/accuracy/accuracy_team.py
from typing import Optional from agno.agent import Agent from agno.eval.accuracy import AccuracyEval, AccuracyResult from agno.models.openai import OpenAIChat from agno.team.team import Team # Setup a team with two members english_agent = Agent( name="English Agent", role="You only answer in English", mod...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/accuracy/accuracy_async.py
cookbook/12_evals/accuracy/accuracy_async.py
"""This example shows how to run an Accuracy evaluation asynchronously.""" import asyncio from typing import Optional from agno.agent import Agent from agno.eval.accuracy import AccuracyEval, AccuracyResult from agno.models.openai import OpenAIChat from agno.tools.calculator import CalculatorTools evaluation = Accur...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/reliability/db_logging.py
cookbook/12_evals/reliability/db_logging.py
"""Example showing how to store evaluation results in the database.""" from typing import Optional from agno.agent import Agent from agno.db.postgres.postgres import PostgresDb from agno.eval.reliability import ReliabilityEval, ReliabilityResult from agno.models.openai import OpenAIChat from agno.run.agent import Run...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/reliability/__init__.py
cookbook/12_evals/reliability/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/reliability/reliability_async.py
cookbook/12_evals/reliability/reliability_async.py
"""This example shows how to run a Reliability evaluation asynchronously.""" import asyncio from typing import Optional from agno.agent import Agent from agno.eval.reliability import ReliabilityEval, ReliabilityResult from agno.models.openai import OpenAIChat from agno.run.agent import RunOutput from agno.tools.calcu...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/reliability/single_tool_calls/calculator.py
cookbook/12_evals/reliability/single_tool_calls/calculator.py
from typing import Optional from agno.agent import Agent from agno.eval.reliability import ReliabilityEval, ReliabilityResult from agno.models.openai import OpenAIChat from agno.run.agent import RunOutput from agno.tools.calculator import CalculatorTools def factorial(): agent = Agent( model=OpenAIChat(i...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/reliability/single_tool_calls/__init__.py
cookbook/12_evals/reliability/single_tool_calls/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/reliability/multiple_tool_calls/calculator.py
cookbook/12_evals/reliability/multiple_tool_calls/calculator.py
from typing import Optional from agno.agent import Agent from agno.eval.reliability import ReliabilityEval, ReliabilityResult from agno.models.openai import OpenAIChat from agno.run.agent import RunOutput from agno.tools.calculator import CalculatorTools def multiply_and_exponentiate(): agent = Agent( mo...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/reliability/multiple_tool_calls/__init__.py
cookbook/12_evals/reliability/multiple_tool_calls/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/reliability/team/ai_news.py
cookbook/12_evals/reliability/team/ai_news.py
from typing import Optional from agno.agent import Agent from agno.eval.reliability import ReliabilityEval, ReliabilityResult from agno.models.openai import OpenAIChat from agno.run.team import TeamRunOutput from agno.team.team import Team from agno.tools.duckduckgo import DuckDuckGoTools team_member = Agent( nam...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/reliability/team/__init__.py
cookbook/12_evals/reliability/team/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/agent_as_judge/agent_as_judge_post_hook.py
cookbook/12_evals/agent_as_judge/agent_as_judge_post_hook.py
"""AgentAsJudgeEval as post-hook example.""" from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.eval.agent_as_judge import AgentAsJudgeEval from agno.models.openai import OpenAIChat # Setup database to persist eval results db = SqliteDb(db_file="tmp/agent_as_judge_post_hook.db") # Eval runs a...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/agent_as_judge/agent_as_judge_async.py
cookbook/12_evals/agent_as_judge/agent_as_judge_async.py
"""Async AgentAsJudgeEval usage example with async on_fail callback.""" import asyncio from agno.agent import Agent from agno.db.sqlite import AsyncSqliteDb from agno.eval.agent_as_judge import AgentAsJudgeEval, AgentAsJudgeEvaluation from agno.models.openai import OpenAIChat def on_evaluation_failure(evaluation: A...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/agent_as_judge/agent_as_judge_team.py
cookbook/12_evals/agent_as_judge/agent_as_judge_team.py
"""AgentAsJudgeEval with teams.""" from typing import Optional from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.eval.agent_as_judge import AgentAsJudgeEval, AgentAsJudgeResult from agno.models.openai import OpenAIChat from agno.team.team import Team # Setup database to persist eval results ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/agent_as_judge/agent_as_judge_with_guidelines.py
cookbook/12_evals/agent_as_judge/agent_as_judge_with_guidelines.py
"""AgentAsJudgeEval with additional guidelines.""" from typing import Optional from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.eval.agent_as_judge import AgentAsJudgeEval, AgentAsJudgeResult from agno.models.openai import OpenAIChat # Setup database to persist eval results db = SqliteDb(db...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/agent_as_judge/agent_as_judge_team_post_hook.py
cookbook/12_evals/agent_as_judge/agent_as_judge_team_post_hook.py
"""AgentAsJudgeEval as post-hook on Team.""" from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.eval.agent_as_judge import AgentAsJudgeEval from agno.models.openai import OpenAIChat from agno.team.team import Team # Setup database to persist eval results db = SqliteDb(db_file="tmp/agent_as_jud...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/12_evals/agent_as_judge/agent_as_judge_with_tools.py
cookbook/12_evals/agent_as_judge/agent_as_judge_with_tools.py
"""AgentAsJudgeEval with agents using tools.""" from typing import Optional from agno.agent import Agent from agno.eval.agent_as_judge import AgentAsJudgeEval, AgentAsJudgeResult from agno.models.openai import OpenAIChat from agno.tools.calculator import CalculatorTools agent = Agent( model=OpenAIChat(id="gpt-4o...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false