File size: 906 Bytes
447ebeb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

import asyncio
import os
import subprocess
import sys
import time
import traceback
import platform

import pytest

sys.path.insert(
    0, os.path.abspath("../..")
)  # Adds the parent directory to the system path

def test_using_litellm_on_windows():
    """Test that LiteLLM can be imported on Windows systems."""
    
    try:
        import litellm
        print(f"litellm imported successfully on Windows ({platform.system()} {platform.release()})")

        response = litellm.completion(
            model="gpt-4o",
            messages=[
                {"role": "user", "content": "This should never fail. Email ishaan@berri.ai if this test ever fails."}
            ],
            mock_response="Hello, how are you?"
        )
        print(response)
    except Exception as e:
        pytest.fail(
            f"Error occurred on Windows: {e}. Installing litellm on Windows failed."
        )