StopReason

@Serializable(with = StopReasoningSerializer::class)
class StopReason(val reasons: List<String>)

Custom stop sequences that cause the model to stop generating further tokens.

A single string or up to 16 strings are accepted. The wire representation collapses a single-element list into a plain JSON string and serializes larger lists as a JSON array, matching the DeepSeek API contract.

Example:

val params = chatCompletionParams {
stop = StopReason(listOf("\nUser:", "\nAssistant:"))
}

Constructors

Link copied to clipboard
constructor(reasons: List<String>)

Properties

Link copied to clipboard

One or more stop strings; empty list serializes as JSON null.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String