pub struct AddToolInputExamples { /* private fields */ }Expand description
Middleware created by add_tool_input_examples.
Implementations§
Source§impl AddToolInputExamples
impl AddToolInputExamples
Sourcepub fn format(
self,
format: impl Fn(&JsonObject, usize) -> String + Send + Sync + 'static,
) -> Self
pub fn format( self, format: impl Fn(&JsonObject, usize) -> String + Send + Sync + 'static, ) -> Self
Custom example formatter.
Sourcepub fn remove(self, remove: bool) -> Self
pub fn remove(self, remove: bool) -> Self
Whether the examples are removed from the tool definition after
being appended (default true).
Sourcepub fn apply(&self, options: CallOptions) -> CallOptions
pub fn apply(&self, options: CallOptions) -> CallOptions
Applies the transformation to options.
Trait Implementations§
Source§impl Clone for AddToolInputExamples
impl Clone for AddToolInputExamples
Source§fn clone(&self) -> AddToolInputExamples
fn clone(&self) -> AddToolInputExamples
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AddToolInputExamples
impl Debug for AddToolInputExamples
Source§impl LanguageModelMiddleware for AddToolInputExamples
impl LanguageModelMiddleware for AddToolInputExamples
Source§fn transform_params<'a>(
&'a self,
options: CallOptions,
_ctx: MiddlewareContext<'a>,
) -> BoxFuture<'a, Result<CallOptions, ProviderError>>
fn transform_params<'a>( &'a self, options: CallOptions, _ctx: MiddlewareContext<'a>, ) -> BoxFuture<'a, Result<CallOptions, ProviderError>>
Rewrites the call options before the call.
Source§fn wrap_generate<'a>(
&'a self,
options: CallOptions,
next: GenerateNext<'a>,
_ctx: MiddlewareContext<'a>,
) -> BoxFuture<'a, Result<GenerateResult, ProviderError>>
fn wrap_generate<'a>( &'a self, options: CallOptions, next: GenerateNext<'a>, _ctx: MiddlewareContext<'a>, ) -> BoxFuture<'a, Result<GenerateResult, ProviderError>>
Wraps
do_generate.Source§fn wrap_stream<'a>(
&'a self,
options: CallOptions,
next: StreamNext<'a>,
_ctx: MiddlewareContext<'a>,
) -> BoxFuture<'a, Result<StreamResult, ProviderError>>
fn wrap_stream<'a>( &'a self, options: CallOptions, next: StreamNext<'a>, _ctx: MiddlewareContext<'a>, ) -> BoxFuture<'a, Result<StreamResult, ProviderError>>
Wraps
do_stream.Source§fn override_provider(&self, _model: &dyn DynLanguageModel) -> Option<ProviderId>
fn override_provider(&self, _model: &dyn DynLanguageModel) -> Option<ProviderId>
Overrides the provider id reported by the wrapped model.
Source§fn override_model_id(&self, _model: &dyn DynLanguageModel) -> Option<ModelId>
fn override_model_id(&self, _model: &dyn DynLanguageModel) -> Option<ModelId>
Overrides the model id reported by the wrapped model.
Source§fn override_supported_urls<'a>(
&'a self,
_model: &'a dyn DynLanguageModel,
) -> Option<BoxFuture<'a, SupportedUrls>>
fn override_supported_urls<'a>( &'a self, _model: &'a dyn DynLanguageModel, ) -> Option<BoxFuture<'a, SupportedUrls>>
Overrides the supported URLs of the wrapped model.
Auto Trait Implementations§
impl !RefUnwindSafe for AddToolInputExamples
impl !UnwindSafe for AddToolInputExamples
impl Freeze for AddToolInputExamples
impl Send for AddToolInputExamples
impl Sync for AddToolInputExamples
impl Unpin for AddToolInputExamples
impl UnsafeUnpin for AddToolInputExamples
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