openai_struct/models/response_format_json_schema.rs
1/*
2 * OpenAI API
3 *
4 * The OpenAI REST API. Please see pub https://platform.openai.com/docs/api-reference for more details.
5 *
6 * OpenAPI spec pub version: 2.3.0
7 *
8 * Generated pub by: https://github.com/swagger-api/swagger-codegen.git
9 */
10
11/// pub ResponseFormatJsonSchema : JSON Schema response format. Used to generate structured JSON responses. Learn more about [Structured Outputs](/docs/guides/structured-outputs).
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16/// # on openapi.yaml
17///
18/// ```yaml
19/// ResponseFormatJsonSchema:
20/// type: object
21/// title: JSON schema
22/// description: |
23/// JSON Schema response format. Used to generate structured JSON responses.
24/// Learn more about [Structured Outputs](/docs/guides/structured-outputs).
25/// properties:
26/// type:
27/// type: string
28/// description: The type of response format being defined. Always `json_schema`.
29/// enum:
30/// - json_schema
31/// x-stainless-const: true
32/// json_schema:
33/// type: object
34/// title: JSON schema
35/// description: |
36/// Structured Outputs configuration options, including a JSON Schema.
37/// properties:
38/// description:
39/// type: string
40/// description: >
41/// A description of what the response format is for, used by the
42/// model to
43///
44/// determine how to respond in the format.
45/// name:
46/// type: string
47/// description: >
48/// The name of the response format. Must be a-z, A-Z, 0-9, or
49/// contain
50///
51/// underscores and dashes, with a maximum length of 64.
52/// schema:
53/// $ref: "#/components/schemas/ResponseFormatJsonSchemaSchema"
54/// strict:
55/// type: boolean
56/// nullable: true
57/// default: false
58/// description: >
59/// Whether to enable strict schema adherence when generating the
60/// output.
61///
62/// If set to true, the model will always follow the exact schema
63/// defined
64///
65/// in the `schema` field. Only a subset of JSON Schema is supported
66/// when
67///
68/// `strict` is `true`. To learn more, read the [Structured Outputs
69///
70/// guide](/docs/guides/structured-outputs).
71/// required:
72/// - name
73/// required:
74/// - type
75/// - json_schema
76/// ```
77#[derive(Debug, Serialize, Deserialize)]
78pub struct ResponseFormatJsonSchema {
79 #[serde(rename = "json_schema")]
80 pub json_schema: crate::models::JsonSchema,
81}