Chat

@Serializable
data class Chat(val createdAt: String = "", val done: Boolean = false, val doneReason: String = "", val evalCount: Long = 0, val evalDuration: Long = 0, val loadDuration: Long = 0, val logprobs: List<Logprob> = emptyList(), val message: Message = Message(content = "default response, probably an error", role = ""), val model: String = "", val promptEvalCount: Long = 0, val promptEvalDuration: Long = 0, val totalDuration: Long = 0)(source)

Full chat-completion response from an LLM backend.

Constructors

Link copied to clipboard
constructor(createdAt: String = "", done: Boolean = false, doneReason: String = "", evalCount: Long = 0, evalDuration: Long = 0, loadDuration: Long = 0, logprobs: List<Logprob> = emptyList(), message: Message = Message(content = "default response, probably an error", role = ""), model: String = "", promptEvalCount: Long = 0, promptEvalDuration: Long = 0, totalDuration: Long = 0)

Properties

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

ISO-8601 timestamp of when the response was generated upstream.

Link copied to clipboard
@SerialName(value = "done")
val done: Boolean

true when this is the final chunk of a streamed response.

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

Reason the upstream stopped generating ("stop", "length", etc.).

Link copied to clipboard
@SerialName(value = "eval_count")
val evalCount: Long

Number of evaluated tokens for the response itself.

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

Wall-clock time in nanoseconds spent evaluating the response.

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

Wall-clock time in nanoseconds the model spent loading.

Link copied to clipboard
@SerialName(value = "logprobs")
val logprobs: List<Logprob>

Optional per-token log-probabilities; empty unless introspection is enabled.

Link copied to clipboard
@SerialName(value = "message")
val message: Message

The assistant's reply.

Link copied to clipboard
@SerialName(value = "model")
val model: String

Identifier of the model that produced the response.

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

Number of evaluated tokens in the prompt.

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

Wall-clock time in nanoseconds spent evaluating the prompt.

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

Total wall-clock time in nanoseconds for the whole request.