pub enum TextModelMode {
Reply(String),
Complete(Completion),
NotConfigured,
Rejected(String),
Transient {
retry_after: Option<Duration>,
},
Error(TextModelError),
}Expand description
How a FakeTextModel answers, mirroring PushMode for the text
model port (issue #429).
Error carries the exact error a test wants, and
Rejected/Transient are the two
fixed modes the port’s own contract names — a caller’s retry and
back-off arms stay reachable without inventing provider responses.
Variants§
Reply(String)
Complete with this text, under a deterministic fake-<tier> model
name and plausible token counts.
Complete(Completion)
Answer exactly this completion, usage and parsed JSON included.
NotConfigured
Report the tier is unwired (TextModelError::NotConfigured).
Rejected(String)
A non-retryable refusal carrying the provider text.
Transient
A retryable failure with the provider’s back-off, where it said one.
Error(TextModelError)
Exactly this error, text and all.
Trait Implementations§
Source§impl Clone for TextModelMode
impl Clone for TextModelMode
Source§impl Debug for TextModelMode
impl Debug for TextModelMode
Source§impl PartialEq for TextModelMode
impl PartialEq for TextModelMode
impl StructuralPartialEq for TextModelMode
Auto Trait Implementations§
impl Freeze for TextModelMode
impl RefUnwindSafe for TextModelMode
impl Send for TextModelMode
impl Sync for TextModelMode
impl Unpin for TextModelMode
impl UnsafeUnpin for TextModelMode
impl UnwindSafe for TextModelMode
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