pub enum PreprocessOutcome {
Skipped,
Replaced {
text: String,
vl_key: String,
},
Failed {
reason: String,
},
}Expand description
Outcome of a preprocessing attempt.
Variants§
Skipped
Preprocessing did not run — feature disabled, main provider already
accepts images, or no images attached. Caller must use the original
(caption, images) tuple unchanged.
Replaced
VL call succeeded. text is the raw VL output (no wrapping);
vl_key is the provider key used (so the caller can show “by
{model}” in the splice wrapper). Caller is responsible for
splicing both into the user message — recommended shape:
format!("{caption}\n\n[图片内容(由 {vl_key} 识别)]\n{text}")
— and clearing the images vec.
Failed
VL call failed (provider missing, network error, timeout, empty
response). reason is intended for AgentEvent::Warning. Caller
should append "\n\n[图片识别失败]" to the user message and clear
images so the turn proceeds with a useful placeholder.
Trait Implementations§
Source§impl Clone for PreprocessOutcome
impl Clone for PreprocessOutcome
Source§fn clone(&self) -> PreprocessOutcome
fn clone(&self) -> PreprocessOutcome
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for PreprocessOutcome
impl RefUnwindSafe for PreprocessOutcome
impl Send for PreprocessOutcome
impl Sync for PreprocessOutcome
impl Unpin for PreprocessOutcome
impl UnsafeUnpin for PreprocessOutcome
impl UnwindSafe for PreprocessOutcome
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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