pub trait ToolEmbedding: Tool {
type InitError: Error + WasmCompatSend + WasmCompatSync + 'static;
type Context: for<'de> Deserialize<'de> + Serialize;
type State: WasmCompatSend;
// Required methods
fn embedding_docs(&self) -> Vec<String>;
fn context(&self) -> Self::Context;
fn init(
state: Self::State,
context: Self::Context,
) -> Result<Self, Self::InitError>;
}Available on crate feature
agent only.Expand description
A tool that can be stored in a vector store and reconstructed for RAG.
Required Associated Types§
Sourcetype InitError: Error + WasmCompatSend + WasmCompatSync + 'static
type InitError: Error + WasmCompatSend + WasmCompatSync + 'static
Error returned while reconstructing the tool.
Sourcetype Context: for<'de> Deserialize<'de> + Serialize
type Context: for<'de> Deserialize<'de> + Serialize
Serializable static context.
Sourcetype State: WasmCompatSend
type State: WasmCompatSend
Runtime initialization state.
Required Methods§
Sourcefn embedding_docs(&self) -> Vec<String>
fn embedding_docs(&self) -> Vec<String>
Documents used to retrieve the tool.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".