LiteRtLmConversationOptions constructor

LiteRtLmConversationOptions({
  1. JSObject? sessionConfig,
  2. JSObject? preface,
  3. bool? filterChannelContentFromKvCache,
  4. bool? prefillPrefaceOnInit,
  5. bool? enableConstrainedDecoding,
})

Implementation

external factory LiteRtLmConversationOptions({
  /// `SessionConfig` from the upstream TS declarations:
  ///   { visionModalityEnabled?, audioModalityEnabled?, samplerParams?,
  ///     maxOutputTokens?, ... }
  /// Build with `jsify({...})`. Typed as opaque [JSObject] for forward
  /// compatibility.
  JSObject? sessionConfig,

  /// `Preface` from upstream TS:
  ///   { messages?: Message[], tools?: Tool[], extra_context?: {...} }
  /// `extra_context` is the same channel native FFI uses to enable
  /// Gemma 4 thinking mode (`{ "thinking": true }`).
  JSObject? preface,

  /// `filterChannelContentFromKvCache`: when thinking is enabled this
  /// strips the thinking channel content from the KV cache so it doesn't
  /// pollute follow-up turns. Mirrors the FFI `filter_channel_content_from_kv_cache`.
  bool? filterChannelContentFromKvCache,

  /// Whether the SDK prefills the preface immediately on init.
  bool? prefillPrefaceOnInit,

  /// Whether constrained decoding is enabled (used for native tool calling).
  bool? enableConstrainedDecoding,
});