Adding "check answer" button
Browse files
app.py
CHANGED
|
@@ -171,6 +171,19 @@ with gr.Blocks() as demo:
|
|
| 171 |
outputs=[status_output, results_table]
|
| 172 |
)
|
| 173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
if __name__ == "__main__":
|
| 175 |
print("\n" + "-"*30 + " App Starting " + "-"*30)
|
| 176 |
# Check for SPACE_HOST and SPACE_ID at startup for information
|
|
|
|
| 171 |
outputs=[status_output, results_table]
|
| 172 |
)
|
| 173 |
|
| 174 |
+
with gr.Row():
|
| 175 |
+
question_input = gr.Textbox(label="Enter your question", placeholder="e.g., What is the capital of France?", lines=1)
|
| 176 |
+
check_button = gr.Button("Check Answer")
|
| 177 |
+
|
| 178 |
+
final_output = gr.Textbox(label="✅ Final Answer", lines=1, interactive=False)
|
| 179 |
+
logs_output = gr.Textbox(label="📝 Agent Logs", lines=10, interactive=False)
|
| 180 |
+
|
| 181 |
+
check_button.click(
|
| 182 |
+
fn=run_agent,
|
| 183 |
+
inputs=question_input,
|
| 184 |
+
outputs=[final_output, logs_output]
|
| 185 |
+
)
|
| 186 |
+
|
| 187 |
if __name__ == "__main__":
|
| 188 |
print("\n" + "-"*30 + " App Starting " + "-"*30)
|
| 189 |
# Check for SPACE_HOST and SPACE_ID at startup for information
|