Update app.py
Browse files
app.py
CHANGED
@@ -77,14 +77,26 @@ def generate_podcast_script(api_key, content, duration, num_hosts):
|
|
77 |
The podcast should last approximately {duration}. Include natural speech patterns,
|
78 |
humor, and occasional off-topic thoughts. Use occasional speech fillers like um, ah,
|
79 |
yes, I see, Ok now. Vary the emotional tone.
|
|
|
80 |
Format the script as a monologue without speaker labels.
|
81 |
Separate each paragraph with a blank line.
|
82 |
-
|
|
|
|
|
|
|
83 |
Ensure the content flows naturally and stays relevant to the topic.
|
84 |
Limit the script length to match the requested duration of {duration}.
|
85 |
-
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
"""
|
89 |
else:
|
90 |
prompt = f"""
|
@@ -92,16 +104,28 @@ def generate_podcast_script(api_key, content, duration, num_hosts):
|
|
92 |
{content}
|
93 |
|
94 |
The podcast should last approximately {duration}. Include natural speech patterns,
|
95 |
-
humor, and occasional off-topic
|
96 |
yes, I see, Ok now. Vary the emotional tone.
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
|
|
|
|
|
|
|
|
101 |
Limit the script length to match the requested duration of {duration}.
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
"""
|
106 |
|
107 |
response = model.generate_content(prompt)
|
|
|
77 |
The podcast should last approximately {duration}. Include natural speech patterns,
|
78 |
humor, and occasional off-topic thoughts. Use occasional speech fillers like um, ah,
|
79 |
yes, I see, Ok now. Vary the emotional tone.
|
80 |
+
|
81 |
Format the script as a monologue without speaker labels.
|
82 |
Separate each paragraph with a blank line.
|
83 |
+
|
84 |
+
Only include the monologue with proper punctuation and emotion tags enclosed in angle brackets < >.
|
85 |
+
For example, use <chuckle> instead of "chuckle".
|
86 |
+
|
87 |
Ensure the content flows naturally and stays relevant to the topic.
|
88 |
Limit the script length to match the requested duration of {duration}.
|
89 |
+
|
90 |
+
To use emotion tags naturally in generative AI speech, incorporate them sparingly at key moments
|
91 |
+
to enhance the dialogue's emotional context.
|
92 |
+
|
93 |
+
Always place tags like <laugh> for joy, <sigh> for frustration or relief, <chuckle> for mild amusement,
|
94 |
+
<cough> or <sniffle> for discomfort, <groan> for displeasure, <yawn> for tiredness, and <gasp> for surprise.
|
95 |
+
|
96 |
+
For example: "I can't believe I stayed up all night <yawn> only to find out the meeting was canceled <groan>.
|
97 |
+
Oh well, at least I finished the project <chuckle>."
|
98 |
+
|
99 |
+
Important: Ensure all emotion tags are properly enclosed in angle brackets < > to distinguish them from regular text."
|
100 |
"""
|
101 |
else:
|
102 |
prompt = f"""
|
|
|
104 |
{content}
|
105 |
|
106 |
The podcast should last approximately {duration}. Include natural speech patterns,
|
107 |
+
humor, and occasional off-topic thoughts. Use occasional speech fillers like um, ah,
|
108 |
yes, I see, Ok now. Vary the emotional tone.
|
109 |
+
|
110 |
+
Format the script as a monologue without speaker labels.
|
111 |
+
Separate each paragraph with a blank line.
|
112 |
+
|
113 |
+
Only include the monologue with proper punctuation and emotion tags enclosed in angle brackets < >.
|
114 |
+
For example, use <chuckle> instead of "chuckle".
|
115 |
+
|
116 |
+
Ensure the content flows naturally and stays relevant to the topic.
|
117 |
Limit the script length to match the requested duration of {duration}.
|
118 |
+
|
119 |
+
To use emotion tags naturally in generative AI speech, incorporate them sparingly at key moments
|
120 |
+
to enhance the dialogue's emotional context.
|
121 |
+
|
122 |
+
Always place tags like <laugh> for joy, <sigh> for frustration or relief, <chuckle> for mild amusement,
|
123 |
+
<cough> or <sniffle> for discomfort, <groan> for displeasure, <yawn> for tiredness, and <gasp> for surprise.
|
124 |
+
|
125 |
+
For example: "I can't believe I stayed up all night <yawn> only to find out the meeting was canceled <groan>.
|
126 |
+
Oh well, at least I finished the project <chuckle>."
|
127 |
+
|
128 |
+
Important: Ensure all emotion tags are properly enclosed in angle brackets < > to distinguish them from regular text."
|
129 |
"""
|
130 |
|
131 |
response = model.generate_content(prompt)
|