Closed pelikhan closed 2 weeks ago
The changes mostly seem to improve the error handling and enhance the readability of the code. Here are a few points that might be worth discussing:
Error handling level was changed from error
to warn
in multiple places. This might not be an issue, but it is something to watch out for if error
level logging is expected.
The function applyRepairs
now continues to work even after reaching maxDataRepairs
, as opposed to throwing an error and halting execution. It might not be a problem if this is the intended behaviour, but it's something to keep in mind.
The error message format has been updated in the applyRepairs
function. The error message now includes data
, schema
, and error
. It might be more helpful for debugging, but it might also break any existing log parsing or error handling that expects the old format.
In general, the changes look good and there don't seem to be any obvious functional issues introduced by the changes. Therefore, I would say:
LGTM :rocket:
generated by pr-review
applyRepairs
function to enhance error reporting. When a JSON validation fails, it now pushes a more detailed object into theinvalids
array.processChatMessage
,validateJSONWithSchema
, andstructurifyChatSession
functions.processChatMessage
to check repair counts and return undefined to keep working when possible.executeChatSession
function. It now provides a clearer breakdown of the messages and the LLM request.datarepair.genai.js
in thepackages/sample/genaisrc/
directory.schema
definition in the newly added file.