Class SessionUpdateEvent
-
- All Implemented Interfaces:
public final class SessionUpdateEvent
Send this event to update the session’s configuration. The client may send this event at any time to update any field except for
voice
andmodel
.voice
can be updated only if there have been no other audio outputs yet.When the server receives a
session.update
, it will respond with asession.updated
event showing the full, effective configuration. Only the fields that are present in thesession.update
are updated. To clear a field likeinstructions
, pass an empty string. To clear a field liketools
, pass an empty array. To clear a field liketurn_detection
, passnull
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
SessionUpdateEvent.Builder
A builder for SessionUpdateEvent.
public final class
SessionUpdateEvent.Session
Update the Realtime session. Choose either a realtime session or a transcription session.
-
Method Summary
Modifier and Type Method Description final SessionUpdateEvent.Session
session()
Update the Realtime session. final JsonValue
_type()
The event type, must be session.update
.final Optional<String>
eventId()
Optional client-generated ID used to identify this event. final JsonField<SessionUpdateEvent.Session>
_session()
Returns the raw JSON value of session. final JsonField<String>
_eventId()
Returns the raw JSON value of eventId. final Map<String, JsonValue>
_additionalProperties()
final SessionUpdateEvent.Builder
toBuilder()
final SessionUpdateEvent
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static SessionUpdateEvent.Builder
builder()
Returns a mutable builder for constructing an instance of SessionUpdateEvent. -
-
Method Detail
-
session
final SessionUpdateEvent.Session session()
Update the Realtime session. Choose either a realtime session or a transcription session.
-
_type
final JsonValue _type()
The event type, must be
session.update
.Expected to always return the following:
JsonValue.from("session.update")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
eventId
final Optional<String> eventId()
Optional client-generated ID used to identify this event. This is an arbitrary string that a client may assign. It will be passed back if there is an error with the event, but the corresponding
session.updated
event will not include it.
-
_session
final JsonField<SessionUpdateEvent.Session> _session()
Returns the raw JSON value of session.
Unlike session, this method doesn't throw if the JSON field has an unexpected type.
-
_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.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final SessionUpdateEvent.Builder toBuilder()
-
validate
final SessionUpdateEvent validate()
-
builder
final static SessionUpdateEvent.Builder builder()
Returns a mutable builder for constructing an instance of SessionUpdateEvent.
The following fields are required:
.session()
-
-
-
-