Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions litellm/llms/AzureOpenAI/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,7 @@ async def aembedding(
logging_obj: LiteLLMLoggingObj,
api_key: Optional[str] = None,
client: Optional[AsyncAzureOpenAI] = None,
extra_headers: Optional[dict] = None,
timeout=None,
):
response = None
Expand All @@ -826,7 +827,7 @@ async def aembedding(
else:
openai_aclient = client
raw_response = await openai_aclient.embeddings.with_raw_response.create(
**data, timeout=timeout
**data, timeout=timeout, extra_headers=extra_headers,
)
headers = dict(raw_response.headers)
response = raw_response.parse()
Expand Down Expand Up @@ -867,6 +868,7 @@ def embedding(
optional_params: dict,
api_key: Optional[str] = None,
azure_ad_token: Optional[str] = None,
extra_headers: Optional[dict] = None,
client=None,
aembedding=None,
) -> litellm.EmbeddingResponse:
Expand Down Expand Up @@ -923,13 +925,14 @@ def embedding(
azure_client_params=azure_client_params,
timeout=timeout,
client=client,
extra_headers=extra_headers,
)
if client is None:
azure_client = AzureOpenAI(**azure_client_params) # type: ignore
else:
azure_client = client
## COMPLETION CALL
raw_response = azure_client.embeddings.with_raw_response.create(**data, timeout=timeout) # type: ignore
raw_response = azure_client.embeddings.with_raw_response.create(**data, timeout=timeout, extra_headers=extra_headers) # type: ignore
headers = dict(raw_response.headers)
response = raw_response.parse()
## LOGGING
Expand Down
1 change: 1 addition & 0 deletions litellm/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3387,6 +3387,7 @@ def embedding( # noqa: PLR0915
optional_params=optional_params,
client=client,
aembedding=aembedding,
extra_headers=extra_headers,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not necessary. extra_headers is already passed via optional_params

)
elif (
model in litellm.open_ai_embedding_models
Expand Down