Record Class OllamaApi.EmbeddingsResponse
java.lang.Object
java.lang.Record
org.springframework.ai.ollama.api.OllamaApi.EmbeddingsResponse
- Record Components:
model- The model used for generating the embeddings.embeddings- The list of embeddings generated from the model. Each embedding (list of doubles) corresponds to a single input text.totalDuration- The total time spent generating the embeddings.loadDuration- The time spent loading the model.promptEvalCount- The number of tokens in the prompt.
- Enclosing class:
- OllamaApi
public static record OllamaApi.EmbeddingsResponse(String model, List<float[]> embeddings, Long totalDuration, Long loadDuration, Integer promptEvalCount)
extends Record
The response object returned from the /embedding endpoint.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<float[]>Returns the value of theembeddingsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theloadDurationrecord component.model()Returns the value of themodelrecord component.Returns the value of thepromptEvalCountrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetotalDurationrecord component.
-
Constructor Details
-
EmbeddingsResponse
public EmbeddingsResponse(String model, List<float[]> embeddings, Long totalDuration, Long loadDuration, Integer promptEvalCount) Creates an instance of aEmbeddingsResponserecord class.- Parameters:
model- the value for themodelrecord componentembeddings- the value for theembeddingsrecord componenttotalDuration- the value for thetotalDurationrecord componentloadDuration- the value for theloadDurationrecord componentpromptEvalCount- the value for thepromptEvalCountrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
model
Returns the value of themodelrecord component.- Returns:
- the value of the
modelrecord component
-
embeddings
Returns the value of theembeddingsrecord component.- Returns:
- the value of the
embeddingsrecord component
-
totalDuration
Returns the value of thetotalDurationrecord component.- Returns:
- the value of the
totalDurationrecord component
-
loadDuration
Returns the value of theloadDurationrecord component.- Returns:
- the value of the
loadDurationrecord component
-
promptEvalCount
Returns the value of thepromptEvalCountrecord component.- Returns:
- the value of the
promptEvalCountrecord component
-