Table of Contents

Method StreamContentAsync

Namespace
LMKit.Agents.Streaming
Assembly
LM-Kit.NET.dll

StreamContentAsync(Agent, string, AgentExecutionOptions, CancellationToken)

Streams only content text (filters out thinking, tool calls, etc.).

public static IAsyncEnumerable<string> StreamContentAsync(this Agent agent, string input, AgentExecutionOptions options = null, CancellationToken cancellationToken = default)

Parameters

agent Agent

The agent to execute.

input string

The input prompt.

options AgentExecutionOptions

Optional execution options.

cancellationToken CancellationToken

Cancellation token.

Returns

IAsyncEnumerable<string>

An async enumerable of content text strings.

Examples

await foreach (var text in agent.StreamContentAsync("Hello"))
{
    Console.Write(text);
}