Skip to content

Commit

Permalink
removed video
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayush0054 committed Dec 30, 2024
1 parent cf70297 commit 33cad6d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
9 changes: 2 additions & 7 deletions cookbook/agents/48_video_caption_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
from phi.tools.openai import OpenAITools



# Create a single tool instance instead of multiple ones
video_tools = MoviePyVideoTools(process_video=True, generate_captions=True, embed_captions=True)

# Define the tools schema for OpenAI

openai_tools = OpenAITools()

video_caption_agent = Agent(
Expand All @@ -31,8 +29,5 @@


video_caption_agent.print_response(
"Generate captions for cookbook/examples/caption_video_tool/React in 100 Seconds.mp4 and embed them in the video"
"Generate captions for {video with location} and embed them in the video"
)
# video_caption_agent.print_response(
# "read the captions for /Users/ayushjha/Downloads/videoplayback (1).mp4 and summarize them"
# )
Binary file not shown.
30 changes: 30 additions & 0 deletions cookbook/tools/moviepy_video_tools.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from phi.agent import Agent
from phi.model.openai import OpenAIChat
from phi.tools.moviepy_video_tools import MoviePyVideoTools
from phi.tools.openai import OpenAITools


video_tools = MoviePyVideoTools(process_video=True, generate_captions=True, embed_captions=True)

openai_tools = OpenAITools()

video_caption_agent = Agent(
name="Video Caption Generator Agent",
model=OpenAIChat(
id="gpt-4o",
),
tools=[video_tools, openai_tools],
description="You are an AI agent that can generate and embed captions for videos.",
instructions=[
"When a user provides a video, process it to generate captions.",
"Use the video processing tools in this sequence:",
"1. Extract audio from the video using extract_audio",
"2. Transcribe the audio using transcribe_audio",
"3. Generate SRT captions using create_srt",
"4. Embed captions into the video using embed_captions",
],
markdown=True,
)


video_caption_agent.print_response("Generate captions for {video with location} and embed them in the video")

0 comments on commit 33cad6d

Please sign in to comment.