pub fn generate_response_with_trace(
spec: &OpenApiSpec,
operation: &Operation,
status_code: u16,
content_type: Option<&str>,
expand_tokens: bool,
scenario: Option<&str>,
selection_mode: Option<ResponseSelectionMode>,
selector: Option<&ResponseSelector>,
persona: Option<&Persona>,
) -> Result<(Value, ResponseGenerationTrace)>Expand description
Generate a response with trace collection
This function wraps the response generation and collects trace data about how the response was generated.
§Arguments
spec- The OpenAPI specificationoperation- The operation to generate a response forstatus_code- The HTTP status codecontent_type- Optional content typeexpand_tokens- Whether to expand template tokensscenario- Optional scenario nameselection_mode- Response selection modeselector- Optional response selectorpersona- Optional persona for data generation
§Returns
A tuple of (response_value, trace_data)