Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ from gtts import gTTS
|
|
6 |
|
7 |
openai.api_key = os.environ["OPEN_AI_KEY"]
|
8 |
|
9 |
-
messages = [{"role": "system", "content": "You are a therapist. Respond in less than 5 sentences."}]
|
10 |
|
11 |
|
12 |
|
@@ -18,7 +18,8 @@ def transcribe(audio):
|
|
18 |
return transcript["text"]
|
19 |
|
20 |
def botResponse(user_input):
|
21 |
-
global messages
|
|
|
22 |
|
23 |
messages.append({"role": "user", "content": user_input})
|
24 |
response = openai.ChatCompletion.create(
|
|
|
6 |
|
7 |
openai.api_key = os.environ["OPEN_AI_KEY"]
|
8 |
|
9 |
+
#messages = [{"role": "system", "content": "You are a therapist. Respond in less than 5 sentences."}]
|
10 |
|
11 |
|
12 |
|
|
|
18 |
return transcript["text"]
|
19 |
|
20 |
def botResponse(user_input):
|
21 |
+
#global messages
|
22 |
+
messages = [{"role": "system", "content": "You are a therapist. Respond in less than 5 sentences."}]
|
23 |
|
24 |
messages.append({"role": "user", "content": user_input})
|
25 |
response = openai.ChatCompletion.create(
|