feat: add debugging for retries (#283)

This commit is contained in:
Jason Liu
2023-12-16 21:49:44 -05:00
committed by GitHub
parent f0d76ac1fc
commit 78a89057f1
+3
View File
@@ -237,6 +237,8 @@ async def retry_async(
mode=mode,
)
except (ValidationError, JSONDecodeError) as e:
logger.exception(f"Retrying, exception: {e}")
logger.debug(f"Error response: {response}")
kwargs["messages"].append(dump_message(response.choices[0].message)) # type: ignore
kwargs["messages"].append(
{
@@ -282,6 +284,7 @@ def retry_sync(
)
except (ValidationError, JSONDecodeError) as e:
logger.exception(f"Retrying, exception: {e}")
logger.debug(f"Error response: {response}")
kwargs["messages"].append(dump_message(response.choices[0].message))
kwargs["messages"].append(
{