mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 10:14:26 +00:00
(fix) embedding pop out client from params
This commit is contained in:
parent
383dd53e86
commit
6f71299bb0
1 changed files with 4 additions and 3 deletions
|
@ -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 = (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue