Skip to main content

ChatOutcome

How a chat reply ended.

abandoned (property)​

True when the stream was closed before the reply completed.

accepted_prediction_tokens (property)​

Drafted tokens the model confirmed under prompt lookup; None when the reply drafted nothing.

cached_prompt_tokens (property)​

Prompt tokens the prefix cache served instead of computing; None when not reported.

completion_tokens (property)​

(self) -> int

finish (property)​

"stop" (an end token or a stop condition), "length" (the budget or the context window), "tool_calls", "content_filter" or "error".

prompt_tokens (property)​

(self) -> int

reasoning (property)​

The reply's reasoning channel (empty when the model has none or it stayed closed).

rejected_prediction_tokens (property)​

Drafted tokens the model rejected under prompt lookup; None when the reply drafted nothing.

speculative_steps (property)​

Decode steps that scored a draft; None when the reply drafted nothing.

stop_string (property)​

The stop string that ended the reply, when one did.

stop_token_id (property)​

The stop token id that ended the reply, when one did.

text (property)​

The complete reply.

tool_calls (property)​

The tool calls read out of the reply (ToolCall each), in order; empty when none.

tools_called (property)​

True when the reply called at least one tool (finish then reads "tool_calls").

visible_text (property)​

The user-facing text: the reply without its reasoning and without any tool call's syntax.

__init__​

__init__(self, /, *args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.