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/03_agents/input_and_output/input_as_messages_list.py
cookbook/03_agents/input_and_output/input_as_messages_list.py
from agno.agent import Agent, Message Agent().print_response( input=[ Message( role="user", content="I'm preparing a presentation for my company about renewable energy adoption.", ), Message( role="assistant", content="I'd be happy to help 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/03_agents/input_and_output/input_schema_on_agent_as_typed_dict.py
cookbook/03_agents/input_and_output/input_schema_on_agent_as_typed_dict.py
from typing import List, Optional, TypedDict from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.tools.hackernews import HackerNewsTools # Define a TypedDict schema class ResearchTopicDict(TypedDict): topic: str focus_areas: List[str] target_audience: str sources_required...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/input_and_output/output_schema_override.py
cookbook/03_agents/input_and_output/output_schema_override.py
""" This example demonstrates output_schema override for agents. Shows how to temporarily change the output schema for a single run and have it automatically restored afterwards. Works with both run/arun and streaming/non-streaming modes. """ import asyncio from agno.agent import Agent from agno.models.openai 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/03_agents/input_and_output/__init__.py
cookbook/03_agents/input_and_output/__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/03_agents/input_and_output/response_as_variable.py
cookbook/03_agents/input_and_output/response_as_variable.py
from typing import Iterator # noqa from rich.pretty import pprint from agno.agent import Agent, RunOutput from agno.models.openai import OpenAIChat from agno.tools.yfinance import YFinanceTools agent = Agent( model=OpenAIChat(id="gpt-4o"), tools=[ YFinanceTools( stock_price=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/03_agents/input_and_output/input_as_list.py
cookbook/03_agents/input_and_output/input_as_list.py
from agno.agent import Agent Agent().print_response( [ {"type": "text", "text": "What's in this image?"}, { "type": "image_url", "image_url": { "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/25...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/input_and_output/structured_input.py
cookbook/03_agents/input_and_output/structured_input.py
from typing import List from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.tools.hackernews import HackerNewsTools from pydantic import BaseModel, Field class ResearchTopic(BaseModel): """Structured research topic with specific requirements""" topic: str focus_areas: List[s...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/user_input_required_all_fields.py
cookbook/03_agents/human_in_the_loop/user_input_required_all_fields.py
"""🤝 Human-in-the-Loop: Allowing users to provide input externally This example shows how to use the `requires_user_input` parameter to allow users to provide input externally. """ from typing import List from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.models.openai import OpenAIChat from...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/external_tool_execution_toolkit.py
cookbook/03_agents/human_in_the_loop/external_tool_execution_toolkit.py
"""🤝 Human-in-the-Loop: Execute a tool call outside of the agent This example shows how to implement human-in-the-loop functionality in your Agno tools. It shows how to: - Use external tool execution to execute a tool call outside of the agent Run `pip install openai agno` to install dependencies. """ import subpro...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/confirmation_required_stream.py
cookbook/03_agents/human_in_the_loop/confirmation_required_stream.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: - Handle user confirmation during tool execution - Gracefully cancel operations based on user choice Some practical applications: - Confirming sensit...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/user_input_required_async.py
cookbook/03_agents/human_in_the_loop/user_input_required_async.py
"""🤝 Human-in-the-Loop: Allowing users to provide input externally""" import asyncio from typing import List from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.models.openai import OpenAIChat from agno.tools import tool from agno.tools.function import UserInputField from agno.utils import ppr...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/external_tool_execution_async.py
cookbook/03_agents/human_in_the_loop/external_tool_execution_async.py
"""🤝 Human-in-the-Loop: Execute a tool call outside of the agent This example shows how to implement human-in-the-loop functionality in your Agno tools. It shows how to: - Use external tool execution to execute a tool call outside of the agent Run `pip install openai agno` to install dependencies. """ import asynci...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/confirmation_required_mixed_tools.py
cookbook/03_agents/human_in_the_loop/confirmation_required_mixed_tools.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. In this case we have multiple tools and only one of them requires confirmation. The agent should execute the tool that doesn't require confirmation and then pause fo...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/confirmation_required_toolkit.py
cookbook/03_agents/human_in_the_loop/confirmation_required_toolkit.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: - Handle user confirmation during tool execution - Gracefully cancel operations based on user choice Some practical applications: - Confirming sensit...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/confirmation_required.py
cookbook/03_agents/human_in_the_loop/confirmation_required.py
"""🤝 Human-in-the-Loop (HITL): 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: - Handle user confirmation during tool execution - Gracefully cancel operations based on user choice Some practical applications: - Confirming...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/confirmation_required_multiple_tools.py
cookbook/03_agents/human_in_the_loop/confirmation_required_multiple_tools.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: - Handle user confirmation during tool execution - Gracefully cancel operations based on user choice Some practical applications: - Confirming sensit...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/external_tool_execution.py
cookbook/03_agents/human_in_the_loop/external_tool_execution.py
"""🤝 Human-in-the-Loop: Execute a tool call outside of the agent This example shows how to implement human-in-the-loop functionality in your Agno tools. It shows how to: - Use external tool execution to execute a tool call outside of the agent Run `pip install openai agno` to install dependencies. """ import subpro...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/agentic_user_input.py
cookbook/03_agents/human_in_the_loop/agentic_user_input.py
"""🤝 Human-in-the-Loop: Allowing users to provide input externally This example shows how to use the UserControlFlowTools to allow the agent to get user input dynamically. If the agent doesn't have enough information to complete a task, it will use the toolkit to get the information it needs from the user. """ from ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/external_tool_execution_async_responses.py
cookbook/03_agents/human_in_the_loop/external_tool_execution_async_responses.py
"""🤝 Human-in-the-Loop with OpenAI Responses API (gpt-4.1-mini) This example mirrors the external tool execution async example but uses OpenAIResponses with gpt-4.1-mini to validate tool-call id handling. Run `pip install openai agno` to install dependencies. """ import asyncio import subprocess from agno.agent im...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/confirmation_required_stream_async.py
cookbook/03_agents/human_in_the_loop/confirmation_required_stream_async.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: - Handle user confirmation during tool execution - Gracefully cancel operations based on user choice Some practical applications: - Confirming sensit...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/confirmation_required_with_history.py
cookbook/03_agents/human_in_the_loop/confirmation_required_with_history.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: - Handle user confirmation during tool execution - Gracefully cancel operations based on user choice Some practical applications: - Confirming sensit...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/user_input_required.py
cookbook/03_agents/human_in_the_loop/user_input_required.py
"""🤝 Human-in-the-Loop: Allowing users to provide input externally This example shows how to use the `requires_user_input` parameter to allow users to provide input externally. """ from typing import List from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.models.openai import OpenAIChat from...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/confirmation_required_async.py
cookbook/03_agents/human_in_the_loop/confirmation_required_async.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: - Handle user confirmation during tool execution - Gracefully cancel operations based on user choice Some practical applications: - Confirming sensit...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/__init__.py
cookbook/03_agents/human_in_the_loop/__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/03_agents/human_in_the_loop/external_tool_execution_stream.py
cookbook/03_agents/human_in_the_loop/external_tool_execution_stream.py
"""🤝 Human-in-the-Loop: Execute a tool call outside of the agent This example shows how to implement human-in-the-loop functionality in your Agno tools. It shows how to: - Use external tool execution to execute a tool call outside of the agent Run `pip install openai agno` to install dependencies. """ import subpro...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/confirmation_required_with_run_id.py
cookbook/03_agents/human_in_the_loop/confirmation_required_with_run_id.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: - Handle user confirmation during tool execution - Gracefully cancel operations based on user choice Some practical applications: - Confirming sensit...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/user_input_required_stream.py
cookbook/03_agents/human_in_the_loop/user_input_required_stream.py
"""🤝 Human-in-the-Loop: Allowing users to provide input externally This example shows how to use the `requires_user_input` parameter to allow users to provide input externally. """ from typing import List from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.models.openai import OpenAIChat from...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/external_tool_execution_stream_async.py
cookbook/03_agents/human_in_the_loop/external_tool_execution_stream_async.py
"""🤝 Human-in-the-Loop: Execute a tool call outside of the agent This example shows how to implement human-in-the-loop functionality in your Agno tools. It shows how to: - Use external tool execution to execute a tool call outside of the agent Run `pip install openai agno` to install dependencies. """ import asynci...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/human_in_the_loop/user_input_required_stream_async.py
cookbook/03_agents/human_in_the_loop/user_input_required_stream_async.py
"""🤝 Human-in-the-Loop: Allowing users to provide input externally This example shows how to use the `requires_user_input` parameter to allow users to provide input externally. """ import asyncio from typing import List from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.models.openai 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/03_agents/context_compression/token_based_tool_call_compression.py
cookbook/03_agents/context_compression/token_based_tool_call_compression.py
""" This example shows how to set a context token based limit for tool call compression. Run: `python cookbook/agents/context_compression/token_based_tool_call_compression.py` """ from agno.agent import Agent from agno.compression.manager import CompressionManager from agno.db.sqlite import SqliteDb from agno.models.o...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/context_compression/tool_call_compression_with_manager.py
cookbook/03_agents/context_compression/tool_call_compression_with_manager.py
""" This example shows how to customize the compression prompt for domain-specific use cases. Here we optimize compression for competitive intelligence gathering. Run: `python cookbook/agents/context_compression/tool_call_compression_with_manager.py` """ from agno.agent import Agent from agno.compression.manager 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/03_agents/context_compression/tool_call_compression.py
cookbook/03_agents/context_compression/tool_call_compression.py
from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.models.openai import OpenAIChat from agno.tools.duckduckgo import DuckDuckGoTools agent = Agent( model=OpenAIChat(id="gpt-5-mini"), tools=[DuckDuckGoTools()], description="Specialized in tracking competitor activities", 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/03_agents/context_compression/async_tool_call_compression.py
cookbook/03_agents/context_compression/async_tool_call_compression.py
import asyncio from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.models.openai import OpenAIChat from agno.tools.duckduckgo import DuckDuckGoTools agent = Agent( model=OpenAIChat(id="gpt-5-mini"), tools=[DuckDuckGoTools()], description="Specialized in tracking competitor activitie...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/caching/async_cache_model_response.py
cookbook/03_agents/caching/async_cache_model_response.py
""" Example showing async caching for model responses. The first run will take a while to finish. The second run will hit the cache and be much faster. You can also see the cache hit announcement in the console logs. """ import asyncio from agno.agent import Agent from agno.models.openai import OpenAIChat 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/03_agents/caching/cache_model_response_stream.py
cookbook/03_agents/caching/cache_model_response_stream.py
""" Example showing how to cache streaming model responses. The first run will take a while to finish. The second run will hit the cache and be much faster. You can also see the cache hit log in the console logs. """ import time from agno.agent import Agent from agno.models.openai import OpenAIChat agent = Agent(m...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/caching/__init__.py
cookbook/03_agents/caching/__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/03_agents/caching/async_cache_model_response_stream.py
cookbook/03_agents/caching/async_cache_model_response_stream.py
""" Example showing async caching for streaming model responses. The first run will take a while to finish. The second run will hit the cache and be much faster. You can also see the cache hit log in the console logs. """ import asyncio import time from agno.agent import Agent from agno.models.openai import OpenAIC...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/caching/cache_model_response.py
cookbook/03_agents/caching/cache_model_response.py
""" Example showing how to cache model responses to avoid redundant API calls. The first run will take a while to finish. The second run will hit the cache and be much faster. You can also see the cache hit log in the console logs. """ import time from agno.agent import Agent from agno.models.openai import 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/03_agents/other/intermediate_steps.py
cookbook/03_agents/other/intermediate_steps.py
from typing import Iterator from agno.agent import Agent, RunOutputEvent from agno.models.openai import OpenAIChat from agno.tools.yfinance import YFinanceTools from rich.pretty import pprint agent = Agent( model=OpenAIChat(id="gpt-4o"), tools=[YFinanceTools()], markdown=True, ) run_stream: Iterator[RunO...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/other/cancel_a_run_async_with_redis.py
cookbook/03_agents/other/cancel_a_run_async_with_redis.py
""" Example demonstrating how to cancel an async agent run using Redis. This example shows how to: 1. Set up a Redis-based cancellation manager with async support 2. Start an async agent run 3. Cancel the run from a concurrent task 4. Handle the cancelled response The async Redis cancellation manager is useful when: ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/other/debug.py
cookbook/03_agents/other/debug.py
from agno.agent import Agent from agno.models.openai import OpenAIChat # You can set the debug mode on the agent for all runs to have more verbose output agent = Agent( model=OpenAIChat(id="gpt-4o-mini"), debug_mode=True, ) agent.print_response(input="Tell me a joke.") # You can also set the debug mode on 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/03_agents/other/cancel_a_run.py
cookbook/03_agents/other/cancel_a_run.py
""" Example demonstrating how to cancel a running agent execution. This example shows how to: 1. Start an agent run in a separate thread 2. Cancel the run from another thread 3. Handle the cancelled response By default, Agno uses an in-memory cancellation manager which works for single-process applications. For distr...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/other/agent_run_metadata.py
cookbook/03_agents/other/agent_run_metadata.py
from datetime import datetime from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.tools.duckduckgo import DuckDuckGoTools agent = Agent( model=OpenAIChat(id="gpt-4o"), tools=[DuckDuckGoTools()], instructions="You are a customer support agent. You help process customer inquirie...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/other/debug_level.py
cookbook/03_agents/other/debug_level.py
""" This example shows how to set the debug level of an agent. The debug level is a number between 1 and 2. 1: Basic debug information 2: Detailed debug information The default debug level is 1. """ from agno.agent.agent import Agent from agno.models.anthropic.claude import Claude from agno.tools.yfinance import YF...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/other/agent_metrics.py
cookbook/03_agents/other/agent_metrics.py
from agno.agent import Agent from agno.db.postgres import PostgresDb from agno.models.openai import OpenAIChat from agno.tools.yfinance import YFinanceTools from agno.utils import pprint agent = Agent( model=OpenAIChat(id="gpt-4o"), tools=[YFinanceTools()], markdown=True, session_id="test-session-metri...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/other/agent_model_string.py
cookbook/03_agents/other/agent_model_string.py
"""Example showing how to set the model for an Agent using a model string""" from agno.agent import Agent # Model strings follow the format "{provider}:{model_id}", for example: model_string = "openai:gpt-4o" agent = Agent(model=model_string, markdown=True) agent.print_response("Share a 2 sentence horror story")
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/other/run_response_events.py
cookbook/03_agents/other/run_response_events.py
from typing import Iterator, List from agno.agent import ( Agent, RunContentEvent, RunOutputEvent, ToolCallCompletedEvent, ToolCallStartedEvent, ) from agno.models.anthropic import Claude from agno.tools.duckduckgo import DuckDuckGoTools agent = Agent( model=Claude(id="claude-sonnet-4-20250514...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/other/agent_retries.py
cookbook/03_agents/other/agent_retries.py
"""Example demonstrating how to set up retries with an Agent.""" from agno.agent import Agent from agno.tools.duckduckgo import DuckDuckGoTools agent = Agent( name="Web Search Agent", role="Search the web for information", tools=[DuckDuckGoTools()], retries=3, # The Agent run will be retried 3 times ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/other/__init__.py
cookbook/03_agents/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/03_agents/other/cancel_a_run_with_redis.py
cookbook/03_agents/other/cancel_a_run_with_redis.py
""" Example demonstrating how to cancel a running agent execution using Redis. This example shows how to: 1. Set up a Redis-based cancellation manager for distributed environments 2. Start an agent run in a separate thread 3. Cancel the run from another thread (or another process/service) 4. Handle the cancelled respo...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/other/agent_extra_metrics.py
cookbook/03_agents/other/agent_extra_metrics.py
"""Show special token metrics like audio, cached and reasoning tokens""" import requests from agno.agent import Agent from agno.media import Audio from agno.models.openai import OpenAIChat from agno.utils.pprint import pprint_run_response # Fetch the audio file and convert it to a base64 encoded string url = "https:/...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/other/tool_call_limit.py
cookbook/03_agents/other/tool_call_limit.py
""" This cookbook shows how to use tool call limit to control the number of tool calls an agent can make. """ from agno.agent import Agent from agno.models.anthropic import Claude from agno.tools.yfinance import YFinanceTools agent = Agent( model=Claude(id="claude-3-5-haiku-20241022"), tools=[YFinanceTools(co...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/other/scenario_testing.py
cookbook/03_agents/other/scenario_testing.py
""" This is an example that uses the [scenario](https://github.com/langwatch/scenario) testing library to test an agent. Prerequisites: - Install scenario: `pip install scenario` """ import pytest from scenario import Scenario, TestingAgent, scenario_cache Scenario.configure(testing_agent=TestingAgent(model="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/03_agents/agentic_search/agentic_rag.py
cookbook/03_agents/agentic_search/agentic_rag.py
"""This cookbook shows how to implement Agentic RAG using Hybrid Search and Reranking. 1. Run: `pip install agno anthropic cohere lancedb tantivy sqlalchemy` to install the dependencies 2. Export your ANTHROPIC_API_KEY and CO_API_KEY 3. Run: `python cookbook/agent_concepts/agentic_search/agentic_rag.py` to run the agen...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/agentic_search/agentic_rag_infinity_reranker.py
cookbook/03_agents/agentic_search/agentic_rag_infinity_reranker.py
"""This cookbook shows how to implement Agentic RAG using Infinity Reranker. Infinity is a high-performance inference server for text-embeddings, reranking, and classification models. It provides fast and efficient reranking capabilities for RAG applications. ## Setup Instructions: ### 1. Install Dependencies 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/03_agents/agentic_search/__init__.py
cookbook/03_agents/agentic_search/__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/03_agents/agentic_search/agentic_rag_with_reasoning.py
cookbook/03_agents/agentic_search/agentic_rag_with_reasoning.py
"""This cookbook shows how to implement Agentic RAG with Reasoning. 1. Run: `pip install agno anthropic cohere lancedb tantivy sqlalchemy` to install the dependencies 2. Export your ANTHROPIC_API_KEY and CO_API_KEY 3. Run: `python cookbook/agent_concepts/agentic_search/agentic_rag_with_reasoning.py` to run the 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/03_agents/agentic_search/lightrag/agentic_rag_with_lightrag.py
cookbook/03_agents/agentic_search/lightrag/agentic_rag_with_lightrag.py
import asyncio from os import getenv from agno.agent import Agent from agno.knowledge.knowledge import Knowledge from agno.knowledge.reader.wikipedia_reader import WikipediaReader from agno.vectordb.lightrag import LightRag vector_db = LightRag( api_key=getenv("LIGHTRAG_API_KEY"), ) knowledge = Knowledge( na...
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/python_tools.py
cookbook/14_tools/python_tools.py
from pathlib import Path from agno.agent import Agent from agno.tools.python import PythonTools # Example 1: All functions available (default behavior) agent_all = Agent( name="Python Agent - All Functions", tools=[PythonTools(base_dir=Path("tmp/python"))], instructions=["You have access to all Python exe...
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/mlx_transcribe_tools.py
cookbook/14_tools/mlx_transcribe_tools.py
""" MLX Transcribe: A tool for transcribing audio files using MLX Whisper Requirements: 1. ffmpeg - Install using: - macOS: `brew install ffmpeg` - Ubuntu: `sudo apt-get install ffmpeg` - Windows: Download from https://ffmpeg.org/download.html 2. mlx-whisper library: pip install mlx-whisper Example Usage...
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/spotify_tools.py
cookbook/14_tools/spotify_tools.py
""" Example: Using SpotifyTools with an Agno Agent This example shows how to create an agent that can: - Search for songs by mood, artist, or genre - Create playlists based on user requests - Update existing playlists """ from os import getenv from agno.agent import Agent from agno.models.anthropic import Claude fro...
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/twilio_tools.py
cookbook/14_tools/twilio_tools.py
from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.tools.twilio import TwilioTools """ Example showing how to use the Twilio Tools with Agno. Requirements: - Twilio Account SID and Auth Token (get from console.twilio.com) - A Twilio phone number - pip install twilio Usage: - Set the fol...
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/webbrowser_tools.py
cookbook/14_tools/webbrowser_tools.py
from agno.agent import Agent from agno.models.google import Gemini from agno.tools.duckduckgo import DuckDuckGoTools from agno.tools.webbrowser import WebBrowserTools # Example 1: Enable specific WebBrowser functions agent = Agent( model=Gemini("gemini-2.0-flash"), tools=[WebBrowserTools(enable_open_page=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/mcp_tools.py
cookbook/14_tools/mcp_tools.py
import asyncio import sys from pathlib import Path from agno.agent import Agent from agno.tools.mcp import MCPTools from mcp import ClientSession, StdioServerParameters from mcp.client.stdio import stdio_client async def main(prompt: str) -> None: # Initialize the MCP server server_params = StdioServerParame...
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/replicate_tools.py
cookbook/14_tools/replicate_tools.py
from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.tools.replicate import ReplicateTools """Create an agent specialized for Replicate AI content generation""" # Example 1: Enable specific Replicate functions image_agent = Agent( name="Image Generator Agent", model=OpenAIChat(id="...
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/shell_tools.py
cookbook/14_tools/shell_tools.py
from agno.agent import Agent from agno.tools.shell import ShellTools agent = Agent(tools=[ShellTools()]) agent.print_response("Show me the contents of the current directory", markdown=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/neo4j_tools.py
cookbook/14_tools/neo4j_tools.py
""" Example script demonstrating the use of Neo4jTools with an Agno agent. This script sets up an agent that can interact with a Neo4j database using natural language queries, such as listing node labels or executing Cypher queries. ## Setting up Neo4j Locally ### Option 1: Using Docker (Recommended) 1. **Install Do...
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/evm_tools.py
cookbook/14_tools/evm_tools.py
""" EVM Tools Example This example demonstrates how to use Agno's EVM integration to send ETH transactions on any EVM-compatible blockchain. 1. Set your environment variables: export EVM_PRIVATE_KEY=0x<your-private-key> export EVM_RPC_URL=https://your-rpc-endpoint 2. Or pass them directly to the EvmTools con...
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/airflow_tools.py
cookbook/14_tools/airflow_tools.py
""" Airflow Tools - DAG Management and Workflow Automation This example demonstrates how to use AirflowTools for managing Apache Airflow DAGs. Shows enable_ flag patterns for selective function access. AirflowTools is a small tool (<6 functions) so it uses enable_ flags. Run: `pip install apache-airflow` to install t...
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/csv_tools.py
cookbook/14_tools/csv_tools.py
""" CSV Tools - Data Analysis and Processing for CSV Files This example demonstrates how to use CsvTools for CSV file operations. Shows enable_ flag patterns for selective function access. CsvTools is a small tool (<6 functions) so it uses enable_ flags. Run: `pip install pandas` to install the dependencies """ from...
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/composio_tools.py
cookbook/14_tools/composio_tools.py
from agno.agent import Agent from composio_agno import Action, ComposioToolSet toolset = ComposioToolSet() composio_tools = toolset.get_tools( actions=[Action.GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER] ) agent = Agent(tools=composio_tools) agent.print_response("Can you star agno-agi/agno repo?")
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/clickup_tools.py
cookbook/14_tools/clickup_tools.py
""" Steps to Get Your ClickUp API Key Step 1: Log In to ClickUp Step 2: Navigate to Settings (usually a circle with your initials) click on it Step 3: Access the Apps Section: In the settings sidebar on the left, scroll down until you find Apps. Click on it to access the API settings. Step 4: Generate Your API Key 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/jinareader_tools.py
cookbook/14_tools/jinareader_tools.py
from agno.agent import Agent from agno.tools.jina import JinaReaderTools agent = Agent(tools=[JinaReaderTools()]) agent.print_response("Summarize: https://github.com/agno-agi/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/sleep_tools.py
cookbook/14_tools/sleep_tools.py
from agno.agent import Agent from agno.tools.sleep import SleepTools # Example 1: Enable specific sleep functions agent = Agent(tools=[SleepTools(enable_sleep=True)], name="Sleep Agent") # Example 2: Enable all sleep functions agent_all = Agent(tools=[SleepTools(all=True)], name="Full Sleep Agent") # Test the 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/14_tools/trafilatura_tools.py
cookbook/14_tools/trafilatura_tools.py
""" TrafilaturaTools Cookbook This cookbook demonstrates various ways to use TrafilaturaTools for web scraping and text extraction. TrafilaturaTools provides powerful capabilities for extracting clean, readable text from web pages and converting raw HTML into structured, meaningful data. Prerequisites: - Install traf...
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/custom_tool_events.py
cookbook/14_tools/custom_tool_events.py
"""This example demonstrate how to yield custom events from a custom tool.""" import asyncio from dataclasses import dataclass from typing import Optional from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.run.agent import CustomEvent from agno.tools import tool # Our custom event, ext...
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/tavily_tools.py
cookbook/14_tools/tavily_tools.py
from agno.agent import Agent from agno.tools.tavily import TavilyTools # Example 1: default TavilyTools agent = Agent(tools=[TavilyTools()]) # Example 2: Enable all Tavily functions (search + extract) agent_all = Agent(tools=[TavilyTools(all=True)]) # Example 3: Use advanced search with context context_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/file_generation_tools.py
cookbook/14_tools/file_generation_tools.py
""" File Generation Tool Example This cookbook shows how to use the FileGenerationTool to generate various file types (JSON, CSV, PDF, TXT). The tool can generate files from agent responses and make them available for download or further processing. """ from agno.agent import Agent from agno.db.sqlite import SqliteDb ...
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/desi_vocal_tools.py
cookbook/14_tools/desi_vocal_tools.py
""" pip install requests """ from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.tools.desi_vocal import DesiVocalTools audio_agent = Agent( model=OpenAIChat(id="gpt-4o"), tools=[DesiVocalTools()], description="You are an AI agent that can generate audio using the DesiVocal AP...
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/scrapegraph_tools.py
cookbook/14_tools/scrapegraph_tools.py
""" ScrapeGraphTools This script demonstrates the various capabilities of ScrapeGraphTools toolkit: 1. smartscraper: Extract structured data using natural language prompts 2. markdownify: Convert web pages to markdown format 3. searchscraper: Search the web and extract information 4. crawl: Crawl websites with struct...
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/baidusearch_tools.py
cookbook/14_tools/baidusearch_tools.py
from agno.agent import Agent from agno.tools.baidusearch import BaiduSearchTools agent = Agent( tools=[BaiduSearchTools()], description="You are a search agent that helps users find the most relevant information using Baidu.", instructions=[ "Given a topic by the user, respond with the 3 most relev...
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/fal_tools.py
cookbook/14_tools/fal_tools.py
from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.tools.fal import FalTools fal_agent = Agent( name="Fal Video Generator Agent", model=OpenAIChat(id="gpt-4o"), tools=[ FalTools( model="fal-ai/hunyuan-video", enable_generate_media=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/custom_api_tools.py
cookbook/14_tools/custom_api_tools.py
from agno.agent import Agent from agno.tools.api import CustomApiTools """ Args: base_url (Optional[str]): Base URL for API calls username (Optional[str]): Username for basic authentication password (Optional[str]): Password for basic authentication api_key (Optional[str]): API key for authentication ...
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/knowledge_tool.py
cookbook/14_tools/knowledge_tool.py
from agno.agent import Agent from agno.knowledge.knowledge import Knowledge from agno.team.team import Team from agno.vectordb.pgvector import PgVector db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai" kb = Knowledge( vector_db=PgVector( table_name="documents", db_url=db_url, ), ) 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/exa_tools.py
cookbook/14_tools/exa_tools.py
from agno.agent import Agent from agno.tools.exa import ExaTools # Example 1: Enable all tools agent_all = Agent( tools=[ ExaTools( all=True, # Enable all exa tools show_results=True, ) ], markdown=True, ) # Example 2: Enable specific tools only agent_specific = 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/14_tools/e2b_tools.py
cookbook/14_tools/e2b_tools.py
""" E2B Tools Example - Demonstrates how to use the E2B toolkit for sandboxed code execution. This example shows how to: 1. Set up authentication with E2B API 2. Initialize the E2BTools with proper configuration 3. Create an agent that can run Python code in a secure sandbox 4. Use the sandbox for data analysis, visua...
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/openbb_tools.py
cookbook/14_tools/openbb_tools.py
from agno.agent import Agent from agno.tools.openbb import OpenBBTools # Example 1: Enable all OpenBB functions agent_all = Agent( tools=[ OpenBBTools( all=True, # Enable all OpenBB financial data functions ) ], markdown=True, ) # Example 2: Enable specific OpenBB functions on...
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/hackernews_tools.py
cookbook/14_tools/hackernews_tools.py
from agno.agent import Agent from agno.models.anthropic import Claude from agno.tools.hackernews import HackerNewsTools agent = Agent( model=Claude(id="claude-sonnet-4-5"), tools=[HackerNewsTools()], markdown=True, ) agent.print_response("Write a report on trending startups and products.", stream=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/apify_tools.py
cookbook/14_tools/apify_tools.py
from agno.agent import Agent from agno.tools.apify import ApifyTools # Apify Tools Demonstration Script """ This script showcases the power of web scraping and data extraction using Apify's Actors (serverless tools). The Apify ecosystem has 4000+ pre-built Actors for almost any web data extraction need! --- Configur...
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/gmail_tools.py
cookbook/14_tools/gmail_tools.py
""" Gmail Agent that can read, draft and send emails using the Gmail. """ from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.tools.gmail import GmailTools from pydantic import BaseModel, Field class FindEmailOutput(BaseModel): message_id: str = Field(..., description="The message id...
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/discord_tools.py
cookbook/14_tools/discord_tools.py
import os from agno.agent import Agent from agno.tools.discord import DiscordTools # Get Discord token from environment discord_token = os.getenv("DISCORD_BOT_TOKEN") if not discord_token: raise ValueError("DISCORD_BOT_TOKEN not set") # Example 1: Enable all Discord functions discord_agent_all = Agent( name=...
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/python_function.py
cookbook/14_tools/python_function.py
import json import httpx from agno.agent import Agent def get_top_hackernews_stories(num_stories: int = 10) -> str: """Use this function to get top stories from Hacker News. Args: num_stories (int): Number of stories to return. Defaults to 10. Returns: str: JSON string of top 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/web_tools.py
cookbook/14_tools/web_tools.py
from agno.agent import Agent from agno.tools.webtools import WebTools agent = Agent(tools=[WebTools()]) agent.print_response("Tell me about https://tinyurl.com/57bmajz4")
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/serpapi_tools.py
cookbook/14_tools/serpapi_tools.py
from agno.agent import Agent from agno.tools.serpapi import SerpApiTools # Example 1: Enable specific SerpAPI functions agent = Agent( tools=[SerpApiTools(enable_search_google=True, enable_search_youtube=False)] ) # Example 2: Enable all SerpAPI functions agent_all = Agent(tools=[SerpApiTools(all=True)]) # Examp...
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/confluence_tools.py
cookbook/14_tools/confluence_tools.py
from agno.agent import Agent from agno.tools.confluence import ConfluenceTools agent = Agent( name="Confluence agent", tools=[ConfluenceTools()], markdown=True, ) ## getting space details agent.print_response("How many spaces are there and what are their names?") ## getting page_content agent.print_respo...
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_calls_accesing_agent.py
cookbook/14_tools/tool_calls_accesing_agent.py
import json import httpx from agno.agent import Agent def get_top_hackernews_stories(agent: Agent) -> str: num_stories = agent.dependencies.get("num_stories", 5) if agent.dependencies else 5 # 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/trello_tools.py
cookbook/14_tools/trello_tools.py
""" Setting Up Authentication for Trello Tools Step 1: Get Your API Key 1. Visit the Trello Power-Ups Administration Page https://trello.com/power-ups/admin 2. (Optional) Create a Workspace 3. Create a Power Up (this is required. Its like a "App" connector) - If you don't already have a power-ups, create one by clic...
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/zep_async_tools.py
cookbook/14_tools/zep_async_tools.py
""" This example demonstrates how to use the ZepAsyncTools class to interact with memories stored in Zep. To get started, please export your Zep API key as an environment variable. You can get your Zep API key from https://app.getzep.com/ export ZEP_API_KEY=<your-zep-api-key> """ import asyncio import time from agn...
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/elevenlabs_tools.py
cookbook/14_tools/elevenlabs_tools.py
""" pip install elevenlabs """ import base64 from textwrap import dedent from agno.agent import Agent from agno.models.google import Gemini from agno.tools.eleven_labs import ElevenLabsTools from agno.utils.media import save_base64_data audio_agent = Agent( model=Gemini(id="gemini-2.5-pro"), tools=[ ...
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/zep_tools.py
cookbook/14_tools/zep_tools.py
""" This example demonstrates how to use the ZepTools class to interact with memories stored in Zep. To get started, please export your Zep API key as an environment variable. You can get your Zep API key from https://app.getzep.com/ export ZEP_API_KEY=<your-zep-api-key> """ import time from agno.agent import Agent...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false