mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
test: add unit test for vertex_ai embedding extra_headers
This commit is contained in:
parent
585c059b69
commit
bd242d0896
1 changed files with 16 additions and 0 deletions
16
tests/test_litellm/test_vertex_ai_embedding_headers.py
Normal file
16
tests/test_litellm/test_vertex_ai_embedding_headers.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import pytest
|
||||
from litellm import embedding
|
||||
|
||||
def test_vertex_ai_embedding_extra_headers():
|
||||
# Test that extra_headers are passed without crashing
|
||||
try:
|
||||
response = embedding(
|
||||
model="vertex_ai/text-embedding-004",
|
||||
input=["hello"],
|
||||
extra_headers={"X-Custom-Header": "test-value"}
|
||||
)
|
||||
except Exception as e:
|
||||
# We expect a 401/404 if no real creds,
|
||||
# but we are checking that it doesn't fail with a TypeError
|
||||
if "extra_headers" in str(e):
|
||||
pytest.fail("extra_headers not accepted by vertex_ai embedding")
|
||||
Loading…
Add table
Reference in a new issue