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
Copy file name to clipboardExpand all lines: models/spring-ai-vertex-ai-gemini/src/test/java/org/springframework/ai/vertexai/gemini/function/MockWeatherService.java
Copy file name to clipboardExpand all lines: models/spring-ai-vertex-ai-gemini/src/test/java/org/springframework/ai/vertexai/gemini/function/VertexAiGeminiChatClientFunctionCallingIT.java
@Disabled("Google Vertex AI degraded support for parallel function calls")
70
72
publicvoidfunctionCallExplicitOpenApiSchema() {
71
73
72
74
UserMessageuserMessage = newUserMessage(
73
-
"What's the weather like in San Francisco, in Paris and in Tokyo, Japan? Use Multi-turn function calling. Provide answer for all requested locations.");
75
+
"What's the weather like in San Francisco, in Paris and in Tokyo, Japan?"
76
+
+ " Use Celsius units. Answer for all requested locations.");
77
+
// " Use Celsius units. Use Multi-turn function calling. Provide answer for all
"What's the weather like in San Francisco, in Paris and in Tokyo, Japan? Use Multi-turn function calling. Provide answer for all requested locations.");
161
+
UserMessageuserMessage = newUserMessage("What's the weather like in San Francisco in Celsius units?");
162
+
// UserMessage userMessage = new UserMessage(
163
+
// "What's the weather like in San Francisco, in Paris and in Tokyo, Japan? Use
164
+
// Multi-turn function calling. Provide answer for all requested locations.");
// Gemini wants single tool with multiple function, instead multiple tools with single
183
-
// function
184
-
@Test
185
-
publicvoidcanDeclareMultipleFunctions() {
186
-
187
-
UserMessageuserMessage = newUserMessage(
188
-
"What's the weather like in San Francisco, in Paris and in Tokyo, Japan? Use Multi-turn function calling. Provide answer for all requested locations.");
Copy file name to clipboardExpand all lines: spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/functions/vertexai-gemini-chat-functions.adoc
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
= Gemini Function Calling
2
2
3
+
WARNING: As of 30th of April 2023, the Vertex AI `Gemini Pro` model has significantly degraded the support for function calling! While the feature is still available, it is not recommended for production use.
4
+
Apparently the Gemini Pro can not handle anymore the function name correctly.
5
+
The parallel function calling is gone as well.
6
+
3
7
Function calling lets developers create a description of a function in their code, then pass that description to a language model in a request. The response from the model includes the name of a function that matches the description and the arguments to call it with.
4
8
5
9
You can register custom Java functions with the `VertexAiGeminiChatClient` and have the Gemini Pro model intelligently choose to output a JSON object containing arguments to call one or many of the registered functions.
Copy file name to clipboardExpand all lines: spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat/vertexai-gemini-chat.adoc
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,10 @@ TIP: In addition to the model specific `VertexAiChatPaLm2Options` you can use a
104
104
105
105
== Function Calling
106
106
107
+
WARNING: As of 30th of April 2023, the Vertex AI `Gemini Pro` model has significantly degraded the support for function calling! While the feature is still available, it is not recommended for production use.
108
+
Apparently the Gemini Pro can not handle anymore the function name correctly.
109
+
The parallel function calling is gone as well.
110
+
107
111
You can register custom Java functions with the VertexAiGeminiChatClient and have the Gemini Pro model intelligently choose to output a JSON object containing arguments to call one or many of the registered functions.
108
112
This is a powerful technique to connect the LLM capabilities with external tools and APIs.
109
113
Read more about xref:api/chat/functions/vertexai-gemini-chat-functions.adoc[Vertex AI Gemini Function Calling].
0 commit comments