openai_struct/models/
stop_configuration.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 StopConfiguration : Not supported with latest reasoning models `o3` and `o4-mini`.  Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16/// # on openai.yaml
17///
18/// ```yaml
19/// StopConfiguration:
20///   description: |
21///     Not supported with latest reasoning models `o3` and `o4-mini`.
22///
23///     Up to 4 sequences where the API will stop generating further tokens. The
24///     returned text will not contain the stop sequence.
25///   default: null
26///   nullable: true
27///   oneOf:
28///     - type: string
29///       default: <|endoftext|>
30///       example: "\n"
31///       nullable: true
32///     - type: array
33///       minItems: 1
34///       maxItems: 4
35///       items:
36///         type: string
37///         example: '["\n"]'
38/// ```
39#[derive(Debug, Serialize, Deserialize)]
40#[serde(untagged)]
41pub enum StopConfiguration {
42    Text(String),
43    Array(Vec<String>),
44}