pub struct ResponseGenerationTrace {
pub template_path: Option<String>,
pub fixture_path: Option<String>,
pub response_selection_mode: ResponseSelectionMode,
pub selected_example: Option<String>,
pub persona_graph_nodes: Vec<PersonaGraphNodeUsage>,
pub rules_executed: Vec<RuleExecution>,
pub template_expansions: Vec<TemplateExpansion>,
pub blending_decision: Option<BlendingDecision>,
pub final_payload: Option<Value>,
pub schema_validation_diff: Option<Vec<ValidationError>>,
pub metadata: HashMap<String, Value>,
}Expand description
Response generation trace
Captures detailed information about how a response was generated, enabling users to understand “why did I get this response?”
Fields§
§template_path: Option<String>Selected template or fixture path
fixture_path: Option<String>Selected fixture path (if using fixtures)
response_selection_mode: ResponseSelectionModeResponse selection mode used
selected_example: Option<String>Selected example/scenario name (if applicable)
persona_graph_nodes: Vec<PersonaGraphNodeUsage>Persona graph nodes used in response generation
rules_executed: Vec<RuleExecution>Rules/hook scripts that fired during generation
template_expansions: Vec<TemplateExpansion>Template expansion steps
blending_decision: Option<BlendingDecision>Reality blending decisions
final_payload: Option<Value>Final resolved response payload (after all transformations)
This is the complete response body that was sent to the client, after all template expansions, persona graph enrichments, and rule/hook modifications have been applied.
schema_validation_diff: Option<Vec<ValidationError>>Schema validation diff results
Contains validation errors if the final payload doesn’t match the expected contract schema. Empty vector means the payload is valid according to the schema.
metadata: HashMap<String, Value>Additional metadata about the generation process
Implementations§
Source§impl ResponseGenerationTrace
impl ResponseGenerationTrace
Sourcepub fn add_persona_node(&mut self, usage: PersonaGraphNodeUsage)
pub fn add_persona_node(&mut self, usage: PersonaGraphNodeUsage)
Add a persona graph node usage
Sourcepub fn add_rule_execution(&mut self, execution: RuleExecution)
pub fn add_rule_execution(&mut self, execution: RuleExecution)
Add a rule execution
Sourcepub fn add_template_expansion(&mut self, expansion: TemplateExpansion)
pub fn add_template_expansion(&mut self, expansion: TemplateExpansion)
Add a template expansion step
Sourcepub fn set_blending_decision(&mut self, decision: BlendingDecision)
pub fn set_blending_decision(&mut self, decision: BlendingDecision)
Set the blending decision
Sourcepub fn add_metadata(&mut self, key: String, value: Value)
pub fn add_metadata(&mut self, key: String, value: Value)
Add metadata
Sourcepub fn set_final_payload(&mut self, payload: Value)
pub fn set_final_payload(&mut self, payload: Value)
Set the final resolved payload
Sourcepub fn set_schema_validation_diff(&mut self, diff: Vec<ValidationError>)
pub fn set_schema_validation_diff(&mut self, diff: Vec<ValidationError>)
Set the schema validation diff results
Trait Implementations§
Source§impl Clone for ResponseGenerationTrace
impl Clone for ResponseGenerationTrace
Source§fn clone(&self) -> ResponseGenerationTrace
fn clone(&self) -> ResponseGenerationTrace
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more