Spaces:
Sleeping
Sleeping
| 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() | |