Freigeben über


ResponseResource Class

Resource for response management.

Initialize a response resource.

Constructor

ResponseResource(connection: VoiceLiveConnection)

Parameters

Name Description
connection
Required

The VoiceLiveConnection to use.

Methods

cancel

Cancel an in-progress response.

The server will respond with a response.cancelled event or an error if there is no response to cancel.

create

Create a response from the model.

This event instructs the server to create a Response (triggering model inference). When in Server VAD mode, the server may create responses automatically.

cancel

Cancel an in-progress response.

The server will respond with a response.cancelled event or an error if there is no response to cancel.

async cancel(*, response_id: str | None = None, event_id: str | None = None) -> None

Keyword-Only Parameters

Name Description
response_id
str

Optional ID of the response to cancel.

Default value: None
event_id
str

Optional ID for the event.

Default value: None

Returns

Type Description

create

Create a response from the model.

This event instructs the server to create a Response (triggering model inference). When in Server VAD mode, the server may create responses automatically.

async create(*, response: ResponseCreateParams | Mapping[str, Any] | None = None, event_id: str | None = None, additional_instructions: str | None = None) -> None

Keyword-Only Parameters

Name Description
response

Optional response configuration to send.

Default value: None
response

~azure.ai.voicelive.models.ResponseCreateParams or Mapping[str, Any] or None

event_id

Optional ID for the event.

Default value: None
event_id

str or None

additional_instructions

Extra system prompt appended to the session's default, for this response only.

Default value: None
additional_instructions

str or None

Returns

Type Description