mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
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:
parent
809838042e
commit
c6240ff621
1 changed files with 3 additions and 0 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue