This repository was archived by the owner on Jan 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error handling in model response parsing
Add error handling for invalid JSON and format in model responses - Introduce `ParseError` class to represent parsing errors, which can be returned instead of `ParsedLLMResponse` when an error occurs. - Handle `JSONDecodeError` and `ValidationError` exceptions in the `JsonParser` class, returning a `ParseError` instance with the appropriate error message and partial response. - Modify the `Conversation` class to handle `ParseError` instances, displaying the error message to the user and not adding the error response to the conversation messages. - Update the `AgentHandler` class to handle `ParseError` instances returned from the parser, displaying the error message to the user and returning an empty list of commands. This change improves the robustness of the system by providing better error handling and feedback to the user when issues occur during the parsing of model responses.
- Loading branch information
1 parent
129c616
commit 7b90f43
Showing
4 changed files
with
54 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters