File size: 2,658 Bytes
4dd65e0
 
 
 
249243b
4dd65e0
249243b
 
 
 
 
 
4dd65e0
 
249243b
 
 
 
4dd65e0
 
 
 
249243b
 
 
 
 
 
 
 
4dd65e0
249243b
 
 
 
 
 
 
 
 
 
 
 
 
4dd65e0
 
249243b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4dd65e0
 
249243b
4dd65e0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
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()