public final class Embedding
- Object
- Embedding
One vector returned by an embedding provider. The vector is defensively
copied on construction and access so callers cannot mutate stored results.
getIndex() identifies the corresponding input position in a
batched EmbeddingRequest.Constructors
public Embedding(float[] vector, int index) | Creates an embedding result. |
Methods
public float[] getVector() | |
public int getIndex() | |
public int getDimensions() |
Inherited methods
Constructor details
Embedding
public Embedding(float[] vector, int index)Creates an embedding result.
Parameters
vectorfloat[]- numeric embedding coordinates, defensively copied; a
nullvalue creates an empty vector indexint- zero-based position of the corresponding request input
Method details
getVector
public float[] getVector()Returns
a defensive copy of the embedding coordinates
getIndex
public int getIndex()Returns
zero-based position of this item in the request
getDimensions
public int getDimensions()Returns
number of coordinates in the embedding