pub struct NullLlmProvider;Expand description
No-op LLM provider for unit tests.
Use this when you need to build a ToolContext (which holds an
Arc<dyn LlmProvider>) in test code, but the test itself does not exercise
any LLM call path. Any call to chat_completion returns an empty success.
Trait Implementations§
Source§impl LlmProvider for NullLlmProvider
impl LlmProvider for NullLlmProvider
fn chat_completion<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_messages: &'life1 [Message],
_tools: &'life2 [ToolDefinition],
) -> Pin<Box<dyn Future<Output = Result<LlmResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn is_copilot(&self) -> bool
fn is_copilot(&self) -> bool
Returns true when this provider is talking to GitHub Copilot.
Used by the REPL to show auth status and guard /login.
Source§fn set_stream_print(&self, _enabled: bool)
fn set_stream_print(&self, _enabled: bool)
Enable / disable real-time streaming output to stdout.
Called by Plan mode to suppress live streaming so the reply can be
post-processed before display. No-op for providers that don’t stream.
Source§fn set_copilot_oauth_token<'life0, 'async_trait>(
&'life0 self,
_token: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_copilot_oauth_token<'life0, 'async_trait>(
&'life0 self,
_token: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update the long-lived OAuth token after /login completes.
Only meaningful for the Copilot provider; all others do nothing.
Auto Trait Implementations§
impl Freeze for NullLlmProvider
impl RefUnwindSafe for NullLlmProvider
impl Send for NullLlmProvider
impl Sync for NullLlmProvider
impl Unpin for NullLlmProvider
impl UnsafeUnpin for NullLlmProvider
impl UnwindSafe for NullLlmProvider
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