跳到主要内容
非官方简体中文翻译,内容版权归 Mastra 所有,遵循 Apache-2.0 许可。

Agent.getDefaultStreamOptionsLegacy()

注意

Deprecated: This method is deprecated and only works with V1 models. For V2 models, use the new .getDefaultOptions() method instead.

Agents can be configured with default streaming options for memory usage and output format. Iteration steps can also be configured. The .getDefaultStreamOptionsLegacy() method returns these defaults, resolving them if they're functions. These options apply to all streamLegacy() calls unless overridden and are useful for inspecting an agent’s unknown defaults.

Usage example
Usage example的直接链接

await agent.getDefaultStreamOptionsLegacy()

Parameters
Parameters的直接链接

options?:

{ requestContext?: RequestContext }
= {}
Optional configuration object containing request context.
{ requestContext?: RequestContext }

requestContext?:

RequestContext
Request Context for dependency injection and contextual information.

Returns
Returns的直接链接

defaultOptions:

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

Extended usage example
Extended usage example的直接链接

await agent.getDefaultStreamOptionsLegacy({
requestContext: new RequestContext(),
})