Class FunctionCallbackContext
java.lang.Object
org.springframework.ai.model.function.FunctionCallbackContext
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class FunctionCallbackContext
extends Object
implements org.springframework.context.ApplicationContextAware
A Spring
ApplicationContextAware
implementation that provides a way to retrieve
a Function
from the Spring context and wrap it into a FunctionCallback
.
The name of the function is determined by the bean name.
The description of the function is determined by the following rules:
- Provided as a default description
- Provided as a
@Description
annotation on the bean - Provided as a
@JsonClassDescription
annotation on the input class
- Author:
- Christian Tzolov, Christopher Smith
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetFunctionCallback
(String beanName, String defaultDescription) void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext)
-
Constructor Details
-
FunctionCallbackContext
public FunctionCallbackContext()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(@NonNull org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
getFunctionCallback
public FunctionCallback getFunctionCallback(@NonNull String beanName, @Nullable String defaultDescription)
-