UNPKG

@mastra/core

Version:
36 lines (22 loc) 1.53 kB
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt # Agent.getDefaultStreamOptionsLegacy() > **Warning:** **Deprecated**: This method is deprecated and only works with V1 models. For V2 models, use the new [`.getDefaultOptions()`](https://mastra.ai/reference/agents/getDefaultOptions) method instead. Agents can be configured with default streaming options for memory usage, output format, and iteration steps. 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 ```typescript await agent.getDefaultStreamOptionsLegacy() ``` ## Parameters **options** (`{ requestContext?: RequestContext }`): Optional configuration object containing request context. (Default: `{}`) **options.requestContext** (`RequestContext`): Request Context for dependency injection and contextual information. ## 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 ```typescript await agent.getDefaultStreamOptionsLegacy({ requestContext: new RequestContext(), }) ``` ## Related - [Streaming with agents](https://mastra.ai/guides/concepts/streaming) - [Request Context](https://mastra.ai/docs/server/request-context)