Skip to content

Commit

Permalink
feat(mistral-schema): allow custom structured output with json schema
Browse files Browse the repository at this point in the history
Signed-off-by: krsamuel <[email protected]>
  • Loading branch information
krsamuel committed Feb 11, 2025
1 parent 9710f78 commit 15783f5
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -633,9 +633,11 @@ public record EmbeddingList<T>(
* @param stop A list of tokens that the model should stop generating after. If set,
* @param randomSeed The seed to use for random sampling. If set, different calls will
* generate deterministic results.
* @param responseFormat An object specifying the format that the model must output.
* Setting to { "type": "json_object" } enables JSON mode, which guarantees the
* message the model generates is valid JSON.
* @param responseFormat An object specifying the format or schema that the model must
* output. Setting to { "type": "json_object" } enables JSON mode, which guarantees
* the message the model generates is valid JSON. Setting to { "type": "json_object" ,
* "json_schema": schema} allows you to ensure the model provides an answer in a very
* specific JSON format by supplying a clear JSON schema.
*/
@JsonInclude(Include.NON_NULL)
public record ChatCompletionRequest(
Expand Down Expand Up @@ -738,11 +740,12 @@ public enum ToolChoice {
* An object specifying the format that the model must output.
*
* @param type Must be one of 'text' or 'json_object'.
* @param jsonSchema A specific JSON schema to match, if 'type' is 'json_object'.
*/
@JsonInclude(Include.NON_NULL)
public record ResponseFormat(@JsonProperty("type") String type) {
public record ResponseFormat(@JsonProperty("type") String type,
@JsonProperty("json_schema") Map<String, Object> jsonSchema) {

}

}

Expand Down

0 comments on commit 15783f5

Please sign in to comment.