Skip to main content

systemprompt_api/services/gateway/
captures.rs

1//! Capture buffers for gateway audit payloads.
2//!
3//! Copyright (c) systemprompt.io — Business Source License 1.1.
4//! See <https://systemprompt.io> for licensing details.
5
6use systemprompt_identifiers::AiToolCallId;
7
8#[derive(Debug, Clone, Copy, Default)]
9#[expect(
10    clippy::struct_field_names,
11    reason = "every field is a token count; the `_tokens` suffix is the domain vocabulary shared \
12              with the provider usage wire formats"
13)]
14pub struct CapturedUsage {
15    pub input_tokens: u32,
16    pub output_tokens: u32,
17    pub cache_read_tokens: u32,
18    pub cache_creation_tokens: u32,
19}
20
21#[derive(Debug, Clone)]
22pub struct CapturedToolUse {
23    pub ai_tool_call_id: AiToolCallId,
24    pub tool_name: String,
25    pub tool_input: String,
26}