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/nebius/async_basic.py | cookbook/11_models/nebius/async_basic.py | import asyncio
from agno.agent import Agent
from agno.models.nebius import Nebius
agent = Agent(
model=Nebius(),
markdown=True,
)
# Print the response in the terminal
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/portkey/tool_use_stream.py | cookbook/11_models/portkey/tool_use_stream.py | from agno.agent import Agent
from agno.models.portkey import Portkey
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Portkey(id="@first-integrati-707071/gpt-5-nano"),
tools=[DuckDuckGoTools()],
markdown=True,
)
# Print the response in the terminal
agent.print_response("What are the ... | 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/portkey/async_tool_use.py | cookbook/11_models/portkey/async_tool_use.py | import asyncio
from agno.agent import Agent
from agno.models.portkey import Portkey
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Portkey(id="@first-integrati-707071/gpt-5-nano"),
tools=[DuckDuckGoTools()],
markdown=True,
)
# Print the response in the terminal
asyncio.run(agent.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/portkey/basic_stream.py | cookbook/11_models/portkey/basic_stream.py | from agno.agent import Agent
from agno.models.portkey import Portkey
agent = Agent(
model=Portkey(
id="@first-integrati-707071/gpt-5-nano",
),
markdown=True,
)
# Print the response in the terminal
agent.print_response(
"What is Portkey and why would I use it as an AI gateway?", 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/portkey/async_tool_use_stream.py | cookbook/11_models/portkey/async_tool_use_stream.py | import asyncio
from agno.agent import Agent
from agno.models.portkey import Portkey
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Portkey(id="@first-integrati-707071/gpt-5-nano"),
tools=[DuckDuckGoTools()],
markdown=True,
)
# Print the response in the terminal
asyncio.run(
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/11_models/portkey/tool_use.py | cookbook/11_models/portkey/tool_use.py | from agno.agent import Agent
from agno.models.portkey import Portkey
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Portkey(id="@first-integrati-707071/gpt-5-nano"),
tools=[DuckDuckGoTools()],
markdown=True,
)
# Print the response in the terminal
agent.print_response("What are the ... | 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/portkey/basic.py | cookbook/11_models/portkey/basic.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.portkey import Portkey
# Create model using Portkey
model = Portkey(
id="@first-integrati-707071/gpt-5-nano",
)
agent = Agent(model=model, markdown=True)
# Get the response in a variable
# run: RunOutput = agent.run("What is Portkey and why would I... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/portkey/async_basic_stream.py | cookbook/11_models/portkey/async_basic_stream.py | import asyncio
from agno.agent import Agent
from agno.models.portkey import Portkey
agent = Agent(
model=Portkey(id="@first-integrati-707071/gpt-5-nano"),
description="You help people with their health and fitness goals.",
instructions=["Recipes should be under 5 ingredients"],
)
# -*- Print a response to... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/portkey/retry.py | cookbook/11_models/portkey/retry.py | """Example demonstrating how to set up retries with Portkey."""
from agno.agent import Agent
from agno.models.portkey import Portkey
# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "portkey-wrong-id"
agent = Agent(
model=Portkey(
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/portkey/structured_output.py | cookbook/11_models/portkey/structured_output.py | from typing import List
from agno.agent import Agent, RunOutput # noqa
from agno.models.portkey import Portkey
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/portkey/async_basic.py | cookbook/11_models/portkey/async_basic.py | import asyncio
from agno.agent import Agent
from agno.models.portkey import Portkey
agent = Agent(
model=Portkey(id="@first-integrati-707071/gpt-5-nano"),
markdown=True,
)
# Print the response in the terminal
asyncio.run(
agent.aprint_response("What is Portkey and why would I use it as an AI gateway?")
)... | 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/azure/retry.py | cookbook/11_models/azure/retry.py | """Example demonstrating how to set up retries with Azure AI Foundry."""
from agno.agent import Agent
from agno.models.azure import AzureAIFoundry
# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "azure-wrong-id"
agent = Agent(
model=AzureAIFoundry(
id=wrong_model_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/11_models/azure/__init__.py | cookbook/11_models/azure/__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/azure/openai/db.py | cookbook/11_models/azure/openai/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.azure import AzureOpenAI
from agno.tools.duckduckgo import DuckDuckGoTools
# Setup the database
db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai"
db = ... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/azure/openai/basic_stream.py | cookbook/11_models/azure/openai/basic_stream.py | from typing import Iterator # noqa
from agno.agent import Agent, RunOutputEvent # noqa
from agno.models.azure import AzureOpenAI
agent = Agent(model=AzureOpenAI(id="gpt-4o-mini"), 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/azure/openai/knowledge.py | cookbook/11_models/azure/openai/knowledge.py | """Run `pip install ddgs sqlalchemy pgvector pypdf openai` to install dependencies."""
import asyncio
from agno.agent import Agent
from agno.knowledge.embedder.azure_openai import AzureOpenAIEmbedder
from agno.knowledge.knowledge import Knowledge
from agno.models.azure import AzureOpenAI
from agno.vectordb.pgvector i... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/azure/openai/tool_use.py | cookbook/11_models/azure/openai/tool_use.py | """Run `pip install ddgs` to install dependencies."""
from agno.agent import Agent
from agno.models.azure import AzureOpenAI
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=AzureOpenAI(id="gpt-4o-mini"),
tools=[DuckDuckGoTools()],
markdown=True,
)
agent.print_response("Whats happen... | 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/azure/openai/basic.py | cookbook/11_models/azure/openai/basic.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.azure import AzureOpenAI
agent = Agent(model=AzureOpenAI(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 on the terminal
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/11_models/azure/openai/async_basic_stream.py | cookbook/11_models/azure/openai/async_basic_stream.py | import asyncio
from agno.agent import Agent
from agno.models.azure import AzureOpenAI
assistant = Agent(
model=AzureOpenAI(id="gpt-4o-mini"),
description="You help people with their health and fitness goals.",
instructions=["Recipes should be under 5 ingredients"],
)
# -*- Print a response to the cli
asyn... | 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/azure/openai/__init__.py | cookbook/11_models/azure/openai/__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/azure/openai/structured_output.py | cookbook/11_models/azure/openai/structured_output.py | from typing import List
from agno.agent import Agent, RunOutput # noqa
from agno.models.azure import AzureOpenAI
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/azure/openai/async_basic.py | cookbook/11_models/azure/openai/async_basic.py | import asyncio
from agno.agent import Agent
from agno.models.azure import AzureOpenAI
agent = Agent(
model=AzureOpenAI(id="gpt-4o-mini"),
description="You help people with their health and fitness goals.",
instructions=["Recipes should be under 5 ingredients"],
)
# -*- Print a response to the cli
asyncio.... | 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/azure/ai_foundry/image_agent.py | cookbook/11_models/azure/ai_foundry/image_agent.py | from agno.agent import Agent
from agno.media import Image
from agno.models.azure import AzureAIFoundry
agent = Agent(
model=AzureAIFoundry(id="Llama-3.2-11B-Vision-Instruct"),
markdown=True,
)
agent.print_response(
"Tell me about this image.",
images=[
Image(
url="https://raw.githu... | 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/azure/ai_foundry/image_agent_bytes.py | cookbook/11_models/azure/ai_foundry/image_agent_bytes.py | from pathlib import Path
from agno.agent import Agent
from agno.media import Image
from agno.models.azure import AzureAIFoundry
from agno.utils.media import download_image
agent = Agent(
model=AzureAIFoundry(id="Llama-3.2-11B-Vision-Instruct"),
markdown=True,
)
image_path = Path(__file__).parent.joinpath("sa... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/azure/ai_foundry/db.py | cookbook/11_models/azure/ai_foundry/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.azure import AzureAIFoundry
from agno.tools.duckduckgo import DuckDuckGoTools
# Setup the database
db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai"
db... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/azure/ai_foundry/async_tool_use.py | cookbook/11_models/azure/ai_foundry/async_tool_use.py | """
Async example using Claude with tool calls.
"""
import asyncio
from agno.agent import Agent
from agno.models.azure import AzureAIFoundry
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=AzureAIFoundry(id="Cohere-command-r-08-2024"),
tools=[DuckDuckGoTools()],
markdown=True,
)
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/azure/ai_foundry/demo_cohere.py | cookbook/11_models/azure/ai_foundry/demo_cohere.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.azure import AzureAIFoundry
agent = Agent(model=AzureAIFoundry(id="Cohere-command-r-08-2024"), markdown=True)
# Get the response in a variable
# run: RunOutput = agent.run("Share a 2 sentence horror story")
# print(run.content)
# Print the response 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/11_models/azure/ai_foundry/basic_stream.py | cookbook/11_models/azure/ai_foundry/basic_stream.py | from typing import Iterator # noqa
from agno.agent import Agent, RunOutputEvent # noqa
from agno.models.azure import AzureAIFoundry
agent = Agent(
model=AzureAIFoundry(
id="Phi-4",
azure_endpoint="",
),
markdown=True,
)
# Get the response in a variable
# run_response: Iterator[RunOutput... | 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/azure/ai_foundry/knowledge.py | cookbook/11_models/azure/ai_foundry/knowledge.py | """Run `pip install ddgs sqlalchemy pgvector pypdf 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.azure import AzureAIFoundry
from agno.vectordb.pgvector import PgVecto... | 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/azure/ai_foundry/tool_use.py | cookbook/11_models/azure/ai_foundry/tool_use.py | """Run `pip install ddgs` to install dependencies."""
from agno.agent import Agent
from agno.models.azure import AzureAIFoundry
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=AzureAIFoundry(id="Cohere-command-r-08-2024"),
tools=[DuckDuckGoTools()],
markdown=True,
)
agent.print_res... | 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/azure/ai_foundry/basic.py | cookbook/11_models/azure/ai_foundry/basic.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.azure import AzureAIFoundry
agent = Agent(model=AzureAIFoundry(id="Phi-4"), markdown=True)
# Get the response in a variable
# run: RunOutput = agent.run("Share a 2 sentence horror story")
# print(run.content)
# Print the response on the terminal
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/11_models/azure/ai_foundry/async_basic_stream.py | cookbook/11_models/azure/ai_foundry/async_basic_stream.py | import asyncio
from agno.agent import Agent
from agno.models.azure import AzureAIFoundry
assistant = Agent(
model=AzureAIFoundry(id="Phi-4"),
description="You help people with their health and fitness goals.",
instructions=["Recipes should be under 5 ingredients"],
)
# -*- Print a response to the cli
asyn... | 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/azure/ai_foundry/__init__.py | cookbook/11_models/azure/ai_foundry/__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/azure/ai_foundry/demo_mistral.py | cookbook/11_models/azure/ai_foundry/demo_mistral.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.azure import AzureAIFoundry
agent = Agent(model=AzureAIFoundry(id="Mistral-Large-2411"), markdown=True)
# Get the response in a variable
# run: RunOutput = agent.run("Share a 2 sentence horror story")
# print(run.content)
# Print the response on the 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/azure/ai_foundry/structured_output.py | cookbook/11_models/azure/ai_foundry/structured_output.py | from typing import List
from agno.agent import Agent, RunOutput # noqa
from agno.models.azure import AzureAIFoundry
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 ... | 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/azure/ai_foundry/async_basic.py | cookbook/11_models/azure/ai_foundry/async_basic.py | import asyncio
from agno.agent import Agent
from agno.models.azure import AzureAIFoundry
agent = Agent(
model=AzureAIFoundry(id="Phi-4"),
description="You help people with their health and fitness goals.",
instructions=["Recipes should be under 5 ingredients"],
)
# -*- Print a response to the cli
asyncio.... | 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_openai/tool_use_stream.py | cookbook/11_models/cerebras_openai/tool_use_stream.py | from agno.agent import Agent
from agno.models.cerebras import CerebrasOpenAI
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=CerebrasOpenAI(id="llama-4-scout-17b-16e-instruct"),
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_openai/db.py | cookbook/11_models/cerebras_openai/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 CerebrasOpenAI
from agno.tools.duckduckgo import DuckDuckGoTools
# Setup the database
db_url = "postgresql+psycopg://ai:ai@localhost... | 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_openai/async_tool_use.py | cookbook/11_models/cerebras_openai/async_tool_use.py | import asyncio
from agno.agent import Agent
from agno.models.cerebras import CerebrasOpenAI
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=CerebrasOpenAI(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_openai/basic_stream.py | cookbook/11_models/cerebras_openai/basic_stream.py | from agno.agent import Agent
from agno.models.cerebras import CerebrasOpenAI
agent = Agent(
model=CerebrasOpenAI(id="llama-4-scout-17b-16e-instruct"),
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_openai/knowledge.py | cookbook/11_models/cerebras_openai/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 CerebrasOpenAI
from agno.vectordb.pgvector import PgVector
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_openai/oss_gpt.py | cookbook/11_models/cerebras_openai/oss_gpt.py | from agno.agent.agent import Agent
from agno.models.cerebras.cerebras_openai import CerebrasOpenAI
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=CerebrasOpenAI(
id="gpt-oss-120b",
),
tools=[DuckDuckGoTools()],
markdown=True,
)
# Print the response in the terminal
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/11_models/cerebras_openai/async_tool_use_stream.py | cookbook/11_models/cerebras_openai/async_tool_use_stream.py | import asyncio
from agno.agent import Agent
from agno.models.cerebras import CerebrasOpenAI
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=CerebrasOpenAI(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_openai/tool_use.py | cookbook/11_models/cerebras_openai/tool_use.py | from agno.agent import Agent
from agno.models.cerebras import CerebrasOpenAI
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=CerebrasOpenAI(id="llama-4-scout-17b-16e-instruct"),
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_openai/basic.py | cookbook/11_models/cerebras_openai/basic.py | from agno.agent import Agent
from agno.models.cerebras import CerebrasOpenAI
agent = Agent(
model=CerebrasOpenAI(id="llama-4-scout-17b-16e-instruct"),
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_openai/async_basic_stream.py | cookbook/11_models/cerebras_openai/async_basic_stream.py | import asyncio
from agno.agent import Agent
from agno.models.cerebras import CerebrasOpenAI
agent = Agent(
model=CerebrasOpenAI(id="llama-4-scout-17b-16e-instruct"),
markdown=True,
)
# Print the response in the terminal
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_openai/__init__.py | cookbook/11_models/cerebras_openai/__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_openai/structured_output.py | cookbook/11_models/cerebras_openai/structured_output.py | from typing import List
from agno.agent import Agent, RunOutput # noqa
from agno.models.cerebras import CerebrasOpenAI
from pydantic import BaseModel, Field
from rich.pretty import pprint # noqa
class MovieScript(BaseModel):
setting: str = Field(
..., description="Provide a nice setting for a blockbust... | 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_openai/async_basic.py | cookbook/11_models/cerebras_openai/async_basic.py | import asyncio
from agno.agent import Agent
from agno.models.cerebras import CerebrasOpenAI
agent = Agent(
model=CerebrasOpenAI(id="llama-4-scout-17b-16e-instruct"),
markdown=True,
)
# Print the response in the terminal
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/sambanova/basic_stream.py | cookbook/11_models/sambanova/basic_stream.py | from agno.agent import Agent, RunOutputEvent # noqa
from agno.models.sambanova import Sambanova
agent = Agent(model=Sambanova(id="Meta-Llama-3.1-8B-Instruct"), markdown=True)
# Get the response in a variable
# run_response: Iterator[RunOutputEvent] = agent.run("Share a 2 sentence horror story", stream=True)
# for ch... | 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/sambanova/basic.py | cookbook/11_models/sambanova/basic.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.sambanova import Sambanova
agent = Agent(model=Sambanova(id="Meta-Llama-3.1-8B-Instruct"), 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 ... | 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/sambanova/async_basic_stream.py | cookbook/11_models/sambanova/async_basic_stream.py | import asyncio
from typing import Iterator # noqa
from agno.agent import Agent, RunOutputEvent # noqa
from agno.models.sambanova import Sambanova
agent = Agent(model=Sambanova(id="Meta-Llama-3.1-8B-Instruct"), markdown=True)
# Get the response in a variable
# run_response: Iterator[RunOutputEvent] = agent.run("Sha... | 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/sambanova/retry.py | cookbook/11_models/sambanova/retry.py | """Example demonstrating how to set up retries with SambaNova."""
from agno.agent import Agent
from agno.models.sambanova import SambaNova
# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "sambanova-wrong-id"
agent = Agent(
model=SambaNova(
id=wrong_model_id,
retr... | 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/sambanova/__init__.py | cookbook/11_models/sambanova/__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/sambanova/async_basic.py | cookbook/11_models/sambanova/async_basic.py | import asyncio
from agno.agent import Agent, RunOutput # noqa
from agno.models.sambanova import Sambanova
agent = Agent(model=Sambanova(id="Meta-Llama-3.1-8B-Instruct"), markdown=True)
# Get the response in a variable
# run: RunOutput = agent.run("Share a 2 sentence horror story")
# print(run.content)
# Print the ... | 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/llama_cpp/tool_use_stream.py | cookbook/11_models/llama_cpp/tool_use_stream.py | """Run `pip install ddgs` to install dependencies."""
from agno.agent import Agent
from agno.models.llama_cpp import LlamaCpp
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=LlamaCpp(id="ggml-org/gpt-oss-20b-GGUF"),
tools=[DuckDuckGoTools()],
markdown=True,
)
agent.print_response("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/llama_cpp/basic_stream.py | cookbook/11_models/llama_cpp/basic_stream.py | from typing import Iterator # noqa
from agno.agent import Agent, RunOutputEvent # noqa
from agno.models.llama_cpp import LlamaCpp
agent = Agent(model=LlamaCpp(id="ggml-org/gpt-oss-20b-GGUF"), markdown=True)
# Get the response in a variable
# run_response: Iterator[RunOutputEvent] = agent.run("Share a 2 sentence hor... | 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/llama_cpp/tool_use.py | cookbook/11_models/llama_cpp/tool_use.py | """Run `pip install ddgs` to install dependencies."""
from agno.agent import Agent
from agno.models.llama_cpp import LlamaCpp
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=LlamaCpp(id="ggml-org/gpt-oss-20b-GGUF"),
tools=[DuckDuckGoTools()],
markdown=True,
)
agent.print_response("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/llama_cpp/basic.py | cookbook/11_models/llama_cpp/basic.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.llama_cpp import LlamaCpp
agent = Agent(model=LlamaCpp(id="ggml-org/gpt-oss-20b-GGUF"), 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 ter... | 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/llama_cpp/retry.py | cookbook/11_models/llama_cpp/retry.py | """Example demonstrating how to set up retries with llama.cpp."""
from agno.agent import Agent
from agno.models.llama_cpp import LlamaCpp
# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "llama-cpp-wrong-id"
agent = Agent(
model=LlamaCpp(
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/llama_cpp/__init__.py | cookbook/11_models/llama_cpp/__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/llama_cpp/structured_output.py | cookbook/11_models/llama_cpp/structured_output.py | from typing import List
from agno.agent import Agent
from agno.models.llama_cpp import LlamaCpp
from agno.run.agent import RunOutput
from pydantic import BaseModel, Field
from rich.pretty import pprint # noqa
class MovieScript(BaseModel):
name: str = Field(..., description="Give a name to this movie")
setti... | 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/xai/image_agent.py | cookbook/11_models/xai/image_agent.py | from agno.agent import Agent
from agno.media import Image
from agno.models.xai import xAI
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=xAI(id="grok-2-vision-latest"),
tools=[DuckDuckGoTools()],
markdown=True,
)
agent.print_response(
"Tell me about this image and give me the l... | 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/xai/image_agent_bytes.py | cookbook/11_models/xai/image_agent_bytes.py | from pathlib import Path
from agno.agent import Agent
from agno.media import Image
from agno.models.xai import xAI
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.utils.media import download_image
agent = Agent(
model=xAI(id="grok-2-vision-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/xai/finance_agent.py | cookbook/11_models/xai/finance_agent.py | """🗞️ Finance Agent - Your Personal Market Analyst!
This example shows how to create a sophisticated financial analyst that provides
comprehensive market insights using real-time data. The agent combines stock market data,
analyst recommendations, company information, and latest news to deliver professional-grade
fin... | 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/xai/tool_use_stream.py | cookbook/11_models/xai/tool_use_stream.py | """Build a Web Search Agent using xAI."""
from agno.agent import Agent
from agno.models.xai import xAI
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=xAI(id="grok-2"),
tools=[DuckDuckGoTools()],
markdown=True,
)
agent.print_response("Whats happening in France?", 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/xai/async_tool_use.py | cookbook/11_models/xai/async_tool_use.py | """Run `pip install ddgs` to install dependencies."""
import asyncio
from agno.agent import Agent
from agno.models.xai import xAI
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=xAI(id="grok-2"),
tools=[DuckDuckGoTools()],
markdown=True,
)
asyncio.run(agent.aprint_response("Whats h... | 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/xai/basic_stream.py | cookbook/11_models/xai/basic_stream.py | from typing import Iterator # noqa
from agno.agent import Agent, RunOutputEvent # noqa
from agno.models.xai import xAI
agent = Agent(model=xAI(id="grok-2"), markdown=True)
# Get the response in a variable
# run_response: Iterator[RunOutputEvent] = agent.run("Share a 2 sentence horror story", stream=True)
# for chun... | 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/xai/image_agent_with_memory.py | cookbook/11_models/xai/image_agent_with_memory.py | from agno.agent import Agent
from agno.media import Image
from agno.models.xai import xAI
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=xAI(id="grok-2-vision-latest"),
tools=[DuckDuckGoTools()],
markdown=True,
add_history_to_context=True,
num_history_runs=3,
)
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/xai/reasoning_agent.py | cookbook/11_models/xai/reasoning_agent.py | from agno.agent import Agent
from agno.models.xai import xAI
from agno.tools.reasoning import ReasoningTools
from agno.tools.yfinance import YFinanceTools
reasoning_agent = Agent(
model=xAI(id="grok-3-beta"),
tools=[
ReasoningTools(add_instructions=True, add_few_shot=True),
YFinanceTools(),
... | 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/xai/tool_use.py | cookbook/11_models/xai/tool_use.py | """Build a Web Search Agent using xAI."""
from agno.agent import Agent
from agno.models.xai import xAI
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=xAI(id="grok-2"),
tools=[DuckDuckGoTools()],
markdown=True,
)
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/xai/basic.py | cookbook/11_models/xai/basic.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.xai import xAI
agent = Agent(model=xAI(id="grok-2"), 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_response("Share 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/xai/live_search_agent_stream.py | cookbook/11_models/xai/live_search_agent_stream.py | from agno.agent import Agent
from agno.models.xai.xai import xAI
agent = Agent(
model=xAI(
id="grok-3",
search_parameters={
"mode": "on",
"max_search_results": 20,
"return_citations": True,
},
),
markdown=True,
)
agent.print_response(
"Provide... | 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/xai/async_basic_stream.py | cookbook/11_models/xai/async_basic_stream.py | import asyncio
from typing import Iterator # noqa
from agno.agent import Agent, RunOutputEvent # noqa
from agno.models.xai import xAI
agent = Agent(model=xAI(id="grok-2"), markdown=True)
# Get the response in a variable
# run_response: Iterator[RunOutputEvent] = agent.run("Share a 2 sentence horror story", stream=... | 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/xai/retry.py | cookbook/11_models/xai/retry.py | """Example demonstrating how to set up retries with xAI."""
from agno.agent import Agent
from agno.models.xai import xAI
# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "grok-wrong-id"
agent = Agent(
model=xAI(
id=wrong_model_id,
retries=3, # Number of times to ... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/xai/__init__.py | cookbook/11_models/xai/__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/xai/structured_output.py | cookbook/11_models/xai/structured_output.py | from typing import List
from agno.agent import Agent
from agno.models.xai.xai import xAI
from agno.run.agent import RunOutput
from pydantic import BaseModel, Field
from rich.pretty import pprint # noqa
class MovieScript(BaseModel):
name: str = Field(..., description="Give a name to this movie")
setting: str... | 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/xai/live_search_agent.py | cookbook/11_models/xai/live_search_agent.py | from agno.agent import Agent
from agno.models.xai.xai import xAI
agent = Agent(
model=xAI(
id="grok-3",
search_parameters={
"mode": "on",
"max_search_results": 20,
"return_citations": True,
},
),
markdown=True,
)
agent.print_response("Provide me 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/xai/async_basic.py | cookbook/11_models/xai/async_basic.py | import asyncio
from agno.agent import Agent, RunOutput # noqa
from agno.models.xai import xAI
agent = Agent(model=xAI(id="grok-2"), 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
asyncio.run(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/cometapi/image_agent.py | cookbook/11_models/cometapi/image_agent.py | """
Image analysis example using CometAPI with vision models.
"""
from agno.agent import Agent
from agno.media import Image
from agno.models.cometapi import CometAPI
# Use a vision-capable model from CometAPI
agent = Agent(
model=CometAPI(id="gpt-4o"), # GPT-4o has vision capabilities
markdown=True,
)
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/11_models/cometapi/tool_use_stream.py | cookbook/11_models/cometapi/tool_use_stream.py | """
from agno.agent import Agent
from agno.models.cometapi import CometAPI
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=CometAPI(id="gpt-5-mini"),
tools=[DuckDuckGoTools()],e with streaming example using CometAPI.
"""
from agno.agent import Agent
from agno.models.cometapi import Come... | 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/cometapi/async_tool_use.py | cookbook/11_models/cometapi/async_tool_use.py | """
Async tool use example using CometAPI.
"""
import asyncio
from agno.agent import Agent
from agno.models.cometapi import CometAPI
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=CometAPI(id="gpt-5"),
tools=[DuckDuckGoTools(enable_search=True, enable_news=True)],
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/cometapi/basic_stream.py | cookbook/11_models/cometapi/basic_stream.py | from agno.agent import Agent
from agno.models.cometapi import CometAPI
agent = Agent(model=CometAPI(id="gpt-5-mini"), markdown=True)
# Print the response in the terminal with streaming enabled
agent.print_response("Explain quantum computing in simple terms", 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/cometapi/async_tool_use_stream.py | cookbook/11_models/cometapi/async_tool_use_stream.py | """
Async streaming tool use example using CometAPI.
"""
import asyncio
from agno.agent import Agent
from agno.models.cometapi import CometAPI
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=CometAPI(id="gpt-5-mini"),
tools=[DuckDuckGoTools()],
markdown=True,
)
# Async streaming 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/11_models/cometapi/image_agent_with_memory.py | cookbook/11_models/cometapi/image_agent_with_memory.py | """
Image analysis with memory example using CometAPI.
"""
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.media import Image
from agno.models.cometapi import CometAPI
agent = Agent(
model=CometAPI(id="gpt-4o"), # GPT-4o has vision capabilities
db=SqliteDb(db_file="tmp/cometapi_ima... | 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/cometapi/multi_model.py | cookbook/11_models/cometapi/multi_model.py | """Example showcasing different models available through CometAPI."""
from agno.agent import Agent
from agno.models.cometapi import CometAPI
def test_model(
model_id: str,
prompt: str = "Explain what makes you unique as an AI model in 2-3 sentences.",
):
"""Test a specific model with a given prompt."""
... | 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/cometapi/tool_use.py | cookbook/11_models/cometapi/tool_use.py | from agno.agent import Agent
from agno.models.cometapi import CometAPI
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=CometAPI(id="gpt-5-mini"),
tools=[DuckDuckGoTools()],
markdown=True,
)
# Print the response in the terminal
agent.print_response("What is the latest price about BTC... | 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/cometapi/basic.py | cookbook/11_models/cometapi/basic.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.cometapi import CometAPI
agent = Agent(model=CometAPI(id="gpt-5-mini"), markdown=True)
# Get the response in a variable
# run: RunOutput = agent.run("Explain quantum computing in simple terms")
# print(run.content)
# Print the response in the terminal
... | 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/cometapi/async_basic_stream.py | cookbook/11_models/cometapi/async_basic_stream.py | """
Async streaming example using CometAPI.
"""
import asyncio
from agno.agent import Agent
from agno.models.cometapi import CometAPI
agent = Agent(model=CometAPI(id="gpt-5-mini"), markdown=True)
# Async streaming response
asyncio.run(
agent.aprint_response(
"Write a short poem about artificial intellig... | 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/cometapi/retry.py | cookbook/11_models/cometapi/retry.py | """Example demonstrating how to set up retries with CometAPI."""
from agno.agent import Agent
from agno.models.cometapi import CometAPI
# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "cometapi-wrong-id"
agent = Agent(
model=CometAPI(
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/cometapi/__init__.py | cookbook/11_models/cometapi/__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/cometapi/structured_output.py | cookbook/11_models/cometapi/structured_output.py | from typing import List
from agno.agent import Agent
from agno.models.cometapi import CometAPI
from pydantic import BaseModel, Field
class MovieScript(BaseModel):
setting: str = Field(..., description="The setting of the movie")
protagonist: str = Field(..., description="Name of the protagonist")
antagon... | 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/cometapi/async_basic.py | cookbook/11_models/cometapi/async_basic.py | """
Basic async example using CometAPI.
"""
import asyncio
from agno.agent import Agent
from agno.models.cometapi import CometAPI
agent = Agent(model=CometAPI(id="gpt-5-mini"), markdown=True)
# Get the response in a variable
# run: RunOutput = agent.run("Share a 2 sentence horror story")
# print(run.content)
# Pri... | 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/requesty/async_tool_use.py | cookbook/11_models/requesty/async_tool_use.py | """Run `pip install ddgs` to install dependencies."""
import asyncio
from agno.agent import Agent
from agno.models.requesty import Requesty
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Requesty(id="openai/gpt-4o"),
tools=[DuckDuckGoTools()],
markdown=True,
)
asyncio.run(agent.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/11_models/requesty/basic_stream.py | cookbook/11_models/requesty/basic_stream.py | from typing import Iterator # noqa
from agno.agent import Agent, RunOutputEvent # noqa
from agno.models.requesty import Requesty
agent = Agent(model=Requesty(id="openai/gpt-4o"), markdown=True)
# Get the response in a variable
# run_response: Iterator[RunOutputEvent] = agent.run("Share a 2 sentence horror story", 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/requesty/tool_use.py | cookbook/11_models/requesty/tool_use.py | """Run `pip install ddgs` to install dependencies."""
from agno.agent import Agent
from agno.models.requesty import Requesty
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Requesty(id="openai/gpt-4o"),
tools=[DuckDuckGoTools()],
markdown=True,
)
agent.print_response("Whats happenin... | 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/requesty/basic.py | cookbook/11_models/requesty/basic.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.requesty import Requesty
agent = Agent(
model=Requesty(
id="openai/gpt-4o",
),
markdown=True,
)
# Get the response in a variable
# run: RunOutput = agent.run("Share a 2 sentence horror story")
# print(run.content)
# Print the respon... | 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/requesty/async_basic_stream.py | cookbook/11_models/requesty/async_basic_stream.py | import asyncio
from typing import Iterator # noqa
from agno.agent import Agent, RunOutputEvent # noqa
from agno.models.requesty import Requesty
agent = Agent(model=Requesty(id="openai/gpt-4o"), markdown=True)
# Get the response in a variable
# run_response: Iterator[RunOutputEvent] = agent.run("Share a 2 sentence ... | 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/requesty/retry.py | cookbook/11_models/requesty/retry.py | """Example demonstrating how to set up retries with Requesty."""
from agno.agent import Agent
from agno.models.requesty import Requesty
# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "requesty-wrong-id"
agent = Agent(
model=Requesty(
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/requesty/__init__.py | cookbook/11_models/requesty/__init__.py | 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.