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
FieldsModifier and TypeFieldDescriptionprotected final FunctionCallbackContextThe 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
ConstructorsConstructorDescriptionAbstractFunctionCallSupport(FunctionCallbackContext functionCallbackContext) -
Method Summary
Modifier and TypeMethodDescriptionprotected RespcallWithFunctionSupport(Req request) protected abstract RespdoChatCompletion(Req request) protected abstract ReqdoCreateToolResponseRequest(Req previousRequest, Msg responseMessage, List<Msg> conversationHistory) protected abstract MsgdoGetToolResponseMessage(Resp response) doGetUserMessages(Req request) handleFunctionCallbackConfigurations(FunctionCallingOptions options, boolean isRuntimeCall) protected ResphandleFunctionCallOrReturn(Req request, Resp response) protected abstract booleanisToolFunctionCall(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
-