mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-22 05:24:40 +00:00
* feat(rust): expand gateway configuration parsing * refactor(rust): unify core calls and host lifecycle * fix(config): accept environment references for model rate limits Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * refactor(rust): unify core calls and host lifecycle * style(rust): apply rustfmt Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(rust): read environment secrets when litellm is not importable Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(core): drop the duplicate rstest attribute Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * refactor(rust): make shared route dispatch route-owned * fix(rust): satisfy Clippy in messages regression test --------- Co-authored-by: Yujong Lee <yujong@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
20 lines
565 B
Rust
20 lines
565 B
Rust
use pyo3::prelude::*;
|
|
|
|
/// Why a custom operation the host answered did not produce a result: the route's own code
|
|
/// rejected it, which the route classifies like any other native failure, or Python code
|
|
/// raised, which reaches the caller as it was raised.
|
|
#[derive(Debug)]
|
|
pub enum InvokeError<E> {
|
|
Native(E),
|
|
Python(PyErr),
|
|
}
|
|
|
|
impl<E> From<PyErr> for InvokeError<E> {
|
|
fn from(error: PyErr) -> Self {
|
|
Self::Python(error)
|
|
}
|
|
}
|
|
|
|
pub fn missing_state() -> PyErr {
|
|
pyo3::exceptions::PyRuntimeError::new_err("missing native call state")
|
|
}
|