@@ -627,9 +627,11 @@ public record EmbeddingList<T>(
627
627
* @param stop A list of tokens that the model should stop generating after. If set,
628
628
* @param randomSeed The seed to use for random sampling. If set, different calls will
629
629
* generate deterministic results.
630
- * @param responseFormat An object specifying the format that the model must output.
631
- * Setting to { "type": "json_object" } enables JSON mode, which guarantees the
632
- * message the model generates is valid JSON.
630
+ * @param responseFormat An object specifying the format or schema that the model must
631
+ * output. Setting to { "type": "json_object" } enables JSON mode, which guarantees
632
+ * the message the model generates is valid JSON. Setting to { "type": "json_object" ,
633
+ * "json_schema": schema} allows you to ensure the model provides an answer in a very
634
+ * specific JSON format by supplying a clear JSON schema.
633
635
*/
634
636
@ JsonInclude (Include .NON_NULL )
635
637
public record ChatCompletionRequest (
@@ -718,12 +720,9 @@ public ChatCompletionRequest(List<ChatCompletionMessage> messages, Boolean strea
718
720
public enum ToolChoice {
719
721
720
722
// @formatter:off
721
- @ JsonProperty ("auto" )
722
- AUTO ,
723
- @ JsonProperty ("any" )
724
- ANY ,
725
- @ JsonProperty ("none" )
726
- NONE
723
+ @ JsonProperty ("auto" ) AUTO ,
724
+ @ JsonProperty ("any" ) ANY ,
725
+ @ JsonProperty ("none" ) NONE
727
726
// @formatter:on
728
727
729
728
}
@@ -732,10 +731,11 @@ public enum ToolChoice {
732
731
* An object specifying the format that the model must output.
733
732
*
734
733
* @param type Must be one of 'text' or 'json_object'.
734
+ * @param jsonSchema A specific JSON schema to match, if 'type' is 'json_object'.
735
735
*/
736
736
@ JsonInclude (Include .NON_NULL )
737
- public record ResponseFormat (@ JsonProperty ("type" ) String type ) {
738
-
737
+ public record ResponseFormat (@ JsonProperty ("type" ) String type ,
738
+ @ JsonProperty ( "json_schema" ) Map < String , Object > jsonSchema ) {
739
739
}
740
740
741
741
}
0 commit comments