AhmadMustafa commited on
Commit
7abd251
·
1 Parent(s): eb44fe1

add: state for origin

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -331,6 +331,7 @@ def get_initial_analysis(
331
  link_start = "http"
332
  else:
333
  link_start = "https"
 
334
  if ct == "si": # street interview
335
  prompt = f"""This is a transcript for a street interview. Transcript: {transcript}
336
  In this street interview, the host asks multiple questions to the interviewees.
@@ -345,6 +346,7 @@ Best Answer timestamp: [Timestamp: start_time - end_time]({link_start}://{{origi
345
  For Example:
346
  If the start time is 10:13 and end time is 10:18, the url will be:
347
  {link_start}://roll.ai/colab/1234aq_12314/51234151?st=613&et=618
 
348
  """
349
  else:
350
  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.
@@ -388,7 +390,6 @@ def chat(
388
  link_start = "http"
389
  else:
390
  link_start = "https"
391
-
392
  prompt = f"""You are a helpful assistant analyzing transcripts and generating timestamps and URL. Call ID is {cid}, Session ID is {rsid}, origin is {origin}, Call Type is {ct}.
393
  Transcript:\n{transcript_processor.get_transcript()}
394
  If a user asks timestamps for a specific topic, find the start time and end time of that specific topic and return answer in the format:
@@ -398,6 +399,8 @@ Topic: Heading [Timestamp: start_time - end_time]({link_start}://{{origin}}/coll
398
  For Example:
399
  If the start time is 10:13 and end time is 10:18, the url will be:
400
  {link_start}://roll.ai/colab/1234aq_12314/51234151?st=613&et=618
 
 
401
  """
402
  messages = [{"role": "system", "content": prompt}]
403
 
@@ -540,6 +543,8 @@ def create_chat_interface():
540
  transcript_processor_state,
541
  call_id_state,
542
  colab_id_state,
 
 
543
  ],
544
  [msg, chatbot],
545
  )
 
331
  link_start = "http"
332
  else:
333
  link_start = "https"
334
+
335
  if ct == "si": # street interview
336
  prompt = f"""This is a transcript for a street interview. Transcript: {transcript}
337
  In this street interview, the host asks multiple questions to the interviewees.
 
346
  For Example:
347
  If the start time is 10:13 and end time is 10:18, the url will be:
348
  {link_start}://roll.ai/colab/1234aq_12314/51234151?st=613&et=618
349
+ In the URL, make sure that after RSID there is ? and then rest of the fields are added via &.
350
  """
351
  else:
352
  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.
 
390
  link_start = "http"
391
  else:
392
  link_start = "https"
 
393
  prompt = f"""You are a helpful assistant analyzing transcripts and generating timestamps and URL. Call ID is {cid}, Session ID is {rsid}, origin is {origin}, Call Type is {ct}.
394
  Transcript:\n{transcript_processor.get_transcript()}
395
  If a user asks timestamps for a specific topic, find the start time and end time of that specific topic and return answer in the format:
 
399
  For Example:
400
  If the start time is 10:13 and end time is 10:18, the url will be:
401
  {link_start}://roll.ai/colab/1234aq_12314/51234151?st=613&et=618
402
+ In the URL, make sure that after RSID there is ? and then rest of the fields are added via &.
403
+
404
  """
405
  messages = [{"role": "system", "content": prompt}]
406
 
 
543
  transcript_processor_state,
544
  call_id_state,
545
  colab_id_state,
546
+ origin_state,
547
+ ct_state,
548
  ],
549
  [msg, chatbot],
550
  )