mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-04 14:39:23 +00:00
fix: address CI lint failures and Bugbot review feedback
- Run ruff format on completion.py - Remove unused 'import os' from test_azure_credentials.py - Catch ImportError in _init_clients for deferred-build path
This commit is contained in:
committed by
Joao Moura
parent
31f480aac0
commit
04a2d606a3
@@ -118,8 +118,12 @@ class AzureCompletion(BaseLLM):
|
||||
data["api_version"] = (
|
||||
data.get("api_version") or os.getenv("AZURE_API_VERSION") or "2024-06-01"
|
||||
)
|
||||
data["azure_tenant_id"] = data.get("azure_tenant_id") or os.getenv("AZURE_TENANT_ID")
|
||||
data["azure_client_id"] = data.get("azure_client_id") or os.getenv("AZURE_CLIENT_ID")
|
||||
data["azure_tenant_id"] = data.get("azure_tenant_id") or os.getenv(
|
||||
"AZURE_TENANT_ID"
|
||||
)
|
||||
data["azure_client_id"] = data.get("azure_client_id") or os.getenv(
|
||||
"AZURE_CLIENT_ID"
|
||||
)
|
||||
|
||||
# Credentials and endpoint are validated lazily in `_init_clients`
|
||||
# so the LLM can be constructed before deployment env vars are set.
|
||||
@@ -154,7 +158,7 @@ class AzureCompletion(BaseLLM):
|
||||
try:
|
||||
self._client = self._build_sync_client()
|
||||
self._async_client = self._build_async_client()
|
||||
except ValueError:
|
||||
except (ValueError, ImportError):
|
||||
pass
|
||||
return self
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ Covers the four credential paths:
|
||||
4. AzureKeyCredential (API key - existing path)
|
||||
"""
|
||||
|
||||
import os
|
||||
from unittest.mock import patch, MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
Reference in New Issue
Block a user