- Notifications
You must be signed in to change notification settings - Fork 2.8k
/
Copy pathtest_mistral_api.py
44 lines (33 loc) · 1.15 KB
/
test_mistral_api.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
importasyncio
importos
importsys
importtraceback
fromdotenvimportload_dotenv
importlitellm.types
importlitellm.types.utils
fromlitellm.llms.anthropic.chatimportModelResponseIterator
load_dotenv()
importio
importos
sys.path.insert(
0, os.path.abspath("../..")
) # Adds the parent directory to the system path
fromtypingimportOptional
fromunittest.mockimportMagicMock, patch
importpytest
importlitellm
fromlitellm.llms.anthropic.common_utilsimportprocess_anthropic_headers
fromhttpximportHeaders
frombase_llm_unit_testsimportBaseLLMChatTest
classTestMistralCompletion(BaseLLMChatTest):
defget_base_completion_call_args(self) ->dict:
litellm.set_verbose=True
return {"model": "mistral/mistral-small-latest"}
deftest_tool_call_no_arguments(self, tool_call_no_arguments):
"""Test that tool calls with no arguments is translated correctly. Relevant issue: https://github.com/BerriAI/litellm/issues/6833"""
pass
deftest_multilingual_requests(self):
"""
Mistral API raises a 400 BadRequest error when the request contains invalid utf-8 sequences.
"""
pass