Set your OpenAI API key as an environment variable:
export OPENAI_API_KEY=your_api_key_here
3
Create Script
Create a new file video_analyzer.py:
from praisonaiagents import Agent, Task, PraisonAIAgents# Create Video Analysis Agentvideo_agent = Agent( name="VideoAnalyst", role="Video Analysis Specialist", goal="Analyze videos to extract meaningful information", backstory="""You are an expert in computer vision and video analysis. You excel at describing content, detecting objects, and understanding context.""", llm="gpt-4o-mini", self_reflect=False)# Create video analysis taskanalysis_task = Task( name="analyze_video", description="""Analyze this video and provide: 1. Summary of main events 2. Key objects and people 3. Text and important information 4. Context and setting""", expected_output="Comprehensive video analysis", agent=video_agent, images=["video.mp4"])# Create PraisonAIAgents instanceagents = PraisonAIAgents( agents=[video_agent], tasks=[analysis_task], process="sequential", verbose=1)# Run analysisagents.start()