AhmadMustafa commited on
Commit
e809da8
·
1 Parent(s): 6b83c96

update: LE prompt

Browse files
Files changed (1) hide show
  1. app.py +9 -38
app.py CHANGED
@@ -382,48 +382,12 @@ 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}}&uid={{uid}}))
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&uid=82314)"""
384
  else:
385
- topic_identification_prompt = f"""Given the transcript {transcript}, identify compelling social media clip topics for each speaker.
386
-
387
- For each speaker, analyze their dialogue and list 2-3 most engaging topics they discussed that would make viral social media content.
388
-
389
- Format:
390
- **Speaker Name**
391
- 1. Topic title: [Brief description of the specific discussion point]
392
- 2. Topic title: [Brief description of the specific discussion point]
393
- 3. Topic title: [Brief description of the specific discussion point]
394
-
395
- Requirements:
396
- - Each topic should be a distinct, self-contained discussion
397
- - Topics should mention people, news, events, trends, or sources
398
- - Skip the host if no compelling content
399
- - Topics should be substantial enough for 20-60 second clips
400
- """
401
-
402
- topics_completion = client.chat.completions.create(
403
- model="gpt-4o-mini",
404
- messages=[
405
- {
406
- "role": "system",
407
- "content": """You are analyzing a transcript to identify engaging social media clip topics.
408
- Focus on finding viral-worthy, substantial content that can be turned into 20-60 second clips.
409
- Avoid mundane or generic content.""",
410
- },
411
- {"role": "user", "content": topic_identification_prompt},
412
- ],
413
- stream=False,
414
- temperature=0.3,
415
- )
416
-
417
- topics_result = topics_completion.choices[0].message.content
418
-
419
  prompt = f"""Call Details:
 
420
  Call ID: {cid}
421
  Speakers: {", ".join(speaker_mapping.values())}
422
  Transcript: {transcript}
423
- Using the following list of identified topics:
424
- {topics_result}
425
-
426
- Find the exact timestamps in the above transcript where each speaker discusses these specific topics.
427
 
428
  Format requirements:
429
 
@@ -621,6 +585,13 @@ In the URL, make sure that after RSID there is ? and then rest of the fields are
621
  if final_chunk.choices[0].delta.content:
622
  yield final_chunk.choices[0].delta.content
623
  return
 
 
 
 
 
 
 
624
 
625
  elif tool_call.function.name == "correct_call_type":
626
  args = eval(tool_call.function.arguments)
 
382
  - [Take 1. <div id='topic' style="display: inline"> 20s at 25:45]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{1245}}&et={{1265}}&uid={{uid}}))
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&uid=82314)"""
384
  else:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
385
  prompt = f"""Call Details:
386
+ User ID: {uid}
387
  Call ID: {cid}
388
  Speakers: {", ".join(speaker_mapping.values())}
389
  Transcript: {transcript}
390
+ Your task is to analyze speakers' discussions to identify compelling social media clips. For each speaker, identify key topics that mention people, news, events, trends, or sources.
 
 
 
391
 
392
  Format requirements:
393
 
 
585
  if final_chunk.choices[0].delta.content:
586
  yield final_chunk.choices[0].delta.content
587
  return
588
+ else:
589
+ function_call_result_message = {
590
+ "role": "tool",
591
+ "content": "No URL Provided",
592
+ "name": tool_call.function.name,
593
+ "tool_call_id": tool_call.id,
594
+ }
595
 
596
  elif tool_call.function.name == "correct_call_type":
597
  args = eval(tool_call.function.arguments)