File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/spring Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -196,14 +196,13 @@ private List<ChatCompletionTool> extractTools(final ToolCallingChatOptions optio
196196 try {
197197 final Map <String , Object > params =
198198 new ObjectMapper ().readValue (toolDefinition .inputSchema (), new TypeReference <>() {});
199- val tool =
200- new ChatCompletionTool ()
201- .type (ChatCompletionTool .TypeEnum .FUNCTION )
202- .function (
203- new FunctionObject ()
204- .name (toolDefinition .name ())
205- .description (toolDefinition .description ())
206- .parameters (params ));
199+ val toolType = ChatCompletionTool .TypeEnum .FUNCTION ;
200+ val toolFunction =
201+ new FunctionObject ()
202+ .name (toolDefinition .name ())
203+ .description (toolDefinition .description ())
204+ .parameters (params );
205+ val tool = new ChatCompletionTool ().type (toolType ).function (toolFunction );
207206 tools .add (tool );
208207 } catch (JsonProcessingException ignored ) {
209208 }
You can’t perform that action at this time.
0 commit comments