pub struct FakeProvider { /* private fields */ }Expand description
In-memory fake provider fixture for SDK conformance tests. Use it to script deterministic behavior in memory; any transcript or endpoint mutation is documented on the method that performs it.
Implementations§
Source§impl FakeProvider
impl FakeProvider
Sourcepub fn with_responses(
responses: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_responses( responses: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Returns this value with its responses setting replaced. The method follows builder-style data construction and does not execute external work.
Sourcepub fn requests(&self) -> Vec<ProviderRequest>
pub fn requests(&self) -> Vec<ProviderRequest>
Returns the requests currently held by this value. This configures deterministic in-memory test state only.
Trait Implementations§
Source§impl Clone for FakeProvider
impl Clone for FakeProvider
Source§fn clone(&self) -> FakeProvider
fn clone(&self) -> FakeProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FakeProvider
impl Debug for FakeProvider
Source§impl Default for FakeProvider
impl Default for FakeProvider
Source§impl ProviderAdapter for FakeProvider
impl ProviderAdapter for FakeProvider
Source§fn capabilities(&self) -> ProviderCapabilities
fn capabilities(&self) -> ProviderCapabilities
Returns adapter capability metadata for policy and package resolution.
This is data-only and does not perform I/O, call host ports, append journals, publish
events, or start processes.
Source§fn complete(
&self,
request: &ProviderRequest,
) -> Result<ProviderResponse, AgentError>
fn complete( &self, request: &ProviderRequest, ) -> Result<ProviderResponse, AgentError>
Calls the provider for one non-streaming completion request.
Implementations may call the model provider; caller-owned runtime code must handle
policy, journaling, and event publication around it.
Source§fn project_request(
&self,
projection: &ContextProjection,
policy: &ProviderProjectionPolicy,
) -> Result<ProviderRequest, AgentError>
fn project_request( &self, projection: &ContextProjection, policy: &ProviderProjectionPolicy, ) -> Result<ProviderRequest, AgentError>
Projects admitted context into the provider’s request shape.
This projects admitted context into a provider request and must not fetch hidden raw
content.
Source§fn stream(
&self,
request: &ProviderRequest,
) -> Result<Vec<ProviderStreamChunk>, AgentError>
fn stream( &self, request: &ProviderRequest, ) -> Result<Vec<ProviderStreamChunk>, AgentError>
Calls the provider for a streaming response.
Implementations may call the model provider; caller-owned runtime code must handle
policy, journaling, and event publication around it.
Source§fn extract_usage(&self, response: &ProviderResponse) -> ProviderUsage
fn extract_usage(&self, response: &ProviderResponse) -> ProviderUsage
Extracts provider usage accounting from a response.
This derives usage accounting from a provider response and performs no provider call.
Auto Trait Implementations§
impl Freeze for FakeProvider
impl RefUnwindSafe for FakeProvider
impl Send for FakeProvider
impl Sync for FakeProvider
impl Unpin for FakeProvider
impl UnsafeUnpin for FakeProvider
impl UnwindSafe for FakeProvider
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