Skip to main content

objectiveai_sdk/functions/executions/response/streaming/
reasoning_summary_chunk.rs

1use crate::agent::completions::response::streaming::AgentCompletionIds;
2use crate::{agent, error};
3use schemars::JsonSchema;
4use serde::{Deserialize, Serialize};
5
6#[derive(
7    Debug,
8    Clone,
9    PartialEq,
10    Serialize,
11    Deserialize,
12    Default,
13    JsonSchema,
14    arbitrary::Arbitrary,
15)]
16#[schemars(
17    rename = "functions.executions.response.streaming.ReasoningSummaryChunk"
18)]
19pub struct ReasoningSummaryChunk {
20    #[serde(flatten)]
21    pub inner: agent::completions::response::streaming::AgentCompletionChunk,
22    #[serde(skip_serializing_if = "Option::is_none")]
23    #[schemars(extend("omitempty" = true))]
24    pub error: Option<error::ResponseError>,
25}
26
27impl AgentCompletionIds for ReasoningSummaryChunk {
28    fn agent_completion_ids(&self) -> impl Iterator<Item = &str> + Send {
29        self.inner.agent_completion_ids()
30    }
31}
32
33impl ReasoningSummaryChunk {
34    pub fn push(&mut self, other: &ReasoningSummaryChunk) {
35        self.inner.push(&other.inner);
36        if let Some(error) = &other.error {
37            self.error = Some(error.clone());
38        }
39    }
40
41}