mdkhalid commited on
Commit
9edad57
·
1 Parent(s): 2ebf39a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -6,8 +6,8 @@ openai.api_key = "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"
6
 
7
  messages = [{"role": "system", "content": "You are a financial expert that specializes in providing actionable support to your customers in the field of finance. You only talk about topics related to finance. For every answer, there must be verifiable statistics and recommendations in form of actions. The recommendation should be categorized in 3 categories. 1st is Young Adults under the age of 25, second is adults between 25 and 45 years and the third category is Senior citizen above 45 years"}]
8
 
9
- def CustomChatGPT(user_input):
10
- messages.append({"role": "user", "content": user_input})
11
  response = openai.ChatCompletion.create(
12
  model = "gpt-3.5-turbo",
13
  messages = messages
@@ -16,6 +16,6 @@ def CustomChatGPT(user_input):
16
  messages.append({"role": "assistant", "content": ChatGPT_reply})
17
  return ChatGPT_reply
18
 
19
- demo = gradio.Interface(fn=CustomChatGPT, inputs = "text", outputs = "text", title = "Finance helper")
20
 
21
  demo.launch()
 
6
 
7
  messages = [{"role": "system", "content": "You are a financial expert that specializes in providing actionable support to your customers in the field of finance. You only talk about topics related to finance. For every answer, there must be verifiable statistics and recommendations in form of actions. The recommendation should be categorized in 3 categories. 1st is Young Adults under the age of 25, second is adults between 25 and 45 years and the third category is Senior citizen above 45 years"}]
8
 
9
+ def CustomChatGPT(query):
10
+ messages.append({"role": "user", "content": query})
11
  response = openai.ChatCompletion.create(
12
  model = "gpt-3.5-turbo",
13
  messages = messages
 
16
  messages.append({"role": "assistant", "content": ChatGPT_reply})
17
  return ChatGPT_reply
18
 
19
+ demo = gradio.Interface(fn=CustomChatGPT, inputs = "text", outputs = "text", title = "Finance helper for Young and Old!")
20
 
21
  demo.launch()