Skip to content

Commit bf2ce11

Browse files
committed
Remove strict tool invocation config
1 parent a13b183 commit bf2ce11

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiService.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ public OpenAiChatCompletionOutput chatCompletionToolExecution(
151151
final var request =
152152
new OpenAiChatCompletionParameters()
153153
.addMessages(messages.toArray(OpenAiChatMessage[]::new))
154-
.setTools(List.of(tool))
155-
.setToolChoiceFunction("weather");
154+
.setTools(List.of(tool));
156155

157156
final var client = OpenAiClient.forModel(GPT_4O_MINI);
158157
final var initialResponse = client.chatCompletion(request);

0 commit comments

Comments
 (0)