import gradio as gr from inference import get_evo_response, get_gpt_response def advisor_interface(prompt, option1, option2): evo_result = get_evo_response(prompt, option1, option2) gpt_result = get_gpt_response(prompt, option1, option2) return evo_result, gpt_result with gr.Blocks() as demo: gr.Markdown("## 🧠 EvoRAG – Retrieval-Augmented Adaptive AI for Reasoning") gr.Markdown("Ask a commonsense or financial reasoning question with two options. Evo and GPT-3.5 will both suggest the better one.") with gr.Row(): prompt = gr.Textbox(label="📝 Your Question", placeholder="e.g. Should we reduce exposure to Tech Fund A this quarter?") with gr.Row(): option1 = gr.Textbox(label="🔹 Option 1", placeholder="Yes, reduce exposure this quarter.") option2 = gr.Textbox(label="🔸 Option 2", placeholder="No, maintain current allocation.") with gr.Row(): evo_output = gr.Textbox(label="🔬 EvoRAG Suggestion") gpt_output = gr.Textbox(label="🤖 GPT-3.5 Suggestion") run_btn = gr.Button("Run Advisors") run_btn.click(fn=advisor_interface, inputs=[prompt, option1, option2], outputs=[evo_output, gpt_output]) demo.launch()