import asyncio import httpx import json import pytest import sys from typing import Any, Dict, List from unittest.mock import MagicMock, Mock, patch import os sys.path.insert( 0, os.path.abspath("../..") ) # Adds the parent directory to the system path import litellm from litellm.exceptions import BadRequestError from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler from litellm.utils import CustomStreamWrapper # test_example.py from abc import ABC, abstractmethod class BaseLLMChatTest(ABC): """ Abstract base test class that enforces a common test across all test classes. """ @abstractmethod def get_base_completion_call_args(self) -> dict: """Must return the base completion call args""" pass def test_content_list_handling(self): """Check if content list is supported by LLM API""" base_completion_call_args = self.get_base_completion_call_args() messages = [ { "role": "user", "content": [{"type": "text", "text": "Hello, how are you?"}], } ] response = litellm.completion( **base_completion_call_args, messages=messages, ) assert response is not None