mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
add cohere embedding models
This commit is contained in:
parent
8213e23970
commit
af914d4be1
5 changed files with 127 additions and 9 deletions
|
@ -8,18 +8,28 @@ sys.path.insert(
|
|||
import litellm
|
||||
from litellm import embedding, completion
|
||||
|
||||
litellm.set_verbose = True
|
||||
|
||||
litellm.set_verbose = False
|
||||
|
||||
def test_openai_embedding():
|
||||
try:
|
||||
response = embedding(
|
||||
model="text-embedding-ada-002", input=["good morning from litellm"]
|
||||
model="text-embedding-ada-002", input=["good morning from litellm", "this is another item"]
|
||||
)
|
||||
print(response)
|
||||
# Add any assertions here to check the response
|
||||
# print(f"response: {str(response)}")
|
||||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
|
||||
|
||||
# test_openai_embedding()
|
||||
|
||||
def test_cohere_embedding():
|
||||
try:
|
||||
response = embedding(
|
||||
model="embed-english-v2.0", input=["good morning from litellm", "this is another item"]
|
||||
)
|
||||
print(f"response:", response)
|
||||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
|
||||
# test_cohere_embedding()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue