pub struct ExtensionRegistryBuilder<'a> { /* private fields */ }Expand description
Builder for ExtensionRegistry with explicit tool registration.
Implementations§
Source§impl<'a> ExtensionRegistryBuilder<'a>
impl<'a> ExtensionRegistryBuilder<'a>
Sourcepub fn new(
enable_memory: bool,
enable_memory_vector: bool,
skills: &'a [LoadedSkill],
) -> Self
pub fn new( enable_memory: bool, enable_memory_vector: bool, skills: &'a [LoadedSkill], ) -> Self
Create a new builder. Call register() for each tool provider, then build().
Sourcepub fn with_task_planning(self, enable: bool) -> Self
pub fn with_task_planning(self, enable: bool) -> Self
Exclude PlanningOnly tools when false (simple mode).
Sourcepub fn with_policy(self, policy: CapabilityPolicy) -> Self
pub fn with_policy(self, policy: CapabilityPolicy) -> Self
Apply a capability policy before building the registry.
Sourcepub fn register(self, tools: impl IntoIterator<Item = RegisteredTool>) -> Self
pub fn register(self, tools: impl IntoIterator<Item = RegisteredTool>) -> Self
Register tools from an extension. Add one line per tool module.
Sourcepub fn register_memory_if(self, enable: bool) -> Self
pub fn register_memory_if(self, enable: bool) -> Self
Register memory tools if enable_memory is true.
Sourcepub fn build(self) -> ExtensionRegistry<'a>
pub fn build(self) -> ExtensionRegistry<'a>
Build the registry. Skills’ tool definitions are added at build time. 按 function.name 去重,避免重复声明导致 Gemini 等 API 报 Duplicate function declaration。
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ExtensionRegistryBuilder<'a>
impl<'a> RefUnwindSafe for ExtensionRegistryBuilder<'a>
impl<'a> Send for ExtensionRegistryBuilder<'a>
impl<'a> Sync for ExtensionRegistryBuilder<'a>
impl<'a> Unpin for ExtensionRegistryBuilder<'a>
impl<'a> UnsafeUnpin for ExtensionRegistryBuilder<'a>
impl<'a> UnwindSafe for ExtensionRegistryBuilder<'a>
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