We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f8d139 commit adfe433Copy full SHA for adfe433
async-openai/src/tools.rs
@@ -125,7 +125,15 @@ impl ToolManager {
125
126
/// Adds a new tool to the manager.
127
pub fn add_tool<T: Tool + 'static>(&mut self, tool: T) {
128
- self.tools.insert(T::name(), Arc::new(tool));
+ self.tools
129
+ .insert(T::name(), Arc::new(tool));
130
+ }
131
+
132
+ /// Adds a new tool with an Arc to the manager.
133
+ ///
134
+ /// Use this if you want to access this tool after being added to the manager.
135
+ pub fn add_tool_arc(&mut self, tool: Arc<dyn ToolDyn>) {
136
+ self.tools.insert(tool.definition().function.name, tool);
137
}
138
139
/// Removes a tool from the manager.
0 commit comments