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