|
import streamlit as st |
|
import openai |
|
|
|
|
|
openai.api_key = st.secrets["YOUR_OPENAI_API_KEY"] |
|
|
|
st.title("Holiday Video Script Generator for Real Estate Agents") |
|
|
|
|
|
agent_name = st.text_input("Agent's Name", placeholder="Enter your name") |
|
neighborhood = st.text_input("Neighborhood or Area", placeholder="Enter the neighborhood or area you focus on") |
|
unique_selling_points = st.text_input("Unique Selling Points", placeholder="Mention any unique selling points or achievements from the year") |
|
personal_message = st.text_area("Personal Message", placeholder="Write a personal message you'd like to include", height=100) |
|
|
|
generate_script_button = st.button('Generate Script') |
|
|
|
if generate_script_button: |
|
|
|
user_input = f""" |
|
Create a festive and engaging one-minute holiday video script for a real estate agent named {agent_name}. The script should focus on the neighborhood of {neighborhood}, incorporate unique selling points: {unique_selling_points}, and include the personal message: {personal_message}. The script should be warm, welcoming, and build a sense of community. Keep it professional yet personal. |
|
""" |
|
|
|
|
|
response = openai.ChatCompletion.create( |
|
model="gpt-4", |
|
messages=[ |
|
{"role": "system", "content": "You are a helpful assistant."}, |
|
{"role": "user", "content": user_input} |
|
] |
|
) |
|
|
|
|
|
script = response.choices[0].message['content'].strip() |
|
st.write("### Generated Script") |
|
st.write(script) |
|
|
|
st.write("### Notes for B-roll and Music (if applicable)") |
|
st.write("Include here any notes on B-roll footage or background music that could enhance the video.") |
|
|