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
@Descriptionannotation on the bean - Provided as a
@JsonClassDescriptionannotation on the input class
- Author:
- Christian Tzolov, Christopher Smith, Sebastien Deleuze
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFunctionCallback(String beanName, String defaultDescription) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetSchemaType(FunctionCallbackContext.SchemaType schemaType)
-
Constructor Details
-
FunctionCallbackContext
public FunctionCallbackContext()
-
-
Method Details
-
setSchemaType
-
setApplicationContext
public void setApplicationContext(@NonNull org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
getFunctionCallback
public FunctionCallback getFunctionCallback(@NonNull String beanName, @Nullable String defaultDescription)
-