docs/src/content/en/reference/agents/getDefaultGenerateOptions.mdx
:::warning
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 generation options for controlling model behavior, output formatting and tool and workflow calls. The .getDefaultGenerateOptionsLegacy() method retrieves these defaults, resolving them if they're functions. These options apply to all generateLegacy() calls unless overridden and are useful for inspecting an agent’s unknown defaults.
await agent.getDefaultGenerateOptionsLegacy()
<PropertiesTable content={[ { name: 'options', type: '{ requestContext?: RequestContext }', isOptional: true, defaultValue: '{}', description: 'Optional configuration object containing request context.', properties: [ { type: '{ requestContext?: RequestContext }', parameters: [ { name: 'requestContext', type: 'RequestContext', isOptional: true, defaultValue: 'new RequestContext()', description: 'Request Context for dependency injection and contextual information.', }, ], }, ], }, ]} />
<PropertiesTable content={[ { name: 'defaultOptions', type: 'AgentGenerateOptions | Promise<AgentGenerateOptions>', description: 'The default generation options configured for the agent, either as a direct object or a promise that resolves to the options.', }, ]} />
await agent.getDefaultGenerateOptionsLegacy({
requestContext: new RequestContext(),
})