openai_struct/models/
auto_chunking_strategy_request_param.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 AutoChunkingStrategyRequestParam : The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`.
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16/// # on openapi.yaml
17///
18/// ```yaml
19/// AutoChunkingStrategyRequestParam:
20///   type: object
21///   title: Auto Chunking Strategy
22///   description: The default strategy. This strategy currently uses a
23///     `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`.
24///   additionalProperties: false
25///   properties:
26///     type:
27///       type: string
28///       description: Always `auto`.
29///       enum:
30///         - auto
31///       x-stainless-const: true
32///   required:
33///     - type
34/// ```
35#[derive(Debug, Serialize, Deserialize)]
36pub struct AutoChunkingStrategyRequestParam {
37    /// Always `auto`.
38    #[serde(rename = "type")]
39    #[serde(default = "default_type")]
40    pub _type: String,
41}
42
43impl Default for AutoChunkingStrategyRequestParam {
44    fn default() -> Self {
45        Self {
46            _type: default_type(),
47        }
48    }
49}
50
51fn default_type() -> String {
52    "auto".into()
53}
54
55#[test]
56fn test_param() {
57    assert_eq!(
58        serde_json::to_string(&AutoChunkingStrategyRequestParam {
59            ..Default::default()
60        })
61        .unwrap(),
62        r#"{"type":"auto"}"#
63    );
64}