Skip to content

Problem with initializing AzureOpenAI() #25801

Closed Answered by dosubot bot
toshnav asked this question in Q&A
Aug 28, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hey there, @toshnav! I'm here to help you with any bugs, questions, or to assist you in becoming a contributor.

The ValidationError when initializing the AzureOpenAI client is likely due to the validation logic in the validate_environment method of the AzureOpenAI class. Specifically, the error can occur if the openai_api_base (or its alias base_url) is specified incorrectly or conflicts with the deployment_name (or its alias azure_deployment) parameter.

From the provided code, the following conditions can trigger a ValidationError:

  1. If openai_api_base is specified and does not contain /openai, it will raise a ValueError:

    if openai_api_base and values["validate_base_url"]:
        if "/openai"

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@toshnav
Comment options

@dosubot
Comment options

Answer selected by toshnav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant