mirror of
https://github.com/open-jarvis/OpenJarvis.git
synced 2026-07-31 03:12:16 +00:00
fix: add pure-Python fallback for think tool when Rust extension unavailable
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
a1626960c1
commit
b72afe9b00
@@ -40,9 +40,13 @@ class ThinkTool(BaseTool):
|
||||
|
||||
def execute(self, **params: Any) -> ToolResult:
|
||||
thought = params.get("thought", "")
|
||||
from openjarvis._rust_bridge import get_rust_module
|
||||
_rust = get_rust_module()
|
||||
content = _rust.ThinkTool().execute(thought)
|
||||
try:
|
||||
from openjarvis._rust_bridge import get_rust_module
|
||||
_rust = get_rust_module()
|
||||
content = _rust.ThinkTool().execute(thought)
|
||||
except (ImportError, ModuleNotFoundError):
|
||||
# Pure-Python fallback when Rust extension isn't built
|
||||
content = thought
|
||||
return ToolResult(
|
||||
tool_name="think",
|
||||
content=content,
|
||||
|
||||
Reference in New Issue
Block a user