Class ResponseCreateEvent
-
- All Implemented Interfaces:
public final class ResponseCreateEvent
This event instructs the server to create a Response, which means triggering model inference. When in Server VAD mode, the server will create Responses automatically.
A Response will include at least one Item, and may have two, in which case the second will be a function call. These Items will be appended to the conversation history by default.
The server will respond with a
response.created
event, events for Items and content created, and finally aresponse.done
event to indicate the Response is complete.The
response.create
event includes inference configuration likeinstructions
andtools
. If these are set, they will override the Session's configuration for this Response only.Responses can be created out-of-band of the default Conversation, meaning that they can have arbitrary input, and it's possible to disable writing the output to the Conversation. Only one Response can write to the default Conversation at a time, but otherwise multiple Responses can be created in parallel. The
metadata
field is a good way to disambiguate multiple simultaneous Responses.Clients can set
conversation
tonone
to create a Response that does not write to the default Conversation. Arbitrary input can be provided with theinput
field, which is an array accepting raw Items and references to existing Items.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
ResponseCreateEvent.Builder
A builder for ResponseCreateEvent.
-
Method Summary
Modifier and Type Method Description final JsonValue
_type()
The event type, must be response.create
.final Optional<String>
eventId()
Optional client-generated ID used to identify this event. final Optional<RealtimeResponseCreateParams>
response()
Create a new Realtime response with these parameters final JsonField<String>
_eventId()
Returns the raw JSON value of eventId. final JsonField<RealtimeResponseCreateParams>
_response()
Returns the raw JSON value of response. final Map<String, JsonValue>
_additionalProperties()
final ResponseCreateEvent.Builder
toBuilder()
final ResponseCreateEvent
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ResponseCreateEvent.Builder
builder()
Returns a mutable builder for constructing an instance of ResponseCreateEvent. -
-
Method Detail
-
_type
final JsonValue _type()
The event type, must be
response.create
.Expected to always return the following:
JsonValue.from("response.create")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
response
final Optional<RealtimeResponseCreateParams> response()
Create a new Realtime response with these parameters
-
_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<RealtimeResponseCreateParams> _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 ResponseCreateEvent.Builder toBuilder()
-
validate
final ResponseCreateEvent validate()
-
builder
final static ResponseCreateEvent.Builder builder()
Returns a mutable builder for constructing an instance of ResponseCreateEvent.
-
-
-
-