File tree Expand file tree Collapse file tree 2 files changed +43
-43
lines changed
specification/inference/chat_completion_unified/examples/request Expand file tree Collapse file tree 2 files changed +43
-43
lines changed Original file line number Diff line number Diff line change @@ -152,25 +152,25 @@ alternatives:
152152 - language : Java
153153 code : |
154154 client.inference().chatCompletionUnified(c -> c
155- .inferenceId("openai-completion")
156- .chatCompletionRequest(ch -> ch
157- .messages(List.of(Message.of(m -> m
158- .content(co -> co
159- .string("Let's find out what the weather is")
160- )
161- .role("assistant")
162- .toolCalls(t -> t
163- .id("call_KcAjWtAww20AihPHphUh46Gd")
164- .function(f -> f
165- .arguments("{\"location\":\"Boston, MA\"}")
166- .name("get_current_weather")
167- )
168- .type("function")
169- )),Message.of(me -> me
170- .content(co -> co
171- .string("The weather is cold")
172- )
173- .role("tool")
174- .toolCallId("call_KcAjWtAww20AihPHphUh46Gd"))))
175- )
155+ .inferenceId("openai-completion")
156+ .chatCompletionRequest(ch -> ch
157+ .messages(List.of(Message.of(m -> m
158+ .content(co -> co
159+ .string("Let's find out what the weather is")
160+ )
161+ .role("assistant")
162+ .toolCalls(t -> t
163+ .id("call_KcAjWtAww20AihPHphUh46Gd")
164+ .function(f -> f
165+ .arguments("{\"location\":\"Boston, MA\"}")
166+ .name("get_current_weather")
167+ )
168+ .type("function")
169+ )),Message.of(me -> me
170+ .content(co -> co
171+ .string("The weather is cold")
172+ )
173+ .role("tool")
174+ .toolCallId("call_KcAjWtAww20AihPHphUh46Gd"))))
175+ )
176176 );
Original file line number Diff line number Diff line change @@ -218,29 +218,29 @@ alternatives:
218218 - language : Java
219219 code : |
220220 client.inference().chatCompletionUnified(c -> c
221- .inferenceId("openai-completion")
222- .chatCompletionRequest(ch -> ch
223- .messages(m -> m
221+ .inferenceId("openai-completion")
222+ .chatCompletionRequest(ch -> ch
223+ .messages(m -> m
224224 .content(co -> co
225225 .string("What's the price of a scarf?")
226226 )
227- .role("user")
228- )
229- .toolChoice(t -> t
230- .object(o -> o
231- .type("function")
232- .function(f -> f
233- .name("get_current_price")
234- )
235- )
236- )
237- .tools(to -> to
238- .type("function")
239- .function(f -> f
240- .description("Get the current price of a item")
241- .name("get_current_price")
242- .parameters(JsonData.fromJson("{\"type\":\"object\",\"properties\":{\"item\":{\"id\":\"123\"}}}"))
243- )
244- )
245- )
227+ .role("user")
228+ )
229+ .toolChoice(t -> t
230+ .object(o -> o
231+ .type("function")
232+ .function(f -> f
233+ .name("get_current_price")
234+ )
235+ )
236+ )
237+ .tools(to -> to
238+ .type("function")
239+ .function(f -> f
240+ .description("Get the current price of a item")
241+ .name("get_current_price")
242+ .parameters(JsonData.fromJson("{\"type\":\"object\",\"properties\":{\"item\":{\"id\":\"123\"}}}"))
243+ )
244+ )
245+ )
246246 );
You can’t perform that action at this time.
0 commit comments