Class Embedding
java.lang.Object
com.codename1.ai.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.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Embedding
public Embedding(float[] vector, int index) Creates an embedding result.- Parameters:
vector- numeric embedding coordinates, defensively copied; anullvalue creates an empty vectorindex- 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
-