Skip to content

Commit 96e9ee3

Browse files
glecarosharryli0108
authored andcommitted
Removing unused state + Fixing enum + Adding versioning to DALL-E models. (Azure#24560)
1 parent e3bc4b4 commit 96e9ee3

File tree

5 files changed

+13
-422
lines changed

5 files changed

+13
-422
lines changed

specification/cognitiveservices/OpenAI.Inference/models/chat.completions.tsp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@ namespace Azure.OpenAI;
1010
@doc("A description of the intended purpose of a message within a chat completions interaction.")
1111
enum ChatRole {
1212
@doc("The role that instructs or sets the behavior of the assistant.")
13-
@projectedName("json", "system")
14-
system,
13+
system: "system",
1514

1615
@doc("The role that provides responses to system-instructed, user-prompted input.")
17-
@projectedName("json", "assistant")
18-
assistant,
16+
assistant: "assistant",
1917

2018
@doc("The role that provides input for chat completions.")
21-
@projectedName("json", "user")
22-
user,
19+
user: "user",
2320
}
2421

2522
@doc("A single, role-attributed message within a chat completion interaction.")

specification/cognitiveservices/OpenAI.Inference/models/images.tsp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import "@azure-tools/typespec-azure-core";
22
import "@typespec/http";
3+
import "@typespec/versioning";
34

45
using Azure.Core;
56
using TypeSpec.Http;
7+
using TypeSpec.Versioning;
68

79
namespace Azure.OpenAI;
810

911
@doc("The desired size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.")
12+
@added(ServiceApiVersions.v2023_06_01_Preview)
1013
enum ImageSize {
1114
@doc("Image size of 256x256.")
1215
Size256x256: "256x256",
@@ -19,6 +22,7 @@ enum ImageSize {
1922
}
2023

2124
@doc("Represents the request data used to generate images.")
25+
@added(ServiceApiVersions.v2023_06_01_Preview)
2226
model ImageGenerationOptions {
2327
@doc("A description of the desired images.")
2428
prompt: string;
@@ -34,6 +38,7 @@ model ImageGenerationOptions {
3438
}
3539

3640
@doc("The image url if successful, and an error otherwise.")
41+
@added(ServiceApiVersions.v2023_06_01_Preview)
3742
model ImageLocation {
3843
@doc("The URL that provides temporary access to download the generated image.")
3944
url?: url;
@@ -43,6 +48,7 @@ model ImageLocation {
4348
}
4449

4550
@doc("The result of the operation if the operation succeeded.")
51+
@added(ServiceApiVersions.v2023_06_01_Preview)
4652
model ImageResponse {
4753
@doc("A timestamp when this job or item was created (in unix epochs).")
4854
created: int64;
@@ -52,6 +58,7 @@ model ImageResponse {
5258
}
5359

5460
@doc("The result of the operation if the operation succeeded.")
61+
@added(ServiceApiVersions.v2023_06_01_Preview)
5562
model ImageOperationResponse {
5663
@doc("The ID of the operation.")
5764
id: string;
@@ -74,6 +81,7 @@ model ImageOperationResponse {
7481

7582
@lroStatus
7683
@doc("The state of a job or item.")
84+
@added(ServiceApiVersions.v2023_06_01_Preview)
7785
enum State {
7886
@doc("The operation was created and is queued to be processed in the future.")
7987
notRunning,
@@ -92,12 +100,10 @@ enum State {
92100
@lroFailed
93101
@doc("The operation has completed processing with a failure and cannot be further consumed.")
94102
failed,
95-
96-
@doc("The entity has been deleted but may still be referenced by other entities predating the deletion.")
97-
deleted,
98103
}
99104

100105
@doc("Provides status details for long running operations.")
106+
@added(ServiceApiVersions.v2023_06_01_Preview)
101107
model ImageOperationStatus {
102108
@key("operationId")
103109
@visibility("read", "query")

specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-06-01-preview/generated.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,8 +1137,7 @@
11371137
"running",
11381138
"succeeded",
11391139
"canceled",
1140-
"failed",
1141-
"deleted"
1140+
"failed"
11421141
],
11431142
"x-ms-enum": {
11441143
"name": "State",
@@ -1168,11 +1167,6 @@
11681167
"name": "failed",
11691168
"value": "failed",
11701169
"description": "The operation has completed processing with a failure and cannot be further consumed."
1171-
},
1172-
{
1173-
"name": "deleted",
1174-
"value": "deleted",
1175-
"description": "The entity has been deleted but may still be referenced by other entities predating the deletion."
11761170
}
11771171
]
11781172
}

specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2022-12-01/generated.json

Lines changed: 0 additions & 203 deletions
Original file line numberDiff line numberDiff line change
@@ -803,161 +803,6 @@
803803
"total_tokens"
804804
]
805805
},
806-
"ImageGenerationOptions": {
807-
"type": "object",
808-
"properties": {
809-
"prompt": {
810-
"type": "string",
811-
"description": "A description of the desired images."
812-
},
813-
"n": {
814-
"type": "integer",
815-
"format": "int32",
816-
"description": "The number of images to generate (defaults to 1).",
817-
"default": 1
818-
},
819-
"size": {
820-
"$ref": "#/definitions/ImageSize",
821-
"description": "The desired size of the generated images. Must be one of 256x256, 512x512, or 1024x1024 (defaults to 1024x1024).",
822-
"default": "1024x1024"
823-
},
824-
"user": {
825-
"type": "string",
826-
"description": "A unique identifier representing your end-user, which can help to monitor and detect abuse."
827-
}
828-
},
829-
"description": "Represents the request data used to generate images.",
830-
"required": [
831-
"prompt"
832-
]
833-
},
834-
"ImageLocation": {
835-
"type": "object",
836-
"properties": {
837-
"url": {
838-
"type": "string",
839-
"format": "uri",
840-
"description": "The URL that provides temporary access to download the generated image."
841-
},
842-
"error": {
843-
"$ref": "#/definitions/Azure.Core.Foundations.Error",
844-
"description": "The error if the operation failed."
845-
}
846-
},
847-
"description": "The image url if successful, and an error otherwise."
848-
},
849-
"ImageOperationResponse": {
850-
"type": "object",
851-
"properties": {
852-
"id": {
853-
"type": "string",
854-
"description": "The ID of the operation."
855-
},
856-
"created": {
857-
"type": "integer",
858-
"format": "int64",
859-
"description": "A timestamp when this job or item was created (in unix epochs)."
860-
},
861-
"expires": {
862-
"type": "integer",
863-
"format": "int64",
864-
"description": "A timestamp when this operation and its associated images expire and will be deleted (in unix epochs)."
865-
},
866-
"result": {
867-
"$ref": "#/definitions/ImageResponse",
868-
"description": "The result of the operation if the operation succeeded."
869-
},
870-
"status": {
871-
"$ref": "#/definitions/State",
872-
"description": "The status of the operation"
873-
},
874-
"error": {
875-
"$ref": "#/definitions/Azure.Core.Foundations.Error",
876-
"description": "The error if the operation failed."
877-
}
878-
},
879-
"description": "The result of the operation if the operation succeeded.",
880-
"required": [
881-
"id",
882-
"created",
883-
"status"
884-
]
885-
},
886-
"ImageOperationStatus": {
887-
"type": "object",
888-
"properties": {
889-
"id": {
890-
"type": "string",
891-
"description": "The unique ID of the operation.",
892-
"x-ms-mutability": [
893-
"read"
894-
]
895-
},
896-
"status": {
897-
"$ref": "#/definitions/State",
898-
"description": "The status of the operation"
899-
}
900-
},
901-
"description": "Provides status details for long running operations.",
902-
"required": [
903-
"id",
904-
"status"
905-
]
906-
},
907-
"ImageResponse": {
908-
"type": "object",
909-
"properties": {
910-
"created": {
911-
"type": "integer",
912-
"format": "int64",
913-
"description": "A timestamp when this job or item was created (in unix epochs)."
914-
},
915-
"data": {
916-
"type": "array",
917-
"items": {
918-
"$ref": "#/definitions/ImageLocation"
919-
},
920-
"x-ms-identifiers": [],
921-
"description": "The images generated by the operator.",
922-
"x-typespec-name": "ImageLocation[]"
923-
}
924-
},
925-
"description": "The result of the operation if the operation succeeded.",
926-
"required": [
927-
"created",
928-
"data"
929-
]
930-
},
931-
"ImageSize": {
932-
"type": "string",
933-
"description": "The desired size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.",
934-
"enum": [
935-
"256x256",
936-
"512x512",
937-
"1024x1024"
938-
],
939-
"x-ms-enum": {
940-
"name": "ImageSize",
941-
"modelAsString": true,
942-
"values": [
943-
{
944-
"name": "Size256x256",
945-
"value": "256x256",
946-
"description": "Image size of 256x256."
947-
},
948-
{
949-
"name": "Size512x512",
950-
"value": "512x512",
951-
"description": "Image size of 512x512."
952-
},
953-
{
954-
"name": "Size1024x1024",
955-
"value": "1024x1024",
956-
"description": "Image size of 1024x1024."
957-
}
958-
]
959-
}
960-
},
961806
"ServiceApiVersions": {
962807
"type": "string",
963808
"enum": [
@@ -983,54 +828,6 @@
983828
}
984829
]
985830
}
986-
},
987-
"State": {
988-
"type": "string",
989-
"description": "The state of a job or item.",
990-
"enum": [
991-
"notRunning",
992-
"running",
993-
"succeeded",
994-
"canceled",
995-
"failed",
996-
"deleted"
997-
],
998-
"x-ms-enum": {
999-
"name": "State",
1000-
"modelAsString": true,
1001-
"values": [
1002-
{
1003-
"name": "notRunning",
1004-
"value": "notRunning",
1005-
"description": "The operation was created and is queued to be processed in the future."
1006-
},
1007-
{
1008-
"name": "running",
1009-
"value": "running",
1010-
"description": "The operation has started to be processed."
1011-
},
1012-
{
1013-
"name": "succeeded",
1014-
"value": "succeeded",
1015-
"description": "The operation has successfully be processed and is ready for consumption."
1016-
},
1017-
{
1018-
"name": "canceled",
1019-
"value": "canceled",
1020-
"description": "The operation has been canceled and is incomplete."
1021-
},
1022-
{
1023-
"name": "failed",
1024-
"value": "failed",
1025-
"description": "The operation has completed processing with a failure and cannot be further consumed."
1026-
},
1027-
{
1028-
"name": "deleted",
1029-
"value": "deleted",
1030-
"description": "The entity has been deleted but may still be referenced by other entities predating the deletion."
1031-
}
1032-
]
1033-
}
1034831
}
1035832
},
1036833
"parameters": {

0 commit comments

Comments
 (0)