Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mistral-schema): allow custom structured output with json schema #2211

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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