diff --git a/specification/cognitiveservices/OpenAI.Inference/models/completions/chat_messages.tsp b/specification/cognitiveservices/OpenAI.Inference/models/completions/chat_messages.tsp index 788e0e490f63..b323ce3d38f3 100644 --- a/specification/cognitiveservices/OpenAI.Inference/models/completions/chat_messages.tsp +++ b/specification/cognitiveservices/OpenAI.Inference/models/completions/chat_messages.tsp @@ -13,6 +13,16 @@ using TypeSpec.Versioning; namespace Azure.OpenAI; +#suppress "@azure-tools/typespec-autorest/union-unsupported" "External API shape is defined in OpenAPI 3.0 as oneOf." +@removed(ServiceApiVersions.v2024_08_01_Preview) +@doc("The contents of the user message, with available input types varying by selected model.") +union ChatMessageContent { + string, + + @added(ServiceApiVersions.v2024_02_15_Preview) + ChatMessageContentItem[], +} + @added(ServiceApiVersions.v2024_02_15_Preview) @doc("An abstract representation of a structured content item within a chat message.") @discriminator("type") @@ -121,7 +131,7 @@ model ChatRequestUserMessage extends ChatRequestMessage { #suppress "@azure-tools/typespec-autorest/union-unsupported" "OpenAPI v2 support deferred" @doc("The contents of the user message, with available input types varying by selected model.") - @typeChangedFrom(ServiceApiVersions.v2024_08_01_Preview, string | ChatMessageContentItem[]) + @typeChangedFrom(ServiceApiVersions.v2024_08_01_Preview, ChatMessageContent) content: string | ChatMessageTextContentItem[] | ChatMessageImageContentItem[]; @doc("An optional name for the participant.") diff --git a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-06-01-preview/generated.json b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-06-01-preview/generated.json index e256ef0ca371..b0b758392aa2 100644 --- a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-06-01-preview/generated.json +++ b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-06-01-preview/generated.json @@ -588,6 +588,10 @@ "messages" ] }, + "ChatMessageContent": { + "type": "string", + "x-nullable": false + }, "ChatRequestAssistantMessage": { "type": "object", "description": "A request chat message representing response or action from the assistant.", @@ -652,6 +656,7 @@ "description": "A request chat message representing user input to the assistant.", "properties": { "content": { + "$ref": "#/definitions/ChatMessageContent", "description": "The contents of the user message, with available input types varying by selected model." }, "name": { diff --git a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-07-01-preview/generated.json b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-07-01-preview/generated.json index 0cc4f303cbe5..4b4b45c51f65 100644 --- a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-07-01-preview/generated.json +++ b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-07-01-preview/generated.json @@ -600,6 +600,10 @@ "messages" ] }, + "ChatMessageContent": { + "type": "string", + "x-nullable": false + }, "ChatRequestAssistantMessage": { "type": "object", "description": "A request chat message representing response or action from the assistant.", @@ -694,6 +698,7 @@ "description": "A request chat message representing user input to the assistant.", "properties": { "content": { + "$ref": "#/definitions/ChatMessageContent", "description": "The contents of the user message, with available input types varying by selected model." }, "name": { diff --git a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-02-15-preview/generated.json b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-02-15-preview/generated.json index 8068385a503b..0b8e2f430fee 100644 --- a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-02-15-preview/generated.json +++ b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-02-15-preview/generated.json @@ -2326,6 +2326,7 @@ "type" ] }, + "ChatMessageContent": {}, "ChatRequestAssistantMessage": { "type": "object", "description": "A request chat message representing response or action from the assistant.", @@ -2454,6 +2455,7 @@ "description": "A request chat message representing user input to the assistant.", "properties": { "content": { + "$ref": "#/definitions/ChatMessageContent", "description": "The contents of the user message, with available input types varying by selected model." }, "name": { diff --git a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-03-01-preview/generated.json b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-03-01-preview/generated.json index 604908670166..3ffa78d976d5 100644 --- a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-03-01-preview/generated.json +++ b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-03-01-preview/generated.json @@ -2326,6 +2326,7 @@ "type" ] }, + "ChatMessageContent": {}, "ChatRequestAssistantMessage": { "type": "object", "description": "A request chat message representing response or action from the assistant.", @@ -2454,6 +2455,7 @@ "description": "A request chat message representing user input to the assistant.", "properties": { "content": { + "$ref": "#/definitions/ChatMessageContent", "description": "The contents of the user message, with available input types varying by selected model." }, "name": { diff --git a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-04-01-preview/generated.json b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-04-01-preview/generated.json index d25b3a41e46a..11c47686fb64 100644 --- a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-04-01-preview/generated.json +++ b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-04-01-preview/generated.json @@ -2462,6 +2462,7 @@ "type" ] }, + "ChatMessageContent": {}, "ChatRequestAssistantMessage": { "type": "object", "description": "A request chat message representing response or action from the assistant.", @@ -2590,6 +2591,7 @@ "description": "A request chat message representing user input to the assistant.", "properties": { "content": { + "$ref": "#/definitions/ChatMessageContent", "description": "The contents of the user message, with available input types varying by selected model." }, "name": { diff --git a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-05-01-preview/generated.json b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-05-01-preview/generated.json index 8fb501e9453d..2f3fecf5277a 100644 --- a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-05-01-preview/generated.json +++ b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-05-01-preview/generated.json @@ -2616,6 +2616,7 @@ "type" ] }, + "ChatMessageContent": {}, "ChatRequestAssistantMessage": { "type": "object", "description": "A request chat message representing response or action from the assistant.", @@ -2744,6 +2745,7 @@ "description": "A request chat message representing user input to the assistant.", "properties": { "content": { + "$ref": "#/definitions/ChatMessageContent", "description": "The contents of the user message, with available input types varying by selected model." }, "name": { diff --git a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-07-01-preview/generated.json b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-07-01-preview/generated.json index 3faefd7bf412..2850dc5290bf 100644 --- a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-07-01-preview/generated.json +++ b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-07-01-preview/generated.json @@ -3293,6 +3293,7 @@ "type" ] }, + "ChatMessageContent": {}, "ChatRequestAssistantMessage": { "type": "object", "description": "A request chat message representing response or action from the assistant.", @@ -3421,6 +3422,7 @@ "description": "A request chat message representing user input to the assistant.", "properties": { "content": { + "$ref": "#/definitions/ChatMessageContent", "description": "The contents of the user message, with available input types varying by selected model." }, "name": { diff --git a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2023-05-15/generated.json b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2023-05-15/generated.json index b121b443c361..83a2a7aa2d12 100644 --- a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2023-05-15/generated.json +++ b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2023-05-15/generated.json @@ -405,6 +405,10 @@ "messages" ] }, + "ChatMessageContent": { + "type": "string", + "x-nullable": false + }, "ChatRequestAssistantMessage": { "type": "object", "description": "A request chat message representing response or action from the assistant.", @@ -469,6 +473,7 @@ "description": "A request chat message representing user input to the assistant.", "properties": { "content": { + "$ref": "#/definitions/ChatMessageContent", "description": "The contents of the user message, with available input types varying by selected model." }, "name": { diff --git a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2024-02-01/generated.json b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2024-02-01/generated.json index f219b028b2e0..2cd199818a7b 100644 --- a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2024-02-01/generated.json +++ b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2024-02-01/generated.json @@ -600,6 +600,10 @@ "messages" ] }, + "ChatMessageContent": { + "type": "string", + "x-nullable": false + }, "ChatRequestAssistantMessage": { "type": "object", "description": "A request chat message representing response or action from the assistant.", @@ -694,6 +698,7 @@ "description": "A request chat message representing user input to the assistant.", "properties": { "content": { + "$ref": "#/definitions/ChatMessageContent", "description": "The contents of the user message, with available input types varying by selected model." }, "name": { diff --git a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2024-06-01/generated.json b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2024-06-01/generated.json index 1582b5c7d135..823f294c8fb1 100644 --- a/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2024-06-01/generated.json +++ b/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2024-06-01/generated.json @@ -2616,6 +2616,7 @@ "type" ] }, + "ChatMessageContent": {}, "ChatRequestAssistantMessage": { "type": "object", "description": "A request chat message representing response or action from the assistant.", @@ -2744,6 +2745,7 @@ "description": "A request chat message representing user input to the assistant.", "properties": { "content": { + "$ref": "#/definitions/ChatMessageContent", "description": "The contents of the user message, with available input types varying by selected model." }, "name": {