mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-28 01:32:17 +00:00
test(integration): deepseek vision image content list reaches the provider unchanged (Pylon #7729)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
c6c3881d7f
commit
1da838e591
2 changed files with 43 additions and 0 deletions
|
|
@ -223,6 +223,9 @@
|
|||
"tests/integration/providers/test_xiaomi_mimo_wire.py::test_xiaomi_mimo_tool_call_is_forwarded_and_returned": [
|
||||
"other.provider_wire.xiaomi_mimo.tool_call_survives_translation"
|
||||
],
|
||||
"tests/integration/providers/test_deepseek_vision_wire.py::test_deepseek_vision_forwards_image_url_content_list_instead_of_collapsing_to_text": [
|
||||
"other.provider_wire.deepseek.vision_image_content_list_reaches_provider"
|
||||
],
|
||||
"tests/integration/providers/test_fal_ai_video_wire.py::test_fal_h3_video_create_uses_canonical_body_and_status_path": [
|
||||
"other.provider_wire.fal_ai.video_queue_create_status_and_content_download"
|
||||
],
|
||||
|
|
|
|||
40
tests/integration/providers/test_deepseek_vision_wire.py
Normal file
40
tests/integration/providers/test_deepseek_vision_wire.py
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
from typing import Final
|
||||
|
||||
import httpx
|
||||
import pytest
|
||||
from pydantic import JsonValue
|
||||
|
||||
from tests.integration._support.client import JSON_OBJECT, Gateway, object_value
|
||||
|
||||
_VISION_MODEL: Final = "deepseek-v4-flash-vision-exp"
|
||||
_API_KEY: Final = "synthetic-deepseek-key"
|
||||
_VISION_CONTENT: Final[JsonValue] = [
|
||||
{"type": "text", "text": "what is in this image?"},
|
||||
{"type": "image_url", "image_url": {"url": "https://example.com/pic.png"}},
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.covers("other.provider_wire.deepseek.vision_image_content_list_reaches_provider")
|
||||
def test_deepseek_vision_forwards_image_url_content_list_instead_of_collapsing_to_text(gateway: Gateway) -> None:
|
||||
with gateway.scenario() as scenario, httpx.Client(base_url=gateway.upstream_url, trust_env=False) as upstream:
|
||||
upstream.get("/__observations").raise_for_status()
|
||||
model: Final = scenario.model(
|
||||
model=f"deepseek/{_VISION_MODEL}",
|
||||
api_key=_API_KEY,
|
||||
model_info={"mode": "chat", "supports_vision": True},
|
||||
)
|
||||
response: Final = gateway.request(
|
||||
"POST",
|
||||
"/v1/chat/completions",
|
||||
{"model": model, "messages": [{"role": "user", "content": _VISION_CONTENT}]},
|
||||
)
|
||||
assert response.status_code == 200, response.text
|
||||
observations: Final = JSON_OBJECT.validate_json(upstream.get("/__observations").content)["requests"]
|
||||
assert isinstance(observations, list)
|
||||
assert len(observations) == 1, response.text
|
||||
observed: Final = object_value(observations[0])
|
||||
assert observed["path"] == "/v1/chat/completions", response.text
|
||||
assert observed["authorization"] == f"Bearer {_API_KEY}", response.text
|
||||
body: Final = object_value(observed["body"])
|
||||
assert body["model"] == _VISION_MODEL, response.text
|
||||
assert body["messages"] == [{"role": "user", "content": _VISION_CONTENT}], response.text
|
||||
Loading…
Add table
Reference in a new issue