FinishReason

org.llm4s.llmconnect.model.FinishReason
@Stable

Why the model's turn ended, as the provider reported it, mapped to one vocabulary (RFC 0009).

Every Completion carries one, and a StreamedChunk may. Each client maps its own provider's values; a value a client has no mapping for is kept as FinishReason.Other, so a new provider value never fails a call. There is no error case: a reply that ended in an error is a Left, and so is a content-filter finish (org.llm4s.error.ContentFilteredError).

Attributes

Source
FinishReason.scala
Graph
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Type members

Enum entries

case Length extends FinishReason

An output limit was reached: max tokens, or the context window. The content is cut short.

An output limit was reached: max tokens, or the context window. The content is cut short.

Attributes

Source
FinishReason.scala
final case class Other(raw: String)

A reason this client has no mapping for, kept as the provider sent it. Other("") means the client did not read one: a provider that sent none, or a client not mapped yet.

A reason this client has no mapping for, kept as the provider sent it. Other("") means the client did not read one: a provider that sent none, or a client not mapped yet.

Attributes

Source
FinishReason.scala
case Stop extends FinishReason

The model ended its turn: a natural stop, or a stop sequence.

The model ended its turn: a natural stop, or a stop sequence.

Attributes

Source
FinishReason.scala
case ToolCalls extends FinishReason

The model asked for one or more tool calls.

The model asked for one or more tool calls.

Attributes

Source
FinishReason.scala