Skip to main content

objectiveai_sdk/laboratories/executions/response/unary/
builder.rs

1use crate::{agent, laboratories::executions::response};
2use serde::{Deserialize, Serialize};
3use schemars::JsonSchema;
4
5/// A single builder agent completion within a laboratory execution (non-streaming).
6#[derive(Debug, Clone, Serialize, Deserialize, Default, JsonSchema)]
7#[schemars(rename = "laboratories.executions.response.unary.Builder")]
8pub struct Builder {
9    /// Builder index (0-based).
10    pub index: u64,
11    /// Agent index (0-based).
12    pub agent_index: u64,
13    #[serde(flatten)]
14    pub inner: agent::completions::response::unary::AgentCompletion,
15}
16
17impl From<response::streaming::BuilderChunk> for Builder {
18    fn from(
19        response::streaming::BuilderChunk {
20            index,
21            agent_index,
22            inner,
23        }: response::streaming::BuilderChunk,
24    ) -> Self {
25        Self {
26            index,
27            agent_index,
28            inner: inner.into(),
29        }
30    }
31}