Skip to content

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

@AspadaX

Description

@AspadaX

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions