File size: 976 Bytes
c2d1596 f3be9dc a391f50 f3be9dc a391f50 f3be9dc c2d1596 f3be9dc c2d1596 f3be9dc c2d1596 f3be9dc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
import gradio as gr
return f"Command not recognized: {command}"
# Define Gradio interfaces
menu_interface = gr.Interface(
fn=get_menu,
inputs=None,
outputs="json",
description="Get the menu."
)
order_interface = gr.Interface(
fn=place_order,
inputs=["text", "text"],
outputs="text",
description="Place an order by providing a comma-separated list of items and customizations."
)
speak_interface = gr.Interface(
fn=text_to_speech,
inputs="text",
outputs="text",
description="Convert text to speech."
)
speech_recognition_interface = gr.Interface(
fn=live_speech,
inputs=None,
outputs="text",
description="Speak commands like 'Show menu' or 'Order Biryani'."
)
# Combine all interfaces
app = gr.TabbedInterface([
menu_interface,
order_interface,
speak_interface,
speech_recognition_interface
], ["Menu", "Order", "Speak", "Voice Commands"])
if __name__ == "__main__":
app.launch() |