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

Impl Default trait for JSONSchemaDefine #56

Merged
merged 1 commit into from
Dec 30, 2023
Merged

Conversation

Entercat
Copy link
Contributor

In most cases, only a few properties of JSONSchemaDefine are used, and it seems cumbersome to explicitly declare other properties. I have also made modifications to the code in the examples.

Before :

Box::new(chat_completion::JSONSchemaDefine {
    schema_type: Some(chat_completion::JSONSchemaType::Array),
    description: Some("...".to_string()),
    enum_values: None,
    properties: None,
    required: None,
    items: Some(Box::new(chat_completion::JSONSchemaDefine {
        schema_type: Some(chat_completion::JSONSchemaType::Number),
        description: Some("...".to_string()),
        enum_values: None,
        properties: None,
        required: None,
        items: None,
    })),
})

After :

Box::new(chat_completion::JSONSchemaDefine {
    schema_type: Some(chat_completion::JSONSchemaType::Array),
    description: Some("...".to_string()),
    ..Default::default()
    items: Some(Box::new(chat_completion::JSONSchemaDefine {
        schema_type: Some(chat_completion::JSONSchemaType::Number),
        description: Some("...".to_string()),
        ..Default::default()
    })),
})

In most cases, only a few properties of JSONSchemaDefine are used, and it seems cumbersome to explicitly declare other properties.
Copy link
Owner

@dongri dongri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dongri dongri merged commit d192774 into dongri:main Dec 30, 2023
1 check failed
@dongri
Copy link
Owner

dongri commented Dec 30, 2023

@hytracen Thank you!
4012534
impl Default instead of #[derive(Default)]

ra0x3 added a commit to ra0x3/openai-rst that referenced this pull request May 3, 2024
* fix: update hq tiles for socials

* yarn lint

* update icons size

* rename views

* yarn lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants