Commit
·
d6f549d
1
Parent(s):
e7769e3
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,9 +8,12 @@ st.title("Holiday Video Script Generator for Real Estate Agents")
|
|
| 8 |
|
| 9 |
# User inputs
|
| 10 |
agent_name = st.text_input("Your Name", placeholder="Enter your name")
|
| 11 |
-
|
|
|
|
|
|
|
| 12 |
holiday_theme = st.text_input("Holiday Theme", placeholder="Enter a specific holiday theme or message (e.g., community spirit, gratitude, holiday events)")
|
| 13 |
call_to_action = st.text_input("Call to Action", placeholder="Enter your desired call to action (e.g., visit your website, schedule a consultation)")
|
|
|
|
| 14 |
|
| 15 |
initial_messages = [{
|
| 16 |
"role": "system",
|
|
@@ -24,11 +27,11 @@ initial_messages = [{
|
|
| 24 |
|
| 25 |
if st.button('Generate Script'):
|
| 26 |
# Process the inputs and call the OpenAI API
|
| 27 |
-
user_input = f"Create a holiday video script for a real estate agent named {agent_name}
|
| 28 |
|
| 29 |
# Call the OpenAI API with the chat model
|
| 30 |
response = openai.ChatCompletion.create(
|
| 31 |
-
model="gpt-4",
|
| 32 |
messages=[
|
| 33 |
{"role": "system", "content": initial_messages[0]["content"]},
|
| 34 |
{"role": "user", "content": user_input}
|
|
|
|
| 8 |
|
| 9 |
# User inputs
|
| 10 |
agent_name = st.text_input("Your Name", placeholder="Enter your name")
|
| 11 |
+
video_tone = st.selectbox("Video Tone", ["Whimsical", "Serious", "Friendly", "Professional", "Inspirational", "Other"])
|
| 12 |
+
if video_tone == "Other":
|
| 13 |
+
video_tone = st.text_input("Custom Video Tone", placeholder="Enter your custom tone")
|
| 14 |
holiday_theme = st.text_input("Holiday Theme", placeholder="Enter a specific holiday theme or message (e.g., community spirit, gratitude, holiday events)")
|
| 15 |
call_to_action = st.text_input("Call to Action", placeholder="Enter your desired call to action (e.g., visit your website, schedule a consultation)")
|
| 16 |
+
additional_info = st.text_area("Additional Information", placeholder="Enter any additional information you want included in the script")
|
| 17 |
|
| 18 |
initial_messages = [{
|
| 19 |
"role": "system",
|
|
|
|
| 27 |
|
| 28 |
if st.button('Generate Script'):
|
| 29 |
# Process the inputs and call the OpenAI API
|
| 30 |
+
user_input = f"Create a holiday video script for a real estate agent named {agent_name}. The video tone should be '{video_tone}'. The holiday theme is '{holiday_theme}'. Include the following additional information: '{additional_info}'. The script should end with a call to action: '{call_to_action}'."
|
| 31 |
|
| 32 |
# Call the OpenAI API with the chat model
|
| 33 |
response = openai.ChatCompletion.create(
|
| 34 |
+
model="gpt-4",
|
| 35 |
messages=[
|
| 36 |
{"role": "system", "content": initial_messages[0]["content"]},
|
| 37 |
{"role": "user", "content": user_input}
|