Skip to main content

Module chat_app

Module chat_app 

Source
Expand description

ChatApp — LLM chat terminal application.

On native, implements [waxterm::app::TerminalApp] so it can be spawned via spawn_app_process inside the TuiService frame loop. The inference background thread is injected as a StreamSpawner closure.

On WASM, works as a push-based state machine: the host calls on_token(), on_stream_complete(), etc. directly, and submit_message_payload() returns the serialized JSON request for the host to forward.

Structs§

ChatApp
ChatGenConfig
Per-session inference configuration, adjustable via the Settings modal.
ChatHistoryEntry
A single message in the conversation history.
ToolCallRecord
A recorded tool call and its result (or in-flight state).

Enums§

ChatEvent
Events sent from the inference background thread to ChatApp::tick.
ChatMode
ChatRole
Role of a chat history entry.
ToolCallFormat
Tool-call output format used by a model family.

Type Aliases§

CancelHandle
One-shot cancellation handle returned by StreamSpawner. Calling it signals the background thread to abort the current stream.
LoadHook
Called once at construction to restore prior history (returns None if no history exists yet).
SaveHook
Called after StreamComplete to persist the current history.
StreamSpawner
Injected by service.rs — captures signing_key + model_ref.
ToolCaller
Tool executor injected at construction time.