(fix) embedding pop out client from params

This commit is contained in:
ishaan-jaff 2023-11-28 21:21:59 -08:00
parent 383dd53e86
commit 6f71299bb0

View file

@ -1717,11 +1717,12 @@ def embedding(
- exception_type: If an exception occurs during the API call.
"""
azure = kwargs.get("azure", None)
client = kwargs.pop("client", None)
optional_params = {}
for param in kwargs:
if param != "metadata": # filter out metadata from optional_params
optional_params[param] = kwargs[param]
model, custom_llm_provider, dynamic_api_key, api_base = get_llm_provider(model=model, custom_llm_provider=custom_llm_provider, api_base=api_base, api_key=api_key)
try:
response = None
@ -1766,7 +1767,7 @@ def embedding(
timeout=timeout,
model_response=EmbeddingResponse(),
optional_params=optional_params,
client=optional_params.pop("client", None)
client=client
)
elif model in litellm.open_ai_embedding_models or custom_llm_provider == "openai":
api_base = (
@ -1801,7 +1802,7 @@ def embedding(
timeout=timeout,
model_response=EmbeddingResponse(),
optional_params=optional_params,
client=optional_params.pop("client", None)
client=client
)
elif model in litellm.cohere_embedding_models:
cohere_key = (