Pass entire transcription message on queue; don't respond to yourself in 06-
This commit is contained in:
@@ -259,10 +259,8 @@ class DailyTransportService(EventHandler):
|
||||
pass
|
||||
|
||||
def on_transcription_message(self, message):
|
||||
print("got transcription", message)
|
||||
if self.loop:
|
||||
asyncio.run_coroutine_threadsafe(self.transcription_queue.put(message["text"]), self.loop)
|
||||
print("put transcription in queue", message)
|
||||
asyncio.run_coroutine_threadsafe(self.transcription_queue.put(message), self.loop)
|
||||
|
||||
def on_transcription_stopped(self, stopped_by, stopped_by_error):
|
||||
pass
|
||||
|
||||
@@ -33,7 +33,11 @@ async def main(room_url:str, token):
|
||||
|
||||
sentence = ""
|
||||
async for message in transport.get_transcriptions():
|
||||
sentence += message
|
||||
if message["session_id"] == transport.my_participant_id:
|
||||
continue
|
||||
|
||||
# todo: we could differentiate between transcriptions from different participants
|
||||
sentence += message["text"]
|
||||
if sentence.endswith((".", "?", "!")):
|
||||
messages.append({"role": "user", "content": sentence})
|
||||
sentence = ''
|
||||
|
||||
Reference in New Issue
Block a user