pub struct MockEngine { /* private fields */ }Expand description
A mock that returns distributions seeded from (id, instructions).
Always satisfies sum-to-1 and confidence-in-range so the validator
passes.
Implementations§
Source§impl MockEngine
impl MockEngine
Sourcepub fn new() -> MockEngine
pub fn new() -> MockEngine
Create a new MockEngine with the default backend identifier ("mock").
Sourcepub fn with_backend(backend: impl Into<String>) -> MockEngine
pub fn with_backend(backend: impl Into<String>) -> MockEngine
Create a new MockEngine with a custom backend identifier string.
Trait Implementations§
Source§impl DecisionEngine for MockEngine
impl DecisionEngine for MockEngine
Source§fn backend_id(&self) -> &str
fn backend_id(&self) -> &str
Identifier of this backend, e.g.
"mock", "qwen-3b-candle".Source§fn model_metadata(&self) -> ModelInfo
fn model_metadata(&self) -> ModelInfo
Public metadata shown by
GET /v1/models. The default is a
minimal mock entry; real backends should override with a real
description and release date.Source§fn evaluate<'life0, 'async_trait>(
&'life0 self,
req: SystemRequest,
) -> Pin<Box<dyn Future<Output = Result<SystemResponse, EngineError>> + Send + 'async_trait>>where
'life0: 'async_trait,
MockEngine: 'async_trait,
fn evaluate<'life0, 'async_trait>(
&'life0 self,
req: SystemRequest,
) -> Pin<Box<dyn Future<Output = Result<SystemResponse, EngineError>> + Send + 'async_trait>>where
'life0: 'async_trait,
MockEngine: 'async_trait,
Evaluate a single request. Returns one answer per question id.
Source§fn estimate_input_tokens(&self, req: &SystemRequest) -> u32
fn estimate_input_tokens(&self, req: &SystemRequest) -> u32
Estimate input tokens (cheap, before evaluation). The mock uses
a rough
bytes / 4 heuristic for state, instructions, and criteria;
real backends will use a tokenizer.Source§impl Default for MockEngine
impl Default for MockEngine
Source§fn default() -> MockEngine
fn default() -> MockEngine
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MockEngine
impl RefUnwindSafe for MockEngine
impl Send for MockEngine
impl Sync for MockEngine
impl Unpin for MockEngine
impl UnsafeUnpin for MockEngine
impl UnwindSafe for MockEngine
Blanket Implementations§
impl<T> Allocation for T
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request