|
import streamlit as st |
|
import openai |
|
|
|
|
|
openai.api_key = st.secrets["OPENAI_API_KEY"] |
|
|
|
st.title("Holiday Video Script Generator for Realtors") |
|
|
|
|
|
agent_name = st.text_input("Your Name", placeholder="Enter your name") |
|
community_focus = st.text_input("Community Focus", placeholder="Enter the community or area you focus on") |
|
holiday_theme = st.selectbox("Holiday Theme", ["Christmas", "Hanukkah", "New Year's", "General Holiday Season"]) |
|
personal_message = st.text_area("Personal Message", placeholder="Enter any personal message or story you want to include") |
|
|
|
if st.button('Generate Script'): |
|
|
|
user_input = ( |
|
f"""You are an AI assistant that helps real estate agents create compelling holiday video scripts. The script should be festive, engaging, and approximately one minute long. Include elements like community engagement, local highlights, market insights, home decoration tips, and a personalized message. The agent's name is {agent_name}. They focus on the {community_focus} community. The holiday theme is {holiday_theme}. They want to include the following personal message: {personal_message}. |
|
""" |
|
) |
|
|
|
|
|
response = openai.ChatCompletion.create( |
|
model="gpt-4", |
|
messages=[ |
|
{"role": "system", "content": "You are a helpful assistant."}, |
|
{"role": "user", "content": user_input} |
|
] |
|
) |
|
|
|
|
|
st.write(response.choices[0].message['content']) |
|
|