File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed
packages/agents-realtime/src Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @openai/agents-realtime " : patch
3+ ---
4+
5+ feat(realtime): Add usage field to input audio transcription completed event
Original file line number Diff line number Diff line change @@ -138,6 +138,18 @@ export const conversationItemInputAudioTranscriptionCompletedEventSchema =
138138 content_index : z . number ( ) ,
139139 transcript : z . string ( ) ,
140140 logprobs : z . array ( z . any ( ) ) . nullable ( ) . optional ( ) ,
141+ usage : z
142+ . object ( {
143+ type : z . literal ( 'tokens' ) ,
144+ total_tokens : z . number ( ) ,
145+ input_tokens : z . number ( ) ,
146+ input_token_details : z . object ( {
147+ text_tokens : z . number ( ) ,
148+ audio_tokens : z . number ( ) ,
149+ } ) ,
150+ output_tokens : z . number ( ) ,
151+ } )
152+ . optional ( ) ,
141153 } ) ;
142154
143155export const conversationItemInputAudioTranscriptionDeltaEventSchema = z . object (
Original file line number Diff line number Diff line change @@ -44,6 +44,16 @@ export type InputAudioTranscriptionCompletedEvent = {
4444 type : 'conversation.item.input_audio_transcription.completed' ;
4545 item_id : string ;
4646 transcript : string ;
47+ usage ?: {
48+ type : 'tokens' ;
49+ total_tokens : number ;
50+ input_tokens : number ;
51+ input_token_details : {
52+ text_tokens : number ;
53+ audio_tokens : number ;
54+ } ;
55+ output_tokens : number ;
56+ } ;
4757} ;
4858
4959export type TransportLayerTranscriptDelta = {
You can’t perform that action at this time.
0 commit comments