akhvedelidze commited on
Commit
b3ddcac
1 Parent(s): 1281309

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -7,8 +7,13 @@ openai.api_key = "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"
7
 
8
  messages = [{"role": "system", "content": "You are a medical experts that specializes in psycoterapist"}]
9
  #engine = pyttsx3.init()
10
- def CustomChatGPT(user_input, command):
11
- messages.append({"role": "user", "content": user_input+command})
 
 
 
 
 
12
  response = openai.ChatCompletion.create(
13
  model = "gpt-3.5-turbo",
14
  messages = messages
@@ -26,9 +31,14 @@ def CustomChatGPT(user_input, command):
26
 
27
  demo = gradio.Interface(
28
  fn=CustomChatGPT,
29
- inputs = ["text", gradio.Radio(["Provide source of the information", "subtract", "multiply", "divide"])],
 
 
 
 
 
30
  outputs = "text",
31
- title = "Psycology consultation")
32
 
33
 
34
  demo.launch()
 
7
 
8
  messages = [{"role": "system", "content": "You are a medical experts that specializes in psycoterapist"}]
9
  #engine = pyttsx3.init()
10
+ def CustomChatGPT(user_input, years, Gender, Age, medication):
11
+ messages.append({"role": "user", "content":
12
+ "My current problem is:" + user_input+
13
+ "I have been experiecne this issue during:" + years+
14
+ "gender is:" + Gender +
15
+ "age is:" + Age +
16
+ "currently taking medication or treatment are:" + medication})
17
  response = openai.ChatCompletion.create(
18
  model = "gpt-3.5-turbo",
19
  messages = messages
 
31
 
32
  demo = gradio.Interface(
33
  fn=CustomChatGPT,
34
+ inputs = [gradio.inputs.Textbox(lines = 5, label="What brings you to therapy? What are your current symptoms or challenges? "),
35
+ gradio.inputs.Textbox(label="How long have you been experiencing these symptoms?"),
36
+ gradio.Radio(["Male", "Female"]),
37
+ gradio.Radio(["Under 18", "18-24", "25-34", "35-44", "45-54", "55-64", "65 and over"]),
38
+ gradio.inputs.Textbox(lines = 5, label="Are you currently taking any medications or receiving any other treatment, if yes please tell us details?")
39
+ ],
40
  outputs = "text",
41
+ title = "MindCareOnline - Caring for Your Mental Health, Anytime, Anywheren")
42
 
43
 
44
  demo.launch()