forked from phoenix/litellm-mirror
fix(main.py): pass extra_headers param to openai
Fixes https://github.com/BerriAI/litellm/issues/6836
This commit is contained in:
parent
250d66b335
commit
dfb34dfe92
2 changed files with 5 additions and 0 deletions
|
@ -3440,6 +3440,10 @@ def embedding( # noqa: PLR0915
|
||||||
or litellm.openai_key
|
or litellm.openai_key
|
||||||
or get_secret_str("OPENAI_API_KEY")
|
or get_secret_str("OPENAI_API_KEY")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if extra_headers is not None:
|
||||||
|
optional_params["extra_headers"] = extra_headers
|
||||||
|
|
||||||
api_type = "openai"
|
api_type = "openai"
|
||||||
api_version = None
|
api_version = None
|
||||||
|
|
||||||
|
|
|
@ -1085,6 +1085,7 @@ def test_cohere_img_embeddings(input, input_type):
|
||||||
@pytest.mark.parametrize("sync_mode", [True, False])
|
@pytest.mark.parametrize("sync_mode", [True, False])
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_embedding_with_extra_headers(sync_mode):
|
async def test_embedding_with_extra_headers(sync_mode):
|
||||||
|
|
||||||
input = ["hello world"]
|
input = ["hello world"]
|
||||||
from litellm.llms.custom_httpx.http_handler import HTTPHandler, AsyncHTTPHandler
|
from litellm.llms.custom_httpx.http_handler import HTTPHandler, AsyncHTTPHandler
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue