@@ -119,6 +119,20 @@ public enum ServerEvent: Sendable {
119119 public let itemId : String
120120 }
121121
122+ public struct OutputAudioBufferStartedEvent : Decodable , Sendable {
123+ /// The unique ID of the server event.
124+ public let eventId : String
125+ /// The ID of the response.
126+ public let responseId : String
127+ }
128+
129+ public struct OutputAudioBufferStoppedEvent : Decodable , Sendable {
130+ /// The unique ID of the server event.
131+ public let eventId : String
132+ /// The ID of the response.
133+ public let responseId : String
134+ }
135+
122136 public struct ResponseEvent : Decodable , Sendable {
123137 /// The unique ID of the server event.
124138 public let eventId : String
@@ -342,6 +356,10 @@ public enum ServerEvent: Sendable {
342356 case conversationItemTruncated( ConversationItemTruncatedEvent )
343357 /// Returned when an item in the conversation is deleted.
344358 case conversationItemDeleted( ConversationItemDeletedEvent )
359+ /// Returned when the output audio buffer is started.
360+ case outputAudioBufferStarted( OutputAudioBufferStartedEvent )
361+ /// Returned when the output audio buffer is stopped.
362+ case outputAudioBufferStopped( OutputAudioBufferStoppedEvent )
345363 /// Returned when a new Response is created. The first event of response creation, where the response is in an initial state of "in_progress".
346364 case responseCreated( ResponseEvent )
347365 /// Returned when a Response is done streaming. Always emitted, no matter the final state.
@@ -405,6 +423,10 @@ extension ServerEvent: Identifiable {
405423 return event. eventId
406424 case let . conversationItemDeleted( event) :
407425 return event. eventId
426+ case let . outputAudioBufferStarted( event) :
427+ return event. eventId
428+ case let . outputAudioBufferStopped( event) :
429+ return event. eventId
408430 case let . responseCreated( event) :
409431 return event. eventId
410432 case let . responseDone( event) :
@@ -477,6 +499,10 @@ extension ServerEvent: Decodable {
477499 self = try . conversationItemTruncated( ConversationItemTruncatedEvent ( from: decoder) )
478500 case " conversation.item.deleted " :
479501 self = try . conversationItemDeleted( ConversationItemDeletedEvent ( from: decoder) )
502+ case " output_audio_buffer.started " :
503+ self = try . outputAudioBufferStarted( OutputAudioBufferStartedEvent ( from: decoder) )
504+ case " output_audio_buffer.stopped " :
505+ self = try . outputAudioBufferStopped( OutputAudioBufferStoppedEvent ( from: decoder) )
480506 case " response.created " :
481507 self = try . responseCreated( ResponseEvent ( from: decoder) )
482508 case " response.done " :
0 commit comments