pub struct FunctionFactory { /* private fields */ }Expand description
Factory for creating and managing function/tool execution
Implementations§
Source§impl FunctionFactory
impl FunctionFactory
Sourcepub fn register_tool<T: Tool + 'static>(&mut self, tool: T)
pub fn register_tool<T: Tool + 'static>(&mut self, tool: T)
Register a tool with the factory
Sourcepub async fn execute_function(
&self,
function_name: &str,
parameters: Value,
) -> Result<Value>
pub async fn execute_function( &self, function_name: &str, parameters: Value, ) -> Result<Value>
Execute a function call by name
Sourcepub fn get_openai_tools(&self) -> Vec<Value>
pub fn get_openai_tools(&self) -> Vec<Value>
Get all available tools for OpenAI function calling
Sourcepub fn has_function(&self, name: &str) -> bool
pub fn has_function(&self, name: &str) -> bool
Check if a function exists
Trait Implementations§
Source§impl Debug for FunctionFactory
impl Debug for FunctionFactory
Auto Trait Implementations§
impl !RefUnwindSafe for FunctionFactory
impl !UnwindSafe for FunctionFactory
impl Freeze for FunctionFactory
impl Send for FunctionFactory
impl Sync for FunctionFactory
impl Unpin for FunctionFactory
impl UnsafeUnpin for FunctionFactory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more