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

bugfix: Updated FileSearchRanker to match change by OpenAI #341

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hiibolt
Copy link
Contributor

@hiibolt hiibolt commented Feb 28, 2025

Fixes issue mentioned in #340

@irbull
Copy link

irbull commented Mar 1, 2025

I can confirm that if I use curl to access the create run endpoint, it also returns default-2024-08-21 which appears to be different from what the docs say. Since this appears to be an undocumented change, what do you think about using an alias instead of a rename, and supporting both default-2024-08-21 and default_2024_08_21. Just in case they break their API again.

Something like:

pub enum FileSearchRanker {
    #[serde(rename = "auto")]
    Auto,
    #[serde(alias = "default_2024_08_21")]
    #[serde(alias = "default-2024-08-21")]
    Default2024_08_21,
}

@hiibolt
Copy link
Contributor Author

hiibolt commented Mar 3, 2025

I can confirm that if I use curl to access the create run endpoint, it also returns default-2024-08-21 which appears to be different from what the docs say. Since this appears to be an undocumented change, what do you think about using an alias instead of a rename, and supporting both default-2024-08-21 and default_2024_08_21. Just in case they break their API again.

Something like:

pub enum FileSearchRanker {
    #[serde(rename = "auto")]
    Auto,
    #[serde(alias = "default_2024_08_21")]
    #[serde(alias = "default-2024-08-21")]
    Default2024_08_21,
}

I agree, I will link a commit tonight.

@hiibolt
Copy link
Contributor Author

hiibolt commented Mar 3, 2025

@64bit Could you look this change over? Because of the unprompted and undocumented spec change by OpenAI, crates currently depending on using the Assistants API fail even if they do not directly use this struct

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