update
Browse files
app.py
CHANGED
|
@@ -13,6 +13,7 @@ def respond(message, history):
|
|
| 13 |
messages = [{"role": "system", "content" : "You are a friendly chatbot."}]
|
| 14 |
if history:
|
| 15 |
messages.extent(history) #conversation adds messages to the history
|
|
|
|
| 16 |
messages.append({"role": "user", "content": message})
|
| 17 |
response = client.chat_completion(
|
| 18 |
messages, #parameters
|
|
@@ -21,10 +22,10 @@ def respond(message, history):
|
|
| 21 |
|
| 22 |
return response['choices'][0]['message']['content'].strip()
|
| 23 |
|
| 24 |
-
def yes_or_no(message,history):
|
| 25 |
-
return random.choice(["absolutely NOT.","now why would you even ask that", "this is not what I meant when i said do it for the lore..","do it for the lore!", "+1000 aura if you do","yes PLEASE", "i mean you do you ig..","i mean yolo"])
|
| 26 |
|
| 27 |
-
print("Hello world!")
|
| 28 |
chatbot = gr.ChatInterface(respond , type = "messages")
|
| 29 |
# defining my chatbot so that the user can interact, see their convo history and send new messages
|
| 30 |
|
|
|
|
| 13 |
messages = [{"role": "system", "content" : "You are a friendly chatbot."}]
|
| 14 |
if history:
|
| 15 |
messages.extent(history) #conversation adds messages to the history
|
| 16 |
+
|
| 17 |
messages.append({"role": "user", "content": message})
|
| 18 |
response = client.chat_completion(
|
| 19 |
messages, #parameters
|
|
|
|
| 22 |
|
| 23 |
return response['choices'][0]['message']['content'].strip()
|
| 24 |
|
| 25 |
+
#def yes_or_no(message,history):
|
| 26 |
+
#return random.choice(["absolutely NOT.","now why would you even ask that", "this is not what I meant when i said do it for the lore..","do it for the lore!", "+1000 aura if you do","yes PLEASE", "i mean you do you ig..","i mean yolo"])
|
| 27 |
|
| 28 |
+
#print("Hello world!")
|
| 29 |
chatbot = gr.ChatInterface(respond , type = "messages")
|
| 30 |
# defining my chatbot so that the user can interact, see their convo history and send new messages
|
| 31 |
|