@@ -265,6 +265,11 @@ public Function(String description, String name, String jsonSchema) {
265
265
* Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will
266
266
* vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100
267
267
* or 100 should result in a ban or exclusive selection of the relevant token.
268
+ * @param logprobs Whether to return log probabilities of the output tokens or not. If true, returns the log
269
+ * probabilities of each output token returned in the 'content' of 'message'. This option is currently not available
270
+ * on the 'gpt-4-vision-preview' model.
271
+ * @param topLogprobs An integer between 0 and 5 specifying the number of most likely tokens to return at each token
272
+ * position, each with an associated log probability. 'logprobs' must be set to 'true' if this parameter is used.
268
273
* @param maxTokens The maximum number of tokens to generate in the chat completion. The total length of input
269
274
* tokens and generated tokens is limited by the model's context length.
270
275
* @param n How many chat completion choices to generate for each input message. Note that you will be charged based
@@ -302,6 +307,8 @@ public record ChatCompletionRequest (
302
307
@ JsonProperty ("model" ) String model ,
303
308
@ JsonProperty ("frequency_penalty" ) Float frequencyPenalty ,
304
309
@ JsonProperty ("logit_bias" ) Map <String , Integer > logitBias ,
310
+ @ JsonProperty ("logprobs" ) Boolean logprobs ,
311
+ @ JsonProperty ("top_logprobs" ) Integer topLogprobs ,
305
312
@ JsonProperty ("max_tokens" ) Integer maxTokens ,
306
313
@ JsonProperty ("n" ) Integer n ,
307
314
@ JsonProperty ("presence_penalty" ) Float presencePenalty ,
@@ -323,7 +330,7 @@ public record ChatCompletionRequest (
323
330
* @param temperature What sampling temperature to use, between 0 and 1.
324
331
*/
325
332
public ChatCompletionRequest (List <ChatCompletionMessage > messages , String model , Float temperature ) {
326
- this (messages , model , null , null , null , null , null ,
333
+ this (messages , model , null , null , null , null , null , null , null ,
327
334
null , null , null , false , temperature , null ,
328
335
null , null , null );
329
336
}
@@ -338,7 +345,7 @@ public ChatCompletionRequest(List<ChatCompletionMessage> messages, String model,
338
345
* as they become available, with the stream terminated by a data: [DONE] message.
339
346
*/
340
347
public ChatCompletionRequest (List <ChatCompletionMessage > messages , String model , Float temperature , boolean stream ) {
341
- this (messages , model , null , null , null , null , null ,
348
+ this (messages , model , null , null , null , null , null , null , null ,
342
349
null , null , null , stream , temperature , null ,
343
350
null , null , null );
344
351
}
@@ -354,7 +361,7 @@ public ChatCompletionRequest(List<ChatCompletionMessage> messages, String model,
354
361
*/
355
362
public ChatCompletionRequest (List <ChatCompletionMessage > messages , String model ,
356
363
List <FunctionTool > tools , String toolChoice ) {
357
- this (messages , model , null , null , null , null , null ,
364
+ this (messages , model , null , null , null , null , null , null , null ,
358
365
null , null , null , false , 0.8f , null ,
359
366
tools , toolChoice , null );
360
367
}
@@ -368,7 +375,7 @@ public ChatCompletionRequest(List<ChatCompletionMessage> messages, String model,
368
375
* as they become available, with the stream terminated by a data: [DONE] message.
369
376
*/
370
377
public ChatCompletionRequest (List <ChatCompletionMessage > messages , Boolean stream ) {
371
- this (messages , null , null , null , null , null , null ,
378
+ this (messages , null , null , null , null , null , null , null , null ,
372
379
null , null , null , stream , null , null ,
373
380
null , null , null );
374
381
}
@@ -869,13 +876,15 @@ public Embedding(Integer index, List<Double> embedding) {
869
876
* dimensions or less.
870
877
* @param model ID of the model to use.
871
878
* @param encodingFormat The format to return the embeddings in. Can be either float or base64.
879
+ * @param dimensions The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.
872
880
* @param user A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
873
881
*/
874
882
@ JsonInclude (Include .NON_NULL )
875
883
public record EmbeddingRequest <T >(
876
884
@ JsonProperty ("input" ) T input ,
877
885
@ JsonProperty ("model" ) String model ,
878
886
@ JsonProperty ("encoding_format" ) String encodingFormat ,
887
+ @ JsonProperty ("dimensions" ) Integer dimensions ,
879
888
@ JsonProperty ("user" ) String user ) {
880
889
881
890
/**
@@ -884,7 +893,7 @@ public record EmbeddingRequest<T>(
884
893
* @param model ID of the model to use.
885
894
*/
886
895
public EmbeddingRequest (T input , String model ) {
887
- this (input , model , "float" , null );
896
+ this (input , model , "float" , null , null );
888
897
}
889
898
890
899
/**
0 commit comments