Skip to main content

objectiveai_sdk/functions/profiles/
response.rs

1//! Profile listing and usage response types.
2
3use crate::functions;
4use serde::{Deserialize, Serialize};
5use schemars::JsonSchema;
6
7/// Response from listing profiles.
8#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
9#[schemars(rename = "functions.profiles.ListProfileResponse")]
10pub struct ListProfileResponse {
11    /// List of available profiles.
12    pub data: Vec<ListProfileItem>,
13}
14
15/// A profile in a list response.
16pub type ListProfileItem = crate::RemotePath;
17
18#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
19#[schemars(rename = "functions.profiles.GetProfileResponse")]
20pub struct GetProfileResponse {
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::RemoteProfile>")]
26    pub inner: functions::RemoteProfile,
27}
28
29/// Usage statistics for a profile.
30#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
31#[schemars(rename = "functions.profiles.UsageProfileResponse")]
32pub struct UsageProfileResponse {
33    /// Total number of requests made with this profile.
34    pub requests: u64,
35    /// Total completion tokens used.
36    pub completion_tokens: u64,
37    /// Total prompt tokens used.
38    pub prompt_tokens: u64,
39    /// Total cost incurred.
40    #[serde(deserialize_with = "crate::serde_util::decimal")]
41    #[schemars(with = "f64")]
42    pub total_cost: rust_decimal::Decimal,
43}