Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,9 +46,20 @@ def openai_chat_history(input, history):
|
|
| 46 |
inp = ' '.join(s)
|
| 47 |
output = generate_response(inp)
|
| 48 |
history.append((input, output))
|
| 49 |
-
return history
|
| 50 |
else:
|
| 51 |
-
return ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
# Define the conversation prompt
|
| 54 |
conversation_prompt = "Welcome to ChatRobo, kindly type in your enquiries: "
|
|
|
|
| 46 |
inp = ' '.join(s)
|
| 47 |
output = generate_response(inp)
|
| 48 |
history.append((input, output))
|
| 49 |
+
return output, history
|
| 50 |
else:
|
| 51 |
+
return "", history
|
| 52 |
+
history = []
|
| 53 |
+
while True:
|
| 54 |
+
# Get user input
|
| 55 |
+
user_input = input("You: ")
|
| 56 |
+
|
| 57 |
+
# Generate response and update chat history
|
| 58 |
+
response, history = openai_chat_history(user_input, history)
|
| 59 |
+
|
| 60 |
+
# Print response
|
| 61 |
+
print("Bot:", response)
|
| 62 |
+
|
| 63 |
|
| 64 |
# Define the conversation prompt
|
| 65 |
conversation_prompt = "Welcome to ChatRobo, kindly type in your enquiries: "
|