image_agent.py with the following code:
image_agent.py
Usage
1
Create a virtual environment
Open the
Terminal and create a python virtual environment.2
Install libraries
3
Run the agent
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
image_agent.py with the following code:
from phi.agent import Agent
from phi.model.openai import OpenAIChat
agent = Agent(
model=OpenAIChat(id="gpt-4o"),
markdown=True,
)
agent.print_response(
"What are in these images? Is there any difference between them?",
images=[
"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
],
)
Create a virtual environment
Terminal and create a python virtual environment.python3 -m venv ~/.venvs/aienv
source ~/.venvs/aienv/bin/activate
python3 -m venv aienv
aienv/scripts/activate
Install libraries
pip install openai phidata
Run the agent
python image_agent.py
Was this page helpful?