raksama19 commited on
Commit
09b4f51
·
verified ·
1 Parent(s): 3ef4ad0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -638,8 +638,8 @@ def generate_voice_response(state: VoiceAppState):
638
  audio_array = audio_array.reshape((-1, 2))
639
 
640
  # Update conversation history
641
- state.conversation.append({"role": "user", "content": {"path": temp_audio_path, "mime_type": "audio/wav"}})
642
- state.conversation.append({"role": "assistant", "content": {"text": text_response}})
643
 
644
  return (audio_segment.frame_rate, audio_array), VoiceAppState(conversation=state.conversation)
645
 
@@ -887,6 +887,7 @@ with gr.Blocks(
887
  chatbot = gr.Chatbot(
888
  value=[],
889
  height=500,
 
890
  elem_classes="chatbot-container",
891
  placeholder="Your conversation will appear here once you process a document..."
892
  )
 
638
  audio_array = audio_array.reshape((-1, 2))
639
 
640
  # Update conversation history
641
+ state.conversation.append({"role": "user", "content": f"[Audio message]"})
642
+ state.conversation.append({"role": "assistant", "content": text_response})
643
 
644
  return (audio_segment.frame_rate, audio_array), VoiceAppState(conversation=state.conversation)
645
 
 
887
  chatbot = gr.Chatbot(
888
  value=[],
889
  height=500,
890
+ type='messages',
891
  elem_classes="chatbot-container",
892
  placeholder="Your conversation will appear here once you process a document..."
893
  )