Vision Agent • AI Agent SDK
VisionAgent: A specialized agent for image analysis and understanding.
VisionAgent
Defined in the Vision Agent module.
AI Agent
A specialized agent for image analysis and understanding.
Provides:
- Image analysis and description
- Multi-image comparison
- Text extraction from images
Supported Providers: – OpenAI: gpt-4o, gpt-4o-mini, gpt-4-turbo – Anthropic: claude-3-5-sonnet-20241022, claude-3-opus-20240229 – Google: gemini/gemini-1.5-pro, gemini/gemini-1.5-flash
Constructor
Optional[str]No description available.
Optional[str]No description available.
Optional[str]No description available.
Optional[str]No description available.
Optional[str]No description available.
Optional[str]No description available.
OptionalNo description available.
Union[bool, int]No description available.
Methods
Lazily initialize Rich Console.
litellm()Lazy load litellm module when needed.
analyze()Analyze an image and return analysis.
describe()Generate a detailed description of an image.
compare()Compare multiple images.
extract_text()Extract text from an image (OCR-like functionality).
aanalyze()Async version of analyze().
adescribe()Async version of describe().
acompare()Async version of compare().
aextract_text()Async version of extract_text().
Usage
from praisonaiagents import VisionAgent
# Simple usage
agent = VisionAgent()
description = agent.describe("https://example.com/image.jpg")
print(description)
# Analyze with custom prompt
result = agent.analyze(
"https://example.com/chart.png",
prompt="What data does this chart show?"
)
# Compare images
comparison = agent.compare([
"image1.jpg",
"image2.jpg"
])
# Extract text
text = agent.extract_text("document.png")Source
View on GitHubpraisonaiagents/agent/vision_agent.py at line 47