LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangChain
  • Browser
  • Universal
  • Hub
  • Node
  • Load
  • Serializable
  • Encoder Backed
  • File System
  • In Memory
  • Tools
LangChain Core
  • Agents
  • Caches
  • Base
  • Dispatch
  • Web
  • Manager
  • Promises
  • Chat History
  • Context
  • Base
  • Langsmith
  • Documents
  • Embeddings
  • Errors
  • Example Selectors
  • Indexing
  • Base
  • Chat Models
  • Compat
  • Event
  • Llms
  • Openai Completions Stream
  • Profile
  • Stream
  • Structured Output
  • Load
  • Serializable
  • Memory
  • Messages
  • Tool
  • Output Parsers
  • Openai Functions
  • Openai Tools
  • Outputs
  • Prompt Values
  • Prompts
  • Retrievers
  • Document Compressors
  • Runnables
  • Graph
  • Singletons
  • Stores
  • Structured Query
  • Testing
  • Tools
  • Base
  • Console
  • Log Stream
  • Run Collector
  • Tracer Langchain
  • Stream
  • Async Caller
  • Chunk Array
  • Context
  • Env
  • Event Source Parse
  • Format
  • Function Calling
  • Gateway
  • Hash
  • Json Patch
  • Json Schema
  • Math
  • Ssrf
  • Standard Schema
  • Stream
  • Testing
  • Tiktoken
  • Types
  • Uuid
  • Vectorstores
Text Splitters
MCP Adapters
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangChain
BrowserUniversalHubNodeLoadSerializableEncoder BackedFile SystemIn MemoryTools
LangChain Core
AgentsCachesBaseDispatchWebManagerPromisesChat HistoryContextBaseLangsmithDocumentsEmbeddingsErrorsExample SelectorsIndexingBaseChat ModelsCompatEventLlmsOpenai Completions StreamProfileStreamStructured OutputLoadSerializableMemoryMessagesToolOutput ParsersOpenai FunctionsOpenai ToolsOutputsPrompt ValuesPromptsRetrieversDocument CompressorsRunnablesGraphSingletonsStoresStructured QueryTestingToolsBaseConsoleLog StreamRun CollectorTracer LangchainStreamAsync CallerChunk ArrayContextEnvEvent Source ParseFormatFunction CallingGatewayHashJson PatchJson SchemaMathSsrfStandard SchemaStreamTestingTiktokenTypesUuidVectorstores
Text Splitters
MCP Adapters
Language
Theme
JavaScriptlangchainindexToolMessageconstructor
Constructor●Since v1.0

constructor

Copy
constructor<
  TStructure extends MessageStructure<MessageToolSet> = MessageStructure<MessageToolSet>
>
View source on GitHub
(
fields
:
InferToolOutputs
<
TStructure
>
extends
TOutput
[
TOutput
]
extends
[
never
]
string
|
ContentBlock
|
Text
[
]
:
[
unknown
]
extends
[
TOutput
]
string
|
ContentBlock
|
Text
[
]
:
string
|
TOutput
|
ContentBlock
|
Text
[
]
:
string
|
ContentBlock
|
Text
[
]
|
ToolMessageFields
<
MessageStructure
<
MessageToolSet
>
>
,
tool_call_id
:
string
,
name
:
string
)
:
ToolMessage
<
TStructure
>

Parameters

NameTypeDescription
fields*$InferToolOutputs<TStructure> extends TOutput ? [TOutput] extends [never] ? string | ContentBlock | Text[] : [unknown] extends [TOutput] ? string | ContentBlock | Text[] : string | TOutput | ContentBlock | Text[] : string | ContentBlock | Text[] | ToolMessageFields<MessageStructure<MessageToolSet>>
tool_call_id*string
namestring