OpenAIChunkChoice

@Serializable
data class OpenAIChunkChoice(val index: Int, val delta: OpenAIDelta, val finishReason: String? = null, val logprobs: OpenAIChoiceLogprobs? = null) : Mapper<List<ChatChunkChoice>>

A choice within a streaming OpenAIChatCompletionChunk.

Maps to one or more io.kory.core.chat.choice.ChatChunkChoice items depending on the delta content:

Constructors

Link copied to clipboard
constructor(index: Int, delta: OpenAIDelta, finishReason: String? = null, logprobs: OpenAIChoiceLogprobs? = null)

Properties

Link copied to clipboard

The incremental delta content.

Link copied to clipboard
@SerialName(value = "finish_reason")
val finishReason: String?

Why the model stopped. null while still streaming.

Link copied to clipboard
val index: Int

The index of this choice.

Link copied to clipboard

Log probability information for the choice. Only present when logprobs is set to true in the request. null otherwise.

Functions

Link copied to clipboard
open override fun map(): List<ChatChunkChoice>
Link copied to clipboard

Converts this to a single core ChatChunkChoice.

Link copied to clipboard

Converts this to a list of core ChatChunkChoice items.