class
AI::Provider::InvalidPromptError
- AI::Provider::InvalidPromptError
- AI::Provider::AISDKError
- Exception
- Reference
- Object
Overview
Error thrown when a prompt is invalid.
This error should be thrown by providers when they cannot process a prompt due to structural or content issues.
Defined in:
ai/provider/errors/invalid_prompt_error.crConstructors
-
.new(*, prompt, message : String, cause : Exception | Nil = nil)
Creates a new InvalidPromptError.
Class Method Summary
-
.instance?(error) : Bool
Checks if the given value is an instance of InvalidPromptError.
Instance Method Summary
-
#prompt : JSON::Any | Nil
The invalid prompt value.
Instance methods inherited from class AI::Provider::AISDKError
name : String
name,
to_s(io : IO) : Nil
to_s
Constructor methods inherited from class AI::Provider::AISDKError
new(*, name : String, message : String, cause : Exception | Nil = nil)
new
Class methods inherited from class AI::Provider::AISDKError
instance?(error) : Bool
instance?
Constructor Detail
def self.new(*, prompt, message : String, cause : Exception | Nil = nil)
#
Creates a new InvalidPromptError.
Parameters:
- prompt: The invalid prompt value (any type)
- message: Description of why the prompt is invalid
- cause: Optional underlying exception