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 new() -> ResponseGenerationTrace
pub fn new() -> ResponseGenerationTrace
Create a new empty trace
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 moreSource§impl Debug for ResponseGenerationTrace
impl Debug for ResponseGenerationTrace
Source§impl Default for ResponseGenerationTrace
impl Default for ResponseGenerationTrace
Source§fn default() -> ResponseGenerationTrace
fn default() -> ResponseGenerationTrace
Source§impl<'de> Deserialize<'de> for ResponseGenerationTrace
impl<'de> Deserialize<'de> for ResponseGenerationTrace
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResponseGenerationTrace, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResponseGenerationTrace, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for ResponseGenerationTrace
impl Serialize for ResponseGenerationTrace
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for ResponseGenerationTrace
impl RefUnwindSafe for ResponseGenerationTrace
impl Send for ResponseGenerationTrace
impl Sync for ResponseGenerationTrace
impl Unpin for ResponseGenerationTrace
impl UnsafeUnpin for ResponseGenerationTrace
impl UnwindSafe for ResponseGenerationTrace
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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