pub struct RecordedCall {
pub index: usize,
pub streamed: bool,
pub request: ModelRequest,
}Expand description
One request the provider received.
The point of recording is to assert what the runtime sent, not only what
it did with the answer: the catalog reaches a model as the output schema
and the declared tools, so schema_mentions and
tool_names are how a test checks that a workflow’s
operations were actually offered.
Fields§
§index: usizeZero-based position in the call sequence.
streamed: booltrue when the call arrived through
ModelProvider::stream, false through
generate.
request: ModelRequestThe request, verbatim.
Implementations§
Source§impl RecordedCall
impl RecordedCall
Sourcepub fn purpose(&self) -> ModelPurpose
pub fn purpose(&self) -> ModelPurpose
Why the call was made.
Sourcepub fn schema(&self) -> Option<&Value>
pub fn schema(&self) -> Option<&Value>
The JSON Schema the call demanded, when it demanded one.
Sourcepub fn schema_name(&self) -> Option<&str>
pub fn schema_name(&self) -> Option<&str>
Name the schema was labelled with.
Sourcepub fn schema_mentions(&self, needle: &str) -> bool
pub fn schema_mentions(&self, needle: &str) -> bool
Returns true when needle occurs anywhere in the serialized schema.
This is how a test asks “was trip.set_name in the catalog this
call offered?” without depending on how the schema is shaped.
Sourcepub fn tool_names(&self) -> Vec<&str>
pub fn tool_names(&self) -> Vec<&str>
Names of the read-only tools the call declared, in order.
Sourcepub fn messages(&self) -> Vec<(Role, String)>
pub fn messages(&self) -> Vec<(Role, String)>
Every message as (role, flattened text), in order.
Sourcepub fn prompt_mentions(&self, needle: &str) -> bool
pub fn prompt_mentions(&self, needle: &str) -> bool
Returns true when needle occurs in the system prompt or in any
message of the call.