Agent.getDefaultOptions()
可以为代理配置默认选项,包括内存使用、输出格式和迭代步骤。.getDefaultOptions() 方法返回这些默认值,如果它们是函数,则会解析它们。这些选项适用于所有 stream() 和 generate() 调用,除非被覆盖,并且对于检查代理未知的默认值非常有用。
🌐 Agents can be configured with default options for memory usage, output format, and iteration steps. The .getDefaultOptions() method returns these defaults, resolving them if they are functions. These options apply to all stream() and generate() calls unless overridden and are useful for inspecting an agent’s unknown defaults.
使用示例Direct link to 使用示例
🌐 Usage example
await agent.getDefaultOptions();
参数Direct link to 参数
🌐 Parameters
options?:
{ requestContext?: RequestContext }
= {}
Optional configuration object containing request context.
返回Direct link to 返回
🌐 Returns
defaultOptions:
AgentExecutionOptions<Output> | Promise<AgentExecutionOptions<Output>>
The default streaming 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.getDefaultOptions({
requestContext: new RequestContext(),
});
选项参数Direct link to 选项参数
🌐 Options parameters
requestContext?:
RequestContext
= new RequestContext()
Request Context for dependency injection and contextual information.
相关Direct link to 相关
🌐 Related