Skip to content

Commit

Permalink
Merge pull request #848 from dcSpark/fix/add-rust-tool
Browse files Browse the repository at this point in the history
add rust tools
  • Loading branch information
nicarq authored Feb 5, 2025
2 parents 35751bf + 23df3a3 commit 60a5e15
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions shinkai-bin/shinkai-node/src/managers/tool_router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,18 @@ impl ToolRouter {
eprintln!("Error importing tools from directory: {}", e);
}

if let Err(e) = self.add_rust_tools().await {
eprintln!("Error adding rust tools: {}", e);
}

if is_empty {
if let Err(e) = self.add_rust_tools().await {
eprintln!("Error adding rust tools: {}", e);
}
if let Err(e) = self.add_static_prompts(&generator).await {
eprintln!("Error adding static prompts: {}", e);
}
if let Err(e) = self.add_testing_network_tools().await {
eprintln!("Error adding testing network tools: {}", e);
}
} else if !has_any_js_tools {
if let Err(e) = self.add_rust_tools().await {
eprintln!("Error adding rust tools: {}", e);
}
if let Err(e) = self.add_testing_network_tools().await {
eprintln!("Error adding testing network tools: {}", e);
}
Expand Down Expand Up @@ -384,10 +382,9 @@ impl ToolRouter {
None,
tool.tool_router_key,
);
self.sqlite_manager
.add_tool(ShinkaiTool::Rust(rust_tool, true))
.await
.map_err(|e| ToolError::DatabaseError(e.to_string()))?;
if let Err(e) = self.sqlite_manager.add_tool(ShinkaiTool::Rust(rust_tool, true)).await {
eprintln!("Error adding rust tool: {}", e);
}
}
Ok(())
}
Expand Down

0 comments on commit 60a5e15

Please sign in to comment.