Spaces:
Sleeping
Sleeping
update retries
Browse files- chatbot_simulator.py +1 -1
chatbot_simulator.py
CHANGED
@@ -70,7 +70,7 @@ class ChatbotSimulation:
|
|
70 |
@retry(
|
71 |
retry=retry_if_exception_type(RateLimitError),
|
72 |
wait=wait_fixed(5), # Waits for 5 seconds between retries
|
73 |
-
stop=stop_after_attempt(
|
74 |
)
|
75 |
def _get_openai_response(self, prompt):
|
76 |
"""Fetch response from OpenAI API using tenacity for handling retries."""
|
|
|
70 |
@retry(
|
71 |
retry=retry_if_exception_type(RateLimitError),
|
72 |
wait=wait_fixed(5), # Waits for 5 seconds between retries
|
73 |
+
stop=stop_after_attempt(50000) # Stops after 5 failed attempts
|
74 |
)
|
75 |
def _get_openai_response(self, prompt):
|
76 |
"""Fetch response from OpenAI API using tenacity for handling retries."""
|