Spaces:
Sleeping
Sleeping
jjz5463
commited on
Commit
·
8e58f6e
1
Parent(s):
c61089d
add trim conversation back
Browse files- chatbot_simulator.py +1 -0
chatbot_simulator.py
CHANGED
|
@@ -72,6 +72,7 @@ class ChatbotSimulation:
|
|
| 72 |
)
|
| 73 |
def _get_openai_response(self, prompt):
|
| 74 |
"""Fetch response from OpenAI API using tenacity for handling retries."""
|
|
|
|
| 75 |
response = self.client.chat.completions.create(
|
| 76 |
model="gpt-4",
|
| 77 |
messages=prompt,
|
|
|
|
| 72 |
)
|
| 73 |
def _get_openai_response(self, prompt):
|
| 74 |
"""Fetch response from OpenAI API using tenacity for handling retries."""
|
| 75 |
+
self._trim_conversation()
|
| 76 |
response = self.client.chat.completions.create(
|
| 77 |
model="gpt-4",
|
| 78 |
messages=prompt,
|