(feat) add voyage ai embeddings

This commit is contained in:
ishaan-jaff 2023-12-28 17:09:27 +05:30
parent cbcf406fd0
commit 95e6d2fbba
4 changed files with 34 additions and 0 deletions

View file

@ -2356,6 +2356,20 @@ def embedding(
client=client,
aembedding=aembedding,
)
elif custom_llm_provider == "voyage":
api_key = api_key or litellm.api_key or get_secret("VOYAGE_API_KEY")
response = openai_chat_completions.embedding(
model=model,
input=input,
api_base=api_base,
api_key=api_key,
logging_obj=logging,
timeout=timeout,
model_response=EmbeddingResponse(),
optional_params=optional_params,
client=client,
aembedding=aembedding,
)
else:
args = locals()
raise ValueError(f"No valid embedding model args passed in - {args}")