mirror of
https://github.com/HumanAIGC-Engineering/gradio-webrtc.git
synced 2026-02-05 18:09:23 +08:00
Fix websocket interruption (#291)
* Code * Fix * add code * interruptions * Add code * code * Add code * Add code * code
This commit is contained in:
@@ -17,7 +17,6 @@ from fastrtc import (
|
||||
wait_for_item,
|
||||
)
|
||||
from gradio.utils import get_space
|
||||
from openai.types.beta.realtime import ResponseAudioTranscriptDoneEvent
|
||||
|
||||
load_dotenv()
|
||||
|
||||
@@ -103,8 +102,8 @@ class OpenAIHandler(AsyncStreamHandler):
|
||||
self.connection = None
|
||||
|
||||
|
||||
def update_chatbot(chatbot: list[dict], response: ResponseAudioTranscriptDoneEvent):
|
||||
chatbot.append({"role": "assistant", "content": response.transcript})
|
||||
def update_chatbot(chatbot: list[dict], response: dict):
|
||||
chatbot.append(response)
|
||||
return chatbot
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user