Skip to main content

objectiveai_sdk/functions/profiles/
response.rs

1//! Profile listing and usage response types.
2
3use crate::functions;
4use schemars::JsonSchema;
5use serde::{Deserialize, Serialize};
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, PartialEq, 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(
26        schema_with = "crate::flatten_schema::<functions::RemoteProfile>"
27    )]
28    pub inner: functions::RemoteProfile,
29}
30
31/// Usage statistics for a profile.
32#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
33#[schemars(rename = "functions.profiles.UsageProfileResponse")]
34pub struct UsageProfileResponse {
35    /// Total number of requests made with this profile.
36    pub requests: u64,
37    /// Total completion tokens used.
38    pub completion_tokens: u64,
39    /// Total prompt tokens used.
40    pub prompt_tokens: u64,
41    /// Total cost incurred.
42    #[serde(deserialize_with = "crate::serde_util::decimal")]
43    #[schemars(with = "f64")]
44    pub total_cost: rust_decimal::Decimal,
45}