Package org.springframework.ai.embedding
Class Embedding
java.lang.Object
org.springframework.ai.embedding.Embedding
- All Implemented Interfaces:
ModelResult<float[]>
Represents a single embedding vector.
-
Constructor Details
-
Embedding
Creates a newEmbedding
instance.- Parameters:
embedding
- the embedding vector values.index
- the embedding index in a list of embeddings.
-
Embedding
Creates a newEmbedding
instance.- Parameters:
embedding
- the embedding vector values.index
- the embedding index in a list of embeddings.metadata
- the metadata associated with the embedding.
-
-
Method Details
-
getOutput
public float[] getOutput()Description copied from interface:ModelResult
Retrieves the output generated by the AI model.- Specified by:
getOutput
in interfaceModelResult<float[]>
- Returns:
- Get the embedding vector values.
-
getIndex
- Returns:
- Get the embedding index in a list of embeddings.
-
getMetadata
Description copied from interface:ModelResult
Retrieves the metadata associated with the result of an AI model.- Specified by:
getMetadata
in interfaceModelResult<float[]>
- Returns:
- Get the metadata associated with the embedding.
-
equals
-
hashCode
public int hashCode() -
toString
-