MCPcopy Create free account
hub / github.com/AI45Lab/Code / read_file

Method read_file

sdk/python/src/lib.rs:2047–2051  ·  view source on GitHub ↗

Read a file from the workspace.

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

Source from the content-addressed store, hash-verified

2045
2046 /// Read a file from the workspace.
2047 fn read_file(&self, py: Python<'_>, path: String) -> PyResult<String> {
2048 let session = self.inner.clone();
2049 py.allow_threads(move || get_runtime().block_on(session.read_file(&path)))
2050 .map_err(|e| PyRuntimeError::new_err(format!("{e}")))
2051 }
2052
2053 /// Write a file in the workspace.
2054 fn write_file(&self, py: Python<'_>, path: String, content: String) -> PyResult<PyToolResult> {

Callers 1

Calls 3

block_onMethod · 0.80
get_runtimeFunction · 0.70
cloneMethod · 0.45

Tested by

no test coverage detected