mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
add testing for cohere embeddings
This commit is contained in:
parent
9b5693a5a2
commit
df024fbbbc
1 changed files with 7 additions and 7 deletions
|
@ -282,19 +282,19 @@ async def test_cohere_embedding(sync_mode):
|
||||||
# test_cohere_embedding()
|
# test_cohere_embedding()
|
||||||
|
|
||||||
|
|
||||||
def test_cohere_embedding3():
|
@pytest.mark.parametrize("custom_llm_provider", ["cohere", "cohere_chat"])
|
||||||
|
@pytest.mark.asyncio()
|
||||||
|
async def test_cohere_embedding3(custom_llm_provider):
|
||||||
try:
|
try:
|
||||||
litellm.set_verbose = True
|
litellm.set_verbose = True
|
||||||
response = embedding(
|
response = await litellm.aembedding(
|
||||||
model="embed-english-v3.0",
|
model=f"{custom_llm_provider}/embed-english-v3.0",
|
||||||
input=["good morning from litellm", "this is another item"],
|
input=["good morning from litellm", "this is another item"],
|
||||||
|
timeout=None,
|
||||||
|
max_retries=0,
|
||||||
)
|
)
|
||||||
print(f"response:", response)
|
print(f"response:", response)
|
||||||
|
|
||||||
custom_llm_provider = response._hidden_params["custom_llm_provider"]
|
|
||||||
|
|
||||||
assert custom_llm_provider == "cohere"
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pytest.fail(f"Error occurred: {e}")
|
pytest.fail(f"Error occurred: {e}")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue