Skip to main content

objectiveai_sdk/functions/executions/response/streaming/reasoning_summary_log_reference/
mod.rs

1//! `LogReference` for the reasoning-summary entry within a
2//! function-execution log file. Carries the wrapper's own
3//! top-level `error` so the summary's failure surface is visible at
4//! the parent's reference level (the inner agent-completion's own
5//! error is preserved separately in its log file).
6
7use schemars::JsonSchema;
8use serde::{Deserialize, Serialize};
9
10use crate::logs::LogReferenceTag;
11
12#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
13#[schemars(
14    rename = "functions.executions.response.streaming.reasoning_summary_log_reference.LogReference"
15)]
16pub struct LogReference {
17    #[serde(rename = "type")]
18    pub r#type: LogReferenceTag,
19    #[serde(skip_serializing_if = "String::is_empty")]
20    #[schemars(extend("omitempty" = true))]
21    pub path: String,
22    #[serde(default, skip_serializing_if = "Option::is_none")]
23    #[schemars(extend("omitempty" = true))]
24    pub error: Option<serde_json::Value>,
25}
26
27impl LogReference {
28    pub fn new(path: String) -> Self {
29        Self {
30            r#type: LogReferenceTag::Reference,
31            path,
32            error: None,
33        }
34    }
35}