pub struct ToolSet { /* private fields */ }
Expand description
A struct that holds a set of tools
Implementations§
Source§impl ToolSet
impl ToolSet
Sourcepub fn from_tools(tools: Vec<impl ToolDyn + 'static>) -> Self
pub fn from_tools(tools: Vec<impl ToolDyn + 'static>) -> Self
Create a new ToolSet from a list of tools
Sourcepub fn builder() -> ToolSetBuilder
pub fn builder() -> ToolSetBuilder
Create a toolset builder
Sourcepub fn contains(&self, toolname: &str) -> bool
pub fn contains(&self, toolname: &str) -> bool
Check if the toolset contains a tool with the given name
pub fn delete_tool(&mut self, tool_name: &str)
pub async fn get_tool_definitions( &self, ) -> Result<Vec<ToolDefinition>, ToolSetError>
Sourcepub async fn call(
&self,
toolname: &str,
args: String,
) -> Result<String, ToolSetError>
pub async fn call( &self, toolname: &str, args: String, ) -> Result<String, ToolSetError>
Call a tool with the given name and arguments
Sourcepub async fn documents(&self) -> Result<Vec<Document>, ToolSetError>
pub async fn documents(&self) -> Result<Vec<Document>, ToolSetError>
Get the documents of all the tools in the toolset
Sourcepub fn schemas(&self) -> Result<Vec<ToolSchema>, EmbedError>
pub fn schemas(&self) -> Result<Vec<ToolSchema>, EmbedError>
Convert tools in self to objects of type ToolSchema. This is necessary because when adding tools to the EmbeddingBuilder because all documents added to the builder must all be of the same type.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolSet
impl !RefUnwindSafe for ToolSet
impl Send for ToolSet
impl Sync for ToolSet
impl Unpin for ToolSet
impl !UnwindSafe for ToolSet
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more