mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-17 23:51:30 +00:00
fix(rust-bridge): narrow OCR input_sources values to the native InputSource variants
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
c827344840
commit
c7c71b95ad
1 changed files with 5 additions and 3 deletions
|
|
@ -1,10 +1,12 @@
|
|||
from asyncio import Future
|
||||
from collections.abc import Coroutine, Mapping, Sequence
|
||||
from typing import Never, final
|
||||
from typing import Literal, Never, TypeAlias, final
|
||||
|
||||
from litellm.llms.base_llm.ocr.transformation import OCRResponse
|
||||
from litellm.rust_bridge.ocr import LiteLLMOcrRequest
|
||||
|
||||
_InputSource: TypeAlias = Literal["request", "deployment", "environment"]
|
||||
|
||||
class RustBridgeDeclined(Exception): ...
|
||||
class RustUpstreamError(Exception): ...
|
||||
|
||||
|
|
@ -16,7 +18,7 @@ def ocr(
|
|||
custom_llm_provider: str | None = None,
|
||||
extra_headers: Mapping[str, object] | None = None,
|
||||
optional_params: Mapping[str, object] | None = None,
|
||||
input_sources: Mapping[str, str] | None = None,
|
||||
input_sources: Mapping[str, _InputSource] | None = None,
|
||||
timeout_seconds: float | None = None,
|
||||
) -> dict[str, object]: ...
|
||||
def aocr(
|
||||
|
|
@ -27,7 +29,7 @@ def aocr(
|
|||
custom_llm_provider: str | None = None,
|
||||
extra_headers: Mapping[str, object] | None = None,
|
||||
optional_params: Mapping[str, object] | None = None,
|
||||
input_sources: Mapping[str, str] | None = None,
|
||||
input_sources: Mapping[str, _InputSource] | None = None,
|
||||
timeout_seconds: float | None = None,
|
||||
) -> Future[dict[str, object]]: ...
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue