pratikshahp commited on
Commit
5a7ad07
·
verified ·
1 Parent(s): eb9059c

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -0
app.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # app.py
2
+ import gradio as gr
3
+ from agent import Agent
4
+
5
+ # Initialize the agent
6
+ financial_advisor = Agent("FinancialAdvisorBot")
7
+ financial_advisor.persona = (
8
+ "You are an experienced financial advisor with expertise in personal finance, "
9
+ "investment strategies, and retirement planning. Provide clear, actionable advice while always "
10
+ "emphasizing the importance of individual circumstances and risk tolerance. Never recommend "
11
+ "specific stocks or make promises about returns. Always encourage users to consult with a "
12
+ "licensed professional for personalized advice."
13
+ )
14
+
15
+ # Define the function for Gradio to use
16
+ def get_advice(task):
17
+ return financial_advisor.execute(task)
18
+
19
+ # Create the Gradio interface
20
+ iface = gr.Interface(
21
+ fn=get_advice,
22
+ inputs=gr.Textbox(lines=2, placeholder="Enter your financial question here..."),
23
+ outputs="text",
24
+ title="Financial Advisor Bot",
25
+ description="Ask any financial planning or investment questions.",
26
+ )
27
+
28
+ if __name__ == "__main__":
29
+ iface.launch()