1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3use uuid::Uuid;
4
5#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
9pub struct UsageSource {
10 pub agent_id: String,
11 pub parent_agent_id: Option<String>,
12 pub task_id: Option<String>,
13 pub agent_name: String,
14}
15
16impl UsageSource {
17 pub fn new(agent_name: impl Into<String>) -> Self {
18 Self {
19 agent_id: Uuid::new_v4().to_string(),
20 parent_agent_id: None,
21 task_id: None,
22 agent_name: agent_name.into(),
23 }
24 }
25}