fix(vertex_ai.py): add async embedding support for vertex ai

This commit is contained in:
Krrish Dholakia 2024-02-03 10:35:17 -08:00
parent 5bf51a6058
commit 0ffdf57dec
3 changed files with 102 additions and 0 deletions

View file

@ -2211,6 +2211,7 @@ async def aembedding(*args, **kwargs):
or custom_llm_provider == "deepinfra"
or custom_llm_provider == "perplexity"
or custom_llm_provider == "ollama"
or custom_llm_provider == "vertex_ai"
): # currently implemented aiohttp calls for just azure and openai, soon all.
# Await normally
init_response = await loop.run_in_executor(None, func_with_context)
@ -2549,6 +2550,7 @@ def embedding(
model_response=EmbeddingResponse(),
vertex_project=vertex_ai_project,
vertex_location=vertex_ai_location,
aembedding=aembedding,
)
elif custom_llm_provider == "oobabooga":
response = oobabooga.embedding(