AhmadMustafa commited on
Commit
f36ef67
·
1 Parent(s): 88ec987

update: link handling

Browse files
Files changed (1) hide show
  1. app.py +23 -13
app.py CHANGED
@@ -363,10 +363,10 @@ Return format:
363
 
364
  [Question Title]
365
  Total takes: [X] (Include ONLY if content appears more than once)
366
- Take 1. [start_time - end_time]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in_sec}}&et={{end_time_in_sec}})
367
- Take 2. [start_time - end_time]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in_sec}}&et={{end_time_in_sec}})
368
  ...
369
- Take X (Best). [start_time - end_time]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in_sec}}&et={{end_time_in_sec}})
370
 
371
  URL formatting:
372
  - Convert timestamps to seconds (e.g., 10:13 → 613)
@@ -380,16 +380,26 @@ Take 1. 09:45 - 09:50
380
  Take 2. 10:13 - 10:18
381
  Best Answer: [10:13 - 10:18]({link_start}://roll.ai/colab/1234aq_12314/51234151?st=613&et=618)"""
382
  else:
383
- prompt = f"""Given the transcript {transcript}, For All the speakers, short list all people, news, events, trends, and source that are discussed by speakers along with the start time of that topic and end time of that topic from the transcript. Rank all topics based on what would make for the best social clips. I need atleast 3 topics per speaker.
384
- You should mention the Speaker Name first, then atleast 3 posts with their timestamps, and so on.
385
- Return format is:
386
- Speaker Name
387
- 1. {{Title}}: [start_time - end_time]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in_sec}}&et={{end_time_in_sec}}"').
388
- 2....
389
- For Example:
390
- If the start time is 10:13 and end time is 10:18, the url will be:
391
- {link_start}://roll.ai/colab/1234aq_12314/51234151?st=613&et=618
392
- In the URL, make sure that after RSID there is ? and then rest of the fields are added via &. Keep the answer less verbose and to the point.
 
 
 
 
 
 
 
 
 
 
393
  """
394
 
395
  completion = client.chat.completions.create(
 
363
 
364
  [Question Title]
365
  Total takes: [X] (Include ONLY if content appears more than once)
366
+ [Take 1. start_time - end_time]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in_sec}}&et={{end_time_in_sec}})
367
+ [Take 2. start_time - end_time]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in_sec}}&et={{end_time_in_sec}})
368
  ...
369
+ [Take X (Best). start_time - end_time]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in_sec}}&et={{end_time_in_sec}})
370
 
371
  URL formatting:
372
  - Convert timestamps to seconds (e.g., 10:13 → 613)
 
380
  Take 2. 10:13 - 10:18
381
  Best Answer: [10:13 - 10:18]({link_start}://roll.ai/colab/1234aq_12314/51234151?st=613&et=618)"""
382
  else:
383
+ prompt = f"""Given the transcript {transcript}, 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 timestamp and duration for each topic.
384
+
385
+ Format the output as follows:
386
+
387
+ **Speaker Name**
388
+ 1. [Topic title <div id='topic' style="display: inline"> 15s at 12:30 </div>]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{750}}&et={{765}})
389
+ 2. [Topic title <div id='topic' style="display: inline"> 30s at 14:45 </div>]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{885}}&et={{915}})
390
+ 3. [Topic title <div id='topic' style="display: inline"> 1m 10s at 16:20 </div>]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{980}}&et={{1050}})
391
+
392
+ Requirements:
393
+ - Only speaker names should be bold using markdown **Name**
394
+ - Topic titles should be in normal case (i.e first word of Sentence capital rest small)
395
+ - Use timestamp and duration format: HH:MM (Xs) where X is seconds
396
+ - Each line should be a clickable link including timestamp and title
397
+ - Convert display timestamps to seconds for URL parameters
398
+ Example: 15s at 10:13 in URL would be st=613&et=628
399
+
400
+ URL format: {link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in_sec}}&et={{end_time_in_sec}}
401
+
402
+ Rank topics based on their potential virality and engagement for social media clips.
403
  """
404
 
405
  completion = client.chat.completions.create(