forked from phoenix/litellm-mirror
(fix) OpenAI's optional messages[].name does not work with Mistral API (#6701)
* use helper for _transform_messages mistral * add test_message_with_name to base LLMChat test * fix linting
This commit is contained in:
parent
c3bc9e6b12
commit
9d20c19e0c
4 changed files with 100 additions and 38 deletions
34
tests/llm_translation/test_mistral_api.py
Normal file
34
tests/llm_translation/test_mistral_api.py
Normal file
|
@ -0,0 +1,34 @@
|
|||
import asyncio
|
||||
import os
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
import litellm.types
|
||||
import litellm.types.utils
|
||||
from litellm.llms.anthropic.chat import ModelResponseIterator
|
||||
|
||||
load_dotenv()
|
||||
import io
|
||||
import os
|
||||
|
||||
sys.path.insert(
|
||||
0, os.path.abspath("../..")
|
||||
) # Adds the parent directory to the system path
|
||||
from typing import Optional
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
import litellm
|
||||
|
||||
from litellm.llms.anthropic.common_utils import process_anthropic_headers
|
||||
from httpx import Headers
|
||||
from base_llm_unit_tests import BaseLLMChatTest
|
||||
|
||||
|
||||
class TestMistralCompletion(BaseLLMChatTest):
|
||||
def get_base_completion_call_args(self) -> dict:
|
||||
litellm.set_verbose = True
|
||||
return {"model": "mistral/mistral-small-latest"}
|
Loading…
Add table
Add a link
Reference in a new issue