mirror of
https://github.com/openai/codex.git
synced 2026-09-06 15:29:32 +00:00
## What changed - Include the complete upstream `response.usage` object in `ResponseUsageMetadata.metadata` while retaining the existing `amount` field. - Expose the metadata through `rawResponse/completed` notifications and update the generated JSON and TypeScript schemas. ## Testing - Cover SSE, WebSocket, turn, and compaction completion paths. GitOrigin-RevId: 6d79b1b4c92ac11abf43ec98f380b4868288a701
15 lines
444 B
Rust
15 lines
444 B
Rust
//! Per-response usage metadata reported by the upstream service, without aggregation.
|
|
|
|
use schemars::JsonSchema;
|
|
use serde::Deserialize;
|
|
use serde::Serialize;
|
|
use serde_json::Value;
|
|
use ts_rs::TS;
|
|
|
|
/// Usage metadata reported for one upstream response.
|
|
#[derive(Debug, Clone, Default, Deserialize, Serialize, PartialEq, Eq, TS, JsonSchema)]
|
|
pub struct ResponseUsageMetadata {
|
|
pub amount: Option<String>,
|
|
pub metadata: Option<Value>,
|
|
}
|