Skip to main content

objectiveai_sdk/functions/profiles/computations/response/unary/
function_execution.rs

1use crate::functions::{self, profiles::computations::response};
2use serde::{Deserialize, Serialize};
3use schemars::JsonSchema;
4
5#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
6#[schemars(rename = "functions.profiles.computations.response.unary.FunctionExecution")]
7pub struct FunctionExecution {
8    pub index: u64,
9    pub dataset: u64,
10    pub n: u64,
11    pub retry: u64,
12    #[serde(flatten)]
13    pub inner: functions::executions::response::unary::FunctionExecution,
14}
15
16impl From<response::streaming::FunctionExecutionChunk> for FunctionExecution {
17    fn from(
18        response::streaming::FunctionExecutionChunk {
19            index,
20            dataset,
21            n,
22            retry,
23            inner,
24        }: response::streaming::FunctionExecutionChunk,
25    ) -> Self {
26        Self {
27            index,
28            dataset,
29            n,
30            retry,
31            inner: inner.into(),
32        }
33    }
34}