Record Class OllamaApi.ChatResponse
java.lang.Object
java.lang.Record
org.springframework.ai.ollama.api.OllamaApi.ChatResponse
- Record Components:
model
- The model used for generating the response.createdAt
- The timestamp of the response generation.message
- The responseOllamaApi.Message
withOllamaApi.Message.Role.ASSISTANT
.doneReason
- The reason the model stopped generating text.done
- Whether this is the final response. For streaming response only the last message is marked as done. If true, this response may be followed by another response with the following, additional fields: context, prompt_eval_count, prompt_eval_duration, eval_count, eval_duration.totalDuration
- Time spent generating the response.loadDuration
- Time spent loading the model.promptEvalCount
- Number of tokens in the prompt.promptEvalDuration
- Time spent evaluating the prompt.evalCount
- Number of tokens in the response.evalDuration
- Time spent generating the response.
- Enclosing class:
- OllamaApi
public static record OllamaApi.ChatResponse(String model, Instant createdAt, OllamaApi.Message message, String doneReason, Boolean done, Long totalDuration, Long loadDuration, Integer promptEvalCount, Long promptEvalDuration, Integer evalCount, Long evalDuration)
extends Record
Ollama chat response object.
- See Also:
-
Constructor Summary
ConstructorDescriptionChatResponse
(String model, Instant createdAt, OllamaApi.Message message, String doneReason, Boolean done, Long totalDuration, Long loadDuration, Integer promptEvalCount, Long promptEvalDuration, Integer evalCount, Long evalDuration) Creates an instance of aChatResponse
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecreatedAt
record component.done()
Returns the value of thedone
record component.Returns the value of thedoneReason
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of theevalCount
record component.Returns the value of theevalDuration
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of theloadDuration
record component.message()
Returns the value of themessage
record component.model()
Returns the value of themodel
record component.Returns the value of thepromptEvalCount
record component.Returns the value of thepromptEvalDuration
record component.final String
toString()
Returns a string representation of this record class.Returns the value of thetotalDuration
record component.
-
Constructor Details
-
ChatResponse
public ChatResponse(String model, Instant createdAt, OllamaApi.Message message, String doneReason, Boolean done, Long totalDuration, Long loadDuration, Integer promptEvalCount, Long promptEvalDuration, Integer evalCount, Long evalDuration) Creates an instance of aChatResponse
record class.- Parameters:
model
- the value for themodel
record componentcreatedAt
- the value for thecreatedAt
record componentmessage
- the value for themessage
record componentdoneReason
- the value for thedoneReason
record componentdone
- the value for thedone
record componenttotalDuration
- the value for thetotalDuration
record componentloadDuration
- the value for theloadDuration
record componentpromptEvalCount
- the value for thepromptEvalCount
record componentpromptEvalDuration
- the value for thepromptEvalDuration
record componentevalCount
- the value for theevalCount
record componentevalDuration
- the value for theevalDuration
record component
-
-
Method Details
-
getTotalDuration
-
getLoadDuration
-
getPromptEvalDuration
-
getEvalDuration
-
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
-
createdAt
Returns the value of thecreatedAt
record component.- Returns:
- the value of the
createdAt
record component
-
message
Returns the value of themessage
record component.- Returns:
- the value of the
message
record component
-
doneReason
Returns the value of thedoneReason
record component.- Returns:
- the value of the
doneReason
record component
-
done
Returns the value of thedone
record component.- Returns:
- the value of the
done
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
-
promptEvalDuration
Returns the value of thepromptEvalDuration
record component.- Returns:
- the value of the
promptEvalDuration
record component
-
evalCount
Returns the value of theevalCount
record component.- Returns:
- the value of the
evalCount
record component
-
evalDuration
Returns the value of theevalDuration
record component.- Returns:
- the value of the
evalDuration
record component
-