This commit is contained in:
Nicholas Albion
2023-09-09 11:54:16 +10:00
parent 4b64631bec
commit a38c7c4f6d
3 changed files with 5 additions and 7 deletions

View File

@@ -118,7 +118,7 @@ def create_gpt_chat_completion(messages: List[dict], req_type, min_tokens=MIN_TO
# Check if the error message is related to token limit
if "context_length_exceeded" in error_message.lower():
raise Exception(f'Too many tokens in the request. Please try to continue the project with some previous development step.')
raise Exception('Too many tokens in the request. Please try to continue the project with some previous development step.')
else:
print('The request to OpenAI API failed. Here is the error message:')
print(e)
@@ -157,7 +157,7 @@ def retry_on_exception(func):
time.sleep(wait_duration)
continue
print(colored(f'There was a problem with request to openai API:', 'red'))
print(colored('There was a problem with request to openai API:', 'red'))
print(err_str)
user_message = questionary.text(