zayeem00 commited on
Commit
2eebd6e
·
verified ·
1 Parent(s): f514878

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -16
app.py CHANGED
@@ -1,21 +1,6 @@
1
  import gradio as gr
2
  import openai
3
-
4
- def financial_planning(prompt, api_key):
5
-
6
- openai.api_key = api_key
7
-
8
- message=[
9
- {"role": "system", "content": "You are a knowledgeable and insightful Financial Planner dedicated to helping users make informed investment decisions based on their unique financial profiles."},
10
- {"role": "user", "content": prompt}
11
- ]
12
- response = openai.ChatCompletion.create(
13
- model="gpt-4o",
14
- messages= message,
15
- max_tokens=500,
16
- temperature=0.7,
17
- )
18
- return response.choices[0]["message"]["content"]
19
 
20
  def generate_advice(name, age, income, expenses, savings, debts, investment_preferences, risk_tolerance, retirement_age, retirement_savings_goal, short_term_goals, long_term_goals, dependents, health_expenses, education_expenses, insurance_policies, major_purchases, emergency_fund, annual_income_growth, annual_expense_growth, currency, api_key):
21
  prompt = (
 
1
  import gradio as gr
2
  import openai
3
+ from model import financial_planning
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  def generate_advice(name, age, income, expenses, savings, debts, investment_preferences, risk_tolerance, retirement_age, retirement_savings_goal, short_term_goals, long_term_goals, dependents, health_expenses, education_expenses, insurance_policies, major_purchases, emergency_fund, annual_income_growth, annual_expense_growth, currency, api_key):
6
  prompt = (