Re-raise openai.error.InvalidRequestError if it is not context exhaustion

This commit is contained in:
Paul Gauthier 2023-07-08 06:06:17 -07:00
parent b4fe54a917
commit 579a3eb4c3

View file

@ -485,6 +485,8 @@ class Coder:
except openai.error.InvalidRequestError as err:
if "maximum context length" in str(err):
exhausted = True
else:
raise err
if exhausted:
self.num_exhausted_context_windows += 1