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/11_models/nexus/async_basic_stream.py | cookbook/11_models/nexus/async_basic_stream.py | """
Basic streaming async example using Nexus.
"""
import asyncio
from agno.agent import Agent
from agno.models.nexus import Nexus
agent = Agent(model=Nexus(id="anthropic/claude-sonnet-4-20250514"), markdown=True)
asyncio.run(agent.aprint_response("Share a 2 sentence horror story", 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/11_models/nexus/retry.py | cookbook/11_models/nexus/retry.py | """Example demonstrating how to set up retries with Nexus."""
from agno.agent import Agent
from agno.models.nexus import Nexus
# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "nexus-wrong-id"
agent = Agent(
model=Nexus(
id=wrong_model_id,
retries=3, # Number of ... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/nexus/__init__.py | cookbook/11_models/nexus/__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/11_models/nexus/async_basic.py | cookbook/11_models/nexus/async_basic.py | """
Basic async example using Nexus.
"""
import asyncio
from agno.agent import Agent
from agno.models.nexus import Nexus
agent = Agent(model=Nexus(id="anthropic/claude-sonnet-4-20250514"), markdown=True)
asyncio.run(agent.aprint_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/11_models/internlm/retry.py | cookbook/11_models/internlm/retry.py | """Example demonstrating how to set up retries with InternLM."""
from agno.agent import Agent
from agno.models.internlm import InternLM
# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "internlm-wrong-id"
agent = Agent(
model=InternLM(
id=wrong_model_id,
retries=3... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/mistral/image_bytes_input_agent.py | cookbook/11_models/mistral/image_bytes_input_agent.py | import requests
from agno.agent import Agent
from agno.media import Image
from agno.models.mistral.mistral import MistralChat
agent = Agent(
model=MistralChat(id="pixtral-12b-2409"),
markdown=True,
)
image_url = (
"https://tripfixers.com/wp-content/uploads/2019/11/eiffel-tower-with-snow.jpeg"
)
def fetc... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/mistral/structured_output_with_tool_use.py | cookbook/11_models/mistral/structured_output_with_tool_use.py | from agno.agent import Agent
from agno.models.mistral import MistralChat
from agno.tools.duckduckgo import DuckDuckGoTools
from pydantic import BaseModel
class Person(BaseModel):
name: str
description: str
model = MistralChat(
id="mistral-medium-latest",
temperature=0.0,
)
researcher = Agent(
n... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/mistral/image_compare_agent.py | cookbook/11_models/mistral/image_compare_agent.py | from agno.agent import Agent
from agno.media import Image
from agno.models.mistral.mistral import MistralChat
agent = Agent(
model=MistralChat(id="pixtral-12b-2409"),
markdown=True,
)
agent.print_response(
"what are the differences between two images?",
images=[
Image(
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/11_models/mistral/mistral_small.py | cookbook/11_models/mistral/mistral_small.py | """Run `pip install ddgs` to install dependencies."""
from agno.agent import Agent
from agno.models.mistral import MistralChat
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=MistralChat(id="mistral-small-latest"),
tools=[DuckDuckGoTools()],
markdown=True,
)
agent.print_response("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/11_models/mistral/memory.py | cookbook/11_models/mistral/memory.py | """
This recipe shows how to use personalized memories and summaries in an agent.
Steps:
1. Run: `./cookbook/scripts/run_pgvector.sh` to start a postgres container with pgvector
2. Run: `pip install mistralai sqlalchemy 'psycopg[binary]' pgvector` to install the dependencies
3. Run: `python cookbook/models/mistral/memo... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/mistral/async_tool_use.py | cookbook/11_models/mistral/async_tool_use.py | """
Async example using Mistral with tool calls.
"""
import asyncio
from agno.agent import Agent
from agno.models.mistral.mistral import MistralChat
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=MistralChat(id="mistral-large-latest"),
tools=[DuckDuckGoTools()],
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/11_models/mistral/basic_stream.py | cookbook/11_models/mistral/basic_stream.py | from agno.agent import Agent, RunOutputEvent # noqa
from agno.models.mistral import MistralChat
agent = Agent(
model=MistralChat(
id="mistral-large-latest",
),
markdown=True,
)
# Get the response in a variable
# run_response: Iterator[RunOutputEvent] = agent.run("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/11_models/mistral/image_transcribe_document_agent.py | cookbook/11_models/mistral/image_transcribe_document_agent.py | """
This agent transcribes an old written document from an image.
"""
from agno.agent import Agent
from agno.media import Image
from agno.models.mistral.mistral import MistralChat
agent = Agent(
model=MistralChat(id="pixtral-12b-2409"),
markdown=True,
)
agent.print_response(
"Transcribe this document.",
... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/mistral/tool_use.py | cookbook/11_models/mistral/tool_use.py | """Run `pip install ddgs` to install dependencies."""
from agno.agent import Agent
from agno.models.mistral import MistralChat
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=MistralChat(
id="mistral-large-latest",
),
tools=[DuckDuckGoTools()],
markdown=True,
)
agent.pr... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/mistral/basic.py | cookbook/11_models/mistral/basic.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.mistral import MistralChat
agent = Agent(
model=MistralChat(id="mistral-small-latest"),
markdown=True,
)
# Get the response in a variable
# run: RunOutput = agent.run("Share a 2 sentence horror story")
# print(run.content)
# Print the response... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/mistral/async_basic_stream.py | cookbook/11_models/mistral/async_basic_stream.py | """
Basic streaming async example using Mistral.
"""
import asyncio
from agno.agent import Agent
from agno.models.mistral.mistral import MistralChat
agent = Agent(
model=MistralChat(id="mistral-large-latest"),
markdown=True,
)
asyncio.run(agent.aprint_response("Share a 2 sentence horror story", 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/11_models/mistral/retry.py | cookbook/11_models/mistral/retry.py | """Example demonstrating how to set up retries with Mistral."""
from agno.agent import Agent
from agno.models.mistral import MistralChat
# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "mistral-wrong-id"
agent = Agent(
model=MistralChat(
id=wrong_model_id,
retrie... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/mistral/__init__.py | cookbook/11_models/mistral/__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/11_models/mistral/image_file_input_agent.py | cookbook/11_models/mistral/image_file_input_agent.py | from pathlib import Path
from agno.agent import Agent
from agno.media import Image
from agno.models.mistral.mistral import MistralChat
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=MistralChat(id="pixtral-12b-2409"),
tools=[
DuckDuckGoTools()
], # pixtral-12b-2409 is not ... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/mistral/structured_output.py | cookbook/11_models/mistral/structured_output.py | from typing import List
from agno.agent import Agent, RunOutput # noqa
from agno.models.mistral import MistralChat
from agno.tools.duckduckgo import DuckDuckGoTools
from pydantic import BaseModel, Field
from rich.pretty import pprint # noqa
class MovieScript(BaseModel):
setting: str = Field(
..., descr... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/mistral/async_structured_output.py | cookbook/11_models/mistral/async_structured_output.py | import asyncio
from typing import List
from agno.agent import Agent, RunOutput # noqa
from agno.models.mistral import MistralChat
from agno.tools.duckduckgo import DuckDuckGoTools
from pydantic import BaseModel, Field
from rich.pretty import pprint # noqa
class MovieScript(BaseModel):
setting: str = Field(
... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/mistral/image_ocr_with_structured_output.py | cookbook/11_models/mistral/image_ocr_with_structured_output.py | from typing import List
from agno.agent import Agent
from agno.media import Image
from agno.models.mistral.mistral import MistralChat
from pydantic import BaseModel
class GroceryItem(BaseModel):
item_name: str
price: float
class GroceryListElements(BaseModel):
bill_number: str
items: List[GroceryIt... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/mistral/async_basic.py | cookbook/11_models/mistral/async_basic.py | """
Basic async example using Mistral.
"""
import asyncio
from agno.agent import Agent
from agno.models.mistral.mistral import MistralChat
agent = Agent(
model=MistralChat(id="mistral-large-latest"),
markdown=True,
)
asyncio.run(agent.aprint_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/11_models/anthropic/pdf_input_bytes.py | cookbook/11_models/anthropic/pdf_input_bytes.py | from pathlib import Path
from agno.agent import Agent
from agno.media import File
from agno.models.anthropic import Claude
from agno.utils.media import download_file
pdf_path = Path(__file__).parent.joinpath("ThaiRecipes.pdf")
# Download the file using the download_file function
download_file(
"https://agno-publ... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/structured_output_strict_tools.py | cookbook/11_models/anthropic/structured_output_strict_tools.py | """Example demonstrating strict tool use with Anthropic structured outputs.
Strict tool use ensures that tool parameters strictly follow the input_schema.
"""
from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.tools import Function
from pydantic import BaseModel
class WeatherInfo(BaseMo... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/image_input_url.py | cookbook/11_models/anthropic/image_input_url.py | from agno.agent import Agent
from agno.media import Image
from agno.models.anthropic import Claude
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Claude(id="claude-sonnet-4-20250514"),
tools=[DuckDuckGoTools()],
markdown=True,
)
agent.print_response(
"Tell me about this image 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/11_models/anthropic/mcp_connector.py | cookbook/11_models/anthropic/mcp_connector.py | from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.utils.models.claude import MCPServerConfiguration
agent = Agent(
model=Claude(
id="claude-sonnet-4-20250514",
betas=["mcp-client-2025-04-04"],
mcp_servers=[
MCPServerConfiguration(
ty... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/tool_use_stream.py | cookbook/11_models/anthropic/tool_use_stream.py | """Run `pip install ddgs` to install dependencies."""
from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Claude(id="claude-sonnet-4-20250514"),
tools=[DuckDuckGoTools()],
markdown=True,
)
agent.print_response("Whats ... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/image_input_bytes.py | cookbook/11_models/anthropic/image_input_bytes.py | from pathlib import Path
from agno.agent import Agent
from agno.media import Image
from agno.models.anthropic.claude import Claude
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.utils.media import download_image
agent = Agent(
model=Claude(id="claude-sonnet-4-20250514"),
tools=[DuckDuckGoTools()]... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/structured_output_stream.py | cookbook/11_models/anthropic/structured_output_stream.py | from typing import Dict, List
from agno.agent import Agent
from agno.models.anthropic import Claude
from pydantic import BaseModel, Field
class MovieScript(BaseModel):
setting: str = Field(
..., description="Provide a nice setting for a blockbuster movie."
)
ending: str = Field(
...,
... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/web_search.py | cookbook/11_models/anthropic/web_search.py | from pprint import pprint
from agno.agent import Agent
from agno.db.in_memory import InMemoryDb
from agno.models.anthropic import Claude
agent = Agent(
model=Claude(
id="claude-sonnet-4-20250514",
),
db=InMemoryDb(),
tools=[
{
"type": "web_search_20250305",
"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/11_models/anthropic/context_management.py | cookbook/11_models/anthropic/context_management.py | """
Self-managed Context Management
This cookbook demonstrates Claude's context management feature for automatic tool result clearing.
This reduces token usage in long-running conversations with extensive tool use.
You can read more in Anthropic docs: https://docs.claude.com/en/docs/build-with-claude/context-editing
... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/pdf_input_local.py | cookbook/11_models/anthropic/pdf_input_local.py | from pathlib import Path
from agno.agent import Agent
from agno.media import File
from agno.models.anthropic import Claude
from agno.utils.media import download_file
pdf_path = Path(__file__).parent.joinpath("ThaiRecipes.pdf")
# Download the file using the download_file function
download_file(
"https://agno-publ... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/thinking.py | cookbook/11_models/anthropic/thinking.py | from agno.agent import Agent
from agno.models.anthropic import Claude
agent = Agent(
model=Claude(
id="claude-3-7-sonnet-20250219",
max_tokens=2048,
thinking={"type": "enabled", "budget_tokens": 1024},
),
markdown=True,
)
# Print the response in the terminal
agent.print_response("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/11_models/anthropic/memory.py | cookbook/11_models/anthropic/memory.py | """
This recipe shows how to use personalized memories and summaries in an agent.
Steps:
1. Run: `./cookbook/scripts/run_pgvector.sh` to start a postgres container with pgvector
2. Run: `pip install anthropic sqlalchemy 'psycopg[binary]' pgvector` to install the dependencies
3. Run: `python cookbook/models/anthropic/me... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/db.py | cookbook/11_models/anthropic/db.py | """Run `pip install ddgs sqlalchemy anthropic` to install dependencies."""
from agno.agent import Agent
from agno.db.postgres import PostgresDb
from agno.models.anthropic import Claude
from agno.tools.duckduckgo import DuckDuckGoTools
# Setup the database
db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai"
db = 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/11_models/anthropic/async_tool_use.py | cookbook/11_models/anthropic/async_tool_use.py | """
Async example using Claude with tool calls.
"""
import asyncio
from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Claude(id="claude-haiku-4-5-20251001"),
tools=[DuckDuckGoTools()],
markdown=True,
)
asyncio.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/11_models/anthropic/image_input_file_upload.py | cookbook/11_models/anthropic/image_input_file_upload.py | """
In this example, we upload a PDF file to Anthropic directly and then use it as an input to an agent.
"""
from pathlib import Path
from agno.agent import Agent
from agno.media import Image
from agno.models.anthropic import Claude
from agno.utils.media import download_file
from anthropic import Anthropic
img_path ... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/image_input_local_file.py | cookbook/11_models/anthropic/image_input_local_file.py | """
In this example, we upload a PDF file to Anthropic directly and then use it as an input to an agent.
"""
from pathlib import Path
from agno.agent import Agent
from agno.media import Image
from agno.models.anthropic import Claude
from agno.utils.media import download_file
from anthropic import Anthropic
img_path ... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/basic_stream.py | cookbook/11_models/anthropic/basic_stream.py | from typing import Iterator # noqa
from agno.agent import Agent, RunOutputEvent # noqa
from agno.models.anthropic import Claude
agent = Agent(model=Claude(id="claude-sonnet-4-5-20250929"), markdown=True)
# Get the response in a variable
# run_response: Iterator[RunOutputEvent] = agent.run("Share a 2 sentence horror... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/knowledge.py | cookbook/11_models/anthropic/knowledge.py | """Run `pip install ddgs sqlalchemy pgvector pypdf anthropic openai` to install dependencies."""
from agno.agent import Agent
from agno.knowledge.embedder.azure_openai import AzureOpenAIEmbedder
from agno.knowledge.knowledge import Knowledge
from agno.models.anthropic import Claude
from agno.vectordb.pgvector import 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/11_models/anthropic/thinking_stream.py | cookbook/11_models/anthropic/thinking_stream.py | from agno.agent import Agent
from agno.models.anthropic import Claude
agent = Agent(
model=Claude(
id="claude-3-7-sonnet-20250219",
max_tokens=2048,
thinking={"type": "enabled", "budget_tokens": 1024},
),
markdown=True,
)
# Print the response in the terminal
agent.print_response("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/11_models/anthropic/pdf_input_file_upload.py | cookbook/11_models/anthropic/pdf_input_file_upload.py | """
In this example, we upload a PDF file to Anthropic directly and then use it as an input to an agent.
"""
from pathlib import Path
from agno.agent import Agent
from agno.media import File
from agno.models.anthropic import Claude
from agno.utils.media import download_file
from anthropic import Anthropic
pdf_path =... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/financial_analyst_thinking.py | cookbook/11_models/anthropic/financial_analyst_thinking.py | from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.tools.calculator import CalculatorTools
from agno.tools.yfinance import YFinanceTools
# Complex multi-step reasoning problem that demonstrates interleaved thinking
task = (
"I'm considering an investment portfolio. I want to invest $50... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/tool_use.py | cookbook/11_models/anthropic/tool_use.py | """Run `pip install ddgs` to install dependencies."""
from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Claude(id="claude-sonnet-4-20250514"),
tools=[DuckDuckGoTools()],
markdown=True,
)
agent.print_response("Whats ... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/basic.py | cookbook/11_models/anthropic/basic.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.anthropic import Claude
agent = Agent(model=Claude(id="claude-sonnet-4-5-20250929"), markdown=True)
# Get the response in a variable
# run: RunOutput = agent.run("Share a 2 sentence horror story")
# print(run.content)
# Print the response in the termin... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/pdf_input_url.py | cookbook/11_models/anthropic/pdf_input_url.py | from agno.agent import Agent
from agno.media import File
from agno.models.anthropic import Claude
agent = Agent(
model=Claude(id="claude-sonnet-4-20250514"),
markdown=True,
)
agent.print_response(
"Summarize the contents of the attached file.",
files=[
File(url="https://agno-public.s3.amazonaw... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/prompt_caching_extended.py | cookbook/11_models/anthropic/prompt_caching_extended.py | """
This cookbook shows how to extend caching time for agents using cache with Anthropic models.
You can check more about extended prompt caching with Anthropic models here: https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching#1-hour-cache-duration-beta
"""
from pathlib import Path
from agno.agent imp... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/async_basic_stream.py | cookbook/11_models/anthropic/async_basic_stream.py | """
Basic streaming async example using Claude.
"""
import asyncio
from agno.agent import Agent
from agno.models.anthropic import Claude
agent = Agent(
model=Claude(id="claude-sonnet-4-20250514"),
markdown=True,
)
asyncio.run(agent.aprint_response("Share a 2 sentence horror story", 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/11_models/anthropic/web_fetch.py | cookbook/11_models/anthropic/web_fetch.py | from agno.agent import Agent
from agno.models.anthropic import Claude
agent = Agent(
model=Claude(id="claude-opus-4-5", betas=["web-fetch-2025-09-10"]),
tools=[
{
"type": "web_fetch_20250910",
"name": "web_fetch",
"max_uses": 5,
}
],
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/11_models/anthropic/betas.py | cookbook/11_models/anthropic/betas.py | """Example demonstrating how to use Anthropic beta features.
Beta features are experimental capability extensions for Anthropic models.
You can use them with the `betas` parameter of the Agno Claude model class.
"""
import anthropic
from agno.agent import Agent
from agno.models.anthropic import Claude
# Setup the be... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/retry.py | cookbook/11_models/anthropic/retry.py | """Example demonstrating how to set up retries with Anthropic Claude."""
from agno.agent import Agent
from agno.models.anthropic import Claude
# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "claude-wrong-id"
agent = Agent(
model=Claude(
id=wrong_model_id,
retrie... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/__init__.py | cookbook/11_models/anthropic/__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/11_models/anthropic/prompt_caching.py | cookbook/11_models/anthropic/prompt_caching.py | """
This cookbook shows how to use prompt caching with Agents using Anthropic models, to catch the system prompt passed to the model.
This can significantly reduce processing time and costs.
Use it when working with a static and large system prompt.
You can check more about prompt caching with Anthropic models here: ... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/structured_output.py | cookbook/11_models/anthropic/structured_output.py | from typing import List
from agno.agent import Agent, RunOutput # noqa
from agno.models.anthropic import Claude
from pydantic import BaseModel, Field
from rich.pretty import pprint # noqa
class MovieScript(BaseModel):
setting: str = Field(
..., description="Provide a nice setting for a blockbuster movi... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/code_execution.py | cookbook/11_models/anthropic/code_execution.py | from agno.agent import Agent
from agno.models.anthropic import Claude
agent = Agent(
model=Claude(
id="claude-sonnet-4-20250514",
betas=["code-execution-2025-05-22"],
),
tools=[
{
"type": "code_execution_20250522",
"name": "code_execution",
}
],
... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/basic_with_timeout.py | cookbook/11_models/anthropic/basic_with_timeout.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.anthropic import Claude
agent = Agent(model=Claude(id="claude-sonnet-4-5-20250929", timeout=1.0), 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/11_models/anthropic/async_basic.py | cookbook/11_models/anthropic/async_basic.py | """
Basic async example using Claude.
"""
import asyncio
from agno.agent import Agent
from agno.models.anthropic import Claude
agent = Agent(
model=Claude(id="claude-sonnet-4-20250514"),
markdown=True,
)
asyncio.run(agent.aprint_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/11_models/anthropic/skills/agent_with_powerpoint.py | cookbook/11_models/anthropic/skills/agent_with_powerpoint.py | """
Agno Agent with PowerPoint Skills.
This cookbook demonstrates how to use Claude's pptx skill to create PowerPoint
presentations through Agno agents.
Prerequisites:
- pip install agno anthropic
- export ANTHROPIC_API_KEY="your_api_key_here"
"""
import os
from agno.agent import Agent
from agno.models.anthropic 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/11_models/anthropic/skills/agent_with_excel.py | cookbook/11_models/anthropic/skills/agent_with_excel.py | """
Agno Agent with Excel Skills.
This cookbook demonstrates how to use Claude's xlsx skill to create Excel
spreadsheets through Agno agents.
Prerequisites:
- pip install agno anthropic
- export ANTHROPIC_API_KEY="your_api_key_here"
"""
import os
from agno.agent import Agent
from agno.models.anthropic import Claude... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/skills/file_download_helper.py | cookbook/11_models/anthropic/skills/file_download_helper.py | """
File Download Helper for Claude Agent Skills.
Utility functions to download files created by Claude Agent Skills.
"""
from typing import List
def detect_file_extension(file_content: bytes) -> str:
"""
Detect file type from magic bytes (file header).
Args:
file_content: First few bytes of th... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/skills/agent_with_documents.py | cookbook/11_models/anthropic/skills/agent_with_documents.py | """
Agno Agent with Word Document Skills.
This cookbook demonstrates how to use Claude's docx skill to create Word
documents through Agno agents.
Prerequisites:
- pip install agno anthropic
- export ANTHROPIC_API_KEY="your_api_key_here"
"""
import os
from agno.agent import Agent
from agno.models.anthropic import Cl... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/anthropic/skills/__init__.py | cookbook/11_models/anthropic/skills/__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/11_models/anthropic/skills/multi_skill_agent.py | cookbook/11_models/anthropic/skills/multi_skill_agent.py | """
Multi-Skill Agent - PowerPoint, Excel, and Word.
This cookbook demonstrates how to create an agent with multiple Claude Agent Skills
that can create presentations, spreadsheets, and documents in a single workflow.
Prerequisites:
- pip install agno anthropic
- export ANTHROPIC_API_KEY="your_api_key_here"
"""
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/11_models/aimlapi/image_agent.py | cookbook/11_models/aimlapi/image_agent.py | from agno.agent import Agent
from agno.media import Image
from agno.models.aimlapi import AIMLAPI
agent = Agent(
model=AIMLAPI(id="meta-llama/Llama-3.2-11B-Vision-Instruct-Turbo"),
markdown=True,
)
agent.print_response(
"Tell me about this image",
images=[
Image(
url="https://uploa... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/aimlapi/image_agent_bytes.py | cookbook/11_models/aimlapi/image_agent_bytes.py | from pathlib import Path
from agno.agent import Agent
from agno.media import Image
from agno.models.aimlapi import AIMLAPI
agent = Agent(
model=AIMLAPI(id="meta-llama/Llama-3.2-11B-Vision-Instruct-Turbo"),
markdown=True,
)
image_path = Path(__file__).parent.joinpath("sample.jpg")
# Read the image file conte... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/aimlapi/async_tool_use.py | cookbook/11_models/aimlapi/async_tool_use.py | """
Async example using AIMlAPI with tool calls.
"""
import asyncio
from agno.agent import Agent
from agno.models.aimlapi import AIMLAPI
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=AIMLAPI(id="gpt-4o-mini"),
tools=[DuckDuckGoTools()],
markdown=True,
)
asyncio.run(agent.aprint_... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/aimlapi/basic_stream.py | cookbook/11_models/aimlapi/basic_stream.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.aimlapi import AIMLAPI
agent = Agent(model=AIMLAPI(id="gpt-4o-mini"), markdown=True)
# Get the response in a variable
# run_response: Iterator[RunOutputEvent] = agent.run("Share a 2 sentence horror story", stream=True)
# for chunk in run_response:
# ... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/aimlapi/image_agent_with_memory.py | cookbook/11_models/aimlapi/image_agent_with_memory.py | from agno.agent import Agent
from agno.media import Image
from agno.models.aimlapi import AIMLAPI
agent = Agent(
model=AIMLAPI(id="meta-llama/Llama-3.2-11B-Vision-Instruct-Turbo"),
markdown=True,
add_history_to_context=True,
num_history_runs=3,
)
agent.print_response(
"Tell me about this image",
... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/aimlapi/tool_use.py | cookbook/11_models/aimlapi/tool_use.py | """Run `pip install ddgs` to install dependencies."""
from agno.agent import Agent
from agno.models.aimlapi import AIMLAPI
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=AIMLAPI(id="gpt-4o-mini"),
tools=[DuckDuckGoTools()],
markdown=True,
)
agent.print_response("Whats happening 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/11_models/aimlapi/basic.py | cookbook/11_models/aimlapi/basic.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.aimlapi import AIMLAPI
agent = Agent(model=AIMLAPI(id="gpt-4o-mini"), markdown=True)
# Get the response in a variable
# run: RunOutput = agent.run("Share a 2 sentence horror story")
# print(run.content)
# Print the response in the terminal
agent.print_... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/aimlapi/async_basic_stream.py | cookbook/11_models/aimlapi/async_basic_stream.py | """
Basic streaming async example using AIMlAPI.
"""
import asyncio
from agno.agent import Agent
from agno.models.aimlapi import AIMLAPI
agent = Agent(
model=AIMLAPI(id="gpt-4o-mini"),
markdown=True,
)
asyncio.run(agent.aprint_response("Share a 2 sentence horror story", 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/11_models/aimlapi/retry.py | cookbook/11_models/aimlapi/retry.py | """Example demonstrating how to set up retries with AIMLAPI."""
from agno.agent import Agent
from agno.models.aimlapi import AIMLAPI
# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "aimlapi-wrong-id"
agent = Agent(
model=AIMLAPI(
id=wrong_model_id,
retries=3, # ... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/aimlapi/__init__.py | cookbook/11_models/aimlapi/__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/11_models/aimlapi/structured_output.py | cookbook/11_models/aimlapi/structured_output.py | from typing import List
from agno.agent import Agent, RunOutput # noqa
from agno.models.aimlapi import AIMLAPI
from pydantic import BaseModel, Field
from rich.pretty import pprint # noqa
class MovieScript(BaseModel):
setting: str = Field(
..., description="Provide a nice setting for a blockbuster movie... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/aimlapi/async_basic.py | cookbook/11_models/aimlapi/async_basic.py | """
Basic async example using AIMlAPI.
"""
import asyncio
from agno.agent import Agent
from agno.models.aimlapi import AIMLAPI
agent = Agent(
model=AIMLAPI(id="gpt-4o-mini"),
markdown=True,
)
asyncio.run(agent.aprint_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/11_models/cerebras/tool_use_stream.py | cookbook/11_models/cerebras/tool_use_stream.py | from agno.agent import Agent
from agno.models.cerebras import Cerebras
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Cerebras(id="llama-3.3-70b"),
tools=[DuckDuckGoTools()],
markdown=True,
)
# Print the response in the terminal
agent.print_response("Whats happening in France?", st... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/cerebras/db.py | cookbook/11_models/cerebras/db.py | """Run `pip install ddgs sqlalchemy cerebras_cloud_sdk` to install dependencies."""
from agno.agent import Agent
from agno.db.postgres import PostgresDb
from agno.models.cerebras import Cerebras
from agno.tools.duckduckgo import DuckDuckGoTools
# Setup the database
db_url = "postgresql+psycopg://ai:ai@localhost:5532/... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/cerebras/async_tool_use.py | cookbook/11_models/cerebras/async_tool_use.py | import asyncio
from agno.agent import Agent
from agno.models.cerebras import Cerebras
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Cerebras(id="llama-3.3-70b"),
tools=[DuckDuckGoTools()],
markdown=True,
)
asyncio.run(agent.aprint_response("Whats happening in France?"))
| python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/cerebras/basic_stream.py | cookbook/11_models/cerebras/basic_stream.py | from agno.agent import Agent # noqa
from agno.models.cerebras import Cerebras
agent = Agent(
model=Cerebras(id="llama-3.3-70b"),
markdown=True,
)
# Print the response in the terminal
agent.print_response("write a two sentence horror story", 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/11_models/cerebras/knowledge.py | cookbook/11_models/cerebras/knowledge.py | """Run `pip install ddgs sqlalchemy pgvector pypdf cerebras_cloud_sdk` to install dependencies."""
from agno.agent import Agent
from agno.knowledge.knowledge import Knowledge
from agno.models.cerebras import Cerebras
from agno.vectordb.pgvector import PgVector
db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai"
... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/cerebras/oss_gpt.py | cookbook/11_models/cerebras/oss_gpt.py | from agno.agent.agent import Agent
from agno.models.cerebras.cerebras import Cerebras
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Cerebras(
id="gpt-oss-120b",
),
tools=[DuckDuckGoTools()],
markdown=True,
)
# Print the response in the terminal
agent.print_response("Wh... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/cerebras/async_tool_use_stream.py | cookbook/11_models/cerebras/async_tool_use_stream.py | import asyncio
from agno.agent import Agent
from agno.models.cerebras import Cerebras
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Cerebras(id="llama-3.3-70b"),
tools=[DuckDuckGoTools()],
markdown=True,
)
asyncio.run(agent.aprint_response("Whats happening in France?", stream=Tru... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/cerebras/tool_use.py | cookbook/11_models/cerebras/tool_use.py | from agno.agent import Agent
from agno.models.cerebras import Cerebras
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Cerebras(id="llama-3.3-70b"),
tools=[DuckDuckGoTools()],
markdown=True,
)
# Print the response in the terminal
agent.print_response("Whats happening in France?")
| python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/cerebras/basic.py | cookbook/11_models/cerebras/basic.py | from agno.agent import Agent
from agno.models.cerebras import Cerebras
agent = Agent(
model=Cerebras(id="llama-3.3-70b"),
markdown=True,
)
# Print the response in the terminal
agent.print_response("write a two 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/11_models/cerebras/async_basic_stream.py | cookbook/11_models/cerebras/async_basic_stream.py | import asyncio
from agno.agent import Agent
from agno.models.cerebras import Cerebras
agent = Agent(
model=Cerebras(id="llama-3.3-70b"),
markdown=True,
)
asyncio.run(agent.aprint_response("write a two sentence horror story", 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/11_models/cerebras/retry.py | cookbook/11_models/cerebras/retry.py | """Example demonstrating how to set up retries with Cerebras."""
from agno.agent import Agent
from agno.models.cerebras import Cerebras
# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "cerebras-wrong-id"
agent = Agent(
model=Cerebras(
id=wrong_model_id,
retries=3... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/cerebras/__init__.py | cookbook/11_models/cerebras/__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/11_models/cerebras/structured_output.py | cookbook/11_models/cerebras/structured_output.py | from typing import List
from agno.agent import Agent, RunOutput # noqa
from agno.models.cerebras import Cerebras
from pydantic import BaseModel, Field
from rich.pretty import pprint # noqa
class MovieScript(BaseModel):
setting: str = Field(
..., description="Provide a nice setting for a blockbuster mov... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/cerebras/async_basic.py | cookbook/11_models/cerebras/async_basic.py | import asyncio
from agno.agent import Agent
from agno.models.cerebras import Cerebras
agent = Agent(
model=Cerebras(id="llama-3.3-70b"),
markdown=True,
)
asyncio.run(agent.aprint_response("write a two 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/11_models/google/__init__.py | cookbook/11_models/google/__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/11_models/google/gemini/search.py | cookbook/11_models/google/gemini/search.py | """Google Search with Gemini.
The search tool enables Gemini to access current information from Google Search.
This is useful for getting up-to-date facts, news, and web content.
Run `pip install google-generativeai` to install dependencies.
"""
from agno.agent import Agent
from agno.models.google import Gemini
age... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/google/gemini/agent_with_thinking_budget.py | cookbook/11_models/google/gemini/agent_with_thinking_budget.py | """
An example of how to use the thinking budget parameter with the Gemini model.
This requires `google-genai > 1.10.0`
- Turn off thinking use thinking_budget=0
- Turn on dynamic thinking use thinking_budget=-1
- To use a specific thinking token budget (e.g. 1280) use thinking_budget=1280
- Use include_thoughts=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/11_models/google/gemini/thinking_agent.py | cookbook/11_models/google/gemini/thinking_agent.py | from agno.agent import Agent
from agno.models.google import Gemini
task = (
"Three missionaries and three cannibals need to cross a river. "
"They have a boat that can carry up to two people at a time. "
"If, at any time, the cannibals outnumber the missionaries on either side of the river, the cannibals w... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/google/gemini/tool_use_stream.py | cookbook/11_models/google/gemini/tool_use_stream.py | """Run `pip install ddgs` to install dependencies."""
from agno.agent import Agent
from agno.models.google import Gemini
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Gemini(id="gemini-2.0-flash-001"),
tools=[DuckDuckGoTools()],
markdown=True,
)
agent.print_response("Whats happeni... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/google/gemini/file_search_rag_pipeline.py | cookbook/11_models/google/gemini/file_search_rag_pipeline.py | import asyncio
from pathlib import Path
from agno.agent import Agent
from agno.models.google import Gemini
# Configuration
DOCUMENTS_DIR = (
Path(__file__).parent / "documents"
) # Use documents directory in same folder
STORE_NAME = "RAG Pipeline Demo"
async def create_and_populate_store(model: Gemini, documen... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/google/gemini/vertex_ai_search.py | cookbook/11_models/google/gemini/vertex_ai_search.py | """Vertex AI Search with Gemini.
Vertex AI Search allows Gemini to search through your data stores,
providing grounded responses based on your private knowledge base.
Prerequisites:
1. Set up Vertex AI Search datastore in Google Cloud Console
2. Export environment variables:
export GOOGLE_GENAI_USE_VERTEXAI="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/11_models/google/gemini/text_to_speech.py | cookbook/11_models/google/gemini/text_to_speech.py | from agno.agent import Agent
from agno.models.google import Gemini
from agno.utils.audio import write_wav_audio_to_file
agent = Agent(
model=Gemini(
id="gemini-2.5-flash-preview-tts",
response_modalities=["AUDIO"],
speech_config={
"voice_config": {"prebuilt_voice_config": {"voic... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/google/gemini/video_input_file_upload.py | cookbook/11_models/google/gemini/video_input_file_upload.py | import time
from pathlib import Path
from agno.agent import Agent
from agno.media import Video
from agno.models.google import Gemini
from agno.utils.log import logger
from google.genai.types import UploadFileConfig
model = Gemini(id="gemini-2.0-flash-exp")
agent = Agent(
model=model,
markdown=True,
)
# Pleas... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/google/gemini/vertexai_with_credentials.py | cookbook/11_models/google/gemini/vertexai_with_credentials.py | from agno.agent import Agent
from agno.models.google import Gemini
# To use Vertex AI with explicit credentials, you can pass a
# google.oauth2.service_account.Credentials object to the Gemini class.
# 1. Load your service account credentials (example using a JSON file)
# from google.oauth2 import service_account
# c... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.