Spaces:
Runtime error
Runtime error
Commit ·
f36ef67
1
Parent(s): 88ec987
update: link handling
Browse files362 unmodified lines3633643653663673683693703713727 unmodified lines380381382383384385386387388389390391392393394395362 unmodified lines[Question Title]Total takes: [X] (Include ONLY if content appears more than once)Take 1. [start_time - end_time]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in_sec}}&et={{end_time_in_sec}})Take 2. [start_time - end_time]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in_sec}}&et={{end_time_in_sec}})...Take X (Best). [start_time - end_time]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in_sec}}&et={{end_time_in_sec}})URL formatting:- Convert timestamps to seconds (e.g., 10:13 → 613)7 unmodified linesTake 2. 10:13 - 10:18Best Answer: [10:13 - 10:18]({link_start}://roll.ai/colab/1234aq_12314/51234151?st=613&et=618)"""else: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.You should mention the Speaker Name first, then atleast 3 posts with their timestamps, and so on.Return format is:Speaker Name1. {{Title}}: [start_time - end_time]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in_sec}}&et={{end_time_in_sec}}"').2....For Example:If the start time is 10:13 and end time is 10:18, the url will be:{link_start}://roll.ai/colab/1234aq_12314/51234151?st=613&et=618In 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."""completion = client.chat.completions.create(362 unmodified lines3633643653663673683693703713727 unmodified lines380381382383384385386387388389390391392393394395396397398399400401402403404405362 unmodified lines[Question Title]Total takes: [X] (Include ONLY if content appears more than once)[Take 1. start_time - end_time]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in_sec}}&et={{end_time_in_sec}})[Take 2. start_time - end_time]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in_sec}}&et={{end_time_in_sec}})...[Take X (Best). start_time - end_time]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in_sec}}&et={{end_time_in_sec}})URL formatting:- Convert timestamps to seconds (e.g., 10:13 → 613)7 unmodified linesTake 2. 10:13 - 10:18Best Answer: [10:13 - 10:18]({link_start}://roll.ai/colab/1234aq_12314/51234151?st=613&et=618)"""else: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.Format the output as follows:**Speaker Name**1. [Topic title <div id='topic' style="display: inline"> 15s at 12:30 </div>]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{750}}&et={{765}})2. [Topic title <div id='topic' style="display: inline"> 30s at 14:45 </div>]({link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{885}}&et={{915}})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}})Requirements:- Only speaker names should be bold using markdown **Name**- Topic titles should be in normal case (i.e first word of Sentence capital rest small)- Use timestamp and duration format: HH:MM (Xs) where X is seconds- Each line should be a clickable link including timestamp and title- Convert display timestamps to seconds for URL parametersExample: 15s at 10:13 in URL would be st=613&et=628URL format: {link_start}://{{origin}}/collab/{{cid}}/{{rsid}}?st={{start_time_in_sec}}&et={{end_time_in_sec}}Rank topics based on their potential virality and engagement for social media clips."""completion = client.chat.completions.create(
app.py+23-13