MCPcopy Create free account
hub / github.com/BerriAI/litellm / ready_future

Function ready_future

litellm-rust/crates/host-python/src/runtime.rs:86–96  ·  view source on GitHub ↗
(
    py: Python<'py>,
    value: &Bound<'py, PyAny>,
)

Source from the content-addressed store, hash-verified

84}
85
86pub fn ready_future<'py>(
87 py: Python<'py>,
88 value: &Bound<'py, PyAny>,
89) -> PyResult<Bound<'py, PyAny>> {
90 let future = py
91 .import("asyncio")?
92 .call_method0("get_running_loop")?
93 .call_method0("create_future")?;
94 future.call_method1("set_result", (value,))?;
95 Ok(future)
96}
97
98pub fn run_sync<T, E, F>(
99 py: Python<'_>,

Callers 4

connectMethod · 0.85
closeMethod · 0.85
completed_futureFunction · 0.85

Calls 1

OkClass · 0.85

Tested by

no test coverage detected