Agent with Vision
Create agents capable of processing and analyzing images.
Quick Start#
Clone the Complete Example#
The easiest way to get started is to clone the complete example repository:
git clone https://github.com/astreus-ai/examples
cd examples/agent-with-vision
npm installOr Install Package Only#
If you prefer to build from scratch:
npm install @astreus-ai/astreusEnvironment Setup#
# .env
# Vision-capable model API key
OPENAI_API_KEY=sk-your-openai-api-key-here
# Database for agent persistence
DB_URL=sqlite://./astreus.dbVision Agent#
import { Agent } from '@astreus-ai/astreus';
const agent = await Agent.create({
name: 'VisionBot',
model: 'gpt-4o',
visionModel: 'gpt-4o',
vision: true,
systemPrompt: 'You can analyze and describe images in detail.'
});
// Analyze an image
const result = await agent.ask("Analyze this image and describe what you see", {
attachments: [{
type: 'image',
path: './screenshot.png'
}]
});
console.log(result); // Detailed image analysisRunning the Example#
If you cloned the repository:
npm run devRepository#
The complete example is available on GitHub: examples/agent-with-vision