pub struct ToolRegistry { /* private fields */ }Expand description
工具注册表
Implementations§
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn new(skills: Vec<Skill>) -> Self
pub fn new(skills: Vec<Skill>) -> Self
创建注册表(包含 run_shell、read_file、write_file、edit_file,以及当 skills 非空时注册 load_skill)
Sourcepub fn build_tools_summary(&self) -> String
pub fn build_tools_summary(&self) -> String
构建工具摘要列表,用于系统提示词的 {{.tools}} 占位符
Sourcepub fn to_openai_tools(&self) -> Vec<ChatCompletionTools>
pub fn to_openai_tools(&self) -> Vec<ChatCompletionTools>
生成 async-openai 的 ChatCompletionTools 列表
Auto Trait Implementations§
impl Freeze for ToolRegistry
impl !RefUnwindSafe for ToolRegistry
impl Send for ToolRegistry
impl Sync for ToolRegistry
impl Unpin for ToolRegistry
impl UnsafeUnpin for ToolRegistry
impl !UnwindSafe for ToolRegistry
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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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