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/google/gemini/structured_output_stream.py | cookbook/11_models/google/gemini/structured_output_stream.py | from typing import Dict, List
from agno.agent import Agent
from agno.models.google import Gemini
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/google/gemini/search_stream.py | cookbook/11_models/google/gemini/search_stream.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/gemini_3_pro_thinking_level.py | cookbook/11_models/google/gemini/gemini_3_pro_thinking_level.py | """
Async example using Gemini with tool calls.
"""
import asyncio
from agno.agent import Agent
from agno.models.google import Gemini
agent = Agent(
model=Gemini(id="gemini-3-pro-preview", thinking_level="low"),
markdown=True,
)
asyncio.run(agent.aprint_response("Whats the current news in France?", stream=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/google/gemini/pdf_input_local.py | cookbook/11_models/google/gemini/pdf_input_local.py | from pathlib import Path
from agno.agent import Agent
from agno.media import File
from agno.models.google import Gemini
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-public.... | 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/grounding.py | cookbook/11_models/google/gemini/grounding.py | """Grounding with Gemini.
Grounding enables Gemini to search the web and provide responses backed by
real-time information with citations. This is a legacy tool - for Gemini 2.0+
models, consider using the 'search' parameter instead.
Run `pip install google-generativeai` to install dependencies.
"""
from agno.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/google/gemini/video_input_youtube.py | cookbook/11_models/google/gemini/video_input_youtube.py | from agno.agent import Agent
from agno.media import Video
from agno.models.google import Gemini
agent = Agent(
model=Gemini(id="gemini-2.0-flash-exp"),
markdown=True,
)
agent.print_response(
"Tell me about this video?",
videos=[Video(url="https://www.youtube.com/watch?v=XinoY2LDdA0")],
)
# Video uplo... | 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/db.py | cookbook/11_models/google/gemini/db.py | """Run `pip install ddgs sqlalchemy google.genai` to install dependencies."""
from agno.agent import Agent
from agno.db.postgres import PostgresDb
from agno.models.google import Gemini
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/google/gemini/async_tool_use.py | cookbook/11_models/google/gemini/async_tool_use.py | """
Async example using Gemini with tool calls.
"""
import asyncio
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,
)
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/google/gemini/image_input_file_upload.py | cookbook/11_models/google/gemini/image_input_file_upload.py | from pathlib import Path
from agno.agent import Agent
from agno.media import Image
from agno.models.google import Gemini
from agno.tools.duckduckgo import DuckDuckGoTools
from google.generativeai import upload_file
from google.generativeai.types import file_types
agent = Agent(
model=Gemini(id="gemini-2.0-flash-e... | 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_upload_with_cache.py | cookbook/11_models/google/gemini/file_upload_with_cache.py | """
In this example, we upload a text file to Google and then create a cache.
This greatly saves on tokens during normal prompting.
"""
from pathlib import Path
from time import sleep
import requests
from agno.agent import Agent
from agno.models.google import Gemini
from google import genai
from google.genai.types 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/google/gemini/url_context_stream.py | cookbook/11_models/google/gemini/url_context_stream.py | """Run `pip install google-generativeai` to install dependencies."""
from agno.agent import Agent
from agno.models.google import Gemini
agent = Agent(
model=Gemini(id="gemini-2.5-flash", url_context=True),
markdown=True,
)
url1 = "https://www.foodnetwork.com/recipes/ina-garten/perfect-roast-chicken-recipe-19... | 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_local_file_upload.py | cookbook/11_models/google/gemini/video_input_local_file_upload.py | from pathlib import Path
from agno.agent import Agent
from agno.media import Video
from agno.models.google import Gemini
agent = Agent(
model=Gemini(id="gemini-2.0-flash-exp"),
markdown=True,
)
# Get sample videos from https://www.pexels.com/search/videos/sample/
video_path = Path(__file__).parent.joinpath("... | 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/image_editing.py | cookbook/11_models/google/gemini/image_editing.py | from io import BytesIO
from agno.agent import Agent, RunOutput # noqa
from agno.media import Image
from agno.models.google import Gemini
from PIL import Image as PILImage
# No system message should be provided (Gemini requires only the image)
agent = Agent(
model=Gemini(
id="gemini-2.0-flash-exp-image-ge... | 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/basic_stream.py | cookbook/11_models/google/gemini/basic_stream.py | from typing import Iterator # noqa
from agno.agent import Agent, RunOutputEvent # noqa
from agno.models.google import Gemini
agent = Agent(model=Gemini(id="gemini-2.0-flash-001"), 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/google/gemini/knowledge.py | cookbook/11_models/google/gemini/knowledge.py | """Run `pip install ddgs sqlalchemy pgvector pypdf openai google.genai` to install dependencies."""
from agno.agent import Agent
from agno.knowledge.embedder.google import GeminiEmbedder
from agno.knowledge.knowledge import Knowledge
from agno.models.google import Gemini
from agno.vectordb.pgvector import PgVector
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/google/gemini/async_image_editing.py | cookbook/11_models/google/gemini/async_image_editing.py | import asyncio
from io import BytesIO
from agno.agent import Agent, RunOutput # noqa
from agno.media import Image
from agno.models.google import Gemini
from PIL import Image as PILImage
# No system message should be provided
agent = Agent(
model=Gemini(
id="gemini-2.0-flash-exp-image-generation",
... | 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/gemini_3_pro.py | cookbook/11_models/google/gemini/gemini_3_pro.py | """
Async example using Gemini with tool calls.
"""
import asyncio
from agno.agent import Agent
from agno.db.sqlite.sqlite import SqliteDb
from agno.models.google import Gemini
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Gemini(id="gemini-3-pro-preview"),
db=SqliteDb(db_file="tmp/d... | 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_stream.py | cookbook/11_models/google/gemini/thinking_agent_stream.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/url_context.py | cookbook/11_models/google/gemini/url_context.py | """Run `pip install google-generativeai` to install dependencies."""
from agno.agent import Agent
from agno.models.google import Gemini
agent = Agent(
model=Gemini(id="gemini-2.5-flash", url_context=True),
markdown=True,
)
url1 = "https://www.foodnetwork.com/recipes/ina-garten/perfect-roast-chicken-recipe-19... | 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/pdf_input_file_upload.py | cookbook/11_models/google/gemini/pdf_input_file_upload.py | """
In this example, we upload a PDF file to Google GenAI directly and then use it as an input to an agent.
Note: If the size of the file is greater than 20MB, and a file path is provided, the file automatically gets uploaded to Google GenAI.
"""
from pathlib import Path
from time import sleep
from agno.agent import... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/google/gemini/async_image_generation.py | cookbook/11_models/google/gemini/async_image_generation.py | import asyncio
import base64
from io import BytesIO
from agno.agent import Agent, RunOutput # noqa
from agno.db.in_memory import InMemoryDb
from agno.models.google import Gemini
from PIL import Image
# No system message should be provided
agent = Agent(
model=Gemini(
id="gemini-2.0-flash-exp-image-genera... | 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/gemini_2_to_3.py | cookbook/11_models/google/gemini/gemini_2_to_3.py | """
Async example using Gemini with tool calls.
"""
import asyncio
from uuid import uuid4
from agno.agent import Agent
from agno.db.sqlite.sqlite import SqliteDb
from agno.models.google import Gemini
from agno.tools.duckduckgo import DuckDuckGoTools
session_id = str(uuid4())
agent = Agent(
model=Gemini(id="gemi... | 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/audio_input_local_file_upload.py | cookbook/11_models/google/gemini/audio_input_local_file_upload.py | from pathlib import Path
from agno.agent import Agent
from agno.media import Audio
from agno.models.google import Gemini
agent = Agent(
model=Gemini(id="gemini-2.0-flash-exp"),
markdown=True,
)
# Please download a sample audio file to test this Agent and upload using:
audio_path = Path(__file__).parent.joinp... | 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.py | cookbook/11_models/google/gemini/tool_use.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/imagen_tool.py | cookbook/11_models/google/gemini/imagen_tool.py | """🔧 Example: Using the GeminiTools Toolkit for Image Generation
Make sure you have set the GOOGLE_API_KEY environment variable.
Example prompts to try:
- "Create a surreal painting of a floating city in the clouds at sunset"
- "Generate a photorealistic image of a cozy coffee shop interior"
- "Design a cute cartoon ... | 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/basic.py | cookbook/11_models/google/gemini/basic.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.google import Gemini
agent = Agent(model=Gemini(id="gemini-2.0-flash-001"), 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.... | 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/pdf_input_url.py | cookbook/11_models/google/gemini/pdf_input_url.py | from agno.agent import Agent
from agno.db.in_memory import InMemoryDb
from agno.media import File
from agno.models.google import Gemini
agent = Agent(
model=Gemini(id="gemini-2.0-flash-exp"),
markdown=True,
db=InMemoryDb(),
add_history_to_context=True,
)
agent.print_response(
"Summarize the conten... | 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/async_basic_stream.py | cookbook/11_models/google/gemini/async_basic_stream.py | import asyncio
from typing import Iterator # noqa
from agno.agent import Agent, RunOutputEvent # noqa
from agno.models.google import Gemini
agent = Agent(model=Gemini(id="gemini-2.0-flash-001"), 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/google/gemini/image_input.py | cookbook/11_models/google/gemini/image_input.py | from agno.agent import Agent
from agno.media import Image
from agno.models.google import Gemini
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Gemini(id="gemini-2.0-flash-exp"),
tools=[DuckDuckGoTools()],
markdown=True,
)
agent.print_response(
"Tell me about this image and give... | 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/image_generation_stream.py | cookbook/11_models/google/gemini/image_generation_stream.py | import base64
from io import BytesIO
from agno.agent import Agent, RunOutput # noqa
from agno.db.in_memory import InMemoryDb
from agno.models.google import Gemini
from PIL import Image
# No system message should be provided
agent = Agent(
model=Gemini(
id="gemini-2.0-flash-exp-image-generation",
... | 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/audio_input_file_upload.py | cookbook/11_models/google/gemini/audio_input_file_upload.py | from pathlib import Path
from agno.agent import Agent
from agno.media import Audio
from agno.models.google import Gemini
from google.genai.types import UploadFileConfig
model = Gemini(id="gemini-2.0-flash-exp")
agent = Agent(
model=model,
markdown=True,
)
# Please download a sample audio file to test this 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/google/gemini/retry.py | cookbook/11_models/google/gemini/retry.py | """Example demonstrating how to set up retries with Google Gemini."""
from agno.agent import Agent
from agno.models.google import Gemini
# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "gemini-wrong-id"
agent = Agent(
model=Gemini(
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/google/gemini/__init__.py | cookbook/11_models/google/gemini/__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/imagen_tool_advanced.py | cookbook/11_models/google/gemini/imagen_tool_advanced.py | """🔧 Example: Using the GeminiTools Toolkit for Image Generation
An Agent using the Gemini image generation tool.
Make sure to set the Vertex AI credentials. Here's the authentication guide: https://cloud.google.com/sdk/docs/initializing
Run `pip install google-genai agno` to install the required packages.
"""
fro... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/google/gemini/async_image_generation_stream.py | cookbook/11_models/google/gemini/async_image_generation_stream.py | import asyncio
import base64
from io import BytesIO
from agno.agent import Agent, RunOutput # noqa
from agno.db.in_memory import InMemoryDb
from agno.models.google import Gemini
from PIL import Image
# No system message should be provided
agent = Agent(
model=Gemini(
id="gemini-2.0-flash-exp-image-genera... | 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.py | cookbook/11_models/google/gemini/vertexai.py | """
To use Vertex AI, with the Gemini Model class, you need to set the following environment variables:
export GOOGLE_GENAI_USE_VERTEXAI="true"
export GOOGLE_CLOUD_PROJECT="your-project-id"
export GOOGLE_CLOUD_LOCATION="your-location"
Or you can set the following parameters in the `Gemini` class:
gemini = Gemini(
... | 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/image_generation.py | cookbook/11_models/google/gemini/image_generation.py | from io import BytesIO
from agno.agent import Agent, RunOutput # noqa
from agno.models.google import Gemini
from PIL import Image
# No system message should be provided
agent = Agent(
model=Gemini(
id="gemini-2.0-flash-exp-image-generation",
response_modalities=["Text", "Image"],
)
)
# 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/google/gemini/structured_output.py | cookbook/11_models/google/gemini/structured_output.py | from typing import Optional, Union
from agno.agent import Agent
from agno.models.google import Gemini
from pydantic import BaseModel, Field
class ContactInfo(BaseModel):
"""Contact information with structured properties"""
contact_name: str = Field(description="Name of the contact person")
contact_metho... | 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_bytes_content.py | cookbook/11_models/google/gemini/video_input_bytes_content.py | import requests
from agno.agent import Agent
from agno.media import Video
from agno.models.google import Gemini
agent = Agent(
model=Gemini(id="gemini-2.0-flash-exp"),
markdown=True,
)
url = "https://videos.pexels.com/video-files/5752729/5752729-uhd_2560_1440_30fps.mp4"
# Download the video file from the URL... | 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/url_context_with_search.py | cookbook/11_models/google/gemini/url_context_with_search.py | """Combine URL context with Google Search for comprehensive web analysis.
Run `pip install google-generativeai` to install dependencies.
"""
from agno.agent import Agent
from agno.models.google import Gemini
# Create agent with both Google Search and URL context enabled
agent = Agent(
model=Gemini(id="gemini-2.5... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/google/gemini/storage_and_memory.py | cookbook/11_models/google/gemini/storage_and_memory.py | """Run `pip install ddgs pgvector google.genai` to install dependencies."""
from agno.agent import Agent
from agno.db.postgres.postgres import PostgresDb
from agno.knowledge import PDFUrlKnowledgeBase
from agno.models.google import Gemini
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.vectordb.pgvector 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/google/gemini/async_basic.py | cookbook/11_models/google/gemini/async_basic.py | import asyncio
from agno.agent import Agent, RunOutput # noqa
from agno.models.google import Gemini
agent = Agent(
model=Gemini(
id="gemini-2.0-flash-001",
instructions=["You are a basic agent that writes short stories."],
),
markdown=True,
)
# Get the response in a variable
# run: RunOu... | 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_basic.py | cookbook/11_models/google/gemini/file_search_basic.py | from pathlib import Path
from agno.agent import Agent
from agno.models.google import Gemini
# Create Gemini model
model = Gemini(id="gemini-2.5-flash")
# Create agent with the model
agent = Agent(model=model, markdown=True)
print("Creating File Search store...")
store = model.create_file_search_store(display_name="... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/google/gemini/audio_input_bytes_content.py | cookbook/11_models/google/gemini/audio_input_bytes_content.py | import requests
from agno.agent import Agent
from agno.media import Audio
from agno.models.google import Gemini
agent = Agent(
model=Gemini(id="gemini-2.0-flash-exp"),
markdown=True,
)
url = "https://openaiassets.blob.core.windows.net/$web/API/docs/audio/alloy.wav"
# Download the audio file from the URL as b... | 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_advanced.py | cookbook/11_models/google/gemini/file_search_advanced.py | from pathlib import Path
from agno.agent import Agent
from agno.models.google import Gemini
# Create Gemini model
model = Gemini(id="gemini-2.5-flash")
# Create agent
agent = Agent(model=model, markdown=True)
print("=" * 60)
print("Setting up multiple File Search stores...")
print("=" * 60)
# Create two different ... | 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/vertexai/retry.py | cookbook/11_models/vertexai/retry.py | """Example demonstrating how to set up retries with Vertex AI."""
from agno.agent import Agent
from agno.models.vertexai import Claude
# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "vertexai-claude-wrong-id"
agent = Agent(
model=Claude(
id=wrong_model_id,
retri... | 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/vertexai/__init__.py | cookbook/11_models/vertexai/__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/vertexai/claude/pdf_input_bytes.py | cookbook/11_models/vertexai/claude/pdf_input_bytes.py | from pathlib import Path
from agno.agent import Agent
from agno.media import File
from agno.models.vertexai.claude 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://agn... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/vertexai/claude/image_input_url.py | cookbook/11_models/vertexai/claude/image_input_url.py | from agno.agent import Agent
from agno.media import Image
from agno.models.vertexai.claude 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 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/vertexai/claude/tool_use_stream.py | cookbook/11_models/vertexai/claude/tool_use_stream.py | """Run `pip install ddgs` to install dependencies."""
from agno.agent import Agent
from agno.models.vertexai.claude import Claude
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Claude(id="claude-sonnet-4@20250514"),
tools=[DuckDuckGoTools()],
markdown=True,
)
agent.print_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/vertexai/claude/image_input_bytes.py | cookbook/11_models/vertexai/claude/image_input_bytes.py | from pathlib import Path
from agno.agent import Agent
from agno.media import Image
from agno.models.vertexai.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/vertexai/claude/structured_output_stream.py | cookbook/11_models/vertexai/claude/structured_output_stream.py | from typing import Dict, List
from agno.agent import Agent
from agno.models.vertexai.claude 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/vertexai/claude/pdf_input_local.py | cookbook/11_models/vertexai/claude/pdf_input_local.py | from pathlib import Path
from agno.agent import Agent
from agno.media import File
from agno.models.vertexai.claude 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://agn... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/vertexai/claude/thinking.py | cookbook/11_models/vertexai/claude/thinking.py | from agno.agent import Agent
from agno.models.vertexai.claude import Claude
agent = Agent(
model=Claude(
id="claude-sonnet-4@20250514",
max_tokens=2048,
thinking={"type": "enabled", "budget_tokens": 1024},
),
markdown=True,
)
# Print the response in the terminal
agent.print_respons... | 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/vertexai/claude/memory.py | cookbook/11_models/vertexai/claude/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/vertexai/claude/db.py | cookbook/11_models/vertexai/claude/db.py | """Run `pip install ddgs sqlalchemy anthropic` to install dependencies."""
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.vertexai.claude import Claude
from agno.tools.duckduckgo import DuckDuckGoTools
# Setup the database
db = SqliteDb(db_file="tmp/data.db")
agent = Agent(
mod... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/vertexai/claude/async_tool_use.py | cookbook/11_models/vertexai/claude/async_tool_use.py | """
Async example using Claude with tool calls.
"""
import asyncio
from agno.agent import Agent
from agno.models.vertexai.claude import Claude
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Claude(id="claude-sonnet-4@20250514"),
tools=[DuckDuckGoTools()],
markdown=True,
)
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/vertexai/claude/basic_stream.py | cookbook/11_models/vertexai/claude/basic_stream.py | from typing import Iterator # noqa
from agno.agent import Agent, RunOutputEvent # noqa
from agno.models.vertexai.claude import Claude
agent = Agent(model=Claude(id="claude-sonnet-4@20250514"))
# Get the response in a variable
# run_response: Iterator[RunOutputEvent] = agent.run("Share a 2 sentence horror story", 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/vertexai/claude/knowledge.py | cookbook/11_models/vertexai/claude/knowledge.py | """Run `pip install ddgs sqlalchemy pgvector pypdf anthropic openai` to install dependencies."""
from agno.agent import Agent
from agno.knowledge.embedder.openai import OpenAIEmbedder
from agno.knowledge.knowledge import Knowledge
from agno.models.vertexai.claude import Claude
from agno.vectordb.pgvector import PgVect... | 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/vertexai/claude/thinking_stream.py | cookbook/11_models/vertexai/claude/thinking_stream.py | from agno.agent import Agent
from agno.models.vertexai.claude import Claude
agent = Agent(
model=Claude(
id="claude-sonnet-4@20250514",
max_tokens=2048,
thinking={"type": "enabled", "budget_tokens": 1024},
),
markdown=True,
)
# Print the response in the terminal
agent.print_respons... | 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/vertexai/claude/tool_use.py | cookbook/11_models/vertexai/claude/tool_use.py | """Run `pip install ddgs` to install dependencies."""
from agno.agent import Agent
from agno.models.vertexai.claude import Claude
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Claude(id="claude-sonnet-4@20250514"),
tools=[DuckDuckGoTools()],
markdown=True,
)
agent.print_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/vertexai/claude/basic.py | cookbook/11_models/vertexai/claude/basic.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.vertexai.claude import Claude
agent = Agent(model=Claude(id="claude-sonnet-4@20250514"), 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 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/vertexai/claude/async_basic_stream.py | cookbook/11_models/vertexai/claude/async_basic_stream.py | """
Basic streaming async example using Claude.
"""
import asyncio
from agno.agent import Agent
from agno.models.vertexai.claude 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/vertexai/claude/betas.py | cookbook/11_models/vertexai/claude/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.vertexai.claude import Claude
# Setup ... | 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/vertexai/claude/__init__.py | cookbook/11_models/vertexai/claude/__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/vertexai/claude/prompt_caching.py | cookbook/11_models/vertexai/claude/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/vertexai/claude/structured_output.py | cookbook/11_models/vertexai/claude/structured_output.py | from typing import List
from agno.agent import Agent, RunOutput # noqa
from agno.models.vertexai.claude 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 blockbuste... | 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/vertexai/claude/basic_with_timeout.py | cookbook/11_models/vertexai/claude/basic_with_timeout.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.vertexai.claude import Claude
agent = Agent(model=Claude(id="claude-sonnet-4@20250514", timeout=5), 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/vertexai/claude/async_basic.py | cookbook/11_models/vertexai/claude/async_basic.py | """
Basic async example using Claude.
"""
import asyncio
from agno.agent import Agent
from agno.models.vertexai.claude 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/clients/http_client_caching.py | cookbook/11_models/clients/http_client_caching.py | """
⚙️ Global HTTP Client Customization (Cookbook)
Demonstrates how to define a single global `httpx.Client`
so that all agno Agents (OpenAI, Anthropic, internal models, etc.)
share consistent behavior: logging, headers, request IDs, and retries.
Use cases:
- Company-wide auth headers and tracking
- Unified logging 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/clients/__init__.py | cookbook/11_models/clients/__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/perplexity/web_search.py | cookbook/11_models/perplexity/web_search.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.perplexity import Perplexity
agent = Agent(model=Perplexity(id="sonar-pro"), markdown=True)
# Print the response in the terminal
agent.print_response("Show me top 2 news stories from USA?")
# Get the response in a variable
# run: RunOutput = agent.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/perplexity/memory.py | cookbook/11_models/perplexity/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 openai sqlalchemy 'psycopg[binary]' pgvector` to install the dependencies
3. Run: `python cookbook/agents/personalized_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/perplexity/basic_stream.py | cookbook/11_models/perplexity/basic_stream.py | from typing import Iterator # noqa
from agno.agent import Agent, RunOutput # noqa
from agno.models.perplexity import Perplexity
agent = Agent(model=Perplexity(id="sonar"), markdown=True)
# Get the response in a variable
# run_response: Iterator[RunOutputEvent] = agent.run("Share a 2 sentence horror story", stream=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/perplexity/knowledge.py | cookbook/11_models/perplexity/knowledge.py | """Run `pip install ddgs sqlalchemy pgvector pypdf openai google.generativeai` to install dependencies."""
from agno.agent import Agent
from agno.knowledge.embedder.openai import OpenAIEmbedder
from agno.knowledge.knowledge import Knowledge
from agno.models.perplexity import Perplexity
from agno.vectordb.pgvector 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/perplexity/basic.py | cookbook/11_models/perplexity/basic.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.perplexity import Perplexity
agent = Agent(model=Perplexity(id="sonar-pro"), 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... | 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/perplexity/async_basic_stream.py | cookbook/11_models/perplexity/async_basic_stream.py | import asyncio
from typing import Iterator # noqa
from agno.agent import Agent, RunOutputEvent # noqa
from agno.models.perplexity import Perplexity
agent = Agent(model=Perplexity(id="sonar"), markdown=True)
# Get the response in a variable
# run_response: Iterator[RunOutputEvent] = agent.run("Share a 2 sentence ho... | 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/perplexity/retry.py | cookbook/11_models/perplexity/retry.py | """Example demonstrating how to set up retries with Perplexity."""
from agno.agent import Agent
from agno.models.perplexity import Perplexity
# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "perplexity-wrong-id"
agent = Agent(
model=Perplexity(
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/perplexity/__init__.py | cookbook/11_models/perplexity/__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/perplexity/structured_output.py | cookbook/11_models/perplexity/structured_output.py | from typing import List
from agno.agent import Agent, RunOutput # noqa
from agno.models.perplexity import Perplexity
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/perplexity/async_basic.py | cookbook/11_models/perplexity/async_basic.py | import asyncio
from agno.agent import Agent, RunOutput # noqa
from agno.models.perplexity import Perplexity
agent = Agent(model=Perplexity(id="sonar"), 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 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/deepseek/async_tool_use.py | cookbook/11_models/deepseek/async_tool_use.py | """
Async example using DeepSeek with tool calls.
"""
import asyncio
from agno.agent import Agent
from agno.models.deepseek import DeepSeek
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=DeepSeek(id="deepseek-chat"),
tools=[DuckDuckGoTools()],
markdown=True,
)
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/deepseek/basic_stream.py | cookbook/11_models/deepseek/basic_stream.py | from agno.agent import Agent, RunOutputEvent # noqa
from agno.models.deepseek import DeepSeek
agent = Agent(model=DeepSeek(id="deepseek-chat"), 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_respo... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/deepseek/reasoning_agent.py | cookbook/11_models/deepseek/reasoning_agent.py | from agno.agent import Agent
from agno.models.deepseek import DeepSeek
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 canniba... | 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/deepseek/tool_use.py | cookbook/11_models/deepseek/tool_use.py | """Run `pip install ddgs` to install dependencies."""
from agno.agent import Agent
from agno.models.deepseek import DeepSeek
from agno.tools.duckduckgo import DuckDuckGoTools
"""
The current version of the deepseek-chat model's Function Calling capabilitity is unstable, which may result in looped calls or empty respo... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/deepseek/async_basic_streaming.py | cookbook/11_models/deepseek/async_basic_streaming.py | """
Basic streaming async example using DeepSeek.
"""
import asyncio
from agno.agent import Agent
from agno.models.deepseek import DeepSeek
agent = Agent(
model=DeepSeek(id="deepseek-chat"),
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/deepseek/basic.py | cookbook/11_models/deepseek/basic.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.deepseek import DeepSeek
agent = Agent(model=DeepSeek(id="deepseek-chat"), 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.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/deepseek/retry.py | cookbook/11_models/deepseek/retry.py | """Example demonstrating how to set up retries with DeepSeek."""
from agno.agent import Agent
from agno.models.deepseek import DeepSeek
# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "deepseek-wrong-id"
agent = Agent(
model=DeepSeek(
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/deepseek/__init__.py | cookbook/11_models/deepseek/__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/deepseek/thinking_tool_calls.py | cookbook/11_models/deepseek/thinking_tool_calls.py | """Run `pip install ddgs` to install dependencies."""
from agno.agent import Agent
from agno.models.deepseek import DeepSeek
from agno.tools.duckduckgo import DuckDuckGoTools
"""
DeepSeek model's thinking mode now supports tool calls.
Before outputting the final answer, the model can engage in multiple turns of reas... | 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/deepseek/structured_output.py | cookbook/11_models/deepseek/structured_output.py | from typing import List
from agno.agent import Agent, RunOutput # noqa
from agno.models.deepseek import DeepSeek
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/deepseek/async_basic.py | cookbook/11_models/deepseek/async_basic.py | """
Basic async example using DeepSeek.
"""
import asyncio
from agno.agent import Agent
from agno.models.deepseek import DeepSeek
agent = Agent(
model=DeepSeek(id="deepseek-chat"),
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/deepinfra/json_output.py | cookbook/11_models/deepinfra/json_output.py | from typing import List
from agno.agent import Agent, RunOutput # noqa
from agno.models.deepinfra import DeepInfra # noqa
from pydantic import BaseModel, Field
from rich.pretty import pprint # noqa
class MovieScript(BaseModel):
setting: str = Field(
..., description="Provide a nice setting for a block... | 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/deepinfra/async_tool_use.py | cookbook/11_models/deepinfra/async_tool_use.py | """Run `pip install ddgs` to install dependencies."""
import asyncio
from agno.agent import Agent # noqa
from agno.models.deepinfra import DeepInfra # noqa
from agno.tools.duckduckgo import DuckDuckGoTools # noqa
agent = Agent(
model=DeepInfra(id="meta-llama/Llama-2-70b-chat-hf"),
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/deepinfra/basic_stream.py | cookbook/11_models/deepinfra/basic_stream.py | from typing import Iterator # noqa
from agno.agent import Agent, RunOutputEvent # noqa
from agno.models.deepinfra import DeepInfra # noqa
agent = Agent(
model=DeepInfra(id="meta-llama/Llama-2-70b-chat-hf"),
markdown=True,
)
# Get the response in a variable
run_response: Iterator[RunOutputEvent] = agent.ru... | 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/deepinfra/tool_use.py | cookbook/11_models/deepinfra/tool_use.py | """Run `pip install ddgs` to install dependencies."""
from agno.agent import Agent # noqa
from agno.models.deepinfra import DeepInfra # noqa
from agno.tools.duckduckgo import DuckDuckGoTools # noqa
agent = Agent(
model=DeepInfra(id="meta-llama/Llama-2-70b-chat-hf"),
tools=[DuckDuckGoTools()],
markdown=... | 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/deepinfra/basic.py | cookbook/11_models/deepinfra/basic.py | from agno.agent import Agent, RunOutput # noqa
from agno.models.deepinfra import DeepInfra # noqa
agent = Agent(
model=DeepInfra(id="meta-llama/Llama-2-70b-chat-hf"),
markdown=True,
)
# Get the response in a variable
# run: RunOutput = agent.run("Share a 2 sentence horror story")
# print(run.content)
# 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/deepinfra/async_basic_stream.py | cookbook/11_models/deepinfra/async_basic_stream.py | import asyncio
from typing import Iterator # noqa
from agno.agent import Agent, RunOutputEvent # noqa
from agno.models.deepinfra import DeepInfra # noqa
agent = Agent(
model=DeepInfra(id="meta-llama/Llama-2-70b-chat-hf"),
markdown=True,
)
# Print the response in the terminal
asyncio.run(agent.aprint_respo... | python | Apache-2.0 | 26b9daa0fb760c3ad8384e1ba9218b1bce854535 | 2026-01-04T14:41:49.609528Z | false |
agno-agi/agno | https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/11_models/deepinfra/retry.py | cookbook/11_models/deepinfra/retry.py | """Example demonstrating how to set up retries with DeepInfra."""
from agno.agent import Agent
from agno.models.deepinfra import DeepInfra
# We will use a deliberately wrong model ID, to trigger retries.
wrong_model_id = "deepinfra-wrong-id"
agent = Agent(
model=DeepInfra(
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/deepinfra/__init__.py | cookbook/11_models/deepinfra/__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.