ChatResponse

data class ChatResponse(val model: String, val createdAt: Instant, val message: Message, val done: Boolean, val doneReason: String? = null, val totalDuration: Long? = null, val loadDuration: Long? = null, val promptEvalCount: Int? = null, val promptEvalDuration: Long? = null, val evalCount: Int? = null, val evalDuration: Long? = null)(source)

Represents a response from the chat completion endpoint.

Constructors

Link copied to clipboard
constructor(model: String, createdAt: Instant, message: Message, done: Boolean, doneReason: String? = null, totalDuration: Long? = null, loadDuration: Long? = null, promptEvalCount: Int? = null, promptEvalDuration: Long? = null, evalCount: Int? = null, evalDuration: Long? = null)

Properties

Link copied to clipboard
@SerialName(value = "created_at")
val createdAt: Instant

Timestamp when the response was created

Link copied to clipboard

Indicates if the generation is complete

Link copied to clipboard
@SerialName(value = "done_reason")
val doneReason: String?
Link copied to clipboard
@SerialName(value = "eval_count")
val evalCount: Int?

Number of tokens in the response

Link copied to clipboard
@SerialName(value = "eval_duration")
val evalDuration: Long?

Time spent generating the response (in nanoseconds)

Link copied to clipboard
@SerialName(value = "load_duration")
val loadDuration: Long?

Time spent loading the model (in nanoseconds)

Link copied to clipboard

The generated message

Link copied to clipboard

The model name used for generation

Link copied to clipboard
@SerialName(value = "prompt_eval_count")
val promptEvalCount: Int?

Number of tokens in the prompt

Link copied to clipboard
@SerialName(value = "prompt_eval_duration")
val promptEvalDuration: Long?

Time spent evaluating the prompt (in nanoseconds)

Link copied to clipboard
@SerialName(value = "total_duration")
val totalDuration: Long?

Time spent generating the response (in nanoseconds)