objectiveai_sdk/functions/
response.rs1use crate::functions;
4use serde::{Deserialize, Serialize};
5use schemars::JsonSchema;
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, 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(schema_with = "crate::flatten_schema::<functions::FullRemoteFunction>")]
26 pub inner: functions::FullRemoteFunction,
27}
28
29#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
31#[schemars(rename = "functions.UsageFunctionResponse")]
32pub struct UsageFunctionResponse {
33 pub requests: u64,
35 pub completion_tokens: u64,
37 pub prompt_tokens: u64,
39 #[serde(deserialize_with = "crate::serde_util::decimal")]
41 #[schemars(with = "f64")]
42 pub total_cost: rust_decimal::Decimal,
43}
44
45#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
47#[schemars(rename = "functions.ListFunctionProfilePairResponse")]
48pub struct ListFunctionProfilePairResponse {
49 pub data: Vec<ListFunctionProfilePairItem>,
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
55#[schemars(rename = "functions.ListFunctionProfilePairItem")]
56pub struct ListFunctionProfilePairItem {
57 pub function: ListFunctionItem,
59 pub profile: functions::profiles::response::ListProfileItem,
61}
62
63#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
65#[schemars(rename = "functions.GetFunctionProfilePairResponse")]
66pub struct GetFunctionProfilePairResponse {
67 pub function: GetFunctionResponse,
69 pub profile: functions::profiles::response::GetProfileResponse,
71}
72
73#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
75#[schemars(rename = "functions.UsageFunctionProfilePairResponse")]
76pub struct UsageFunctionProfilePairResponse {
77 pub requests: u64,
79 pub completion_tokens: u64,
81 pub prompt_tokens: u64,
83 #[serde(deserialize_with = "crate::serde_util::decimal")]
85 #[schemars(with = "f64")]
86 pub total_cost: rust_decimal::Decimal,
87}