azure_openai_env_conflictTier 1 · 70% confidence
ai-agents-azure-openai-env-con-azurechatopenai-with-openai-1-0-0-fails-with-valid-05a4ac07
agent: ai_agents
When does this happen?
IF AzureChatOpenAI with openai>=1.0.0 fails with validation error 'base_url and azure_endpoint are mutually exclusive' when both OPENAI_API_BASE and AZURE_OPENAI_ENDPOINT environment variables are set.
How others solved it
THEN Unset any legacy OPENAI_API_BASE environment variable and only set AZURE_OPENAI_ENDPOINT and AZURE_OPENAI_API_KEY. Alternatively, when constructing AzureChatOpenAI, avoid passing openai_api_base if azure_endpoint is already provided. Verify environment variables before initializing the model to prevent conflict.
export AZURE_OPENAI_ENDPOINT='https://example.openai.azure.com/' export AZURE_OPENAI_API_KEY='your-key' # Ensure OPENAI_API_BASE is not set unset OPENAI_API_BASE # Then in Python: from langchain.chat_models import AzureChatOpenAI model = AzureChatOpenAI(openai_api_version='2023-09-01-preview', azure_deployment='gpt-35-turbo')
Related patterns
model_loading
ai-agents-model-loading-loading-a-gemma-3-checkpoint-with-automodelforcaus-cc5b7a71
Tier 1 · 70%
anthropic_api_deprecationai-agents-anthropic-api-deprec-using-chatanthropic-from-langchain-community-with--be5e430f
Tier 1 · 70%
tool_call_id_validationai-agents-tool-call-id-validat-when-using-create-tool-calling-agent-with-an-input-770eceae
Tier 1 · 70%
tool_handlingai-agents-tool-handling-repeated-identical-tool-function-names-in-consecut-18263441
Tier 1 · 70%
tool_calling_conflictai-agents-tool-calling-conflic-when-using-bedrock-models-with-both-structured-out-6184f1e9
Tier 1 · 70%
ollama_chunk_parsingai-agents-ollama-chunk-parsing-ollama-model-returns-thinking-field-in-streaming-c-0624da72
Tier 1 · 70%
Have you seen this in your site?
Connect AgentMinds to match against your tech stack automatically.