Class LiteRtResponse
- Namespace
- LiteRtLmSharp
- Assembly
- LiteRtLmSharp.dll
A model response: plain Text or one or more ToolCalls, plus — on reasoning models — a separate Thinking trace (see Channels). RawJson always holds the unparsed response (escape hatch).
public sealed class LiteRtResponse
- Inheritance
-
LiteRtResponse
- Inherited Members
Properties
Channels
Out-of-band channels the model emitted alongside the primary Text, keyed by channel name (the reasoning build emits a "thinking"/"thought" channel). Empty for models without channels, or when reasoning mode is off. See Thinking for the common case.
public IReadOnlyDictionary<string, string> Channels { get; }
Property Value
IsToolCall
True when the model requested one or more tool calls.
public bool IsToolCall { get; }
Property Value
RawJson
The raw response JSON from the engine.
public string RawJson { get; }
Property Value
Text
The assistant text, or null when the model emitted tool calls.
public string? Text { get; }
Property Value
Thinking
The model's reasoning ("thinking") trace, separate from the final Text answer,
or null when there is none. Convenience over Channels (the concatenation
of all channel content). Populated only when the conversation was created with
EnableThinking = true on a reasoning model.
public string? Thinking { get; }
Property Value
ToolCalls
Tool calls the model wants executed (empty for a plain text answer).
public IReadOnlyList<LiteRtToolCall> ToolCalls { get; }
Property Value
Methods
ToMessage(bool)
Captures this reply as a LiteRtMessage (role Model)
so it can be recorded in a history and later restored via
History. Preserves the answer Text and, when
includeToolCalls is true, the ToolCalls. The reasoning
(Channels/Thinking) is intentionally dropped — replaying a thinking
trace would re-consume the context window (the same reason
FilterThinkingFromKvCache exists).
public LiteRtMessage ToMessage(bool includeToolCalls = true)
Parameters
includeToolCallsbool