-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(parameter_extractor): implement custom error classes (#10260)
- Loading branch information
Showing
2 changed files
with
86 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
class ParameterExtractorNodeError(ValueError): | ||
"""Base error for ParameterExtractorNode.""" | ||
|
||
|
||
class InvalidModelTypeError(ParameterExtractorNodeError): | ||
"""Raised when the model is not a Large Language Model.""" | ||
|
||
|
||
class ModelSchemaNotFoundError(ParameterExtractorNodeError): | ||
"""Raised when the model schema is not found.""" | ||
|
||
|
||
class InvalidInvokeResultError(ParameterExtractorNodeError): | ||
"""Raised when the invoke result is invalid.""" | ||
|
||
|
||
class InvalidTextContentTypeError(ParameterExtractorNodeError): | ||
"""Raised when the text content type is invalid.""" | ||
|
||
|
||
class InvalidNumberOfParametersError(ParameterExtractorNodeError): | ||
"""Raised when the number of parameters is invalid.""" | ||
|
||
|
||
class RequiredParameterMissingError(ParameterExtractorNodeError): | ||
"""Raised when a required parameter is missing.""" | ||
|
||
|
||
class InvalidSelectValueError(ParameterExtractorNodeError): | ||
"""Raised when a select value is invalid.""" | ||
|
||
|
||
class InvalidNumberValueError(ParameterExtractorNodeError): | ||
"""Raised when a number value is invalid.""" | ||
|
||
|
||
class InvalidBoolValueError(ParameterExtractorNodeError): | ||
"""Raised when a bool value is invalid.""" | ||
|
||
|
||
class InvalidStringValueError(ParameterExtractorNodeError): | ||
"""Raised when a string value is invalid.""" | ||
|
||
|
||
class InvalidArrayValueError(ParameterExtractorNodeError): | ||
"""Raised when an array value is invalid.""" | ||
|
||
|
||
class InvalidModelModeError(ParameterExtractorNodeError): | ||
"""Raised when the model mode is invalid.""" |
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