🐛 fix(base.py): add exception logging to improve error handling and debugging

The `logger.exception(exc)` line has been added to log the exception that occurred. This will help with error handling and debugging by providing more information about the exception that caused the error.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-07-01 09:43:02 -03:00
commit 2635f06a06

View file

@ -51,5 +51,6 @@ async def get_result_and_steps(langchain_object, message: str, **kwargs):
)
thought = format_actions(intermediate_steps) if intermediate_steps else ""
except Exception as exc:
logger.exception(exc)
raise ValueError(f"Error: {str(exc)}") from exc
return result, thought