Skip to Content
ReferenceAgentsgetDefaultStreamOptions()

getDefaultStreamOptions()

The .getDefaultStreamOptions() method retrieves the default streaming options configured for an agent, resolving them if they’re a function. These options are used as the base configuration for all stream() calls unless overridden.

Usage example

const defaultOptions = await agent.getDefaultStreamOptions();

Parameters

options?:

{ runtimeContext?: RuntimeContext }
= {}
Optional configuration object containing runtime context.

Extended usage example

const defaultOptions = await agent.getDefaultStreamOptions({ runtimeContext: new RuntimeContext() });

Options parameters

runtimeContext?:

RuntimeContext
= new RuntimeContext()
Runtime context for dependency injection and contextual information.

Returns

defaultOptions:

AgentStreamOptions | Promise<AgentStreamOptions>
The default streaming options configured for the agent, either as a direct object or a promise that resolves to the options.