OpenAIStop
Stop sequences for an OpenAI chat completion request.
The API accepts either a single string or an array of up to 4 strings. The model stops generating further tokens when a sequence is encountered, and the returned text does not contain the stop sequence.
Not supported by the latest reasoning models (o3, o4-mini and newer).
See also
Samples
// Single sequence.
val stopString = OpenAIStop.OpenAIString("###")
// Multiple sequences.
val stopList = OpenAIStop.OpenAIList(listOf("\n\n", "###"))Content copied to clipboard