Skip to content

Commit 2125636

Browse files
authored
Merge pull request Azure#14 from yulin-li/yulin/warnings
add warning type
2 parents 46b789b + bb0ff56 commit 2125636

3 files changed

Lines changed: 74 additions & 0 deletions

File tree

specification/ai/data-plane/VoiceLive/events.tsp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ union ClientEventType {
2828
union ServerEventType {
2929
string,
3030
error: "error",
31+
warning: "warning",
3132
session_avatar_connecting: "session.avatar.connecting",
3233
session_created: "session.created",
3334
session_updated: "session.updated",

specification/ai/data-plane/VoiceLive/models.tsp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,34 @@ model ServerEventErrorDetails {
456456
event_id?: string;
457457
}
458458

459+
/** Details of the warning. */
460+
#suppress "@azure-tools/typespec-azure-core/casing-style" // Service message format is snake_case to remain close to OpenAI style.
461+
@usage(ResponseUsage)
462+
model ServerEventWarningDetails {
463+
/** A human-readable warning message. */
464+
message: string;
465+
466+
/** Warning code, if any. */
467+
code?: string;
468+
469+
/** Parameter related to the warning, if any. */
470+
param?: string;
471+
}
472+
473+
// Tool customization (apply_discriminator): apply discriminated type
474+
/**
475+
* Returned when a warning occurs that does not interrupt the conversation flow.
476+
* Warnings are informational and the session will continue normally.
477+
*/
478+
@usage(ResponseUsage)
479+
model ServerEventWarning extends ServerEvent {
480+
/** The event type, must be `warning`. */
481+
type: ServerEventType.warning;
482+
483+
/** Details of the warning. */
484+
warning: ServerEventWarningDetails;
485+
}
486+
459487
// Tool customization (apply_discriminator): apply discriminated type
460488
/**
461489
* Returned when a Session is created. Emitted automatically when a new

specification/ai/data-plane/VoiceLive/stable/2025-10-01/GeneratedSystemEvents.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5014,6 +5014,7 @@
50145014
"description": "Server event types used in VoiceLive protocol.",
50155015
"enum": [
50165016
"error",
5017+
"warning",
50175018
"session.avatar.connecting",
50185019
"session.created",
50195020
"session.updated",
@@ -5072,6 +5073,10 @@
50725073
"name": "error",
50735074
"value": "error"
50745075
},
5076+
{
5077+
"name": "warning",
5078+
"value": "warning"
5079+
},
50755080
{
50765081
"name": "session_avatar_connecting",
50775082
"value": "session.avatar.connecting"
@@ -5271,6 +5276,46 @@
52715276
]
52725277
}
52735278
},
5279+
"ServerEventWarning": {
5280+
"type": "object",
5281+
"description": "Returned when a warning occurs that does not interrupt the conversation flow.\nWarnings are informational and the session will continue normally.",
5282+
"properties": {
5283+
"warning": {
5284+
"$ref": "#/definitions/ServerEventWarningDetails",
5285+
"description": "Details of the warning."
5286+
}
5287+
},
5288+
"required": [
5289+
"warning"
5290+
],
5291+
"allOf": [
5292+
{
5293+
"$ref": "#/definitions/ServerEvent"
5294+
}
5295+
],
5296+
"x-ms-discriminator-value": "warning"
5297+
},
5298+
"ServerEventWarningDetails": {
5299+
"type": "object",
5300+
"description": "Details of the warning.",
5301+
"properties": {
5302+
"message": {
5303+
"type": "string",
5304+
"description": "A human-readable warning message."
5305+
},
5306+
"code": {
5307+
"type": "string",
5308+
"description": "Warning code, if any."
5309+
},
5310+
"param": {
5311+
"type": "string",
5312+
"description": "Parameter related to the warning, if any."
5313+
}
5314+
},
5315+
"required": [
5316+
"message"
5317+
]
5318+
},
52745319
"ServerVad": {
52755320
"type": "object",
52765321
"description": "Base model for VAD-based turn detection.",

0 commit comments

Comments
 (0)