mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
ocr: resolve mistral key via get_secret_str before the rust path (secret-manager parity)
This commit is contained in:
parent
53f059a1d3
commit
a21a80751d
1 changed files with 9 additions and 1 deletions
|
|
@ -268,8 +268,16 @@ def ocr(
|
|||
rust_bridge = importlib.import_module("litellm.ocr.rust_bridge")
|
||||
|
||||
if custom_llm_provider == "mistral" and rust_bridge.rust_ocr_enabled():
|
||||
# Resolve the key the same way the Python path does so secret-manager
|
||||
# backends (AWS/Azure/GCP/Vault) work — the Rust bridge's own fallback
|
||||
# only reads the process environment.
|
||||
from litellm.secret_managers.main import get_secret_str
|
||||
|
||||
resolved_api_key = api_key or get_secret_str("MISTRAL_API_KEY")
|
||||
return OCRResponse(
|
||||
**rust_bridge.rust_ocr(model, document, api_key, api_base, kwargs)
|
||||
**rust_bridge.rust_ocr(
|
||||
model, document, resolved_api_key, api_base, kwargs
|
||||
)
|
||||
)
|
||||
|
||||
# Get provider config
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue