Skip to content

KuralleChatRouterOptions

type KuralleChatRouterOptions = object;
runtime: OpenAICompatRuntime;

optional sendWidgetWelcomeMessage?: boolean;

Whether /agents/chat/:sessionId should auto-greet on socket open. Deprecated. Use widgetWelcomeMode instead. Backward compatibility mapping:

  • false => off
  • true + widgetWelcomeMessage => static
  • true + no message => model

optional streamFilter?: StreamEventFilter;

Controls which HarnessStreamPart events are sent to external clients (SSE + widget/flow WebSockets).

  • 'safe': only user-facing events (text-delta, done, sanitized error, suggested-questions, input).
  • 'all': full stream (Studio / dev tooling).
  • function: custom predicate; return true to emit.
'safe'

optional upgradeWebSocket?: UpgradeWebSocket;

optional widgetWelcomeMessage?: string;

Optional static welcome text to send immediately on socket open. If provided, this is sent directly instead of running a runtime turn.


optional widgetWelcomeMode?: WidgetWelcomeMode;

Controls widget welcome behavior for /agents/chat/:sessionId.

  • off: do not send a welcome turn on connect.
  • model: generate welcome by calling runtime.stream(...).
  • static: send widgetWelcomeMessage directly without model inference.

optional widgetWelcomeSuggestions?: string[];

Optional static quick-reply suggestions for the initial widget state.