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 @@ -100,14 +100,13 @@ private List<ChatCompletionTool> extractTools(final DefaultToolCallingChatOption
100100 try {
101101 final Map <String , Object > params =
102102 new ObjectMapper ().readValue (toolDefinition .inputSchema (), new TypeReference <>() {});
103- val tool =
104- new ChatCompletionTool ()
105- .type (ChatCompletionTool .TypeEnum .FUNCTION )
106- .function (
107- new FunctionObject ()
108- .name (toolDefinition .name ())
109- .description (toolDefinition .description ())
110- .parameters (params ));
103+ val toolType = ChatCompletionTool .TypeEnum .FUNCTION ;
104+ val toolFunction =
105+ new FunctionObject ()
106+ .name (toolDefinition .name ())
107+ .description (toolDefinition .description ())
108+ .parameters (params );
109+ val tool = new ChatCompletionTool ().type (toolType ).function (toolFunction );
111110 tools .add (tool );
112111 } catch (JsonProcessingException ignored ) {
113112 }
You can’t perform that action at this time.
0 commit comments