Class ToolContext
java.lang.Object
org.springframework.ai.chat.model.ToolContext
Represents the context for tool execution in a function calling scenario.
This class encapsulates a map of contextual information that can be passed to tools (functions) when they are called. It provides an immutable view of the context to ensure thread-safety and prevent modification after creation.
The context is typically populated from the toolContext field of
ToolCallingChatOptions and is used in the function execution process.
The context map can contain any information that is relevant to the tool execution.
- Since:
- 1.0.0
- Author:
- Christian Tzolov
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe key for the running, tool call history stored in the context map. -
Constructor Summary
ConstructorsConstructorDescriptionToolContext(Map<String, Object> context) Constructs a new ToolContext with the given context map. -
Method Summary
Modifier and TypeMethodDescriptionReturns the immutable context map.Returns the tool call history from the context map.
-
Field Details
-
TOOL_CALL_HISTORY
The key for the running, tool call history stored in the context map.- See Also:
-
-
Constructor Details
-
ToolContext
-
-
Method Details
-
getContext
-
getToolCallHistory
-