jack 2 semanas atrás
pai
commit
7210defba9

+ 9 - 0
app/core/runner/llm_callback_handler.py

@@ -149,6 +149,15 @@ class LLMCallbackHandler:
                         self.event_handler.pub_message_created(self.message)
                         self.event_handler.pub_message_in_progress(self.message)
 
+                    """
+                                    if 'transcript' in chunk.choices[0].delta.audio:
+                                        print(chunk.choices[0].delta.audio['transcript'])
+                                        text_chunk = chunk.choices[0].delta.audio['transcript']
+                                        yield "text", text_chunk
+                                    if 'data' in chunk.choices[0].delta.audio:
+                                        audio_chunk = chunk.choices[0].delta.audio['data']
+                                        yield "audio", base64.b64decode(audio_chunk)
+                    """
                     # append message content delta
                     # message.audio += delta.audio
                     self.event_handler.pub_message_delta(

+ 2 - 0
app/services/message/message.py

@@ -37,6 +37,8 @@ class MessageService:
                     )
                 elif msg.get("type") == "image_file" or msg.get("type") == "image_url":
                     content.append(msg)
+                elif msg.get("type") == "input_audio":
+                    content.append(msg)
         return content
 
     @staticmethod