struct AI::OpenAI::OpenAIEmbeddingResponse

Overview

Response from OpenAI embedding API.

This is a minimal version of the schema, focused on what is needed for the implementation. This approach limits breakages when the API changes and increases efficiency.

Included Modules

Defined in:

ai/openai/embedding/openai_embedding_api.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(data : Array(OpenAIEmbeddingData), usage : OpenAIEmbeddingUsage | Nil = nil) #

[View source]
def self.new(*, __pull_for_json_serializable pull : JSON::PullParser) #

[View source]

Instance Method Detail

def data : Array(OpenAIEmbeddingData) #

Array of embedding data objects.


[View source]
def usage : OpenAIEmbeddingUsage | Nil #

Usage information (optional).


[View source]