Spaces:
Runtime error
Runtime error
Commit
·
36e015f
1
Parent(s):
7c10fee
linkelement
Browse files
app.py
CHANGED
@@ -595,9 +595,22 @@ def SetAgent(Choice):
|
|
595 |
agent = agent_OPENAI_MULTI
|
596 |
print("Set to:", Choice)
|
597 |
|
|
|
|
|
|
|
598 |
def LinkElement(chat_history):
|
599 |
-
|
600 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
601 |
|
602 |
|
603 |
with gr.Blocks() as demo:
|
@@ -616,7 +629,12 @@ with gr.Blocks() as demo:
|
|
616 |
scale= 1,
|
617 |
)
|
618 |
voice_input = gr.Audio(source="microphone", type="filepath", scale= 1)
|
619 |
-
voice_output = gr.Audio(
|
|
|
|
|
|
|
|
|
|
|
620 |
with gr.Accordion(
|
621 |
label = "LOGS",
|
622 |
open = False,
|
|
|
595 |
agent = agent_OPENAI_MULTI
|
596 |
print("Set to:", Choice)
|
597 |
|
598 |
+
global record
|
599 |
+
record = []
|
600 |
+
|
601 |
def LinkElement(chat_history):
|
602 |
+
'''
|
603 |
+
Link chatbot display output with other UI
|
604 |
+
'''
|
605 |
+
global record
|
606 |
+
if record != chat_history:
|
607 |
+
last_response = chat_history[-1:][1]
|
608 |
+
print("last response:", last_response)
|
609 |
+
record = chat_history
|
610 |
+
print(chat_history)
|
611 |
+
# print("link element test")
|
612 |
+
else:
|
613 |
+
pass
|
614 |
|
615 |
|
616 |
with gr.Blocks() as demo:
|
|
|
629 |
scale= 1,
|
630 |
)
|
631 |
voice_input = gr.Audio(source="microphone", type="filepath", scale= 1)
|
632 |
+
voice_output = gr.Audio(
|
633 |
+
source="microphone",
|
634 |
+
type="filepath",
|
635 |
+
scale= 1,
|
636 |
+
interactive=False,
|
637 |
+
autoplay= True)
|
638 |
with gr.Accordion(
|
639 |
label = "LOGS",
|
640 |
open = False,
|