v0.3
v0.2
v0.1
Preparing search index...
The search index is not available
LangChain.js
LangChain.js
@langchain/core
tools
ToolReturnType
Type Alias ToolReturnType<TInput, TConfig, TOutput>
Tool
Return
Type
<
TInput
,
TConfig
,
TOutput
>
:
TOutput
extends
DirectToolOutput
?
TOutput
:
TConfig
extends
{
toolCall
:
{
id
:
string
;
}
;
}
?
ToolMessage
:
TConfig
extends
{
toolCall
:
{
id
:
undefined
;
}
;
}
?
TOutput
:
TConfig
extends
{
toolCall
:
{
id
?:
string
;
}
;
}
?
TOutput
|
ToolMessage
:
TInput
extends
ToolCall
?
ToolMessage
:
TOutput
Conditional type that determines the return type of the
StructuredTool.invoke
method.
If the input is a ToolCall, it returns a ToolMessage
If the config is a runnable config and contains a toolCall property, it returns a ToolMessage
Otherwise, it returns the original output type
Type Parameters
TInput
TConfig
TOutput
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
LangChain.js
Loading...
Conditional type that determines the return type of the StructuredTool.invoke method.