pub struct EchoLlmClient { /* private fields */ }Expand description
A deterministic, scripted InferenceAdapter for offline task-execution
testing (#2056).
Why: exercises the SAME PM -> engineer -> tool -> engineer-stop ->
PM-stop shape run_task’s own offline tests use, but as production code
so the real daemon binary can drive it with no network access at all.
What: an atomic cursor over a fixed 4-response script:
- PM calls
delegate_to_agent(python-engineer, ...). - Engineer calls
bash(command="echo hello-from-mock-engineer"). - Engineer stops with final text.
- PM stops with final text.
Running past the script’s end returns an InferenceError rather than
panicking, so a bug that adds an unexpected turn fails loudly instead of
hanging.
Test: task::mock_llm::tests::script_drives_full_delegation_flow.
Implementations§
Source§impl EchoLlmClient
impl EchoLlmClient
Trait Implementations§
Source§impl Default for EchoLlmClient
impl Default for EchoLlmClient
Source§impl InferenceAdapter for EchoLlmClient
impl InferenceAdapter for EchoLlmClient
Source§fn capabilities(&self) -> &ProviderCapabilities
fn capabilities(&self) -> &ProviderCapabilities
The capability descriptor for this adapter’s provider. Read more
Source§fn chat<'life0, 'life1, 'async_trait>(
&'life0 self,
_req: &'life1 ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatResponse, InferenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn chat<'life0, 'life1, 'async_trait>(
&'life0 self,
_req: &'life1 ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatResponse, InferenceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Issue one chat/completions call. Read more
Source§fn capabilities_for(&self, model: &str) -> &ProviderCapabilities
fn capabilities_for(&self, model: &str) -> &ProviderCapabilities
The capability descriptor for the provider that would actually serve
model. Read moreSource§fn chat_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<ChatStreamEvent, InferenceError>> + Send>>, InferenceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn chat_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<ChatStreamEvent, InferenceError>> + Send>>, InferenceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Issue one chat/completions call as an incremental token stream. Read more
Source§fn map_tool_choice(&self, choice: ToolChoice) -> Value
fn map_tool_choice(&self, choice: ToolChoice) -> Value
Translate a neutral
ToolChoice into this provider’s wire JSON. Read moreSource§fn supports_native_tools(&self) -> bool
fn supports_native_tools(&self) -> bool
Whether the provider supports native function-calling. Read more
Source§fn supports_prompt_caching(&self) -> bool
fn supports_prompt_caching(&self) -> bool
Whether the provider honours Anthropic-style prompt-cache breakpoints. Read more
Source§fn supports_structured_output(&self) -> bool
fn supports_structured_output(&self) -> bool
Whether the provider supports structured / JSON-schema output. Read more
Source§fn wants_detailed_usage(&self) -> bool
fn wants_detailed_usage(&self) -> bool
Whether to request detailed usage accounting (OpenRouter’s
usage: {"include": true} directive). Read moreAuto Trait Implementations§
impl !Freeze for EchoLlmClient
impl RefUnwindSafe for EchoLlmClient
impl Send for EchoLlmClient
impl Sync for EchoLlmClient
impl Unpin for EchoLlmClient
impl UnsafeUnpin for EchoLlmClient
impl UnwindSafe for EchoLlmClient
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
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> ⓘ
Converts
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> ⓘ
Converts
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 moreCreates a shared type from an unshared type.