pub struct ToolSurfaceOptimizer { /* private fields */ }Expand description
Applies count, token, and lifecycle limits to a tool surface.
Implementations§
Source§impl ToolSurfaceOptimizer
impl ToolSurfaceOptimizer
Sourcepub const fn new(max_tools: usize, max_schema_tokens: usize) -> Self
pub const fn new(max_tools: usize, max_schema_tokens: usize) -> Self
Creates an optimizer that excludes deprecated tools by default.
Sourcepub fn from_profile(profile: &ClientEfficiencyProfile) -> Self
pub fn from_profile(profile: &ClientEfficiencyProfile) -> Self
Creates an optimizer using the tool budget advertised by a client profile.
Sourcepub const fn exclude_deprecated(self, exclude: bool) -> Self
pub const fn exclude_deprecated(self, exclude: bool) -> Self
Configures whether deprecated tools are removed before selection.
Sourcepub fn optimize(&self, schemas: &[ToolSchema]) -> SurfaceReduction
pub fn optimize(&self, schemas: &[ToolSchema]) -> SurfaceReduction
Selects the highest-priority schemas that fit both configured budgets.
Auto Trait Implementations§
impl Freeze for ToolSurfaceOptimizer
impl RefUnwindSafe for ToolSurfaceOptimizer
impl Send for ToolSurfaceOptimizer
impl Sync for ToolSurfaceOptimizer
impl Unpin for ToolSurfaceOptimizer
impl UnsafeUnpin for ToolSurfaceOptimizer
impl UnwindSafe for ToolSurfaceOptimizer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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