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

AzureOpenAI does not take model parameter into account when creating a request #348

Open
AspadaX opened this issue Mar 12, 2025 · 1 comment

Comments

@AspadaX
Copy link

AspadaX commented Mar 12, 2025

As I figured, the current approach is to use the deployment_id that the user sat when instantiating the AzureConfig, and it gets handled by the url() method provided by the Config trait.

impl Config for AzureConfig {
    fn headers(&self) -> HeaderMap {
        let mut headers = HeaderMap::new();

        headers.insert("api-key", self.api_key.expose_secret().parse().unwrap());

        headers
    }

    fn url(&self, path: &str) -> String {
        format!(
            "{}/openai/deployments/{}{}",
            self.api_base, self.deployment_id, path
        ) // It pieces things together here... 
    }

    fn api_base(&self) -> &str {
        &self.api_base
    }

    fn api_key(&self) -> &SecretString {
        &self.api_key
    }

    fn query(&self) -> Vec<(&str, &str)> {
        vec![("api-version", &self.api_version)]
    }
}

However, after I tried, the model parameter does not seem to work in the request creation part, nor the example had mentioned about deployment_id. This is handled in the Python library, of course.

The so-called deployment_id is confusing, as the official documents phrases it as deployment_name, as of this post.

Could you please make the model work just like the normal OpenAI approach?

@felix-schultz
Copy link

The model is always attached to a deployment_id / name. So the model parameter itself would never have an effect. Could you clarify what you mean by the python library handling it?

If I setup a endpoint with gpt-4o and I send the model gpt-3.5 I will still get gpt-4o per design.

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

No branches or pull requests

2 participants