Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -50,34 +50,18 @@ agent = CodeAgent(
|
|
| 50 |
|
| 51 |
import gradio as gr
|
| 52 |
|
| 53 |
-
|
| 54 |
-
def agent_response(prompt):
|
| 55 |
-
response = agent.run(prompt)
|
| 56 |
-
return response # Gradio will handle Markdown rendering
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
# ✅ Define function BEFORE using it
|
| 64 |
-
def process_request(user_input):
|
| 65 |
-
response = agent.run(user_input)
|
| 66 |
-
return response
|
| 67 |
-
|
| 68 |
-
# Build UI
|
| 69 |
-
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 70 |
-
gr.Markdown("## 🤖 AI Wedding Planner Agent")
|
| 71 |
-
gr.Markdown("Ask the agent anything about wedding planning, catering, and more!")
|
| 72 |
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
submit_button = gr.Button("Submit")
|
| 76 |
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
-
|
| 80 |
|
| 81 |
-
|
| 82 |
-
if __name__ == "__main__":
|
| 83 |
-
demo.launch()
|
|
|
|
| 50 |
|
| 51 |
import gradio as gr
|
| 52 |
|
| 53 |
+
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
+
def agent_response(user_input):
|
| 56 |
+
return agent.run(user_input)
|
|
|
|
| 57 |
|
| 58 |
+
with gr.Blocks() as demo:
|
| 59 |
+
gr.Markdown("# 🎩 Band Baaja Bot - Your Wedding Assistant! 💍")
|
| 60 |
+
|
| 61 |
+
user_input = gr.Textbox(label="Your Request", placeholder="Ask me anything about wedding planning...")
|
| 62 |
+
submit = gr.Button("Submit") # Submit button below the input box
|
| 63 |
+
output = gr.Textbox(label="Agent Response") # Output space below the button
|
| 64 |
|
| 65 |
+
submit.click(agent_response, inputs=user_input, outputs=output)
|
| 66 |
|
| 67 |
+
demo.launch()
|
|
|
|
|
|