struct

OpenAI::Embedding

Inherits JSON::Serializable / Struct / Value / Object

Embedding is a special format of data representation that can be easily utilized by machine learning models and algorithms. The embedding is an information dense representation of the semantic meaning of a piece of text. Each embedding is a vector of floating point numbers, such that the distance between two embeddings in the vector space is correlated with semantic similarity between two inputs in the original format. For example, if two texts are similar, then their vector representations should also be similar.

Constructors

new(pull : JSON::PullParser)
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
index

The index of the embedding in the list of embeddings.

Source
object

The object type, which is always "embedding".

Source