class AI::Provider::NoSuchModelError

Overview

Error thrown when a requested model does not exist.

This error is raised when attempting to access a model that is not available from the provider.

Defined in:

ai/provider/errors/no_such_model_error.cr

Constructors

Class Method Summary

Instance Method Summary

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(*, model_id : String, model_type : ModelType, error_name : String = DEFAULT_ERROR_NAME, message : String | Nil = nil) #

Creates a new NoSuchModelError.

Parameters:

  • model_id: The ID of the model that was not found
  • model_type: The type of model (language, embedding, image, etc.)
  • error_name: Optional custom error name
  • message: Optional custom message

[View source]

Class Method Detail

def self.instance?(error) : Bool #

Checks if the given value is an instance of NoSuchModelError.


[View source]

Instance Method Detail

def model_id : String #

The ID of the model that was not found.


[View source]
def model_type : ModelType #

The type of model that was requested.


[View source]