This commit is contained in:
Vince Lwt 2023-08-22 15:48:43 +02:00
parent 0cb4816ab2
commit fd9c9227b6
2 changed files with 13 additions and 11 deletions

View file

@ -14,14 +14,19 @@ litellm.failure_callback = ["llmonitor"]
litellm.set_verbose = True
# openai call
# first_success_test = completion(model="gpt-3.5-turbo",
# messages=[{
# "role": "user",
# "content": "Hi 👋 - i'm openai"
# }])
# print(first_success_test)
def test_chat_openai():
try:
response = completion(model="gpt-3.5-turbo",
messages=[{
"role": "user",
"content": "Hi 👋 - i'm openai"
}])
print(response)
except Exception as e:
print(e)
def test_embedding_openai():
@ -31,7 +36,7 @@ def test_embedding_openai():
print(f"response: {str(response)[:50]}")
except Exception as e:
print(e)
# pytest.fail(f"Error occurred: {e}")
test_chat_openai()
test_embedding_openai()