Code
cookbook/models/xai/image_agent_with_memory.py
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
You are viewing v1 docs. For the latest documentation, visit docs.agno.com
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_messages=True,
num_history_responses=3,
)
agent.print_response(
"Tell me about this image and give me the latest news about it.",
images=[
Image(
url="https://upload.wikimedia.org/wikipedia/commons/0/0c/GoldenGateBridge-001.jpg"
)
],
)
agent.print_response("Tell me where I can get more images?")
Create a virtual environment
Terminal and create a python virtual environment.python3 -m venv .venv
source .venv/bin/activate
Was this page helpful?