MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / new

Method new

python/src/tools/decorator.rs:32–41  ·  view source on GitHub ↗
(registry: Option<&ToolRegistry>)

Source from the content-addressed store, hash-verified

30 #[new]
31 #[pyo3(signature = (registry=None))]
32 pub fn new(registry: Option<&ToolRegistry>) -> Self {
33 let reg = if let Some(_r) = registry {
34 // Clone the provided registry (this is a simplified approach)
35 Arc::new(Mutex::new(ToolRegistry::new()))
36 } else {
37 get_global_registry()
38 };
39
40 Self { registry: reg }
41 }
42
43 /// Decorator function to convert a Python function to a tool
44 #[pyo3(signature = (description=None, name=None, return_type=None))]

Callers

nothing calls this directly

Calls 1

get_global_registryFunction · 0.85

Tested by

no test coverage detected