-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
66 additions
and
386 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,2 @@ | ||
from logging import LogRecord | ||
|
||
from llmclient.messages import EMPTY_CONTENT_BASE_MSG | ||
|
||
|
||
class JSONSchemaValidationError(ValueError): | ||
"""Raised when the completion does not match the specified schema.""" | ||
|
||
|
||
class MalformedMessageError(ValueError): | ||
"""Error to throw if some aspect of a Message variant is malformed.""" | ||
|
||
@classmethod | ||
def common_retryable_errors_log_filter(cls, record: LogRecord) -> bool: | ||
""" | ||
Filter out common parsing failures not worth looking into from logs. | ||
Returns: | ||
False if the LogRecord should be filtered out, otherwise True to keep it. | ||
""" | ||
# NOTE: match both this Exception type's name and its content, to be robust | ||
return not all(x in record.msg for x in (cls.__name__, EMPTY_CONTENT_BASE_MSG)) |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.