mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
Merge branch 'main' into litellm_return-response_headers
This commit is contained in:
commit
04e3ebf627
37 changed files with 570 additions and 89 deletions
|
@ -142,6 +142,36 @@ def test_completion_azure_ai_command_r():
|
|||
pytest.fail(f"Error occurred: {e}")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("sync_mode", [True, False])
|
||||
@pytest.mark.asyncio
|
||||
async def test_completion_azure_ai_mistral_invalid_params(sync_mode):
|
||||
try:
|
||||
import os
|
||||
|
||||
litellm.set_verbose = True
|
||||
|
||||
os.environ["AZURE_AI_API_BASE"] = os.getenv("AZURE_MISTRAL_API_BASE", "")
|
||||
os.environ["AZURE_AI_API_KEY"] = os.getenv("AZURE_MISTRAL_API_KEY", "")
|
||||
|
||||
data = {
|
||||
"model": "azure_ai/mistral",
|
||||
"messages": [{"role": "user", "content": "What is the meaning of life?"}],
|
||||
"frequency_penalty": 0.1,
|
||||
"presence_penalty": 0.1,
|
||||
"drop_params": True,
|
||||
}
|
||||
if sync_mode:
|
||||
response: litellm.ModelResponse = completion(**data) # type: ignore
|
||||
else:
|
||||
response: litellm.ModelResponse = await litellm.acompletion(**data) # type: ignore
|
||||
|
||||
assert "azure_ai" in response.model
|
||||
except litellm.Timeout as e:
|
||||
pass
|
||||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
|
||||
|
||||
def test_completion_azure_command_r():
|
||||
try:
|
||||
litellm.set_verbose = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue