可选
config可选
kwargs受保护的
lc_可选
name构造函数参数别名映射。键是属性名称,例如“foo”。值是在序列化中将替换键的别名。这用于例如使参数名称与 Python 匹配。
要与构造函数参数合并的附加属性映射。键是属性名称,例如“foo”。值是将要序列化的属性值。这些属性需要被构造函数接受为参数。
模块的最终序列化标识符。
密钥映射,将从序列化中省略。键是构造函数参数中密钥的路径,例如“foo.bar.baz”。值是密钥 ID,将在反序列化时使用。
应序列化的键的手动列表。如果未覆盖,则传递给构造函数的所有字段都将被序列化。
处理 runnable 的批处理和配置的内部方法。它接受一个函数、输入值和可选配置,并返回一个解析为输出值的 Promise。
要为每个输入值执行的函数。
可选
options: Partial<RunnableConfig<Record<string, any>>>[]可选
runManagers: (undefined | CallbackManagerForChainRun)[]可选
batchOptions: RunnableBatchOptions可选
options: Partial<RunnableConfig<Record<string, any>> & { 可选
batchOptions: RunnableBatchOptions一个解析为输出值的 Promise。
受保护的
_call执行工具调用
要调用的工具以及要传递给它的输入。
可选
config: RunnableConfig<Record<string, any>>调用工具时要传递的可选配置。
工具调用的结果(string
或 ToolMessage
,由 ToolOutput
泛型设置)或字符串错误消息。
受保护
_get受保护
_separate可选
options: Partial<RunnableConfig<Record<string, any>>>受保护
_stream受保护
_transformHelper method to transform an Iterator of Input values into an Iterator of Output values, with callbacks. Use this to implement stream()
or transform()
in Runnable subclasses.
Convert a runnable to a tool. Return a new instance of RunnableToolLike
which contains the runnable, name, description and schema.
可选
description?: stringThe description of the tool. Falls back to the description on the Zod schema if not provided, or undefined if neither are provided.
可选
name?: stringThe name of the tool. If not provided, it will default to the name of the runnable.
The Zod schema for the input of the tool. Infers the Zod type from the input type of the runnable.
An instance of RunnableToolLike
which is a runnable that can be used as a tool.
可选
options: Partial<RunnableConfig<Record<string, any>>> | Partial<RunnableConfig<Record<string, any>>>[]可选
batchOptions: RunnableBatchOptions & { 可选
options: Partial<RunnableConfig<Record<string, any>>> | Partial<RunnableConfig<Record<string, any>>>[]可选
batchOptions: RunnableBatchOptions & { 可选
options: Partial<RunnableConfig<Record<string, any>>> | Partial<RunnableConfig<Record<string, any>>>[]可选
batchOptions: RunnableBatchOptionsCreate a new runnable sequence that runs each individual runnable in series, piping the output of one runnable into another runnable or runnable-like.
A runnable, function, or object whose values are functions or runnables.
A new runnable sequence.
Optional
streamOptions: Omit<LogStreamCallbackHandlerInput, "autoClose">Optional
streamOptions: Omit<LogStreamCallbackHandlerInput, "autoClose">从 runnable 对象流式传输所有输出,正如回调系统报告的那样。这包括 LLM、Retriever、Tool 等所有内部运行。输出以 Log 对象的形式流式传输,其中包括 jsonpatch 操作列表,这些操作描述了运行的每个步骤中状态是如何变化的,以及运行的最终状态。可以按顺序应用 jsonpatch 操作来构建状态。
可选
options: Partial<RunnableConfig<Record<string, any>>>Optional
streamOptions: Omit<LogStreamCallbackHandlerInput, "autoClose">从当前的 runnable 对象创建一个新的 runnable 对象,如果初始调用失败,它将尝试调用其他传递的后备 runnable 对象。
一个新的 RunnableWithFallbacks。
将生命周期监听器绑定到 Runnable 对象,返回一个新的 Runnable 对象。Run 对象包含关于运行的信息,包括其 id、类型、输入、输出、错误、startTime、endTime,以及添加到运行中的任何标签或元数据。
包含回调函数的对象。
Optional
on在 runnable 对象完成运行后调用,带有 Run 对象。
可选
config: RunnableConfig<Record<string, any>>Optional
on如果 runnable 对象抛出错误,则调用此函数,带有 Run 对象。
可选
config: RunnableConfig<Record<string, any>>Optional
on在 runnable 对象开始运行之前调用,带有 Run 对象。
可选
config: RunnableConfig<Record<string, any>>Optional
fields: { Optional
onOptional
stopStatic
isStatic
isStatic
lc_
已弃用
请使用 ToolNode 代替。