21spl commited on
Commit
f190cd2
·
verified ·
1 Parent(s): 350a99e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -27
app.py CHANGED
@@ -50,34 +50,18 @@ agent = CodeAgent(
50
 
51
  import gradio as gr
52
 
53
- # Function to interact with the agent
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
- with gr.Row():
74
- user_input = gr.Textbox(label="Enter your request...", interactive=True)
75
- submit_button = gr.Button("Submit")
76
 
77
- output = gr.Markdown("") # Output area
 
 
 
 
 
78
 
79
- submit_button.click(process_request, inputs=user_input, outputs=output)
80
 
81
- # Launch UI
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()