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 theembeddings
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theloadDuration
record component.model()
Returns the value of themodel
record component.Returns the value of thepromptEvalCount
record component.final String
toString()
Returns a string representation of this record class.Returns the value of thetotalDuration
record component.
-
Constructor Details
-
EmbeddingsResponse
public EmbeddingsResponse(String model, List<float[]> embeddings, Long totalDuration, Long loadDuration, Integer promptEvalCount) Creates an instance of aEmbeddingsResponse
record class.- Parameters:
model
- the value for themodel
record componentembeddings
- the value for theembeddings
record componenttotalDuration
- the value for thetotalDuration
record componentloadDuration
- the value for theloadDuration
record componentpromptEvalCount
- the value for thepromptEvalCount
record 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 themodel
record component.- Returns:
- the value of the
model
record component
-
embeddings
Returns the value of theembeddings
record component.- Returns:
- the value of the
embeddings
record component
-
totalDuration
Returns the value of thetotalDuration
record component.- Returns:
- the value of the
totalDuration
record component
-
loadDuration
Returns the value of theloadDuration
record component.- Returns:
- the value of the
loadDuration
record component
-
promptEvalCount
Returns the value of thepromptEvalCount
record component.- Returns:
- the value of the
promptEvalCount
record component
-