mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-03 01:38:46 +00:00
* test: remove 130 legacy tests owned by stronger unit proofs Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test: list router _embedding and _aembedding as covered via public embedding calls Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: yuneng <yuneng@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
55 lines
1.8 KiB
Python
55 lines
1.8 KiB
Python
"""
|
|
Test TogetherAI LLM
|
|
"""
|
|
|
|
from base_llm_unit_tests import BaseLLMChatTest
|
|
from tests._live_test_helpers import cheapest_together_chat_model
|
|
import json
|
|
import os
|
|
from datetime import datetime
|
|
from unittest.mock import AsyncMock
|
|
|
|
|
|
import litellm
|
|
import pytest
|
|
|
|
|
|
class TestTogetherAI(BaseLLMChatTest):
|
|
test_basic_tool_calling = None
|
|
test_empty_tools = None
|
|
test_function_calling_with_tool_response = None
|
|
test_json_response_format = None
|
|
test_json_response_nested_json_schema = None
|
|
test_json_response_nested_pydantic_obj = None
|
|
test_json_response_pydantic_obj = None
|
|
test_tool_call_with_empty_enum_property = None
|
|
test_tool_call_with_property_type_array = None
|
|
|
|
def get_base_completion_call_args(self) -> dict:
|
|
litellm.set_verbose = True
|
|
return {
|
|
"model": cheapest_together_chat_model(
|
|
function_calling=True, response_schema=True
|
|
)
|
|
}
|
|
|
|
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
|
|
|
|
@pytest.mark.parametrize(
|
|
"model",
|
|
[
|
|
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
|
|
"nvidia/Llama-3.1-Nemotron-70B-Instruct-HF",
|
|
],
|
|
)
|
|
def test_get_supported_response_format_together_ai(self, model: str) -> None:
|
|
os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True"
|
|
litellm.model_cost = litellm.get_model_cost_map(url="")
|
|
optional_params = litellm.get_supported_openai_params(
|
|
model, custom_llm_provider="together_ai"
|
|
)
|
|
assert isinstance(optional_params, list)
|
|
assert "response_format" in optional_params
|
|
assert "tools" in optional_params
|