import gradio as gr from asr import transcribe_audio from llm_agent import get_llm_reply def voice_to_reply(audio): if audio is None: return "No audio received!", "..." text = transcribe_audio(audio) reply = get_llm_reply(text) return text, reply ui = gr.Interface( fn=voice_to_reply, inputs=gr.Audio(type="filepath", label="Upload voice (.wav or .mp3)"), outputs=[ gr.Textbox(label="📝 Transcribed Text"), gr.Textbox(label="🤖 LLM Reply") ], title="VoiceFreight AI v1: ASR + LLM", description="Upload a voice file. ASR + TinyLlama gives you a response!" ) if __name__ == "__main__": ui.launch()