support for later embeddings

This commit is contained in:
Vince Lwt 2023-08-22 15:42:56 +02:00
parent 342b83544f
commit 0cb4816ab2
3 changed files with 61 additions and 22 deletions

View file

@ -6,7 +6,7 @@ import os
sys.path.insert(0, os.path.abspath('../..'))
from litellm import completion
from litellm import completion, embedding
import litellm
litellm.success_callback = ["llmonitor"]
@ -15,10 +15,23 @@ 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"
}])
# first_success_test = completion(model="gpt-3.5-turbo",
# messages=[{
# "role": "user",
# "content": "Hi 👋 - i'm openai"
# }])
print(first_success_test)
# print(first_success_test)
def test_embedding_openai():
try:
response = embedding(model="text-embedding-ada-002", input=['test'])
# Add any assertions here to check the response
print(f"response: {str(response)[:50]}")
except Exception as e:
print(e)
# pytest.fail(f"Error occurred: {e}")
test_embedding_openai()