Class AbstractFunctionCallSupport<Msg,Req,Resp>
java.lang.Object
org.springframework.ai.model.function.AbstractFunctionCallSupport<Msg,Req,Resp>
- Direct Known Subclasses:
AzureOpenAiChatClient
,MistralAiChatClient
,OpenAiChatClient
,VertexAiGeminiChatClient
- Author:
- Christian Tzolov
-
Field Summary
Modifier and TypeFieldDescriptionprotected final FunctionCallbackContext
The function callback context is used to resolve the function callbacks by name from the Spring context.protected final Map
<String, FunctionCallback> The function callback register is used to resolve the function callbacks by name.protected static final boolean
-
Constructor Summary
ConstructorDescriptionAbstractFunctionCallSupport
(FunctionCallbackContext functionCallbackContext) -
Method Summary
Modifier and TypeMethodDescriptionprotected Resp
callWithFunctionSupport
(Req request) protected abstract Resp
doChatCompletion
(Req request) protected abstract Req
doCreateToolResponseRequest
(Req previousRequest, Msg responseMessage, List<Msg> conversationHistory) protected abstract Msg
doGetToolResponseMessage
(Resp response) doGetUserMessages
(Req request) handleFunctionCallbackConfigurations
(FunctionCallingOptions options, boolean isRuntimeCall) protected Resp
handleFunctionCallOrReturn
(Req request, Resp response) protected abstract boolean
isToolFunctionCall
(Resp response) protected List
<FunctionCallback> resolveFunctionCallbacks
(Set<String> functionNames) Resolve the function callbacks by name.
-
Field Details
-
IS_RUNTIME_CALL
protected static final boolean IS_RUNTIME_CALL- See Also:
-
functionCallbackRegister
The function callback register is used to resolve the function callbacks by name. -
functionCallbackContext
The function callback context is used to resolve the function callbacks by name from the Spring context. It is optional and usually used with Spring auto-configuration.
-
-
Constructor Details
-
AbstractFunctionCallSupport
-
-
Method Details
-
getFunctionCallbackRegister
-
handleFunctionCallbackConfigurations
protected Set<String> handleFunctionCallbackConfigurations(FunctionCallingOptions options, boolean isRuntimeCall) -
resolveFunctionCallbacks
Resolve the function callbacks by name. Retrieve them from the registry or try to resolve them from the Application Context.- Parameters:
functionNames
- Name of function callbacks to retrieve.- Returns:
- list of resolved FunctionCallbacks.
-
callWithFunctionSupport
-
handleFunctionCallOrReturn
-
doCreateToolResponseRequest
-
doGetUserMessages
-
doGetToolResponseMessage
-
doChatCompletion
-
isToolFunctionCall
-