pub struct ExtractReasoning { /* private fields */ }Expand description
Middleware created by extract_reasoning.
Implementations§
Source§impl ExtractReasoning
impl ExtractReasoning
Sourcepub fn separator(self, separator: impl Into<String>) -> Self
pub fn separator(self, separator: impl Into<String>) -> Self
Separator between extracted sections (default "\n").
Sourcepub fn start_with_reasoning(self, start_with_reasoning: bool) -> Self
pub fn start_with_reasoning(self, start_with_reasoning: bool) -> Self
Treats the text as starting inside a tag (for models that omit the opening tag).
Sourcepub fn apply(&self, result: GenerateResult) -> GenerateResult
pub fn apply(&self, result: GenerateResult) -> GenerateResult
Applies the extraction to a complete result.
Sourcepub fn apply_stream(&self, result: StreamResult) -> StreamResult
pub fn apply_stream(&self, result: StreamResult) -> StreamResult
Applies the extraction to a stream result.
Trait Implementations§
Source§impl Clone for ExtractReasoning
impl Clone for ExtractReasoning
Source§fn clone(&self) -> ExtractReasoning
fn clone(&self) -> ExtractReasoning
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 ExtractReasoning
impl Debug for ExtractReasoning
Source§impl LanguageModelMiddleware for ExtractReasoning
impl LanguageModelMiddleware for ExtractReasoning
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 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 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 Freeze for ExtractReasoning
impl RefUnwindSafe for ExtractReasoning
impl Send for ExtractReasoning
impl Sync for ExtractReasoning
impl Unpin for ExtractReasoning
impl UnsafeUnpin for ExtractReasoning
impl UnwindSafe for ExtractReasoning
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