MCPcopy Index your code
hub / github.com/AI45Lab/Code / cancel

Method cancel

sdk/python/src/lib.rs:3294–3297  ·  view source on GitHub ↗

Cancel the current ongoing operation (send/stream). If an operation is in progress, this will trigger cancellation of the LLM streaming and tool execution. The operation will terminate as soon as possible. :returns: ``True`` if an operation was cancelled, ``False`` if no operation was in progress.

(&self, py: Python<'_>)

Source from the content-addressed store, hash-verified

3292 ///
3293 /// :returns: ``True`` if an operation was cancelled, ``False`` if no operation was in progress.
3294 fn cancel(&self, py: Python<'_>) -> bool {
3295 let session = self.inner.clone();
3296 py.allow_threads(move || get_runtime().block_on(session.cancel()))
3297 }
3298
3299 /// Close the session and cancel any active operation.
3300 fn close(&self, py: Python<'_>) -> PyResult<()> {

Callers 1

stopMethod · 0.45

Calls 3

block_onMethod · 0.80
get_runtimeFunction · 0.70
cloneMethod · 0.45

Tested by

no test coverage detected