Class ResponseDoneEvent
-
- All Implemented Interfaces:
public final class ResponseDoneEvent
Returned when a Response is done streaming. Always emitted, no matter the final state. The Response object included in the
response.done
event will include all output Items in the Response but will omit the raw audio data.Clients should check the
status
field of the Response to determine if it was successful (completed
) or if there was another outcome:cancelled
,failed
, orincomplete
.A response will contain all output items that were generated during the response, excluding any audio content.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
ResponseDoneEvent.Builder
A builder for ResponseDoneEvent.
-
Method Summary
Modifier and Type Method Description final String
eventId()
The unique ID of the server event. final RealtimeResponse
response()
The response resource. final JsonValue
_type()
The event type, must be response.done
.final JsonField<String>
_eventId()
Returns the raw JSON value of eventId. final JsonField<RealtimeResponse>
_response()
Returns the raw JSON value of response. final Map<String, JsonValue>
_additionalProperties()
final ResponseDoneEvent.Builder
toBuilder()
final ResponseDoneEvent
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ResponseDoneEvent.Builder
builder()
Returns a mutable builder for constructing an instance of ResponseDoneEvent. -
-
Method Detail
-
response
final RealtimeResponse response()
The response resource.
-
_type
final JsonValue _type()
The event type, must be
response.done
.Expected to always return the following:
JsonValue.from("response.done")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
_eventId
final JsonField<String> _eventId()
Returns the raw JSON value of eventId.
Unlike eventId, this method doesn't throw if the JSON field has an unexpected type.
-
_response
final JsonField<RealtimeResponse> _response()
Returns the raw JSON value of response.
Unlike response, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final ResponseDoneEvent.Builder toBuilder()
-
validate
final ResponseDoneEvent validate()
-
builder
final static ResponseDoneEvent.Builder builder()
Returns a mutable builder for constructing an instance of ResponseDoneEvent.
The following fields are required:
.eventId() .response()
-
-
-
-