fix(azure.py): adding support for aiohttp calls on azure + openai

This commit is contained in:
Krrish Dholakia 2023-11-09 10:40:26 -08:00
parent bbc2cb43aa
commit 1d46891ceb
7 changed files with 93 additions and 30 deletions

View file

@ -25,16 +25,19 @@ def test_sync_response():
def test_async_response():
import asyncio
async def test_get_response():
litellm.set_verbose = True
user_message = "Hello, how are you?"
messages = [{"content": user_message, "role": "user"}]
try:
response = await acompletion(model="gpt-3.5-turbo", messages=messages)
print(f"response: {response}")
response = await acompletion(model="azure/chatgpt-v-2", messages=messages)
print(f"response: {response}")
except Exception as e:
pytest.fail(f"An exception occurred: {e}")
response = asyncio.run(test_get_response())
# print(response)
test_async_response()
def test_get_response_streaming():
import asyncio