Rate this page:

RealtimeAPIClient

Methods

addEventListener

Copy URL
addEventListener(event: 

Events

|

RealtimeAPIEvents

,
callback:

Function

):

void

Adds a handler for the specified Yandex.RealtimeAPIEvents or Yandex.Events event. Use only functions as handlers; anything except a function leads to the error and scenario termination when a handler is called.

Parameters

Returns

  • type:

    void

clearMediaBuffer

Copy URL
clearMediaBuffer(parameters: 

ClearMediaBufferParameters

):

void

Clears the Yandex WebSocket media buffer.

Parameters

Returns

  • type:

    void

close

Copy URL
close(): 

void

Closes the Yandex connection (over WebSocket) or connection attempt.

Returns

  • type:

    void

conversationItemCreate

Copy URL
conversationItemCreate(parameters: 

Object

):

void

Add a new Item to the Conversation's context.

Parameters

  • parameters:

    Object

Returns

  • type:

    void

conversationItemDelete

Copy URL
conversationItemDelete(parameters: 

Object

):

void

Send this event when you want to remove any item from the conversation history.

Parameters

  • parameters:

    Object

Returns

  • type:

    void

conversationItemRetrieve

Copy URL
conversationItemRetrieve(parameters: 

Object

):

void

Send this event when you want to retrieve the server's representation of a specific item in the conversation history.

Parameters

  • parameters:

    Object

Returns

  • type:

    void

conversationItemTruncate

Copy URL
conversationItemTruncate(parameters: 

Object

):

void

Send this event to truncate a previous assistant message’s audio.

Parameters

  • parameters:

    Object

Returns

  • type:

    void

id

Copy URL
id(): 

string

Returns the RealtimeAPIClient id.

Returns

  • type:

    string

removeEventListener

Copy URL
removeEventListener(event: 

Events

|

RealtimeAPIEvents

,
callback:

Function

):

void

Removes a handler for the specified Yandex.RealtimeAPIEvents or Yandex.Events event.

Parameters

Returns

  • type:

    void

responseCancel

Copy URL
responseCancel(parameters: 

Object

):

void

Send this event to cancel an in-progress response.

Parameters

  • parameters:

    Object

Returns

  • type:

    void

responseCreate

Copy URL
responseCreate(parameters: 

Object

):

void

This event instructs the server to create a Response, which means triggering model inference.

Parameters

  • parameters:

    Object

Returns

  • type:

    void

sendMediaTo

Copy URL
sendMediaTo(mediaUnit: 

VoxMediaUnit

,
parameters:

SendMediaParameters

):

void

Starts sending media from the Yandex (via WebSocket) to the media unit. Yandex works in real time.

Parameters

Returns

  • type:

    void

sessionUpdate

Copy URL
sessionUpdate(parameters: 

Object

):

void

Send this event to update the session’s configuration.

Parameters

  • parameters:

    Object

Returns

  • type:

    void

stopMediaTo

Copy URL
stopMediaTo(mediaUnit: 

VoxMediaUnit

):

void

Stops sending media from the Yandex (via WebSocket) to the media unit.

Parameters

Returns

  • type:

    void

webSocketId

Copy URL
webSocketId(): 

string

Returns the Yandex WebSocket id.

Returns

  • type:

    string