Skip to main content

objectiveai_sdk/functions/executions/response/unary/
object.rs

1use crate::functions::executions::response;
2use serde::{Deserialize, Serialize};
3use schemars::JsonSchema;
4
5#[derive(Debug, Clone, Copy, Serialize, Deserialize, JsonSchema)]
6#[schemars(rename = "functions.executions.response.unary.Object")]
7pub enum Object {
8    #[serde(rename = "scalar.function.execution")]
9    ScalarFunctionExecution,
10    #[serde(rename = "vector.function.execution")]
11    VectorFunctionExecution,
12}
13
14impl From<response::streaming::Object> for Object {
15    fn from(value: response::streaming::Object) -> Self {
16        match value {
17            response::streaming::Object::ScalarFunctionExecutionChunk => {
18                Object::ScalarFunctionExecution
19            }
20            response::streaming::Object::VectorFunctionExecutionChunk => {
21                Object::VectorFunctionExecution
22            }
23        }
24    }
25}