bstraehle commited on
Commit
1a4e9af
·
verified ·
1 Parent(s): 5862638

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +86 -84
app.py CHANGED
@@ -58,91 +58,93 @@ with gr.Blocks() as grady:
58
  gr.Markdown("## Grady - General AI Assistant")
59
  gr.Markdown(os.environ.get("DESCRIPTION"))
60
 
61
- with gr.Row():
62
- with gr.Column(scale=3):
63
- with gr.Row():
64
- question = gr.Textbox(
65
- label="Question *",
66
- placeholder="In the 2025 Gradio Agents & MCP Hackathon, what percentage of participants submitted a solution during the last 24 hours?",
67
- interactive=True
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  )
69
- with gr.Row():
70
- level = gr.Radio(
71
- choices=[1, 2, 3],
72
- label="GAIA Benchmark Level",
73
- interactive=True,
74
- scale=1
75
- )
76
- ground_truth = gr.Textbox(
77
- label="Ground Truth",
78
- interactive=True,
79
- scale=1
80
- )
81
- file_name = gr.Textbox(
82
- label="File Name",
83
- interactive=True,
84
- scale=2
85
- )
86
- with gr.Row():
87
- openai_api_key = gr.Textbox(
88
- label="OpenAI API Key *",
89
- type="password",
90
- placeholder="sk‑...",
91
- interactive=True
92
- )
93
- gemini_api_key = gr.Textbox(
94
- label="Gemini API Key *",
95
- type="password",
96
- interactive=True
97
- )
98
- anthropic_api_key = gr.Textbox(
99
- label="Anthropic API Key *",
100
- type="password",
101
- placeholder="sk-ant-...",
102
- interactive=True
103
- )
104
- with gr.Row():
105
- clear_btn = gr.ClearButton(
106
- components=[question, level, ground_truth, file_name]
107
- )
108
- submit_btn = gr.Button("Submit", variant="primary")
109
- with gr.Column(scale=1):
110
- answer = gr.Textbox(
111
- label="Answer",
112
- lines=1,
113
- interactive=False
114
- )
115
-
116
- submit_btn.click(
117
- fn=ask,
118
- inputs=[question, openai_api_key, gemini_api_key, anthropic_api_key, file_name],
119
- outputs=answer
120
- )
121
-
122
- QUESTION_FILE_PATH = "data/gaia_validation.jsonl"
123
 
124
- gr.Examples(
125
- label="GAIA Benchmark Level 1 Problems",
126
- examples=get_questions(QUESTION_FILE_PATH, 1),
127
- inputs=[question, level, ground_truth, file_name, openai_api_key, gemini_api_key, anthropic_api_key],
128
- outputs=answer,
129
- cache_examples=False
130
- )
131
-
132
- gr.Examples(
133
- label="GAIA Benchmark Level 2 Problems",
134
- examples=get_questions(QUESTION_FILE_PATH, 2),
135
- inputs=[question, level, ground_truth, file_name, openai_api_key, gemini_api_key, anthropic_api_key],
136
- outputs=answer,
137
- cache_examples=False
138
- )
139
-
140
- gr.Examples(
141
- label="GAIA Benchmark Level 3 Problems",
142
- examples=get_questions(QUESTION_FILE_PATH, 3),
143
- inputs=[question, level, ground_truth, file_name, openai_api_key, gemini_api_key, anthropic_api_key],
144
- outputs=answer,
145
- cache_examples=False
146
- )
 
 
 
 
 
 
 
 
 
147
 
148
  grady.launch(mcp_server=True)
 
58
  gr.Markdown("## Grady - General AI Assistant")
59
  gr.Markdown(os.environ.get("DESCRIPTION"))
60
 
61
+ with gr.Tab("Assistant"):
62
+ with gr.Row():
63
+ with gr.Column(scale=3):
64
+ with gr.Row():
65
+ question = gr.Textbox(
66
+ label="Question *",
67
+ placeholder="In the 2025 Gradio Agents & MCP Hackathon, what percentage of participants submitted a solution during the last 24 hours?",
68
+ interactive=True
69
+ )
70
+ with gr.Row():
71
+ level = gr.Radio(
72
+ choices=[1, 2, 3],
73
+ label="GAIA Benchmark Level",
74
+ interactive=True,
75
+ scale=1
76
+ )
77
+ ground_truth = gr.Textbox(
78
+ label="Ground Truth",
79
+ interactive=True,
80
+ scale=1
81
+ )
82
+ file_name = gr.Textbox(
83
+ label="File Name",
84
+ interactive=True,
85
+ scale=2
86
+ )
87
+ with gr.Row():
88
+ openai_api_key = gr.Textbox(
89
+ label="OpenAI API Key *",
90
+ type="password",
91
+ placeholder="sk‑...",
92
+ interactive=True
93
+ )
94
+ gemini_api_key = gr.Textbox(
95
+ label="Gemini API Key *",
96
+ type="password",
97
+ interactive=True
98
+ )
99
+ anthropic_api_key = gr.Textbox(
100
+ label="Anthropic API Key *",
101
+ type="password",
102
+ placeholder="sk-ant-...",
103
+ interactive=True
104
+ )
105
+ with gr.Row():
106
+ clear_btn = gr.ClearButton(
107
+ components=[question, level, ground_truth, file_name]
108
+ )
109
+ submit_btn = gr.Button("Submit", variant="primary")
110
+ with gr.Column(scale=1):
111
+ answer = gr.Textbox(
112
+ label="Answer",
113
+ lines=1,
114
+ interactive=False
115
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
 
117
+ submit_btn.click(
118
+ fn=ask,
119
+ inputs=[question, openai_api_key, gemini_api_key, anthropic_api_key, file_name],
120
+ outputs=answer
121
+ )
122
+
123
+ QUESTION_FILE_PATH = "data/gaia_validation.jsonl"
124
+
125
+ gr.Examples(
126
+ label="GAIA Benchmark Level 1 Problems",
127
+ examples=get_questions(QUESTION_FILE_PATH, 1),
128
+ inputs=[question, level, ground_truth, file_name, openai_api_key, gemini_api_key, anthropic_api_key],
129
+ outputs=answer,
130
+ cache_examples=False
131
+ )
132
+
133
+ gr.Examples(
134
+ label="GAIA Benchmark Level 2 Problems",
135
+ examples=get_questions(QUESTION_FILE_PATH, 2),
136
+ inputs=[question, level, ground_truth, file_name, openai_api_key, gemini_api_key, anthropic_api_key],
137
+ outputs=answer,
138
+ cache_examples=False
139
+ )
140
+
141
+ gr.Examples(
142
+ label="GAIA Benchmark Level 3 Problems",
143
+ examples=get_questions(QUESTION_FILE_PATH, 3),
144
+ inputs=[question, level, ground_truth, file_name, openai_api_key, gemini_api_key, anthropic_api_key],
145
+ outputs=answer,
146
+ cache_examples=False
147
+ )
148
+ with gr.Tab("Documentation"):
149
 
150
  grady.launch(mcp_server=True)