Spaces:
Sleeping
Sleeping
updated
Browse files
app.py
CHANGED
|
@@ -12,10 +12,19 @@ def respond(message, history):
|
|
| 12 |
|
| 13 |
response = client.chat_completion(
|
| 14 |
messages=messages,
|
| 15 |
-
max_tokens=400 #
|
| 16 |
)
|
| 17 |
|
| 18 |
return response.choices[0].message.content.strip()
|
| 19 |
|
| 20 |
-
chatbot = gr.ChatInterface(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
chatbot.launch()
|
|
|
|
| 12 |
|
| 13 |
response = client.chat_completion(
|
| 14 |
messages=messages,
|
| 15 |
+
max_tokens=400 # allow longer responses
|
| 16 |
)
|
| 17 |
|
| 18 |
return response.choices[0].message.content.strip()
|
| 19 |
|
| 20 |
+
chatbot = gr.ChatInterface(
|
| 21 |
+
respond,
|
| 22 |
+
examples=[ # give the user example prompts
|
| 23 |
+
"I've been feeling stressed about school lately.",
|
| 24 |
+
"What are some coping strategies for anxiety?",
|
| 25 |
+
"How can I manage test anxiety?",
|
| 26 |
+
"What should I do when I'm feeling overwhelmed?"
|
| 27 |
+
]
|
| 28 |
+
|
| 29 |
+
)
|
| 30 |
chatbot.launch()
|