mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
(test) fix mistral tests
This commit is contained in:
parent
43b66d562e
commit
38e003bcc0
2 changed files with 10 additions and 1 deletions
|
@ -107,11 +107,16 @@ def test_completion_mistral_api():
|
||||||
pytest.fail(f"Error occurred: {e}")
|
pytest.fail(f"Error occurred: {e}")
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skip(
|
||||||
|
reason="Since we already test mistral/mistral-tiny in test_completion_mistral_api. This is only for locally verifying azure mistral works"
|
||||||
|
)
|
||||||
def test_completion_mistral_azure():
|
def test_completion_mistral_azure():
|
||||||
try:
|
try:
|
||||||
litellm.set_verbose = True
|
litellm.set_verbose = True
|
||||||
response = completion(
|
response = completion(
|
||||||
model="mistral/Mistral-large-nmefg",
|
model="mistral/Mistral-large-nmefg",
|
||||||
|
api_key=os.environ["MISTRAL_AZURE_API_KEY"],
|
||||||
|
api_base=os.environ["MISTRAL_AZURE_API_BASE"],
|
||||||
max_tokens=5,
|
max_tokens=5,
|
||||||
messages=[
|
messages=[
|
||||||
{
|
{
|
||||||
|
|
|
@ -5011,7 +5011,11 @@ def get_llm_provider(
|
||||||
# if api_base does not end with /v1 we add it
|
# if api_base does not end with /v1 we add it
|
||||||
if api_base is not None and not api_base.endswith("/v1"):
|
if api_base is not None and not api_base.endswith("/v1"):
|
||||||
api_base = api_base + "/v1"
|
api_base = api_base + "/v1"
|
||||||
dynamic_api_key = api_key or get_secret("MISTRAL_AZURE_API_KEY")
|
dynamic_api_key = (
|
||||||
|
api_key
|
||||||
|
or get_secret("MISTRAL_AZURE_API_KEY")
|
||||||
|
or get_secret("MISTRAL_API_KEY")
|
||||||
|
)
|
||||||
elif custom_llm_provider == "voyage":
|
elif custom_llm_provider == "voyage":
|
||||||
# voyage is openai compatible, we just need to set this to custom_openai and have the api_base be https://api.voyageai.com/v1
|
# voyage is openai compatible, we just need to set this to custom_openai and have the api_base be https://api.voyageai.com/v1
|
||||||
api_base = "https://api.voyageai.com/v1"
|
api_base = "https://api.voyageai.com/v1"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue