Skip to main content

Agent.getDefaultGenerateOptionsLegacy()

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 are functions. These options apply to all generateLegacy() calls unless overridden and are useful for inspecting an agent’s unknown defaults.

Usage example

await agent.getDefaultGenerateOptionsLegacy();

Parameters

options?:

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

Returns

defaultOptions:

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

Extended usage example

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

Options parameters

requestContext?:

RequestContext
= new RequestContext()
Request Context for dependency injection and contextual information.

On this page