class AI::OpenAI::OpenAIEmbeddingModel

Overview

OpenAI embedding model implementation.

Implements the EmbeddingModelV3 interface for generating embeddings using OpenAI's embedding API.

Included Modules

Defined in:

ai/openai/embedding/openai_embedding_model.cr

Constructors

Instance Method Summary

Instance methods inherited from module AI::Provider::EmbeddingModel::V3

do_embed(options : CallOptions) : Result do_embed, max_embeddings_per_call : Int32 | Nil max_embeddings_per_call, model_id : String model_id, provider : String provider, specification_version : String specification_version, supports_parallel_calls? : Bool supports_parallel_calls?

Constructor Detail

def self.new(model_id : OpenAIEmbeddingModelId, config : OpenAIConfig) #

[View source]

Instance Method Detail

Generates embeddings for the given values.

Parameters:

  • options: Call options including values to embed, headers, and provider options

Returns embedding result with vectors and usage information.


[View source]
def max_embeddings_per_call : Int32 #

Maximum number of embeddings per API call.


[View source]
def model_id : OpenAIEmbeddingModelId #

The model ID.


[View source]
def provider : String #

Returns the provider name.


[View source]
def specification_version : String #

Returns the specification version.


[View source]
def supports_parallel_calls? : Bool #

Whether parallel calls are supported.


[View source]