fix(azure_ai): resolve api_base from env var in get_complete_url for Document Intelligence OCR

validate_environment() resolved AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT
from the env var but only returned headers. get_complete_url() still
received None and raised ValueError. Now get_complete_url() also
resolves the env var as a fallback.

Fixes #21034
This commit is contained in:
Chesars 2026-02-19 15:14:09 -03:00
parent 809838042e
commit c6240ff621

View file

@ -121,6 +121,9 @@ class AzureDocumentIntelligenceOCRConfig(BaseOCRConfig):
Returns: Complete URL for Azure DI analyze endpoint
"""
if api_base is None:
api_base = get_secret_str("AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT")
if api_base is None:
raise ValueError(
"Missing Azure Document Intelligence Endpoint - Set AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT environment variable or pass api_base parameter"