Skip to main content

Agent.getDefaultGenerateOptionsLegacy()

warning

已弃用:此方法已被弃用,仅适用于 V1 模型。对于 V2 模型,请改用新的 .getDefaultOptions() 方法。

可以为代理配置默认生成选项,以控制模型行为、输出格式以及工具和工作流调用。.getDefaultGenerateOptionsLegacy() 方法会检索这些默认值,如果它们是函数,则会解析它们。这些选项适用于所有 generateLegacy() 调用,除非被覆盖,并且对于检查代理的未知默认值非常有用。

🌐 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.

使用示例
Direct link to 使用示例

🌐 Usage example

await agent.getDefaultGenerateOptionsLegacy();

参数
Direct link to 参数

🌐 Parameters

options?:

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

返回
Direct link to 返回

🌐 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.

扩展使用示例
Direct link to 扩展使用示例

🌐 Extended usage example

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

选项参数
Direct link to 选项参数

🌐 Options parameters

requestContext?:

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

🌐 Related