mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 09:08:31 +00:00
Fix Azure OpenAI authentication for models without azure/ prefix (fixes #2358)
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -221,6 +221,20 @@ def test_get_custom_llm_provider_openai():
|
||||
llm = LLM(model="gpt-4")
|
||||
assert llm._get_custom_llm_provider() == None
|
||||
|
||||
def test_get_custom_llm_provider_azure_with_prefix():
|
||||
llm = LLM(model="azure/gpt-4")
|
||||
assert llm._get_custom_llm_provider() == "azure"
|
||||
|
||||
|
||||
def test_get_custom_llm_provider_azure_without_prefix():
|
||||
llm = LLM(
|
||||
model="gpt-4",
|
||||
api_key="test_key",
|
||||
api_base="test_base",
|
||||
api_version="test_version"
|
||||
)
|
||||
assert llm._get_custom_llm_provider() == "azure"
|
||||
|
||||
|
||||
def test_validate_call_params_supported():
|
||||
class DummyResponse(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user