mirror of
https://github.com/openai/codex.git
synced 2026-10-20 19:20:37 +00:00
## What changed - Parse optional `usage_metadata.amount` values from Responses API completion events without converting their string representation. - Propagate the metadata through SSE and WebSocket streams, regular turns, and remote compaction. - Add `usageMetadata` to the app-server `rawResponse/completed` notification and its generated schemas. ## Testing - Cover missing, null, zero, and high-precision amounts, including completion events emitted during compaction. GitOrigin-RevId: b16d81e8350eab0dc7ff613d0dc9dbed73041713
13 lines
379 B
Rust
13 lines
379 B
Rust
//! Per-response usage metadata reported by the upstream service, without aggregation.
|
|
|
|
use schemars::JsonSchema;
|
|
use serde::Deserialize;
|
|
use serde::Serialize;
|
|
use ts_rs::TS;
|
|
|
|
/// Usage metadata reported for one upstream response.
|
|
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, TS, JsonSchema)]
|
|
pub struct ResponseUsageMetadata {
|
|
pub amount: Option<String>,
|
|
}
|