GenerateResponse

data class GenerateResponse(val model: String, val createdAt: Instant, val response: String, val done: Boolean, val doneReason: String? = null, val context: List<Int>? = 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 generate completion endpoint.

Constructors

Link copied to clipboard
constructor(model: String, createdAt: Instant, response: String, done: Boolean, doneReason: String? = null, context: List<Int>? = null, totalDuration: Long? = null, loadDuration: Long? = null, promptEvalCount: Int? = null, promptEvalDuration: Long? = null, evalCount: Int? = null, evalDuration: Long? = null)

Properties

Link copied to clipboard

An encoding of the conversation used in this response

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?

The reason why generation completed (e.g., "stop", "length")

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 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

The generated text response (empty if streamed)

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

Time spent generating the response (in nanoseconds)