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

Missing required model_version with AzureOpenAiGenerativeModel #85

Open
wnijmeijer opened this issue Feb 18, 2025 · 4 comments
Open

Missing required model_version with AzureOpenAiGenerativeModel #85

wnijmeijer opened this issue Feb 18, 2025 · 4 comments
Assignees

Comments

@wnijmeijer
Copy link

Azure requires the default_headers={"model-version": "2024-07-18"}. But we cannot set it in the AzureOpenAiGenerativeModel

@galshubeli galshubeli self-assigned this Feb 18, 2025
@galshubeli
Copy link
Contributor

Hi @wnijmeijer t thank you for your question. Based on Microsoft's documentation, the only credentials you need are api_key, api_version, and azure_endpoint.

You can also use our Litellm integration, and the configuration there is the same.

Are you sure you mean "model-version" and not "api_version"?
Would you like to share your exception?"

@wnijmeijer
Copy link
Author

When i use this:


    def _connect_to_model(self) -> None:
        """
        Establish a connection to the Azure OpenAI model by initializing the AzureOpenAI client.
        """
        self.client = AzureOpenAI(azure_endpoint=self.azure_endpoint,
                                api_version=self.api_version,
                                api_key=self.api_key,default_headers={"model-version": "2024-07-18"}
                                )


it works.

Else i get this error message:
Chyper error Error code: 400 - {'statusCode': 400, 'message': 'Missing model-version in header'}

@galshubeli
Copy link
Contributor

You’re right. Thanks for this, I’ll fix it.

In the meantime, it looks like you know how to modify this function for your use.
Until I release the fix, do you need any more help?

@wnijmeijer
Copy link
Author

No all good, thanks

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