mirror of
https://github.com/tiennm99/litellm.git
synced 2026-06-26 21:07:19 +00:00
1c4fdb4a8f
* Enhance Mistral API: Add support for parallel tool calls and refine name handling in tool messages. Plus, introduce a new test for parallel tool calls in the Mistral model. * tests * make mypy happy * Refine name handling in Mistral chat transformation: clarify conditions for removing the 'name' field based on message role and content.
39 lines
998 B
Python
39 lines
998 B
Python
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-medium-latest"}
|
|
|
|
def test_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
|