import gradio as gr from orchestrator import run_workflow def run_system(problem, order, bias, override, human_text): results = run_workflow(problem, order, bias) final = results.get("Final", "") if override and human_text.strip(): final = f"🧑‍⚖️ HUMAN OVERRIDE\n\n{human_text}" return ( results.get("Market", ""), results.get("Finance", ""), results.get("Risk", ""), results.get("Ethics", ""), final ) # Material-style theme theme = gr.themes.Soft( primary_hue="blue", secondary_hue="cyan", radius_size="lg", font=["Inter", "sans-serif"] ) with gr.Blocks(theme=theme) as demo: gr.Markdown( """ # 🧠 AI Strategy Lab ### Multi-Agent Decision System Demonstrates: • Agent workflows • Order effects • Bias • Human-in-the-loop """ ) with gr.Row(): with gr.Column(scale=2): problem = gr.Textbox( label="📌 Problem Statement", lines=4, placeholder="Should we launch Product X in Market Y?" ) order = gr.Textbox( label="🔁 Agent Order (comma-separated)", value="Market, Finance, Risk, Ethics", info="Example: Risk, Finance, Market, Ethics" ) bias = gr.Checkbox( label="Inject Market Bias" ) override = gr.Checkbox( label="Enable Human Override" ) human_text = gr.Textbox( label="Human Decision", lines=3 ) run_btn = gr.Button( "🚀 Run Analysis", variant="primary" ) with gr.Column(scale=3): with gr.Tab("📊 Market"): market_out = gr.Textbox(lines=10) with gr.Tab("💰 Finance"): finance_out = gr.Textbox(lines=10) with gr.Tab("⚠️ Risk"): risk_out = gr.Textbox(lines=10) with gr.Tab("🌱 Ethics"): ethics_out = gr.Textbox(lines=10) with gr.Tab("✅ Final Decision"): final_out = gr.Textbox(lines=12) run_btn.click( run_system, inputs=[ problem, order, bias, override, human_text ], outputs=[ market_out, finance_out, risk_out, ethics_out, final_out ] ) demo.launch()