Set your OpenAI API key as an environment variable:
Copy
export OPENAI_API_KEY=your_api_key_here
3
Create Script
Create a new file image_analysis.py:
Copy
from praisonaiagents import Agent, Task, PraisonAIAgents# Create Image Analysis Agentimage_agent = Agent( name="ImageAnalyst", role="Image Analysis Specialist", goal="Analyze images and videos to extract meaningful information", backstory="""You are an expert in computer vision and image analysis. You excel at describing images, detecting objects, and understanding visual content.""", llm="gpt-4o-mini", self_reflect=False)# Create tasks for different types of analysistask1 = Task( name="analyze_landmark", description="Describe this famous landmark and its architectural features.", expected_output="Detailed description of the landmark's architecture and significance", agent=image_agent, images=["https://example.com/landmark.jpg"])task2 = Task( name="analyze_local_image", description="What objects can you see in this image? Describe their arrangement.", expected_output="Detailed description of objects and their spatial relationships", agent=image_agent, images=["local_image.jpg"])# Create PraisonAIAgents instanceagents = PraisonAIAgents( agents=[image_agent], tasks=[task1, task2], process="sequential", verbose=1)# Run analysisagents.start()