ChatResponse

data class ChatResponse(val message: ChatMessage.Assistant, val usage: TokenUsage? = null, val model: String? = null)

What a ChatModel answered.

Constructors

Link copied to clipboard
constructor(message: ChatMessage.Assistant, usage: TokenUsage? = null, model: String? = null)

Properties

Link copied to clipboard

the model's message. Add it to the conversation before the next request. Its ChatMessage.Assistant.truncated tells whether the model reached its output limit.

Link copied to clipboard

the model that answered, as the provider names it in its answer, when it does. It can be more exact than the ChatModel.name that was asked, such as gpt-4o-mini-2024-07-18 for gpt-4o-mini.

Link copied to clipboard

the tokens the call used, when the provider reports them.