objectiveai_sdk/functions/
response.rs1use crate::functions;
4use schemars::JsonSchema;
5use serde::{Deserialize, Serialize};
6
7#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
9#[schemars(rename = "functions.ListFunctionResponse")]
10pub struct ListFunctionResponse {
11 pub data: Vec<ListFunctionItem>,
13}
14
15pub type ListFunctionItem = crate::RemotePath;
17
18#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
19#[schemars(rename = "functions.GetFunctionResponse")]
20pub struct GetFunctionResponse {
21 #[serde(flatten)]
22 #[schemars(schema_with = "crate::flatten_schema::<crate::RemotePath>")]
23 pub path: crate::RemotePath,
24 #[serde(flatten)]
25 #[schemars(
26 schema_with = "crate::flatten_schema::<functions::FullRemoteFunction>"
27 )]
28 pub inner: functions::FullRemoteFunction,
29}
30
31#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
33#[schemars(rename = "functions.UsageFunctionResponse")]
34pub struct UsageFunctionResponse {
35 pub requests: u64,
37 pub completion_tokens: u64,
39 pub prompt_tokens: u64,
41 #[serde(deserialize_with = "crate::serde_util::decimal")]
43 #[schemars(with = "f64")]
44 pub total_cost: rust_decimal::Decimal,
45}
46
47#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
49#[schemars(rename = "functions.ListFunctionProfilePairResponse")]
50pub struct ListFunctionProfilePairResponse {
51 pub data: Vec<ListFunctionProfilePairItem>,
53}
54
55#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
57#[schemars(rename = "functions.ListFunctionProfilePairItem")]
58pub struct ListFunctionProfilePairItem {
59 pub function: ListFunctionItem,
61 pub profile: functions::profiles::response::ListProfileItem,
63}
64
65#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
67#[schemars(rename = "functions.GetFunctionProfilePairResponse")]
68pub struct GetFunctionProfilePairResponse {
69 pub function: GetFunctionResponse,
71 pub profile: functions::profiles::response::GetProfileResponse,
73}
74
75#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
77#[schemars(rename = "functions.UsageFunctionProfilePairResponse")]
78pub struct UsageFunctionProfilePairResponse {
79 pub requests: u64,
81 pub completion_tokens: u64,
83 pub prompt_tokens: u64,
85 #[serde(deserialize_with = "crate::serde_util::decimal")]
87 #[schemars(with = "f64")]
88 pub total_cost: rust_decimal::Decimal,
89}