class
ion7.llm.chat.Thinking
Functions
Thinking.new
Thinking:reset
Reset to the initial state — call between generations. Returns the thinking text accumulated since the last reset (useful when the upstream loop wants to clear the buffer AND keep the trace).
Thinking:in_think
True when the buffer is currently inside a `
Thinking:active_token_count
Total tokens consumed inside the active block. Resets to 0 each time a block closes. Used by the reasoning-budget guard.
Thinking:thinking
Concatenated text of every closed `
?
Feed a decoded piece. Returns one of the three transitions :
- `"content"` — emit `text` on the assistant channel.
- `"thinking"`— emit `text` on the reasoning channel.
- `"split"` — the piece straddles the `
Thinking:force_close
Force-close the active think block. Used by the reasoning-budget guard when the model exceeds its allotment without emitting ``. Returns the body collected so far.