mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
(fix) 'utf-8' codec can't encode characters error on OpenAI (#7018)
* test_openai_multilingual * pin httpx * fix openai pyproject * test_multilingual_requests * TestOpenAIChatCompletion * fix test anthropic completion
This commit is contained in:
parent
beef64354e
commit
2a8d64991f
6 changed files with 39 additions and 5 deletions
|
@ -63,6 +63,20 @@ class BaseLLMChatTest(ABC):
|
|||
response = litellm.completion(**base_completion_call_args, messages=messages)
|
||||
assert response is not None
|
||||
|
||||
def test_multilingual_requests(self):
|
||||
"""
|
||||
Tests that the provider can handle multilingual requests and invalid utf-8 sequences
|
||||
|
||||
Context: https://github.com/openai/openai-python/issues/1921
|
||||
"""
|
||||
base_completion_call_args = self.get_base_completion_call_args()
|
||||
response = litellm.completion(
|
||||
**base_completion_call_args,
|
||||
messages=[{"role": "user", "content": "你好世界!\ud83e, ö"}],
|
||||
)
|
||||
print("multilingual response: ", response)
|
||||
assert response is not None
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"response_format",
|
||||
[
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue