fixing acompletion

This commit is contained in:
Krrish Dholakia 2023-08-03 13:53:38 -07:00
parent eb475ad0be
commit 82a75a9d92
5 changed files with 28 additions and 3 deletions

View file

@ -0,0 +1,21 @@
#### What this tests ####
# This tests the the acompletion function
import sys, os
import pytest
import traceback
import asyncio
sys.path.insert(0, os.path.abspath('../..')) # Adds the parent directory to the system path
from litellm import acompletion
async def test_get_response():
user_message = "Hello, how are you?"
messages = [{ "content": user_message,"role": "user"}]
try:
response = await acompletion(model="gpt-3.5-turbo", messages=messages)
except Exception as e:
pytest.fail(f"error occurred: {e}")
return response
response = asyncio.run(test_get_response())
print(response)