struct MockRequest {
message: Option<String>,
format_name: Option<String>,
stream: bool,
}Expand description
The parts of a request the mock picks its answer from.
Fields§
§message: Option<String>The text of the last input message, or None when the request ends in a tool output
instead. The other two endings never reach here.
format_name: Option<String>The structured output schema the answer has to parse as, None for a chat request.
stream: boolWhether the caller reads the answer as a Server-Sent Events stream or as one JSON object.
Implementations§
Source§impl MockRequest
impl MockRequest
Sourcefn after_tool_run() -> Self
fn after_tool_run() -> Self
A streamed request resuming a tool loop, which ends in the tool’s output rather than in a message.
Sourcefn structured_output(format_name: &str) -> Self
fn structured_output(format_name: &str) -> Self
A request for structured output in format_name. Its message is one that would drive a
function call round if the message decided anything here, which it must not.
Sourcefn wants_format(&self, format_name: &str) -> bool
fn wants_format(&self, format_name: &str) -> bool
Whether this asks for the structured output named format_name. False for a streamed
request even when it names the schema, since the answer to one is a whole JSON object that
a streaming caller cannot read.
Sourcefn triggered_tool_call(&self) -> Option<TriggeredToolCall>
fn triggered_tool_call(&self) -> Option<TriggeredToolCall>
The tool call a streamed chat message asks the mock to make, if any.
Sourcefn message_contains(&self, trigger: &str) -> bool
fn message_contains(&self, trigger: &str) -> bool
Whether this is a streamed chat message containing trigger.
Auto Trait Implementations§
impl Freeze for MockRequest
impl RefUnwindSafe for MockRequest
impl Send for MockRequest
impl Sync for MockRequest
impl Unpin for MockRequest
impl UnsafeUnpin for MockRequest
impl UnwindSafe for MockRequest
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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 more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].