pub struct ToolServer { /* private fields */ }Implementations§
Source§impl ToolServer
impl ToolServer
pub fn new() -> ToolServer
Sourcepub fn tool(self, tool: impl Tool + 'static) -> ToolServer
pub fn tool(self, tool: impl Tool + 'static) -> ToolServer
Add a static tool to the agent
Sourcepub fn dynamic_tools(
self,
sample: usize,
dynamic_tools: impl VectorStoreIndexDyn + Send + Sync + 'static,
toolset: ToolSet,
) -> ToolServer
pub fn dynamic_tools( self, sample: usize, dynamic_tools: impl VectorStoreIndexDyn + Send + Sync + 'static, toolset: ToolSet, ) -> ToolServer
Add some dynamic tools to the agent. On each prompt, sample tools from the
dynamic toolset will be inserted in the request.
pub fn run(self) -> ToolServerHandle
pub async fn handle_message(&mut self, message: ToolServerRequest)
pub async fn get_tool_definitions( &mut self, text: Option<String>, ) -> Result<Vec<ToolDefinition>, CompletionError>
Trait Implementations§
Source§impl Default for ToolServer
impl Default for ToolServer
Source§fn default() -> ToolServer
fn default() -> ToolServer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ToolServer
impl !RefUnwindSafe for ToolServer
impl Send for ToolServer
impl Sync for ToolServer
impl Unpin for ToolServer
impl UnsafeUnpin for ToolServer
impl !UnwindSafe for ToolServer
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