Added new demo

This commit is contained in:
ShubhamSaboo 2024-07-14 21:28:48 -05:00
parent 2cac446ffd
commit 49df320fce
4 changed files with 131 additions and 0 deletions

View file

@ -29,6 +29,7 @@ A curated collection of awesome LLM apps built with RAG and AI agents. This repo
- [🗞️ AI Journalist Agent](#-ai-journalist-agent)
- [💰 AI Personal Finance Agent](#-ai-personal-finance-agent)
- [🛫 AI Travel Agent](#-ai-travel-agent)
- [🎬 AI Movie Production Agent](#-ai-movie-production-agent)
- [📰 Multi-Agent AI Researcher](#-multi-agent-ai-researcher)
- [📄 Chat with PDF](#-chat-with-pdf)
- [💻 Web Scraping AI Agent](#-web-scraping-ai-agent)
@ -67,6 +68,9 @@ AI-powered personal finance planner that generates personalized financial plans
### 🛫 AI Travel Agent
AI-powered travel Agent that generates personalized travel itineraries using OpenAI GPT-4o. It automates the process of researching, planning, and organizing your dream vacation, allowing you to explore exciting destinations with ease.
### 🎬 AI Movie Production Agent
AI-powered movie production assistant that helps bring your movie ideas to life using Claude 3.5 Sonnet model. It automates the process of script writing and casting, allowing you to create compelling movie concepts with ease.
### 📰 Multi-Agent AI Researcher
Use a team of AI agents to research top HackerNews stories and users with GPT-4 to generate blog posts, reports, and social media content on autopilot.

View file

@ -0,0 +1,39 @@
## 🎬 AI Movie Production Agent
This Streamlit app is an AI-powered movie production assistant that helps bring your movie ideas to life using Claude 3.5 Sonnet model. It automates the process of script writing and casting, allowing you to create compelling movie concepts with ease.
### Features
- Generates script outlines based on your movie idea, genre, and target audience
- Suggests suitable actors for main roles, considering their past performances and current availability
- Provides a concise movie concept overview
### How to get Started?
1. Clone the GitHub repository
```bash
git clone https://github.com/Shubhamsaboo/awesome-llm-apps.git
```
2. Install the required dependencies:
```bash
pip install -r requirements.txt
```
3. Get your Anthropic API Key
- Sign up for an [Anthropic account](https://console.anthropic.com) (or the LLM provider of your choice) and obtain your API key.
4. Get your SerpAPI Key
- Sign up for an [SerpAPI account](https://serpapi.com/) and obtain your API key.
5. Run the Streamlit App
```bash
streamlit run movie_production_agent.py
```
### How it Works?
The AI Movie Production Agent utilizes three main components:
- **ScriptWriter**: Develops a compelling script outline with character descriptions and key plot points based on the given movie idea and genre.
- **CastingDirector**: Suggests suitable actors for the main roles, considering their past performances and current availability.
- **MovieProducer**: Oversees the entire process, coordinating between the ScriptWriter and CastingDirector, and providing a concise movie concept overview.

View file

@ -0,0 +1,83 @@
# Import the required libraries
import streamlit as st
from phi.assistant import Assistant
from phi.tools.serpapi_tools import SerpApiTools
from phi.llm.anthropic import Claude
from textwrap import dedent
# Set up the Streamlit app
st.title("AI Movie Production Agent 🎬")
st.caption("Bring your movie ideas to life with the teams of script writing and casting AI agents")
# Get Anthropic API key from user
anthropic_api_key = st.text_input("Enter Anthropic API Key to access Claude Sonnet 3.5", type="password")
# Get SerpAPI key from the user
serp_api_key = st.text_input("Enter Serp API Key for Search functionality", type="password")
if anthropic_api_key and serp_api_key:
script_writer = Assistant(
name="ScriptWriter",
llm=Claude(model="claude-3-5-sonnet-20240620", api_key=anthropic_api_key),
description=dedent(
"""\
You are an expert screenplay writer. Given a movie idea and genre,
develop a compelling script outline with character descriptions and key plot points.
"""
),
instructions=[
"Write a script outline with 3-5 main characters and key plot points.",
"Outline the three-act structure and suggest 2-3 twists.",
"Ensure the script aligns with the specified genre and target audience.",
],
)
casting_director = Assistant(
name="CastingDirector",
llm=Claude(model="claude-3-5-sonnet-20240620", api_key=anthropic_api_key),
description=dedent(
"""\
You are a talented casting director. Given a script outline and character descriptions,
suggest suitable actors for the main roles, considering their past performances and current availability.
"""
),
instructions=[
"Suggest 2-3 actors for each main role.",
"Check actors' current status using `search_google`.",
"Provide a brief explanation for each casting suggestion.",
"Consider diversity and representation in your casting choices.",
],
tools=[SerpApiTools(api_key=serp_api_key)],
)
movie_producer = Assistant(
name="MovieProducer",
llm=Claude(model="claude-3-5-sonnet-20240620", api_key=anthropic_api_key),
team=[script_writer, casting_director],
description="Experienced movie producer overseeing script and casting.",
instructions=[
"Ask ScriptWriter for a script outline based on the movie idea.",
"Pass the outline to CastingDirector for casting suggestions.",
"Summarize the script outline and casting suggestions.",
"Provide a concise movie concept overview.",
],
markdown=True,
)
# Input field for the report query
movie_idea = st.text_area("Describe your movie idea in a few sentences:")
genre = st.selectbox("Select the movie genre:",
["Action", "Comedy", "Drama", "Sci-Fi", "Horror", "Romance", "Thriller"])
target_audience = st.selectbox("Select the target audience:",
["General", "Children", "Teenagers", "Adults", "Mature"])
estimated_runtime = st.slider("Estimated runtime (in minutes):", 60, 180, 120)
# Process the movie concept
if st.button("Develop Movie Concept"):
with st.spinner("Developing movie concept..."):
input_text = (
f"Movie idea: {movie_idea}, Genre: {genre}, "
f"Target audience: {target_audience}, Estimated runtime: {estimated_runtime} minutes"
)
# Get the response from the assistant
response = movie_producer.run(input_text, stream=False)
st.write(response)

View file

@ -0,0 +1,5 @@
streamlit
phidata
anthropic
google-search-results
lxml_html_clean