Badro commited on
Commit
5d6fe45
·
1 Parent(s): 3537ff0

Deploy YouTube analysis tools to Clip-Engine Space

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py CHANGED
@@ -3,3 +3,21 @@ import gradio as gr
3
  from pytube import YouTube
4
  # ... more of your code ...
5
  youtube_tool_interface.launch(mcp_server=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  from pytube import YouTube
4
  # ... more of your code ...
5
  youtube_tool_interface.launch(mcp_server=True)
6
+ # app.py
7
+ # ... (your imports and function definitions for analyze_youtube_content) ...
8
+
9
+ youtube_tool_interface = gr.Interface(
10
+ fn=analyze_youtube_content,
11
+ inputs=[
12
+ gr.Textbox(label="YouTube Video URL (Optional)", placeholder="Enter YouTube video URL..."),
13
+ gr.Textbox(label="Video Transcript Text (Optional)", placeholder="Paste video transcript here...", lines=5)
14
+ ],
15
+ outputs=gr.JSON(label="Analysis Result"),
16
+ title="YouTube Content Analyzer Tool",
17
+ description="Provides information and sentiment analysis for a YouTube video URL or its transcript. (For Agent Use via MCP)"
18
+ )
19
+
20
+ if __name__ == "__main__":
21
+ logging.info("Launching Gradio app with MCP server enabled for the YouTube Content Analyzer Tool...")
22
+ # The `mcp_server=True` flag is crucial for the agent to connect and use the tool.
23
+ youtube_tool_interface.launch(mcp_server=True) # <<< MAKE SURE THIS IS CORRECT