mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
test(ocr): keep parity harness behavior-neutral
This commit is contained in:
parent
321634775e
commit
9c3adce01a
4 changed files with 1 additions and 28 deletions
|
|
@ -177,9 +177,8 @@ class VertexAIDeepSeekOCRConfig(BaseOCRConfig):
|
|||
content_item = {"type": "image_url", "image_url": document_url}
|
||||
|
||||
# Build DeepSeek OCR request
|
||||
provider_model: Final = model if model.startswith("deepseek-ai/") else f"deepseek-ai/{model}"
|
||||
data: Final = {
|
||||
"model": provider_model,
|
||||
"model": "deepseek-ai/" + model,
|
||||
"messages": [{"role": "user", "content": [content_item]}],
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -191,10 +191,6 @@ def _prepare_ocr_request(
|
|||
def _rust_ocr_supported(prepared_request: _PreparedOCRRequest) -> bool:
|
||||
if prepared_request.optional_params.get(OCR_REQUEST_FORMAT_PARAM) == "native":
|
||||
return False
|
||||
if prepared_request.extra_headers is not None and any(
|
||||
not isinstance(value, str) for value in prepared_request.extra_headers.values()
|
||||
):
|
||||
return False
|
||||
return prepared_request.custom_llm_provider in _RUST_OCR_PROVIDERS
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -457,19 +457,6 @@ def test_unqualified_reducto_models_accept_explicit_provider(
|
|||
assert sdk_input.model == model
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model", ("deepseek-ocr-maas", "deepseek-ai/deepseek-ocr-maas"))
|
||||
def test_vertex_deepseek_request_uses_single_provider_namespace(model: str) -> None:
|
||||
request: Final = VertexAIDeepSeekOCRConfig().transform_ocr_request( # pyright: ignore[reportUnknownMemberType]
|
||||
model=model,
|
||||
document={"type": "image_url", "image_url": "data:image/png;base64,AA=="},
|
||||
optional_params={},
|
||||
headers={},
|
||||
)
|
||||
|
||||
data: Final = cast(dict[str, object], request.data)
|
||||
assert data["model"] == "deepseek-ai/deepseek-ocr-maas"
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"document",
|
||||
(
|
||||
|
|
|
|||
|
|
@ -147,15 +147,6 @@ INVALID_OCR_CASES: Final = (
|
|||
expected_message="Invalid `features` for Azure Document Intelligence",
|
||||
extra_kwargs=(("features", [1]),),
|
||||
),
|
||||
InvalidOcrCase(
|
||||
name="invalid_header_value",
|
||||
model="mistral/mistral-ocr-latest",
|
||||
document={"type": "document_url", "document_url": "data:application/pdf;base64,AA=="},
|
||||
expected_exception_type="litellm.exceptions.InternalServerError",
|
||||
expected_status_code=500,
|
||||
expected_message="Header value must be str or bytes",
|
||||
extra_kwargs=(("extra_headers", {"x-invalid": 1}),),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue