InjectedToolCallId#
- class langchain_core.tools.base.InjectedToolCallId[source]#
Annotation for injecting the tool_call_id.
Example
..code-block:: python
from typing_extensions import Annotated
from langchain_core.messages import ToolMessage from langchain_core.tools import tool, InjectedToolCallID
@tool def foo(x: int, tool_call_id: Annotated[str, InjectedToolCallID]) -> ToolMessage:
βββReturn x.βββ return ToolMessage(str(x), artifact=x, name=βfooβ, tool_call_id=tool_call_id)