ngx-prompt-kit

Reasoning Selector

ngx-prompt-kit original — not part of ibelick/prompt-kit

A composer-toolbar picker for how long the model reasons before answering. The trigger shows a strength glyph and the level's name; the menu, a spartan dropdown menu of radio items, lists each level with a one-line description, and its footer rates the highlighted level's speed and credits as it follows the pointer and the arrow keys.

Examples

In a composer

Placed in the composer's end slot, left of the model button. Arrow keys move through the levels, Enter picks one, Escape closes the menu and returns focus to the trigger.

value: medium

Your own levels

Pass levels with your provider's values. Leave out an entry with value null to drop Auto, and leave out speed and credits to drop the footer.

value: low

Glyphs

pk-reasoning-glyph on its own, for showing a level elsewhere (a message header, a settings row). Give it a label when no text next to it names the level.

Disabled

Installation

Add the reasoning-selector component (and the cn() utility) to your project.

ng generate ngx-prompt-kit:reasoning-selector

It is built on spartan/ui, so add these helm components too: button, dropdown-menu.

ng g @spartan-ng/cli:ui button dropdown-menu

Component API

PkReasoningSelector

PropTypeDefaultDescription
levelsReasoningLevelOption<T>[] DEFAULT_REASONING_LEVELS The rows, in order. An entry with strength "auto" is followed by a divider. { value: T | null, label, description?, strength: 0-4 | "auto", speed?: 1-5, credits?: 1-5 }.
valuemodel<T | null> null The picked level, two-way with [(value)]. null is the auto entry. A value no level has shows the auto entry (or the first).
valueChangeoutput<T | null> — Fires when a level is picked.
disabledboolean false Disables the trigger.
labelstring 'Reasoning' The menu heading and accessible name; the trigger is named "<label>: <level>".
side'top' | 'bottom' | 'left' | 'right' 'top' Where the menu opens; it flips when there is no room.
align'start' | 'center' | 'end' 'start' How the menu lines up with the trigger.
classstring — Extra classes for the host.

PkReasoningGlyph

PropTypeDefaultDescription
strength0 | 1 | 2 | 3 | 4 | "auto" — Filled bars, or a sparkle for auto.
labelstring '' Accessible name (role="img"). Empty leaves the glyph decorative.