You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Remove the deprecated FunctionCallback related classes, references
- Replace them with the corresponding ToolCallback usage
Signed-off-by: Ilayaperumal Gopinathan <[email protected]>
Copy file name to clipboardExpand all lines: auto-configurations/models/spring-ai-autoconfigure-model-bedrock-ai/src/main/java/org/springframework/ai/model/bedrock/converse/autoconfigure/BedrockConverseProxyChatProperties.java
+1-1
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ public ToolCallingChatOptions getOptions() {
Copy file name to clipboardExpand all lines: auto-configurations/models/spring-ai-autoconfigure-model-minimax/src/test/java/org/springframework/ai/model/minimax/autoconfigure/FunctionCallbackInPromptIT.java
Copy file name to clipboardExpand all lines: auto-configurations/models/spring-ai-autoconfigure-model-minimax/src/test/java/org/springframework/ai/model/minimax/autoconfigure/FunctionCallbackWithPlainFunctionBeanIT.java
Copy file name to clipboardExpand all lines: auto-configurations/models/spring-ai-autoconfigure-model-minimax/src/test/java/org/springframework/ai/model/minimax/autoconfigure/MiniMaxFunctionCallbackIT.java
Copy file name to clipboardExpand all lines: auto-configurations/models/spring-ai-autoconfigure-model-ollama/src/test/kotlin/org/springframework/ai/model/ollama/autoconfigure/tool/FunctionCallbackContextKotlinIT.kt
+1-1
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ class FunctionCallbackResolverKotlinIT : BaseOllamaIT() {
59
59
.withUserConfiguration(Config::class.java)
60
60
61
61
@Test
62
-
funfunctionCallTest() {
62
+
funtoolCallTest() {
63
63
this.contextRunner.run {context ->
64
64
65
65
val chatModel = context.getBean(OllamaChatModel::class.java)
Copy file name to clipboardExpand all lines: auto-configurations/models/spring-ai-autoconfigure-model-ollama/src/test/kotlin/org/springframework/ai/model/ollama/autoconfigure/tool/ToolCallbackKotlinIT.kt
Copy file name to clipboardExpand all lines: auto-configurations/models/spring-ai-autoconfigure-model-vertex-ai/src/main/java/org/springframework/ai/model/vertexai/autoconfigure/gemini/VertexAiGeminiChatAutoConfiguration.java
-12
Original file line number
Diff line number
Diff line change
@@ -113,16 +113,4 @@ public VertexAiGeminiChatModel vertexAiGeminiChat(VertexAI vertexAi, VertexAiGem
113
113
returnchatModel;
114
114
}
115
115
116
-
/**
117
-
* Because of the OPEN_API_SCHEMA type, the FunctionCallbackResolver instance must
Copy file name to clipboardExpand all lines: auto-configurations/models/spring-ai-autoconfigure-model-vertex-ai/src/test/java/org/springframework/ai/model/vertexai/autoconfigure/gemini/tool/FunctionCallWithFunctionBeanIT.java
Copy file name to clipboardExpand all lines: auto-configurations/models/spring-ai-autoconfigure-model-zhipuai/src/test/java/org/springframework/ai/model/zhipuai/autoconfigure/tool/FunctionCallbackInPromptIT.java
Copy file name to clipboardExpand all lines: auto-configurations/models/spring-ai-autoconfigure-model-zhipuai/src/test/java/org/springframework/ai/model/zhipuai/autoconfigure/tool/FunctionCallbackWithPlainFunctionBeanIT.java
Copy file name to clipboardExpand all lines: auto-configurations/models/spring-ai-autoconfigure-model-zhipuai/src/test/java/org/springframework/ai/model/zhipuai/autoconfigure/tool/ZhipuAiFunctionCallbackIT.java
Copy file name to clipboardExpand all lines: auto-configurations/models/tool/spring-ai-autoconfigure-model-tool/src/test/java/org/springframework/ai/model/tool/autoconfigure/ToolCallingAutoConfigurationTests.java
Copy file name to clipboardExpand all lines: models/spring-ai-vertex-ai-gemini/src/test/java/org/springframework/ai/vertexai/gemini/tool/VertexAiGeminiPaymentTransactionMethodIT.java
Copy file name to clipboardExpand all lines: spring-ai-client-chat/src/test/java/org/springframework/ai/chat/client/advisor/api/AdvisedRequestTests.java
Copy file name to clipboardExpand all lines: spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/functions/anthropic-chat-functions.adoc
+4-4
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ Your function can in turn invoke other 3rd party services to provide the results
20
20
Spring AI makes this as easy as defining a `@Bean` definition that returns a `java.util.Function` and supplying the bean name as an option when invoking the `ChatModel`.
21
21
22
22
Under the hood, Spring wraps your POJO (the function) with the appropriate adapter code that enables interaction with the AI Model, saving you from writing tedious boilerplate code.
23
-
The basis of the underlying infrastructure is the link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-model/src/main/java/org/springframework/ai/model/function/FunctionCallback.java[FunctionCallback.java] interface and the companion Builder utility class to simplify the implementation and registration of Java callback functions.
23
+
The basis of the underlying infrastructure is the link:https://github.com/spring-projects/spring-ai/blob/main/spring-ai-model/src/main/java/org/springframework/ai/tool/ToolCallback.java[ToolCallback.java] interface and the companion Builder utility class to simplify the implementation and registration of Java callback functions.
24
24
25
25
== How it works
26
26
@@ -72,7 +72,7 @@ We start with describing the most POJO friendly options.
72
72
73
73
In this approach you define `@Beans` in your application context as you would any other Spring managed object.
74
74
75
-
Internally, Spring AI `ChatModel` will create an instance of a `FunctionCallback` that adds the logic for it being invoked via the AI model.
75
+
Internally, Spring AI `ChatModel` will create an instance of a `ToolCallback` that adds the logic for it being invoked via the AI model.
76
76
The name of the `@Bean` is passed as a `ChatOption`.
77
77
78
78
@@ -117,9 +117,9 @@ It is a best practice to annotate the request object with information such that
117
117
The link:https://github.com/spring-projects/spring-ai/blob/main/auto-configurations/models/spring-ai-autoconfigure-model-anthropic/src/test/java/org/springframework/ai/model/anthropic/autoconfigure/tool/FunctionCallWithFunctionBeanIT.java[FunctionCallWithFunctionBeanIT.java] demonstrates this approach.
118
118
119
119
120
-
==== FunctionCallback
120
+
==== ToolCallback
121
121
122
-
Another way to register a function is to create a `FunctionCallback` instance like this:
122
+
Another way to register a function is to create a `ToolCallback` instance like this:
0 commit comments