AI scenarios
Reasoning
Bit.BlazorUI.AI Scripted transportModel thinking, shown in its own collapsed panel and kept out of the answer, the copy, and the next prompt.
Live demo
Ask the starter question: the model thinks out loud first, then answers.
How it works
Reasoning arrives as BitAiReasoningDeltaEvent and becomes a BitAiReasoningPart.
Because it is a part of its own rather than text with a label, it can be collapsed, timed, excluded from the
copy button, and left out of the plain-text projection of the conversation sent back to the provider on the
next turn (IBitAiMessage.GetText() skips it). A provider that needs its reasoning replayed on a
later turn sends an opaque Signature with the delta, which the part keeps.
The transport here streams the reasoning a word at a time, then the answer as ordinary text deltas. Nothing
says where the thinking ends: the first part of the answer completes the reasoning part, as a
BitAiPartCompletedEvent for it would. The panel is open while the model thinks and folds itself
away once the answer starts, with the time it took in its header. BitAiUiOptions.CollapseReasoning turns the folding off; a reader who opens or
closes the panel themselves keeps it the way they left it.
Components used
BitAiReasoningPartView- the reasoning, in its own panel, rendered as Markdown.BitAiCollapsible- the disclosure the panel is drawn with.BitAiThinkingIndicator- what shows before the first token arrives.BitAiChat- the chat around them.
Feedback
Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.