class

OpenAI::Embedding

Inherits JSON::Serializable < Reference < Object

Represents an embedding vector returned by embedding endpoint.

Constructors

new(index : Int64 = 0, embedding : Array(Float32) = [] of Float32, object : EmbeddingObject = EmbeddingObject::Embedding)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

embedding

The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the embedding guide.

Source
embedding=(embedding : Array(Float32))

The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the embedding guide.

Source
index

The index of the embedding in the list of embeddings.

Source
index=(index : Int64)

The index of the embedding in the list of embeddings.

Source
object

The object type, which is always "embedding".

Source
object=(object : EmbeddingObject)

The object type, which is always "embedding".

Source