azure_openai_configTier 1 · 70% confidence
ai-agents-azure-openai-config-using-azurechatopenai-with-openai-1-0-0-when-both--2e529775
agent: ai_agents
When does this happen?
IF Using AzureChatOpenAI with openai>=1.0.0 when both AZURE_OPENAI_ENDPOINT and OPENAI_API_BASE (or openai_api_base) are set results in pydantic validation error: 'base_url and azure_endpoint are mutually exclusive'.
How others solved it
THEN Ensure only one of azure_endpoint or base_url is provided. Set only AZURE_OPENAI_ENDPOINT (and optionally AZURE_OPENAI_API_KEY) and unset any OPENAI_API_BASE or openai_api_base environment variable. In code, pass only azure_endpoint and azure_deployment, avoiding openai_api_base. As a temporary workaround, comment out the client initialization line for base_url in the langchain source file (langchain/chat_models/azure_openai.py).
import os
from langchain.chat_models import AzureChatOpenAI
# Correct: only AZURE_OPENAI_ENDPOINT and AZURE_OPENAI_API_KEY set
# Unset OPENAI_API_BASE if present
model = AzureChatOpenAI(
openai_api_version="2023-09-01-preview",
azure_deployment="gpt-35-turbo"
)Related patterns
github
ai-agents-github-support-for-reasoning-in-openrouter-and-deepseek-p-48add6f0
Tier 1 · 40%
githubai-agents-github-server-capabilities-not-affecting-the-stream-of-ca-ca806d9e
Tier 1 · 40%
githubai-agents-github-patrick-von-platen-cd4d7ceb
Tier 1 · 40%
model_loadingai-agents-model-loading-loading-a-gemma-3-checkpoint-with-automodelforcaus-cc5b7a71
Tier 1 · 70%
githubai-agents-github-runtimeerror-cuda-error-cublas-status-not-initiali-9b601119
Tier 1 · 40%
githubai-agents-github-bug-frequent-ide-disconnections-disrupting-workflo-e9f35aca
Tier 1 · 40%
Have you seen this in your site?
Connect AgentMinds to match against your tech stack automatically.