Interface ToolProvider
- All Known Implementing Classes:
McpToolProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A tool provider. It is called when an AI service is invoked and supplies tools for that invocation.
Tools returned in ToolProviderResult will be included in the request to the LLM.
By default, a tool provider is called once at the beginning of an AI service invocation.
Override isDynamic() to return true if this provider should be re-evaluated
before each LLM call in the tool execution loop.
A dynamic provider can return different tools based on the current conversation state.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanWhether this tool provider is dynamic (i.e., should be re-evaluated before each LLM call in the tool execution loop).provideTools(ToolProviderRequest request) Provides tools for the request to the LLM.
-
Method Details
-
provideTools
Provides tools for the request to the LLM.- Parameters:
request- theToolProviderRequest, containsUserMessage,ChatMemoryID (seeMemoryId) andInvocationParameters.- Returns:
ToolProviderResultcontains tools that should be included in the request to the LLM.
-
isDynamic
default boolean isDynamic()Whether this tool provider is dynamic (i.e., should be re-evaluated before each LLM call in the tool execution loop).A static provider (default, returns
false) is called once per AI service invocation. A dynamic provider (returnstrue) has itsprovideTools(ToolProviderRequest)called before each LLM call, allowing it to return different tools based on the current conversation state.- Returns:
trueif this provider should be re-evaluated before each LLM call- Since:
- 1.13.0
-