Spaces:
Sleeping
Sleeping
| # interface.py | |
| import gradio as gr | |
| from friday_system import FridaySystem | |
| def create_gradio_interface(api_key): | |
| """Creates and returns the Gradio interface.""" | |
| friday = FridaySystem(api_key=api_key) | |
| interface = gr.Interface( | |
| fn=friday.generate_response, | |
| inputs=[ | |
| gr.Audio(type="filepath", label="Speak to FRIDAY (Upload or Record)"), | |
| gr.Textbox(label="Or Type to FRIDAY", placeholder="Enter your message here (English or French)...") | |
| ], | |
| outputs=[ | |
| gr.Audio(label="FRIDAY's Voice Response", type="filepath", autoplay=True), | |
| gr.Textbox(label="FRIDAY's Text Response") | |
| ], | |
| title="FRIDAY - Your AI Voice Assistant", | |
| description="Interact with FRIDAY by speaking (upload/record) or typing in English or French! Say or type 'exit', 'quit', 'stop', 'quitter', or 'arrêter' to end the session.", | |
| allow_flagging="never" | |
| ) | |
| return interface |