Spaces:
Sleeping
Sleeping
update c
Browse files
app.py
CHANGED
|
@@ -8,10 +8,16 @@ def respond(message,history):
|
|
| 8 |
messages = [{"role":"system", "content": "You are a friendly chatbot!"}]
|
| 9 |
if history:
|
| 10 |
messages.extend(history)
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
chatbot = gr.ChatInterface(respond, type="messages", title="Personal ChatWoman")
|
| 16 |
|
| 17 |
chatbot.launch()
|
|
|
|
| 8 |
messages = [{"role":"system", "content": "You are a friendly chatbot!"}]
|
| 9 |
if history:
|
| 10 |
messages.extend(history)
|
| 11 |
+
|
| 12 |
+
messages.append({"role": "user", "content":message})
|
| 13 |
+
|
| 14 |
+
response = client.chat_completion(
|
| 15 |
+
messages,
|
| 16 |
+
max_token=100
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
+
return response['choices'][0]['message']['content'].strip()
|
| 20 |
+
|
| 21 |
chatbot = gr.ChatInterface(respond, type="messages", title="Personal ChatWoman")
|
| 22 |
|
| 23 |
chatbot.launch()
|