Spaces:
Sleeping
Sleeping
Commit
·
5416d7e
1
Parent(s):
68cab52
update: live event prompt
Browse files
app.py
CHANGED
@@ -331,6 +331,7 @@ def get_initial_analysis(
|
|
331 |
"""Perform initial analysis of the transcript using OpenAI."""
|
332 |
try:
|
333 |
transcript = transcript_processor.get_transcript()
|
|
|
334 |
client = OpenAI()
|
335 |
if "localhost" in origin:
|
336 |
link_start = "http"
|
@@ -382,7 +383,9 @@ Total takes: 2
|
|
382 |
- [Take 1. <div id='topic' style="display: inline"> 20s at 25:45]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{1245}}&et={{1265}})
|
383 |
- [Take 3 (Best). <div id='topic' style="display: inline"> 5s at 10:13 </div>]({link_start}://roll.ai/colab/1234aq_12314/51234151?st=613&et=618)"""
|
384 |
else:
|
385 |
-
prompt = f"""<div id="initial_message"> Given the
|
|
|
|
|
386 |
|
387 |
Format the output as follows:
|
388 |
|
@@ -406,7 +409,7 @@ URL format: {link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in
|
|
406 |
|
407 |
Rank topics based on their potential virality and engagement for social media clips. </div>
|
408 |
"""
|
409 |
-
|
410 |
completion = client.chat.completions.create(
|
411 |
model="gpt-4o-mini",
|
412 |
messages=[
|
|
|
331 |
"""Perform initial analysis of the transcript using OpenAI."""
|
332 |
try:
|
333 |
transcript = transcript_processor.get_transcript()
|
334 |
+
speaker_mapping = transcript_processor.speaker_mapping
|
335 |
client = OpenAI()
|
336 |
if "localhost" in origin:
|
337 |
link_start = "http"
|
|
|
383 |
- [Take 1. <div id='topic' style="display: inline"> 20s at 25:45]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{1245}}&et={{1265}})
|
384 |
- [Take 3 (Best). <div id='topic' style="display: inline"> 5s at 10:13 </div>]({link_start}://roll.ai/colab/1234aq_12314/51234151?st=613&et=618)"""
|
385 |
else:
|
386 |
+
prompt = f"""<div id="initial_message"> Given the following transcript with Speakers: {", ".join([speaker for speaker in speaker_mapping.values()])}. Transcript:
|
387 |
+
{transcript}
|
388 |
+
Analyze all speakers' discussions and list out people, news, events, trends, and sources mentioned. For each speaker, provide at least 3 topics that would make engaging social media clips. Include duration and starting time for each topic.
|
389 |
|
390 |
Format the output as follows:
|
391 |
|
|
|
409 |
|
410 |
Rank topics based on their potential virality and engagement for social media clips. </div>
|
411 |
"""
|
412 |
+
print(prompt)
|
413 |
completion = client.chat.completions.create(
|
414 |
model="gpt-4o-mini",
|
415 |
messages=[
|