Skip to main content

objectiveai_sdk/functions/inventions/response/streaming/
function_invention_chunk_log.rs

1//! On-disk shape of a `FunctionInventionChunk` log file.
2//!
3//! Mirrors [`super::FunctionInventionChunk`] field-for-field, with
4//! `completions: Vec<AgentCompletionChunk>` →
5//! `Vec<IndexedLogReference>` (each per-agent completion
6//! in its own file under `agents/completions/`, with `index` at the
7//! reference level).
8
9use schemars::JsonSchema;
10use serde::{Deserialize, Serialize};
11
12use crate::agent;
13use crate::error;
14use crate::logs::IndexedLogReference;
15use crate::functions;
16
17#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
18#[schemars(
19    rename = "functions.inventions.response.streaming.FunctionInventionChunkLog"
20)]
21pub struct FunctionInventionChunkLog {
22    pub id: String,
23    pub completions: Vec<IndexedLogReference>,
24    #[serde(skip_serializing_if = "Option::is_none")]
25    #[schemars(extend("omitempty" = true))]
26    pub state: Option<functions::inventions::State>,
27    #[serde(skip_serializing_if = "Option::is_none")]
28    #[schemars(extend("omitempty" = true))]
29    pub path: Option<crate::RemotePath>,
30    #[serde(skip_serializing_if = "Option::is_none")]
31    #[schemars(extend("omitempty" = true))]
32    pub function: Option<functions::FullRemoteFunction>,
33    pub created: u64,
34    pub object: super::Object,
35    #[serde(skip_serializing_if = "Option::is_none")]
36    #[schemars(extend("omitempty" = true))]
37    pub usage: Option<agent::completions::response::Usage>,
38    #[serde(skip_serializing_if = "Option::is_none")]
39    #[schemars(extend("omitempty" = true))]
40    pub error: Option<error::ResponseError>,
41}