From 168662a398e0c9c096eb9c64f543416fa585c086 Mon Sep 17 00:00:00 2001 From: Mark Cowlishaw Date: Fri, 12 May 2023 15:21:51 -0700 Subject: [PATCH 1/3] Changes for OpenAI.Authoring --- .../2022-06-01-preview/openapi.json | 530 +++++++----------- .../OpenAI.Authoring/common.tsp | 23 +- .../OpenAI.Authoring/deployment.tsp | 17 +- .../OpenAI.Authoring/file.tsp | 17 +- .../OpenAI.Authoring/finetune.tsp | 27 +- .../OpenAI.Authoring/main.tsp | 17 +- .../OpenAI.Authoring/model.routes.tsp | 6 +- .../models/deployment.models.tsp | 5 +- .../OpenAI.Authoring/models/file.models.tsp | 5 +- .../models/finetune.models.tsp | 23 +- .../OpenAI.Authoring/models/model.models.tsp | 11 +- .../OpenAI.Authoring/tspconfig.yaml | 8 +- 12 files changed, 322 insertions(+), 367 deletions(-) diff --git a/specification/cognitiveservices/OpenAI.Authoring/cadl-output/2022-06-01-preview/openapi.json b/specification/cognitiveservices/OpenAI.Authoring/cadl-output/2022-06-01-preview/openapi.json index d619df664803..97af6badf8c6 100644 --- a/specification/cognitiveservices/OpenAI.Authoring/cadl-output/2022-06-01-preview/openapi.json +++ b/specification/cognitiveservices/OpenAI.Authoring/cadl-output/2022-06-01-preview/openapi.json @@ -4,9 +4,9 @@ "title": "Azure OpenAI API", "version": "2022-06-01-preview", "description": "API for managing and utilizing Azure Open AI endpoints", - "x-cadl-generated": [ + "x-typespec-generated": [ { - "emitter": "@azure-tools/cadl-autorest" + "emitter": "@azure-tools/typespec-autorest" } ] }, @@ -37,20 +37,24 @@ "ApiKeyAuth": [] }, { - "OAuth2Auth": [] + "OAuth2Auth": [ + "https://cognitiveservices.azure.com/.default" + ] } ], "securityDefinitions": { "ApiKeyAuth": { "type": "apiKey", "in": "header", - "name": "apiKey" + "name": "api-key" }, "OAuth2Auth": { "type": "oauth2", "flow": "implicit", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", - "scopes": {} + "scopes": { + "https://cognitiveservices.azure.com/.default": "" + } } }, "tags": [], @@ -74,6 +78,12 @@ }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -89,26 +99,12 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "body", + "name": "resource", "in": "body", + "required": true, + "description": "The resource instance.", "schema": { - "type": "object", - "properties": { - "model": { - "type": "string", - "description": "The OpenAI model to deploy. Can be a base model or a fine tune." - }, - "scale_settings": { - "$ref": "#/definitions/ScaleSettings", - "description": "The scale settings of a deployment. It defines the modes for scaling and the\nreserved capacity." - } - }, - "description": "The template for adding updateable properties.", - "required": [ - "model", - "scale_settings" - ], - "x-cadl-name": "Azure.Core.Foundations.ResourceCreateOrReplaceModel" + "$ref": "#/definitions/Deployment" } } ], @@ -123,62 +119,17 @@ } }, "schema": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/State", - "description": "The state of a job or item.", - "readOnly": true - }, - "created_at": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was created (in unix epochs).", - "readOnly": true - }, - "updated_at": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was modified last (in unix epochs).", - "readOnly": true - }, - "id": { - "type": "string", - "description": "The identifier of the deployment", - "readOnly": true - }, - "model": { - "type": "string", - "description": "The OpenAI model to deploy. Can be a base model or a fine tune." - }, - "owner": { - "type": "string", - "description": "The owner of this deployment. For Azure OpenAI only \"organization-owner\" is\nsupported.", - "readOnly": true - }, - "scale_settings": { - "$ref": "#/definitions/ScaleSettings", - "description": "The scale settings of a deployment. It defines the modes for scaling and the\nreserved capacity." - } - }, - "required": [ - "status", - "created_at", - "updated_at", - "id", - "model", - "scale_settings" - ], - "x-cadl-name": "Azure.Core.Foundations.CustomResponseFields<(anonymous model)>" + "$ref": "#/definitions/Deployment" } }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -192,15 +143,15 @@ "summary": "Gets details for a single deployment specified by the given deployment_id.", "description": "Gets details for a single deployment specified by the given deployment_id.", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "deploymentId", "in": "path", "required": true, "description": "The identifier of the deployment", "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" } ], "responses": { @@ -212,6 +163,12 @@ }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -223,6 +180,9 @@ "summary": "Updates the mutable details of the deployment with the given deployment_id.", "description": "Updates the mutable details of the deployment with the given deployment_id.", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "deploymentId", "in": "path", @@ -231,25 +191,12 @@ "type": "string" }, { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "body", + "name": "resource", "in": "body", + "required": true, + "description": "The resource instance.", "schema": { - "type": "object", - "properties": { - "model": { - "type": "string", - "description": "The OpenAI model to deploy. Can be a base model or a fine tune." - }, - "scale_settings": { - "$ref": "#/definitions/ScaleSettings", - "description": "The scale settings of a deployment. It defines the modes for scaling and the\nreserved capacity." - } - }, - "description": "The template for adding optional properties.", - "x-cadl-name": "Azure.Core.Foundations.ResourceCreateOrUpdateModel" + "$ref": "#/definitions/DeploymentUpdate" } } ], @@ -257,120 +204,23 @@ "200": { "description": "The request has succeeded.", "schema": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/State", - "description": "The state of a job or item.", - "readOnly": true - }, - "created_at": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was created (in unix epochs).", - "readOnly": true - }, - "updated_at": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was modified last (in unix epochs).", - "readOnly": true - }, - "id": { - "type": "string", - "description": "The identifier of the deployment", - "readOnly": true - }, - "model": { - "type": "string", - "description": "The OpenAI model to deploy. Can be a base model or a fine tune." - }, - "owner": { - "type": "string", - "description": "The owner of this deployment. For Azure OpenAI only \"organization-owner\" is\nsupported.", - "readOnly": true - }, - "scale_settings": { - "$ref": "#/definitions/ScaleSettings", - "description": "The scale settings of a deployment. It defines the modes for scaling and the\nreserved capacity." - } - }, - "required": [ - "status", - "created_at", - "updated_at", - "id", - "model", - "scale_settings" - ], - "x-cadl-name": "Azure.Core.Foundations.ResourceOkResponse" + "$ref": "#/definitions/Deployment" } }, "201": { "description": "The request has succeeded and a new resource has been created as a result.", "schema": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/State", - "description": "The state of a job or item.", - "readOnly": true - }, - "created_at": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was created (in unix epochs).", - "readOnly": true - }, - "updated_at": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was modified last (in unix epochs).", - "readOnly": true - }, - "id": { - "type": "string", - "description": "The identifier of the deployment", - "readOnly": true - }, - "model": { - "type": "string", - "description": "The OpenAI model to deploy. Can be a base model or a fine tune." - }, - "owner": { - "type": "string", - "description": "The owner of this deployment. For Azure OpenAI only \"organization-owner\" is\nsupported.", - "readOnly": true - }, - "scale_settings": { - "$ref": "#/definitions/ScaleSettings", - "description": "The scale settings of a deployment. It defines the modes for scaling and the\nreserved capacity." - } - }, - "description": "A resource was successfully created.", - "required": [ - "status", - "created_at", - "updated_at", - "id", - "model", - "scale_settings" - ], - "x-cadl-name": "Azure.Core.Foundations.ResourceCreatedResponse" + "$ref": "#/definitions/Deployment" } }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -385,15 +235,15 @@ "summary": "Deletes the deployment specified by the given deployment_id.", "description": "Deletes the deployment specified by the given deployment_id.", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "deploymentId", "in": "path", "required": true, "description": "The identifier of the deployment", "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" } ], "responses": { @@ -402,6 +252,12 @@ }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -428,6 +284,12 @@ }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -443,26 +305,12 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "body", + "name": "resource", "in": "body", + "required": true, + "description": "The resource instance.", "schema": { - "type": "object", - "properties": { - "purpose": { - "$ref": "#/definitions/Purpose", - "description": "The intended purpose of the uploaded documents. Use \"fine-tune\" for\nfine-tuning. This allows us to validate the format of the uploaded file." - }, - "filename": { - "type": "string", - "description": "The name of the file." - } - }, - "description": "The template for adding updateable properties.", - "required": [ - "purpose", - "filename" - ], - "x-cadl-name": "Azure.Core.Foundations.ResourceCreateOrReplaceModel" + "$ref": "#/definitions/File" } } ], @@ -477,60 +325,17 @@ } }, "schema": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/State", - "description": "The state of a job or item.", - "readOnly": true - }, - "created_at": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was created (in unix epochs).", - "readOnly": true - }, - "updated_at": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was modified last (in unix epochs).", - "readOnly": true - }, - "id": { - "type": "string", - "description": "The identity of this item.", - "readOnly": true - }, - "bytes": { - "type": "integer", - "format": "int32", - "description": "The size of this file when available (can be null). File sizes larger than\n2^53-1 are not supported to ensure compatibility\nwith JavaScript integers.", - "readOnly": true - }, - "purpose": { - "$ref": "#/definitions/Purpose", - "description": "The intended purpose of the uploaded documents. Use \"fine-tune\" for\nfine-tuning. This allows us to validate the format of the uploaded file." - }, - "filename": { - "type": "string", - "description": "The name of the file." - } - }, - "required": [ - "id", - "purpose", - "filename" - ], - "x-cadl-name": "Azure.Core.Foundations.CustomResponseFields<(anonymous model)>" + "$ref": "#/definitions/File" } }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -544,15 +349,15 @@ "summary": "Gets details for a single file specified by the given file_id including status,\nsize, purpose, etc.", "description": "Gets details for a single file specified by the given file_id including status,\nsize, purpose, etc.", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "fileId", "in": "path", "required": true, "description": "The identity of this item.", "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" } ], "responses": { @@ -564,6 +369,12 @@ }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -575,15 +386,15 @@ "summary": "Deletes the file with the given file_id.\nDeletion is also allowed if a file\nwas used, e.g., as training file in a fine-tune job.", "description": "Deletes the file with the given file_id.\nDeletion is also allowed if a file\nwas used, e.g., as training file in a fine-tune job.", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "fileId", "in": "path", "required": true, "description": "The identity of this item.", "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" } ], "responses": { @@ -592,6 +403,12 @@ }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -605,15 +422,15 @@ "summary": "Gets the content of the file specified by the given file_id.\nFiles can be user\nuploaded content or generated by the service like result metrics of a fine-tune\njob.", "description": "Gets the content of the file specified by the given file_id.\nFiles can be user\nuploaded content or generated by the service like result metrics of a fine-tune\njob.", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "fileId", "in": "path", "required": true, "description": "The identity of this item.", "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" } ], "responses": { @@ -625,6 +442,12 @@ }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -657,8 +480,8 @@ "headers": { "location": { "description": "Location of the newly created item", - "format": "uri", - "type": "string" + "type": "string", + "format": "uri" } }, "schema": { @@ -667,6 +490,12 @@ }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -693,6 +522,12 @@ }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -721,8 +556,8 @@ "headers": { "location": { "description": "Location of the newly created item", - "format": "uri", - "type": "string" + "type": "string", + "format": "uri" } }, "schema": { @@ -731,6 +566,12 @@ }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -744,15 +585,15 @@ "summary": "Gets details for a single fine-tune job specified by the given\nfine_tune_id.\nThe details contain the base model, training and validation\nfiles, hyper parameters, time stamps, status and events.\nEvents are created\nwhen the job status changes, e.g. running or complete, and when results are\nuploaded.", "description": "Gets details for a single fine-tune job specified by the given\nfine_tune_id.\nThe details contain the base model, training and validation\nfiles, hyper parameters, time stamps, status and events.\nEvents are created\nwhen the job status changes, e.g. running or complete, and when results are\nuploaded.", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "fineTuneId", "in": "path", "required": true, "description": "The identity of this item.", "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" } ], "responses": { @@ -764,6 +605,12 @@ }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -775,15 +622,15 @@ "summary": "Deletes the fine-tune job specified by the given fine_tune_id.", "description": "Deletes the fine-tune job specified by the given fine_tune_id.", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "fineTuneId", "in": "path", "required": true, "description": "The identity of this item.", "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" } ], "responses": { @@ -792,6 +639,12 @@ }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -805,15 +658,15 @@ "summary": "Cancels the processing of the fine-tune job specified by the given fine_tune_id.", "description": "Cancels the processing of the fine-tune job specified by the given fine_tune_id.", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "fineTuneId", "in": "path", "required": true, "description": "The identity of this item.", "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" } ], "responses": { @@ -825,6 +678,12 @@ }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -838,6 +697,9 @@ "summary": "List events for the fine-tune job specified by the given fine_tune_id.\nEvents are created when the job status changes, e.g. running or\ncomplete, and when results are uploaded.", "description": "List events for the fine-tune job specified by the given fine_tune_id.\nEvents are created when the job status changes, e.g. running or\ncomplete, and when results are uploaded.", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "fineTuneId", "in": "path", @@ -851,9 +713,6 @@ "required": true, "description": "A flag indicating whether to stream events for the fine-tune job. If set to true,\nevents will be sent as data-only server-sent events as they become available. The stream will terminate with\na data: [DONE] message when the job is finished (succeeded, cancelled, or failed).\nIf set to false, only events generated so far will be returned..", "type": "boolean" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" } ], "responses": { @@ -865,6 +724,12 @@ }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -891,6 +756,12 @@ }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -904,15 +775,15 @@ "summary": "Gets details for the model specified by the given model_id.", "description": "Gets details for the model specified by the given model_id.", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "model_id", "in": "path", "required": true, "description": "The identity of this item.", "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" } ], "responses": { @@ -924,6 +795,12 @@ }, "default": { "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } @@ -954,7 +831,7 @@ "$ref": "#/definitions/Azure.Core.Foundations.Error" }, "x-ms-identifiers": [], - "x-cadl-name": "Azure.Core.Foundations.Error[]", + "x-typespec-name": "Azure.Core.Foundations.Error[]", "description": "An array of details about specific errors that led to this reported error." }, "innererror": { @@ -1027,7 +904,7 @@ "items": { "$ref": "#/definitions/ScaleType" }, - "x-cadl-name": "ScaleType[]", + "x-typespec-name": "ScaleType[]", "description": "The supported scale types for deployments of this model.", "readOnly": true } @@ -1111,11 +988,25 @@ "items": { "$ref": "#/definitions/Deployment" }, - "x-cadl-name": "Deployment[]", + "x-typespec-name": "Deployment[]", "description": "The list of Deployments" } } }, + "DeploymentUpdate": { + "type": "object", + "properties": { + "model": { + "type": "string", + "description": "The OpenAI model to deploy. Can be a base model or a fine tune." + }, + "scale_settings": { + "$ref": "#/definitions/ScaleSettings", + "description": "The scale settings of a deployment. It defines the modes for scaling and the\nreserved capacity." + } + }, + "description": "Deployments manage the reserved quota for Azure OpenAI models and make them\navailable for inference requests." + }, "Deprecation": { "type": "object", "properties": { @@ -1205,7 +1096,7 @@ ], "x-ms-enum": { "name": "ErrorCodeKnownValues", - "modelAsString": false, + "modelAsString": true, "values": [ { "name": "Conflict", @@ -1286,7 +1177,7 @@ "$ref": "#/definitions/Event" }, "x-ms-identifiers": [], - "x-cadl-name": "Event[]", + "x-typespec-name": "Event[]", "description": "The list of Events" } } @@ -1403,7 +1294,7 @@ "items": { "$ref": "#/definitions/File" }, - "x-cadl-name": "File[]", + "x-typespec-name": "File[]", "description": "The list of Files" } } @@ -1452,7 +1343,7 @@ "items": { "$ref": "#/definitions/File" }, - "x-cadl-name": "File[]", + "x-typespec-name": "File[]", "description": "The files that are used for training the fine tuned model." }, "validation_files": { @@ -1460,7 +1351,7 @@ "items": { "$ref": "#/definitions/File" }, - "x-cadl-name": "File[]", + "x-typespec-name": "File[]", "description": "The files that are used to evaluate the fine tuned model during training." }, "result_files": { @@ -1468,7 +1359,7 @@ "items": { "$ref": "#/definitions/File" }, - "x-cadl-name": "File[]", + "x-typespec-name": "File[]", "description": "The result files containing training and evaluation metrics in csv format.\nThe\nfile is only available for successfully completed fine-tune runs.", "readOnly": true }, @@ -1478,7 +1369,7 @@ "$ref": "#/definitions/Event" }, "x-ms-identifiers": [], - "x-cadl-name": "Event[]", + "x-typespec-name": "Event[]", "description": "The events that show the progress of the fine-tune run including queued,\nrunning and completed.", "readOnly": true }, @@ -1548,7 +1439,7 @@ "items": { "$ref": "#/definitions/FineTune" }, - "x-cadl-name": "FineTune[]", + "x-typespec-name": "FineTune[]", "description": "The list of FineTunes" } } @@ -1595,7 +1486,7 @@ "type": "number", "format": "float" }, - "x-cadl-name": "float32[]", + "x-typespec-name": "float32[]", "description": "The classification beta values. If this is provided, we calculate F-beta scores\nat the specified beta values.\nThe F-beta score is a generalization of F-1\nscore. This is only used for binary classification.\nWith a beta of 1 (i.e.the\nF-1 score), precision and recall are given the same weight.\nA larger beta\nscore puts more weight on recall and less on precision. A smaller beta score\nputs more weight on precision and less on recall." } }, @@ -1624,7 +1515,7 @@ ], "x-ms-enum": { "name": "InnerErrorCodeKnownValues", - "modelAsString": false, + "modelAsString": true, "values": [ { "name": "InvalidPayload", @@ -1642,7 +1533,7 @@ ], "x-ms-enum": { "name": "LogLevel", - "modelAsString": false, + "modelAsString": true, "values": [ { "name": "Info", @@ -1751,7 +1642,7 @@ "items": { "$ref": "#/definitions/Model" }, - "x-cadl-name": "Model[]", + "x-typespec-name": "Model[]", "description": "The list of Models" } } @@ -1785,7 +1676,7 @@ ], "x-ms-enum": { "name": "PurposeKnownValues", - "modelAsString": false, + "modelAsString": true, "values": [ { "name": "FineTune", @@ -1841,7 +1732,7 @@ ], "x-ms-enum": { "name": "ScaleTypeKnownValues", - "modelAsString": false, + "modelAsString": true, "values": [ { "name": "Manual", @@ -1877,7 +1768,7 @@ ], "x-ms-enum": { "name": "State", - "modelAsString": false, + "modelAsString": true, "values": [ { "name": "NotRunning", @@ -1959,7 +1850,7 @@ ], "x-ms-enum": { "name": "TypeDiscriminatorKnownValues", - "modelAsString": false, + "modelAsString": true, "values": [ { "name": "List", @@ -1995,7 +1886,7 @@ ], "x-ms-enum": { "name": "Versions", - "modelAsString": false, + "modelAsString": true, "values": [ { "name": "v2022_06_01_preview", @@ -2011,6 +1902,7 @@ "in": "query", "required": true, "description": "The API version to use for this operation.", + "x-ms-client-name": "apiVersion", "minLength": 1, "type": "string", "x-ms-parameter-location": "method" diff --git a/specification/cognitiveservices/OpenAI.Authoring/common.tsp b/specification/cognitiveservices/OpenAI.Authoring/common.tsp index 297faeb9ae8c..d72f1d55552d 100644 --- a/specification/cognitiveservices/OpenAI.Authoring/common.tsp +++ b/specification/cognitiveservices/OpenAI.Authoring/common.tsp @@ -3,6 +3,9 @@ import "@typespec/http"; using TypeSpec.Rest; using TypeSpec.Http; +using Azure.Core; +using Azure.Core.Traits; +using Azure.Core.Traits.Private; namespace Azure.OpenAI; @@ -80,6 +83,22 @@ model CreatedResponse { @doc("Location of the newly created item") @header - @format("uri") - location: string; + location: url; } + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "Template" +#suppress "@azure-tools/typespec-providerhub/no-inline-model" "This operation signature is not used in Azure Resource Manager operations (yet)" +@TypeSpec.Rest.createsResource(TResource) +op CustomResourceCreateWithServiceProvidedName< + TResource extends object, + Traits extends object = {} +> is Azure.Core.Foundations.ResourceCollectionOperation< + TResource, + Azure.Core.Foundations.ResourceBody & + TraitProperties, + Azure.Core.Foundations.LocationOfCreatedResourceResponse & + TResource & + TraitProperties, + Traits, + Azure.Core.Foundations.ErrorResponse +>; diff --git a/specification/cognitiveservices/OpenAI.Authoring/deployment.tsp b/specification/cognitiveservices/OpenAI.Authoring/deployment.tsp index 4ade825eae61..6b1b98eca9cf 100644 --- a/specification/cognitiveservices/OpenAI.Authoring/deployment.tsp +++ b/specification/cognitiveservices/OpenAI.Authoring/deployment.tsp @@ -8,14 +8,18 @@ using TypeSpec.Http; using Azure.Core; interface Deployments { - #suppress "@azure-tools/cadl-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." @summary("Gets the list of deployments owned by the Azure OpenAI resource.") @doc("Gets the list of deployments owned by the Azure OpenAI resource.") - @route("/deployments") + @route("/") @get // TODO: enum value types not supported in csharp emitter, change string literal to TypeDiscriminatorKnownValues enum when fixed - ListDeployments is ServiceCustomizations.OpenAIListOperation; + ListDeployments is ServiceCustomizations.OpenAIListOperation< + Deployment, + "deployment" + >; + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Existing spec" @summary(""" Creates a new deployment for the Azure OpenAI resource according to the given specification. @@ -24,12 +28,7 @@ specification. Creates a new deployment for the Azure OpenAI resource according to the given specification. """) - CreateDeployment is ResourceCreateWithServiceProvidedName< - Deployment, - { - response: Deployment - } - >; + CreateDeployment is CustomResourceCreateWithServiceProvidedName; @summary("Gets details for a single deployment specified by the given deployment_id.") @doc("Gets details for a single deployment specified by the given deployment_id.") diff --git a/specification/cognitiveservices/OpenAI.Authoring/file.tsp b/specification/cognitiveservices/OpenAI.Authoring/file.tsp index 1356a2292a1f..d407c28d2fe2 100644 --- a/specification/cognitiveservices/OpenAI.Authoring/file.tsp +++ b/specification/cognitiveservices/OpenAI.Authoring/file.tsp @@ -10,9 +10,8 @@ using TypeSpec.Rest; using TypeSpec.Http; using Azure.Core; -interface Files -{ - #suppress "@azure-tools/cadl-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." +interface Files { + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." @summary(""" Gets a list of all files owned by the Azure OpenAI resource. These include user uploaded content like files with purpose "fine-tune" for training or @@ -28,11 +27,12 @@ as well as files that are generated by the service such as \"fine-tune-results\" which contains various metrics for the corresponding fine-tune job. """) - @route("/files") + @route("/") @get // TODO: enum value types not supported in csharp emitter, change string literal to TypeDiscriminatorKnownValues enum when fixed ListFiles is ServiceCustomizations.OpenAIListOperation; + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Existing spec" @summary(""" Creates a new file entity by uploading data from a local machine. Uploaded files can, for example, be used for training or evaluating fine-tuned models. @@ -41,12 +41,7 @@ files can, for example, be used for training or evaluating fine-tuned models. Creates a new file entity by uploading data from a local machine. Uploaded files can, for example, be used for training or evaluating fine-tuned models. """) - UploadFile is ResourceCreateWithServiceProvidedName< - File, - { - response: File - } - >; + UploadFile is CustomResourceCreateWithServiceProvidedName; @summary(""" Gets details for a single file specified by the given file_id including status, @@ -87,7 +82,7 @@ job. @actionSeparator("/") GetFileContent is ResourceAction; - #suppress "@azure-tools/cadl-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." @summary(""" Creates a new file entity by importing data from a provided url. Uploaded files can, for example, be used for training or evaluating fine-tuned models. diff --git a/specification/cognitiveservices/OpenAI.Authoring/finetune.tsp b/specification/cognitiveservices/OpenAI.Authoring/finetune.tsp index beb23f1c1d56..30d053e2661e 100644 --- a/specification/cognitiveservices/OpenAI.Authoring/finetune.tsp +++ b/specification/cognitiveservices/OpenAI.Authoring/finetune.tsp @@ -11,7 +11,7 @@ using TypeSpec.Http; using Azure.Core; interface FineTunes { - #suppress "@azure-tools/cadl-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." @summary(""" Gets a list of all fine-tune jobs owned by the Azure OpenAI resource. The details that are returned for each fine-tune job contain besides its @@ -26,12 +26,15 @@ identifier the base model, training and validation files, hyper parameters, time stamps, status and events. Events are created when the job status changes, e.g. running or complete, and when results are uploaded. """) - @route("/fine-tunes") + @route("/") @get // TODO: enum value types not supported in csharp emitter, change string literal to TypeDiscriminatorKnownValues enum when fixed - ListFineTunes is ServiceCustomizations.OpenAIListOperation; + ListFineTunes is ServiceCustomizations.OpenAIListOperation< + FineTune, + "fine-tune" + >; - #suppress "@azure-tools/cadl-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." @summary(""" Creates a job that fine-tunes a specified model from a given training file. @@ -51,7 +54,7 @@ once complete. @route("/fine-tunes") @post CreateFineTune is Foundations.Operation< - FineTuneCreation, + FineTuneCreation, FineTune & CreatedResponse >; @@ -90,13 +93,17 @@ List events for the fine-tune job specified by the given fine_tune_id. Events are created when the job status changes, e.g. running or complete, and when results are uploaded. """) - @Cadl.Rest.actionSeparator("/") + @TypeSpec.Rest.actionSeparator("/") @get - ListFineTuneEvents is Azure.Core.ResourceAction>; + @query + stream: boolean; + }, + ServiceCustomizations.OpenAiList + >; // #suppress "@azure-tools/cadl-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." @summary("Cancels the processing of the fine-tune job specified by the given fine_tune_id.") diff --git a/specification/cognitiveservices/OpenAI.Authoring/main.tsp b/specification/cognitiveservices/OpenAI.Authoring/main.tsp index 0be8f283aaf8..f2172fef3acc 100644 --- a/specification/cognitiveservices/OpenAI.Authoring/main.tsp +++ b/specification/cognitiveservices/OpenAI.Authoring/main.tsp @@ -11,14 +11,19 @@ using TypeSpec.Rest; using TypeSpec.Http; using TypeSpec.Versioning; +#suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @useAuth( - ApiKeyAuth | - OAuth2Auth<[{ + ApiKeyAuth | OAuth2Auth<[ + { type: OAuth2FlowType.implicit, authorizationUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", - scopes: ["https://cognitiveservices.azure.com/.default"] - }]>) -@service({title: "Azure OpenAI API"}) + scopes: ["https://cognitiveservices.azure.com/.default"], + } + ]> +) +@service({ + title: "Azure OpenAI API", +}) @versioned(Azure.OpenAI.Versions) @server( "{endpoint}/openai", @@ -37,4 +42,4 @@ namespace Azure.OpenAI; enum Versions { @useDependency(Azure.Core.Versions.v1_0_Preview_1) v2022_06_01_preview: "2022-06-01-preview", -} \ No newline at end of file +} diff --git a/specification/cognitiveservices/OpenAI.Authoring/model.routes.tsp b/specification/cognitiveservices/OpenAI.Authoring/model.routes.tsp index 042a19979486..befafec9cf1d 100644 --- a/specification/cognitiveservices/OpenAI.Authoring/model.routes.tsp +++ b/specification/cognitiveservices/OpenAI.Authoring/model.routes.tsp @@ -6,8 +6,8 @@ import "./serviceCustomizations.tsp"; namespace Azure.OpenAI; -using Cadl.Rest; -using Cadl.Http; +using TypeSpec.Rest; +using TypeSpec.Http; using Azure.Core; interface Models { @@ -24,7 +24,7 @@ resource. These include base models as well as all successfully completed fine-tuned models owned by the Azure OpenAI resource. """) - @route("/models") + @route("/") @get // TODO: enum value types not supported in csharp emitter, change string literal to TypeDiscriminatorKnownValues enum when fixed ListModels is ServiceCustomizations.OpenAIListOperation; diff --git a/specification/cognitiveservices/OpenAI.Authoring/models/deployment.models.tsp b/specification/cognitiveservices/OpenAI.Authoring/models/deployment.models.tsp index b53a9e3f377b..ad6b41d233d8 100644 --- a/specification/cognitiveservices/OpenAI.Authoring/models/deployment.models.tsp +++ b/specification/cognitiveservices/OpenAI.Authoring/models/deployment.models.tsp @@ -20,10 +20,12 @@ model Deployment { @visibility("read") status: State; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("A timestamp when this job or item was created (in unix epochs).") @visibility("read") created_at: int32; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("A timestamp when this job or item was modified last (in unix epochs).") @visibility("read") updated_at: int32; @@ -34,7 +36,7 @@ model Deployment { id: string; @doc("The OpenAI model to deploy. Can be a base model or a fine tune.") - "model": string; + `model`: string; @doc(""" The owner of this deployment. For Azure OpenAI only \"organization-owner\" is @@ -43,6 +45,7 @@ supported. @visibility("read") owner?: string; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc(""" The scale settings of a deployment. It defines the modes for scaling and the reserved capacity. diff --git a/specification/cognitiveservices/OpenAI.Authoring/models/file.models.tsp b/specification/cognitiveservices/OpenAI.Authoring/models/file.models.tsp index 251c54baa6a5..ab6c9737cbdf 100644 --- a/specification/cognitiveservices/OpenAI.Authoring/models/file.models.tsp +++ b/specification/cognitiveservices/OpenAI.Authoring/models/file.models.tsp @@ -21,10 +21,12 @@ model File { @visibility("read") status?: State; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("A timestamp when this job or item was created (in unix epochs).") @visibility("read") created_at?: int32; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("A timestamp when this job or item was modified last (in unix epochs).") @visibility("read") updated_at?: int32; @@ -72,6 +74,7 @@ examples. """) filename: string; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc(""" The url to download the document from (can be SAS url of a blob or any other external url accessible with a GET request). @@ -89,4 +92,4 @@ fine-tuning. This allows us to validate the format of the uploaded file. @doc("Gets or sets the file to upload into Azure OpenAI.") file: bytes; -} \ No newline at end of file +} diff --git a/specification/cognitiveservices/OpenAI.Authoring/models/finetune.models.tsp b/specification/cognitiveservices/OpenAI.Authoring/models/finetune.models.tsp index 37137faf8995..28264fbbed00 100644 --- a/specification/cognitiveservices/OpenAI.Authoring/models/finetune.models.tsp +++ b/specification/cognitiveservices/OpenAI.Authoring/models/finetune.models.tsp @@ -19,10 +19,12 @@ model FineTune { @visibility("read") status?: State; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("A timestamp when this job or item was created (in unix epochs).") @visibility("read") created_at?: int32; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("A timestamp when this job or item was modified last (in unix epochs).") @visibility("read") updated_at?: int32; @@ -33,8 +35,9 @@ model FineTune { id: string; @doc("The identifier of the base model used for the fine-tune.") - "model": string; + `model`: string; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc(""" The identifier of the resulting fine tuned model. This property is only populated for successfully completed fine-tune runs. @@ -44,12 +47,15 @@ create a deployment for inferencing. @visibility("read") fine_tuned_model?: string; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("The files that are used for training the fine tuned model.") training_files: File[]; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("The files that are used to evaluate the fine tuned model during training.") validation_files?: File[]; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc(""" The result files containing training and evaluation metrics in csv format. The @@ -65,6 +71,7 @@ running and completed. @visibility("read") events?: Event[]; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc(""" The organisation id of this fine tune job. Unused on Azure OpenAI; compatibility for OpenAI only. @@ -72,6 +79,7 @@ compatibility for OpenAI only. @visibility("read") organisation_id?: string; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc(""" The user id of this fine tune job. Unused on Azure OpenAI; compatibility for OpenAI only. @@ -89,6 +97,7 @@ model Event { @visibility("read") object?: TypeDiscriminator; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("A timestamp when this event was created (in unix epochs).") @visibility("read") created_at?: int32; @@ -107,6 +116,7 @@ enqueued, started, failed or completed, or other events like uploaded results. @doc("The hyper parameter settings used in a fine tune job.") model HyperParameters { + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc(""" The batch size to use for training. The batch size is the number of training examples used to train a single forward and backward pass. @@ -118,6 +128,7 @@ base model. """) batch_size?: int32; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc(""" The learning rate multiplier to use for training. The fine-tuning learning rate is the original learning rate used for pre-training multiplied by this @@ -129,12 +140,14 @@ what produces the best results. """) learning_rate_multiplier?: float32; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc(""" The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. """) n_epochs?: int32; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc(""" The weight to use for loss on the prompt tokens. This controls how much the model tries to learn to generate the prompt @@ -147,6 +160,7 @@ over-prioritizing learning the prompt. """) prompt_loss_weight?: float32; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc(""" A value indicating whether to compute classification metrics. If set, we @@ -161,6 +175,7 @@ classification. """) compute_classification_metrics?: boolean; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc(""" The number of classes in a classification task. This parameter is required for @@ -168,6 +183,7 @@ multiclass classification. """) classification_n_classes?: int32; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc(""" The positive class in binary classification. This parameter is needed to @@ -175,6 +191,7 @@ generate precision, recall, and F1 metrics when doing binary classification. """) classification_positive_class?: string; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc(""" The classification beta values. If this is provided, we calculate F-beta scores at the specified beta values. @@ -192,11 +209,13 @@ puts more weight on precision and less on recall. @doc("Defines the values of a fine tune job.") model FineTuneCreation { @doc("The identifier of the base model used for this fine-tune.") - "model": string; + `model`: string; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("The file that is used for training this fine tuned model.") training_file: string; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("The file that is used to evaluate the fine tuned model during training.") validation_file?: string; diff --git a/specification/cognitiveservices/OpenAI.Authoring/models/model.models.tsp b/specification/cognitiveservices/OpenAI.Authoring/models/model.models.tsp index 5522d86dd6cc..0b86b0987a93 100644 --- a/specification/cognitiveservices/OpenAI.Authoring/models/model.models.tsp +++ b/specification/cognitiveservices/OpenAI.Authoring/models/model.models.tsp @@ -19,14 +19,17 @@ model Model { @visibility("read") status?: State; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("A timestamp when this job or item was created (in unix epochs).") @visibility("read") created_at?: int32; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("A timestamp when this job or item was modified last (in unix epochs).") @visibility("read") updated_at?: int32; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("The identity of this item.") @visibility("read") @key("model_id") @@ -34,8 +37,9 @@ model Model { @doc("The base model ID if this is a fine tune model; otherwise `null`.") @visibility("read") - "model"?: string; + `model`?: string; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("The fine tune job ID if this is a fine tune model; otherwise `null`.") @visibility("read") fine_tune?: string; @@ -56,6 +60,7 @@ models. The exact dates are specified in the properties. @doc("The capabilities of a base or fine tune model.") model Capabilities { + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("A value indicating whether a model can be used for fine tuning.") @visibility("read") fine_tune?: boolean; @@ -72,6 +77,7 @@ model Capabilities { @visibility("read") embeddings?: boolean; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("The supported scale types for deployments of this model.") @visibility("read") scale_types?: ScaleType[]; @@ -86,6 +92,7 @@ fine tuned models. The exact dates are specified in the properties. """) model Deprecation { + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc(""" The end date of fine tune support of this model. Will be `null` for fine tune models. @@ -103,10 +110,12 @@ model ManualScaleSettings extends ScaleSettings { @doc("The constant reserved capacity of the inference endpoint for this deployment.") capacity: int32; + #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("Defines how scaling operations will be executed.") scale_type: "manual"; } +#suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" @doc("Settings for the standard scale type.") model StandardScaleSettings extends ScaleSettings { @doc("Defines how scaling operations will be executed.") diff --git a/specification/cognitiveservices/OpenAI.Authoring/tspconfig.yaml b/specification/cognitiveservices/OpenAI.Authoring/tspconfig.yaml index 1f75eeae3530..3785c43fcd7f 100644 --- a/specification/cognitiveservices/OpenAI.Authoring/tspconfig.yaml +++ b/specification/cognitiveservices/OpenAI.Authoring/tspconfig.yaml @@ -1,7 +1,11 @@ emit: - "@azure-tools/typespec-autorest" - - "@azure-tools/cadl-apiview" -# options: +# - "@azure-tools/typespec-apiview" +options: + "@azure-tools/typespec-autorest": + azure-resource-provider-folder: "cadl-output" + emitter-output-dir: "{project-root}" + output-file: "{azure-resource-provider-folder}/{version}/openapi.json" # Uncomment this line and add "@azure-tools/cadl-python" to your package.json to generate Python code # "@azure-tools/cadl-python": # "basic-setup-py": true From 005ebf55698ea93790ffdbd209442e4746f5469c Mon Sep 17 00:00:00 2001 From: Mark Cowlishaw Date: Mon, 15 May 2023 15:40:07 -0700 Subject: [PATCH 2/3] Removing extraneous file --- .../OpenAI.Authoring/cadl-output/openapi.json | 2081 ----------------- 1 file changed, 2081 deletions(-) delete mode 100644 specification/cognitiveservices/OpenAI.Authoring/cadl-output/openapi.json diff --git a/specification/cognitiveservices/OpenAI.Authoring/cadl-output/openapi.json b/specification/cognitiveservices/OpenAI.Authoring/cadl-output/openapi.json deleted file mode 100644 index e1eea43f5ede..000000000000 --- a/specification/cognitiveservices/OpenAI.Authoring/cadl-output/openapi.json +++ /dev/null @@ -1,2081 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Azure OpenAI API", - "version": "2022-06-01-preview", - "description": "API for managing and utilizing Azure Open AI endpoints", - "x-cadl-generated": [ - { - "emitter": "@azure-tools/cadl-autorest" - } - ] - }, - "schemes": [ - "https" - ], - "x-ms-parameterized-host": { - "hostTemplate": "{endpoint}/openai", - "useSchemePrefix": false, - "parameters": [ - { - "name": "endpoint", - "in": "path", - "required": true, - "description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).", - "type": "string" - } - ] - }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "security": [ - { - "ApiKeyAuth": [] - }, - { - "OAuth2Auth": [] - } - ], - "securityDefinitions": { - "ApiKeyAuth": { - "type": "apiKey", - "in": "header", - "name": "apiKey" - }, - "OAuth2Auth": { - "type": "oauth2", - "flow": "implicit", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", - "scopes": {} - } - }, - "tags": [], - "paths": { - "/deployments": { - "get": { - "operationId": "Deployments_List", - "summary": "Gets the list of deployments owned by the Azure OpenAI resource.", - "description": "Gets the list of deployments owned by the Azure OpenAI resource.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/DeploymentList" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - }, - "post": { - "operationId": "Deployments_Create", - "summary": "Creates a new deployment for the Azure OpenAI resource according to the given\nspecification.", - "description": "Creates a new deployment for the Azure OpenAI resource according to the given\nspecification.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "body", - "in": "body", - "schema": { - "type": "object", - "properties": { - "model": { - "type": "string", - "description": "The OpenAI model to deploy. Can be a base model or a fine tune." - }, - "scaleSettings": { - "$ref": "#/definitions/ScaleSettings", - "description": "The scale settings of a deployment. It defines the modes for scaling and the\nreserved capacity." - } - }, - "description": "The template for adding updateable properties.", - "required": [ - "scaleSettings" - ], - "x-cadl-name": "Azure.Core.Foundations.ResourceCreateOrReplaceModel" - } - } - ], - "responses": { - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "headers": { - "Location": { - "description": "The location of an instance of Deployment", - "type": "string", - "format": "uri" - } - }, - "schema": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/State", - "description": "The state of a job or item.", - "readOnly": true - }, - "createdAt": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was created (in unix epochs).", - "readOnly": true - }, - "updatedAt": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was modified last (in unix epochs).", - "readOnly": true - }, - "id": { - "type": "string", - "description": "The identifier of the deployment", - "readOnly": true - }, - "model": { - "type": "string", - "description": "The OpenAI model to deploy. Can be a base model or a fine tune." - }, - "owner": { - "type": "string", - "description": "The owner of this deployment. For Azure OpenAI only \"organization-owner\" is\nsupported.", - "readOnly": true - }, - "scaleSettings": { - "$ref": "#/definitions/ScaleSettings", - "description": "The scale settings of a deployment. It defines the modes for scaling and the\nreserved capacity." - } - }, - "required": [ - "id", - "scaleSettings" - ], - "x-cadl-name": "Azure.Core.Foundations.CustomResponseFields<(anonymous model)>" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/deployments/{deploymentId}": { - "get": { - "operationId": "Deployments_Get", - "summary": "Gets details for a single deployment specified by the given deploymentId.", - "description": "Gets details for a single deployment specified by the given deploymentId.", - "parameters": [ - { - "name": "deploymentId", - "in": "path", - "required": true, - "description": "The identifier of the deployment", - "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/Deployment" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - }, - "patch": { - "operationId": "Deployments_Update", - "summary": "Updates the mutable details of the deployment with the given deploymentId.", - "description": "Updates the mutable details of the deployment with the given deploymentId.", - "parameters": [ - { - "name": "deploymentId", - "in": "path", - "required": true, - "description": "The identifier of the deployment", - "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "body", - "in": "body", - "schema": { - "type": "object", - "properties": { - "model": { - "type": "string", - "description": "The OpenAI model to deploy. Can be a base model or a fine tune." - }, - "scaleSettings": { - "$ref": "#/definitions/ScaleSettings", - "description": "The scale settings of a deployment. It defines the modes for scaling and the\nreserved capacity." - } - }, - "description": "The template for adding optional properties.", - "x-cadl-name": "Azure.Core.Foundations.ResourceCreateOrUpdateModel" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/State", - "description": "The state of a job or item.", - "readOnly": true - }, - "createdAt": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was created (in unix epochs).", - "readOnly": true - }, - "updatedAt": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was modified last (in unix epochs).", - "readOnly": true - }, - "id": { - "type": "string", - "description": "The identifier of the deployment", - "readOnly": true - }, - "model": { - "type": "string", - "description": "The OpenAI model to deploy. Can be a base model or a fine tune." - }, - "owner": { - "type": "string", - "description": "The owner of this deployment. For Azure OpenAI only \"organization-owner\" is\nsupported.", - "readOnly": true - }, - "scaleSettings": { - "$ref": "#/definitions/ScaleSettings", - "description": "The scale settings of a deployment. It defines the modes for scaling and the\nreserved capacity." - } - }, - "required": [ - "id", - "scaleSettings" - ], - "x-cadl-name": "Azure.Core.Foundations.ResourceOkResponse" - } - }, - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "schema": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/State", - "description": "The state of a job or item.", - "readOnly": true - }, - "createdAt": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was created (in unix epochs).", - "readOnly": true - }, - "updatedAt": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was modified last (in unix epochs).", - "readOnly": true - }, - "id": { - "type": "string", - "description": "The identifier of the deployment", - "readOnly": true - }, - "model": { - "type": "string", - "description": "The OpenAI model to deploy. Can be a base model or a fine tune." - }, - "owner": { - "type": "string", - "description": "The owner of this deployment. For Azure OpenAI only \"organization-owner\" is\nsupported.", - "readOnly": true - }, - "scaleSettings": { - "$ref": "#/definitions/ScaleSettings", - "description": "The scale settings of a deployment. It defines the modes for scaling and the\nreserved capacity." - } - }, - "description": "A resource was successfully created.", - "required": [ - "id", - "scaleSettings" - ], - "x-cadl-name": "Azure.Core.Foundations.ResourceCreatedResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - }, - "consumes": [ - "application/merge-patch+json" - ] - }, - "delete": { - "operationId": "Deployments_Delete", - "summary": "Deletes the deployment specified by the given deploymentId.", - "description": "Deletes the deployment specified by the given deploymentId.", - "parameters": [ - { - "name": "deploymentId", - "in": "path", - "required": true, - "description": "The identifier of the deployment", - "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "204": { - "description": "There is no content to send for this request, but the headers may be useful. " - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/files": { - "get": { - "operationId": "Files_List", - "summary": "Gets a list of all files owned by the Azure OpenAI resource.\nThese include user uploaded content like files with purpose \"fine-tune\" for training or\nvalidation of fine-tunes models as well as files that are generated by the\nservice such as \"fine-tune-results\" which contains various metrics for the\ncorresponding fine-tune job.", - "description": "Gets a list of all files owned by the Azure OpenAI resource.\nThese include user uploaded content like files with purpose \"fine-tune\" for training or\nvalidation of fine-tunes models\nas well as files that are generated by the\nservice such as \"fine-tune-results\" which contains various metrics for the\ncorresponding fine-tune job.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/FileList" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - }, - "post": { - "operationId": "Files_Upload", - "summary": "Creates a new file entity by uploading data from a local machine. Uploaded\nfiles can, for example, be used for training or evaluating fine-tuned models.", - "description": "Creates a new file entity by uploading data from a local machine. Uploaded\nfiles can, for example, be used for training or evaluating fine-tuned models.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "body", - "in": "body", - "schema": { - "type": "object", - "properties": { - "purpose": { - "$ref": "#/definitions/Purpose", - "description": "The intended purpose of the uploaded documents. Use \"fine-tune\" for\nfine-tuning. This allows us to validate the format of the uploaded file." - }, - "filename": { - "type": "string", - "description": "The name of the file." - } - }, - "description": "The template for adding updateable properties.", - "required": [ - "purpose", - "filename" - ], - "x-cadl-name": "Azure.Core.Foundations.ResourceCreateOrReplaceModel" - } - } - ], - "responses": { - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "headers": { - "Location": { - "description": "The location of an instance of File", - "type": "string", - "format": "uri" - } - }, - "schema": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/State", - "description": "The state of a job or item.", - "readOnly": true - }, - "createdAt": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was created (in unix epochs).", - "readOnly": true - }, - "updatedAt": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was modified last (in unix epochs).", - "readOnly": true - }, - "id": { - "type": "string", - "description": "The identity of this item.", - "readOnly": true - }, - "bytes": { - "type": "integer", - "format": "int32", - "description": "The size of this file when available (can be null). File sizes larger than\n2^53-1 are not supported to ensure compatibility\nwith JavaScript integers.", - "readOnly": true - }, - "purpose": { - "$ref": "#/definitions/Purpose", - "description": "The intended purpose of the uploaded documents. Use \"fine-tune\" for\nfine-tuning. This allows us to validate the format of the uploaded file." - }, - "filename": { - "type": "string", - "description": "The name of the file." - } - }, - "required": [ - "id", - "purpose", - "filename" - ], - "x-cadl-name": "Azure.Core.Foundations.CustomResponseFields<(anonymous model)>" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/files/{fileId}": { - "get": { - "operationId": "Files_Get", - "summary": "Gets details for a single file specified by the given fileId including status,\nsize, purpose, etc.", - "description": "Gets details for a single file specified by the given fileId including status,\nsize, purpose, etc.", - "parameters": [ - { - "name": "fileId", - "in": "path", - "required": true, - "description": "The identity of this item.", - "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/File" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - }, - "delete": { - "operationId": "Files_Delete", - "summary": "Deletes the file with the given fileId.\nDeletion is also allowed if a file\nwas used, e.g., as training file in a fine-tune job.", - "description": "Deletes the file with the given fileId.\nDeletion is also allowed if a file\nwas used, e.g., as training file in a fine-tune job.", - "parameters": [ - { - "name": "fileId", - "in": "path", - "required": true, - "description": "The identity of this item.", - "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "204": { - "description": "There is no content to send for this request, but the headers may be useful. " - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/files/{fileId}/content": { - "get": { - "operationId": "Files_GetFileContent", - "summary": "Gets the content of the file specified by the given fileId.\nFiles can be user\nuploaded content or generated by the service like result metrics of a fine-tune\njob.", - "description": "Gets the content of the file specified by the given fileId.\nFiles can be user\nuploaded content or generated by the service like result metrics of a fine-tune\njob.", - "parameters": [ - { - "name": "fileId", - "in": "path", - "required": true, - "description": "The identity of this item.", - "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/FileContent" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/files/import": { - "post": { - "operationId": "Files_Import", - "summary": "Creates a new file entity by importing data from a provided url. Uploaded files\ncan, for example, be used for training or evaluating fine-tuned models.", - "description": "Creates a new file entity by importing data from a provided url. Uploaded files\ncan, for example, be used for training or evaluating fine-tuned models.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "body", - "in": "body", - "required": true, - "description": "expected schema for the body of the completion post request", - "schema": { - "$ref": "#/definitions/FileImport" - } - } - ], - "responses": { - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "headers": { - "location": { - "description": "Location of the newly created item", - "format": "uri", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/File" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/fine-tunes": { - "get": { - "operationId": "FineTunes_List", - "summary": "Gets a list of all fine-tune jobs owned by the Azure OpenAI resource.\nThe details that are returned for each fine-tune job contain besides its\nidentifier the base model, training and validation files, hyper parameters,\ntime stamps, status and events. Events are created when the job status\nchanges, e.g. running or complete, and when results are uploaded.", - "description": "Gets a list of all fine-tune jobs owned by the Azure OpenAI resource.\nThe details that are returned for each fine-tune job contain besides its\nidentifier the base model, training and validation files, hyper parameters,\ntime stamps, status and events. Events are created when the job status\nchanges, e.g. running or complete, and when results are uploaded.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/FineTuneList" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - }, - "post": { - "operationId": "FineTunes_Create", - "summary": "Creates a job that fine-tunes a specified model from a given training\nfile.\nResponse includes details of the enqueued job including job status and\nhyper parameters.\nThe name of the fine-tuned model is added to the response\nonce complete.", - "description": "Creates a job that fine-tunes a specified model from a given training\nfile.\nResponse includes details of the enqueued job including job status and\nhyper parameters.\nThe name of the fine-tuned model is added to the response\nonce complete.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/FineTuneCreation" - } - } - ], - "responses": { - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "headers": { - "location": { - "description": "Location of the newly created item", - "format": "uri", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/FineTune" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/fine-tunes/{fineTuneId}": { - "get": { - "operationId": "FineTunes_Get", - "summary": "Gets details for a single fine-tune job specified by the given\nfineTuneId.\nThe details contain the base model, training and validation\nfiles, hyper parameters, time stamps, status and events.\nEvents are created\nwhen the job status changes, e.g. running or complete, and when results are\nuploaded.", - "description": "Gets details for a single fine-tune job specified by the given\nfineTuneId.\nThe details contain the base model, training and validation\nfiles, hyper parameters, time stamps, status and events.\nEvents are created\nwhen the job status changes, e.g. running or complete, and when results are\nuploaded.", - "parameters": [ - { - "name": "fineTuneId", - "in": "path", - "required": true, - "description": "The identity of this item.", - "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/FineTune" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - }, - "delete": { - "operationId": "FineTunes_Delete", - "summary": "Deletes the fine-tune job specified by the given fineTuneId.", - "description": "Deletes the fine-tune job specified by the given fineTuneId.", - "parameters": [ - { - "name": "fineTuneId", - "in": "path", - "required": true, - "description": "The identity of this item.", - "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "204": { - "description": "There is no content to send for this request, but the headers may be useful. " - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/fine-tunes/{fineTuneId}/cancel": { - "post": { - "operationId": "FineTunes_Cancel", - "summary": "Cancels the processing of the fine-tune job specified by the given fineTuneId.", - "description": "Cancels the processing of the fine-tune job specified by the given fineTuneId.", - "parameters": [ - { - "name": "fineTuneId", - "in": "path", - "required": true, - "description": "The identity of this item.", - "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/FineTune" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/fine-tunes/{fineTuneId}/events": { - "get": { - "operationId": "FineTunes_ListEvents", - "summary": "List events for the fine-tune job specified by the given fineTuneId.\nEvents are created when the job status changes, e.g. running or\ncomplete, and when results are uploaded.", - "description": "List events for the fine-tune job specified by the given fineTuneId.\nEvents are created when the job status changes, e.g. running or\ncomplete, and when results are uploaded.", - "parameters": [ - { - "name": "fineTuneId", - "in": "path", - "required": true, - "description": "fine tune id for which to get events", - "type": "string" - }, - { - "name": "stream", - "in": "query", - "required": true, - "description": "A flag indicating whether to stream events for the fine-tune job. If set to true,\nevents will be sent as data-only server-sent events as they become available. The stream will terminate with\na data: [DONE] message when the job is finished (succeeded, cancelled, or failed).\nIf set to false, only events generated so far will be returned..", - "type": "boolean" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/EventList" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/models": { - "get": { - "operationId": "Models_List", - "summary": "Gets a list of all models that are accessible by the Azure OpenAI\nresource.\nThese include base models as well as all successfully completed\nfine-tuned models owned by the Azure OpenAI resource.", - "description": "Gets a list of all models that are accessible by the Azure OpenAI\nresource.\nThese include base models as well as all successfully completed\nfine-tuned models owned by the Azure OpenAI resource.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/ModelList" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/models/{model_id}": { - "get": { - "operationId": "Models_Get", - "summary": "Gets details for the model specified by the given model_id.", - "description": "Gets details for the model specified by the given model_id.", - "parameters": [ - { - "name": "model_id", - "in": "path", - "required": true, - "description": "The identity of this item.", - "type": "string" - }, - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/Model" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - } - }, - "definitions": { - "AcceptedResponse": { - "type": "object", - "properties": {}, - "description": "Accepted Response" - }, - "Azure.Core.Foundations.Error": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "One of a server-defined set of error codes." - }, - "message": { - "type": "string", - "description": "A human-readable representation of the error." - }, - "target": { - "type": "string", - "description": "The target of the error." - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/Azure.Core.Foundations.Error" - }, - "x-ms-identifiers": [], - "x-cadl-name": "Azure.Core.Foundations.Error[]", - "description": "An array of details about specific errors that led to this reported error." - }, - "innererror": { - "$ref": "#/definitions/Azure.Core.Foundations.InnerError", - "description": "An object containing more specific information than the current object about the error." - } - }, - "description": "The error object.", - "required": [ - "code", - "message", - "details" - ] - }, - "Azure.Core.Foundations.ErrorResponse": { - "type": "object", - "properties": { - "error": { - "$ref": "#/definitions/Azure.Core.Foundations.Error", - "description": "The error object." - } - }, - "description": "A response containing error details.", - "required": [ - "error" - ] - }, - "Azure.Core.Foundations.InnerError": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "One of a server-defined set of error codes." - }, - "innererror": { - "$ref": "#/definitions/Azure.Core.Foundations.InnerError", - "description": "Inner error." - } - }, - "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", - "required": [ - "code" - ] - }, - "Capabilities": { - "type": "object", - "properties": { - "fineTune": { - "type": "boolean", - "description": "A value indicating whether a model can be used for fine tuning.", - "readOnly": true - }, - "inference": { - "type": "boolean", - "description": "A value indicating whether a model can be deployed.", - "readOnly": true - }, - "completion": { - "type": "boolean", - "description": "A value indicating whether a model supports completion.", - "readOnly": true - }, - "embeddings": { - "type": "boolean", - "description": "A value indicating whether a model supports embeddings.", - "readOnly": true - }, - "scaleTypes": { - "type": "array", - "items": { - "$ref": "#/definitions/ScaleType" - }, - "x-cadl-name": "ScaleType[]", - "description": "The supported scale types for deployments of this model.", - "readOnly": true - } - }, - "description": "The capabilities of a base or fine tune model." - }, - "Deployment": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/State", - "description": "The state of a job or item.", - "readOnly": true - }, - "createdAt": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was created (in unix epochs).", - "readOnly": true - }, - "updatedAt": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was modified last (in unix epochs).", - "readOnly": true - }, - "id": { - "type": "string", - "description": "The identifier of the deployment", - "readOnly": true - }, - "model": { - "type": "string", - "description": "The OpenAI model to deploy. Can be a base model or a fine tune." - }, - "owner": { - "type": "string", - "description": "The owner of this deployment. For Azure OpenAI only \"organization-owner\" is\nsupported.", - "readOnly": true - }, - "scaleSettings": { - "$ref": "#/definitions/ScaleSettings", - "description": "The scale settings of a deployment. It defines the modes for scaling and the\nreserved capacity." - } - }, - "description": "Deployments manage the reserved quota for Azure OpenAI models and make them\navailable for inference requests.", - "required": [ - "id", - "scaleSettings" - ] - }, - "DeploymentList": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Deployment" - }, - "x-cadl-name": "Deployment[]", - "description": "The list of items.", - "readOnly": true - } - }, - "description": "Represents a list of deployments." - }, - "DeploymentUpdate": { - "type": "object", - "properties": { - "model": { - "type": "string", - "description": "The new OpenAI model to be used for this deployment. Can be a base model or a\nfine tune." - }, - "scaleSettings": { - "$ref": "#/definitions/ScaleSettingsUpdate", - "description": "The scale settings of a deployment. It defines the modes for scaling and the\nreserved capacity." - } - }, - "description": "Defines changes to the deployment." - }, - "Deprecation": { - "type": "object", - "properties": { - "fineTuneEndDate": { - "type": "integer", - "format": "int32", - "description": "The end date of fine tune support of this model. Will be `null` for fine tune\nmodels.", - "readOnly": true - }, - "inference": { - "type": "integer", - "format": "int32", - "description": "The end date of inference support of this model.", - "readOnly": true - } - }, - "description": "Defines the dates of deprecation for the different use cases of a\nmodel.\nUsually base models support 1 year of fine tuning after creation.\nInference is typically supported 2 years after creation of base or\nfine tuned\nmodels. The exact dates are specified in the properties." - }, - "Error": { - "type": "object", - "properties": { - "code": { - "$ref": "#/definitions/ErrorCode", - "description": "Error codes as defined in the Microsoft REST guidelines\n(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses)." - }, - "message": { - "type": "string", - "description": "The message of this error." - }, - "target": { - "type": "string", - "description": "The location where the error happened if available." - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/Error" - }, - "x-ms-identifiers": [], - "x-cadl-name": "Error[]", - "description": "The error details if available." - }, - "innererror": { - "$ref": "#/definitions/InnerError", - "description": "Inner error as defined in the Microsoft REST guidelines\n(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses)." - } - }, - "description": "Error content as defined in the Microsoft REST guidelines\n(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses).", - "required": [ - "code", - "message" - ] - }, - "ErrorCode": { - "type": "string", - "enum": [ - "conflict", - "invalidPayload", - "forbidden", - "notFound", - "unexpectedEntityState", - "itemDoesAlreadyExist", - "serviceUnavailable", - "internalFailure", - "quotaExceeded" - ], - "x-ms-enum": { - "name": "ErrorCode", - "modelAsString": true, - "values": [ - { - "name": "Conflict", - "value": "conflict" - }, - { - "name": "InvalidPayload", - "value": "invalidPayload" - }, - { - "name": "Forbidden", - "value": "forbidden" - }, - { - "name": "NotFound", - "value": "notFound" - }, - { - "name": "UnexpectedEntityState", - "value": "unexpectedEntityState" - }, - { - "name": "ItemDoesAlreadyExist", - "value": "itemDoesAlreadyExist" - }, - { - "name": "ServiceUnavailable", - "value": "serviceUnavailable" - }, - { - "name": "InternalFailure", - "value": "internalFailure" - }, - { - "name": "QuotaExceeded", - "value": "quotaExceeded" - } - ] - } - }, - "ErrorCodeKnownValues": { - "type": "string", - "enum": [ - "conflict", - "invalidPayload", - "forbidden", - "notFound", - "unexpectedEntityState", - "itemDoesAlreadyExist", - "serviceUnavailable", - "internalFailure", - "quotaExceeded" - ], - "x-ms-enum": { - "name": "ErrorCodeKnownValues", - "modelAsString": false, - "values": [ - { - "name": "Conflict", - "value": "conflict" - }, - { - "name": "InvalidPayload", - "value": "invalidPayload" - }, - { - "name": "Forbidden", - "value": "forbidden" - }, - { - "name": "NotFound", - "value": "notFound" - }, - { - "name": "UnexpectedEntityState", - "value": "unexpectedEntityState" - }, - { - "name": "ItemDoesAlreadyExist", - "value": "itemDoesAlreadyExist" - }, - { - "name": "ServiceUnavailable", - "value": "serviceUnavailable" - }, - { - "name": "InternalFailure", - "value": "internalFailure" - }, - { - "name": "QuotaExceeded", - "value": "quotaExceeded" - } - ] - } - }, - "ErrorResponse": { - "type": "object", - "properties": { - "error": { - "$ref": "#/definitions/Error", - "description": "Error content as defined in the Microsoft REST guidelines\n(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses)." - } - }, - "description": "Error response as defined in the Microsoft REST guidelines\n(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses)." - }, - "Event": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "createdAt": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this event was created (in unix epochs).", - "readOnly": true - }, - "level": { - "$ref": "#/definitions/LogLevel", - "description": "The verbosity level of an event.", - "readOnly": true - }, - "message": { - "type": "string", - "description": "The message describing the event. This can be a change of state, e.g.,\nenqueued, started, failed or completed, or other events like uploaded results.", - "readOnly": true - } - }, - "description": "Event" - }, - "EventList": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Event" - }, - "x-ms-identifiers": [], - "x-cadl-name": "Event[]", - "description": "The list of items.", - "readOnly": true - } - }, - "description": "Represents a list of events." - }, - "File": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/State", - "description": "The state of a job or item.", - "readOnly": true - }, - "createdAt": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was created (in unix epochs).", - "readOnly": true - }, - "updatedAt": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was modified last (in unix epochs).", - "readOnly": true - }, - "id": { - "type": "string", - "description": "The identity of this item.", - "readOnly": true - }, - "bytes": { - "type": "integer", - "format": "int32", - "description": "The size of this file when available (can be null). File sizes larger than\n2^53-1 are not supported to ensure compatibility\nwith JavaScript integers.", - "readOnly": true - }, - "purpose": { - "$ref": "#/definitions/Purpose", - "description": "The intended purpose of the uploaded documents. Use \"fine-tune\" for\nfine-tuning. This allows us to validate the format of the uploaded file." - }, - "filename": { - "type": "string", - "description": "The name of the file." - } - }, - "description": "A file is a document usable for training and validation. It can also be a\nservice generated document with result details.", - "required": [ - "id", - "purpose", - "filename" - ] - }, - "FileContent": { - "type": "object", - "properties": { - "purpose": { - "$ref": "#/definitions/Purpose", - "description": "The intended purpose of the uploaded documents. Use \"fine-tune\" for\nfine-tuning. This allows us to validate the format of the uploaded file." - }, - "file": { - "type": "string", - "format": "byte", - "description": "Gets or sets the file to upload into Azure OpenAI." - } - }, - "description": "content of uploaded file", - "required": [ - "purpose", - "file" - ] - }, - "FileImport": { - "type": "object", - "properties": { - "purpose": { - "$ref": "#/definitions/Purpose", - "description": "The intended purpose of the uploaded documents. Use \"fine-tune\" for\nfine-tuning. This allows us to validate the format of the uploaded file." - }, - "filename": { - "type": "string", - "description": "The name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file\nto be uploaded.\nIf the `purpose` is set to \"fine-tune\", each line is a JSON\nrecord with \"prompt\" and \"completion\" fields representing your training\nexamples." - }, - "content_url": { - "type": "string", - "description": "The url to download the document from (can be SAS url of a blob or any other\nexternal url accessible with a GET request)." - } - }, - "description": "Defines a document to import from an external content url to be usable with\nAzure OpenAI.", - "required": [ - "purpose", - "filename", - "content_url" - ] - }, - "FileList": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/File" - }, - "x-cadl-name": "File[]", - "description": "The list of items.", - "readOnly": true - } - }, - "description": "Represents a list of files." - }, - "FineTune": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/State", - "description": "The state of a job or item.", - "readOnly": true - }, - "createdAt": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was created (in unix epochs).", - "readOnly": true - }, - "updatedAt": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was modified last (in unix epochs).", - "readOnly": true - }, - "id": { - "type": "string", - "description": "The identity of this item.", - "readOnly": true - }, - "model": { - "type": "string", - "description": "The identifier of the base model used for the fine-tune." - }, - "fine_tuned_model": { - "type": "string", - "description": "The identifier of the resulting fine tuned model. This property is only\npopulated for successfully completed fine-tune runs.\nUse this identifier to\ncreate a deployment for inferencing.", - "readOnly": true - }, - "training_files": { - "type": "array", - "items": { - "$ref": "#/definitions/File" - }, - "x-cadl-name": "File[]", - "description": "The files that are used for training the fine tuned model." - }, - "validation_files": { - "type": "array", - "items": { - "$ref": "#/definitions/File" - }, - "x-cadl-name": "File[]", - "description": "The files that are used to evaluate the fine tuned model during training." - }, - "result_files": { - "type": "array", - "items": { - "$ref": "#/definitions/File" - }, - "x-cadl-name": "File[]", - "description": "The result files containing training and evaluation metrics in csv format.\nThe\nfile is only available for successfully completed fine-tune runs.", - "readOnly": true - }, - "events": { - "type": "array", - "items": { - "$ref": "#/definitions/Event" - }, - "x-ms-identifiers": [], - "x-cadl-name": "Event[]", - "description": "The events that show the progress of the fine-tune run including queued,\nrunning and completed.", - "readOnly": true - }, - "organisation_id": { - "type": "string", - "description": "The organisation id of this fine tune job. Unused on Azure OpenAI;\ncompatibility for OpenAI only.", - "readOnly": true - }, - "user_id": { - "type": "string", - "description": "The user id of this fine tune job. Unused on Azure OpenAI; compatibility for\nOpenAI only.", - "readOnly": true - }, - "hyperparams": { - "$ref": "#/definitions/HyperParameters", - "description": "The hyper parameter settings used in a fine tune job." - } - }, - "description": "Fine tuning is a job to tailor a model to specific training data.", - "required": [ - "id", - "model", - "training_files" - ] - }, - "FineTuneCreation": { - "type": "object", - "properties": { - "model": { - "type": "string", - "description": "The identifier of the base model used for this fine-tune." - }, - "training_file": { - "type": "string", - "description": "The file that is used for training this fine tuned model." - }, - "validation_file": { - "type": "string", - "description": "The file that is used to evaluate the fine tuned model during training." - }, - "hyperparams": { - "$ref": "#/definitions/HyperParameters", - "description": "The hyper parameter settings used in a fine tune job." - } - }, - "description": "Defines the values of a fine tune job.", - "required": [ - "model", - "training_file" - ] - }, - "FineTuneList": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/FineTune" - }, - "x-cadl-name": "FineTune[]", - "description": "The list of items.", - "readOnly": true - } - }, - "description": "Represents a list of fine tunes." - }, - "HyperParameters": { - "type": "object", - "properties": { - "batch_size": { - "type": "integer", - "format": "int32", - "description": "The batch size to use for training. The batch size is the number of training\nexamples used to train a single forward and backward pass.\nIn general, we've\nfound that larger batch sizes tend to work better for larger datasets.\nThe\ndefault value as well as the maximum value for this property are specific to a\nbase model." - }, - "learning_rate_multiplier": { - "type": "number", - "format": "float", - "description": "The learning rate multiplier to use for training. The fine-tuning learning rate\nis the original learning rate used for pre-training multiplied by this\nvalue.\nLarger learning rates tend to perform better with larger batch\nsizes.\nWe recommend experimenting with values in the range 0.02 to 0.2 to see\nwhat produces the best results." - }, - "n_epochs": { - "type": "integer", - "format": "int32", - "description": "The number of epochs to train the model for. An epoch refers to one full cycle\nthrough the training dataset." - }, - "prompt_loss_weight": { - "type": "number", - "format": "float", - "description": "The weight to use for loss on the prompt tokens. This controls how much the\nmodel tries to learn to generate the prompt\n(as compared to the completion\nwhich always has a weight of 1.0), and can add a stabilizing effect to training\nwhen completions are short.\nIf prompts are extremely long (relative to\ncompletions), it may make sense to reduce this weight so as to avoid\nover-prioritizing learning the prompt." - }, - "compute_classification_metrics": { - "type": "boolean", - "description": "A value indicating whether to compute classification metrics.\nIf set, we\ncalculate classification-specific metrics such as accuracy and F-1 score using\nthe validation set at the end of every epoch.\nThese metrics can be viewed in\nthe results file. In order to compute classification metrics, you must provide\na validation_file.Additionally,\nyou must specify classification_n_classes for\nmulticlass classification or classification_positive_class for binary\nclassification." - }, - "classification_n_classes": { - "type": "integer", - "format": "int32", - "description": "The number of classes in a classification task.\nThis parameter is required for\nmulticlass classification." - }, - "classification_positive_class": { - "type": "string", - "description": "The positive class in binary classification.\nThis parameter is needed to\ngenerate precision, recall, and F1 metrics when doing binary classification." - }, - "classification_betas": { - "type": "array", - "items": { - "type": "number", - "format": "float" - }, - "x-cadl-name": "float32[]", - "description": "The classification beta values. If this is provided, we calculate F-beta scores\nat the specified beta values.\nThe F-beta score is a generalization of F-1\nscore. This is only used for binary classification.\nWith a beta of 1 (i.e.the\nF-1 score), precision and recall are given the same weight.\nA larger beta\nscore puts more weight on recall and less on precision. A smaller beta score\nputs more weight on precision and less on recall." - } - }, - "description": "The hyper parameter settings used in a fine tune job." - }, - "InnerError": { - "type": "object", - "properties": { - "code": { - "$ref": "#/definitions/InnerErrorCode", - "description": "Inner error codes as defined in the Microsoft REST guidelines\n(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses)." - }, - "innererror": { - "$ref": "#/definitions/InnerError", - "description": "Inner error as defined in the Microsoft REST guidelines\n(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses)." - } - }, - "description": "Inner error as defined in the Microsoft REST guidelines\n(https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses)." - }, - "InnerErrorCode": { - "type": "string", - "enum": [ - "invalidPayload" - ], - "x-ms-enum": { - "name": "InnerErrorCode", - "modelAsString": true, - "values": [ - { - "name": "InvalidPayload", - "value": "invalidPayload" - } - ] - } - }, - "InnerErrorCodeKnownValues": { - "type": "string", - "enum": [ - "invalidPayload" - ], - "x-ms-enum": { - "name": "InnerErrorCodeKnownValues", - "modelAsString": false, - "values": [ - { - "name": "InvalidPayload", - "value": "invalidPayload" - } - ] - } - }, - "LogLevel": { - "type": "string", - "enum": [ - "info", - "warning", - "error" - ], - "x-ms-enum": { - "name": "LogLevel", - "modelAsString": false, - "values": [ - { - "name": "Info", - "value": "info" - }, - { - "name": "Warning", - "value": "warning" - }, - { - "name": "Error", - "value": "error" - } - ] - } - }, - "ManualScaleSettings": { - "type": "object", - "properties": { - "capacity": { - "type": "integer", - "format": "int32", - "description": "The constant reserved capacity of the inference endpoint for this deployment." - } - }, - "description": "Settings for the manual scale type.", - "required": [ - "capacity" - ], - "allOf": [ - { - "$ref": "#/definitions/ScaleSettings" - } - ], - "x-ms-discriminator-value": "manual" - }, - "ManualScaleSettingsUpdate": { - "type": "object", - "properties": { - "capacity": { - "type": "integer", - "format": "int32", - "description": "The constant reserved capacity of the inference endpoint for this deployment." - } - }, - "description": "Settings for the manual scale type.", - "allOf": [ - { - "$ref": "#/definitions/ScaleSettingsUpdate" - } - ], - "x-ms-discriminator-value": "manual" - }, - "Model": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/State", - "description": "The state of a job or item.", - "readOnly": true - }, - "createdAt": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was created (in unix epochs).", - "readOnly": true - }, - "updatedAt": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was modified last (in unix epochs).", - "readOnly": true - }, - "id": { - "type": "string", - "description": "The identity of this item.", - "readOnly": true - }, - "model": { - "type": "string", - "description": "The base model ID if this is a fine tune model; otherwise `null`.", - "readOnly": true - }, - "fineTuneId": { - "type": "string", - "description": "The fine tune job ID if this is a fine tune model; otherwise `null`.", - "readOnly": true - }, - "capabilities": { - "$ref": "#/definitions/Capabilities", - "description": "The capabilities of a base or fine tune model." - }, - "deprecation": { - "$ref": "#/definitions/Deprecation", - "description": "Defines the dates of deprecation for the different use cases of a\nmodel.\nUsually base models support 1 year of fine tuning after creation.\nInference is typically supported 2 years after creation of base or\nfine tuned\nmodels. The exact dates are specified in the properties." - } - }, - "description": "A model is either a base model or the result of a successful fine tune job.", - "required": [ - "id" - ] - }, - "ModelList": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Model" - }, - "x-cadl-name": "Model[]", - "description": "The list of items.", - "readOnly": true - } - }, - "description": "Represents a list of models." - }, - "Purpose": { - "type": "string", - "enum": [ - "fine-tune", - "fine-tune-results" - ], - "x-ms-enum": { - "name": "Purpose", - "modelAsString": true, - "values": [ - { - "name": "FineTune", - "value": "fine-tune" - }, - { - "name": "FineTuneResults", - "value": "fine-tune-results" - } - ] - } - }, - "PurposeKnownValues": { - "type": "string", - "enum": [ - "fine-tune", - "fine-tune-results" - ], - "x-ms-enum": { - "name": "PurposeKnownValues", - "modelAsString": false, - "values": [ - { - "name": "FineTune", - "value": "fine-tune" - }, - { - "name": "FineTuneResults", - "value": "fine-tune-results" - } - ] - } - }, - "ScaleSettings": { - "type": "object", - "properties": { - "scaleType": { - "type": "string", - "description": "Discriminator property for ScaleSettings." - } - }, - "description": "The scale settings of a deployment. It defines the modes for scaling and the\nreserved capacity.", - "discriminator": "scaleType", - "required": [ - "scaleType" - ] - }, - "ScaleSettingsUpdate": { - "type": "object", - "properties": { - "scaleType": { - "type": "string", - "description": "Discriminator property for ScaleSettingsUpdate." - } - }, - "description": "The scale settings of a deployment. It defines the modes for scaling and the\nreserved capacity.", - "discriminator": "scaleType", - "required": [ - "scaleType" - ] - }, - "ScaleType": { - "type": "string", - "enum": [ - "manual", - "standard" - ], - "x-ms-enum": { - "name": "ScaleType", - "modelAsString": true, - "values": [ - { - "name": "Manual", - "value": "manual" - }, - { - "name": "Standard", - "value": "standard" - } - ] - } - }, - "ScaleTypeKnownValues": { - "type": "string", - "enum": [ - "manual", - "standard" - ], - "x-ms-enum": { - "name": "ScaleTypeKnownValues", - "modelAsString": false, - "values": [ - { - "name": "Manual", - "value": "manual" - }, - { - "name": "Standard", - "value": "standard" - } - ] - } - }, - "StandardScaleSettings": { - "type": "object", - "properties": {}, - "description": "Settings for the standard scale type.", - "allOf": [ - { - "$ref": "#/definitions/ScaleSettings" - } - ], - "x-ms-discriminator-value": "standard" - }, - "State": { - "type": "string", - "enum": [ - "notRunning", - "running", - "succeeded", - "canceled", - "failed", - "deleted" - ], - "x-ms-enum": { - "name": "State", - "modelAsString": false, - "values": [ - { - "name": "NotRunning", - "value": "notRunning" - }, - { - "name": "Running", - "value": "running" - }, - { - "name": "Succeeded", - "value": "succeeded" - }, - { - "name": "Canceled", - "value": "canceled" - }, - { - "name": "Failed", - "value": "failed" - }, - { - "name": "Deleted", - "value": "deleted" - } - ] - } - }, - "TypeDiscriminator": { - "type": "string", - "enum": [ - "list", - "fine-tune", - "file", - "fine-tune-event", - "model", - "deployment" - ], - "x-ms-enum": { - "name": "TypeDiscriminator", - "modelAsString": true, - "values": [ - { - "name": "List", - "value": "list" - }, - { - "name": "FineTune", - "value": "fine-tune" - }, - { - "name": "File", - "value": "file" - }, - { - "name": "FineTuneEvent", - "value": "fine-tune-event" - }, - { - "name": "Model", - "value": "model" - }, - { - "name": "Deployment", - "value": "deployment" - } - ] - } - }, - "TypeDiscriminatorKnownValues": { - "type": "string", - "enum": [ - "list", - "fine-tune", - "file", - "fine-tune-event", - "model", - "deployment" - ], - "x-ms-enum": { - "name": "TypeDiscriminatorKnownValues", - "modelAsString": false, - "values": [ - { - "name": "List", - "value": "list" - }, - { - "name": "FineTune", - "value": "fine-tune" - }, - { - "name": "File", - "value": "file" - }, - { - "name": "FineTuneEvent", - "value": "fine-tune-event" - }, - { - "name": "Model", - "value": "model" - }, - { - "name": "Deployment", - "value": "deployment" - } - ] - } - } - }, - "parameters": { - "Azure.Core.Foundations.ApiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "description": "The API version to use for this operation.", - "minLength": 1, - "type": "string", - "x-ms-parameter-location": "method" - } - } -} From b8d468411815598ec1a2d66dd5619813b7716fb8 Mon Sep 17 00:00:00 2001 From: Mark Cowlishaw Date: Tue, 16 May 2023 17:05:38 -0700 Subject: [PATCH 3/3] Removing TypeSpec files for OpenAI.Authoring --- .../2022-06-01-preview/openapi.json | 1911 ----------------- .../OpenAI.Authoring/common.tsp | 104 - .../OpenAI.Authoring/deployment.tsp | 44 - .../OpenAI.Authoring/file.tsp | 104 - .../OpenAI.Authoring/finetune.tsp | 115 - .../OpenAI.Authoring/main.tsp | 45 - .../OpenAI.Authoring/model.routes.tsp | 35 - .../models/deployment.models.tsp | 61 - .../OpenAI.Authoring/models/file.models.tsp | 95 - .../models/finetune.models.tsp | 224 -- .../OpenAI.Authoring/models/model.models.tsp | 123 -- .../serviceCustomizations.tsp | 16 - .../OpenAI.Authoring/swagger-to-cadl.sh | 3 - .../OpenAI.Authoring/tspconfig.yaml | 20 - 14 files changed, 2900 deletions(-) delete mode 100644 specification/cognitiveservices/OpenAI.Authoring/cadl-output/2022-06-01-preview/openapi.json delete mode 100644 specification/cognitiveservices/OpenAI.Authoring/common.tsp delete mode 100644 specification/cognitiveservices/OpenAI.Authoring/deployment.tsp delete mode 100644 specification/cognitiveservices/OpenAI.Authoring/file.tsp delete mode 100644 specification/cognitiveservices/OpenAI.Authoring/finetune.tsp delete mode 100644 specification/cognitiveservices/OpenAI.Authoring/main.tsp delete mode 100644 specification/cognitiveservices/OpenAI.Authoring/model.routes.tsp delete mode 100644 specification/cognitiveservices/OpenAI.Authoring/models/deployment.models.tsp delete mode 100644 specification/cognitiveservices/OpenAI.Authoring/models/file.models.tsp delete mode 100644 specification/cognitiveservices/OpenAI.Authoring/models/finetune.models.tsp delete mode 100644 specification/cognitiveservices/OpenAI.Authoring/models/model.models.tsp delete mode 100644 specification/cognitiveservices/OpenAI.Authoring/serviceCustomizations.tsp delete mode 100644 specification/cognitiveservices/OpenAI.Authoring/swagger-to-cadl.sh delete mode 100644 specification/cognitiveservices/OpenAI.Authoring/tspconfig.yaml diff --git a/specification/cognitiveservices/OpenAI.Authoring/cadl-output/2022-06-01-preview/openapi.json b/specification/cognitiveservices/OpenAI.Authoring/cadl-output/2022-06-01-preview/openapi.json deleted file mode 100644 index 97af6badf8c6..000000000000 --- a/specification/cognitiveservices/OpenAI.Authoring/cadl-output/2022-06-01-preview/openapi.json +++ /dev/null @@ -1,1911 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Azure OpenAI API", - "version": "2022-06-01-preview", - "description": "API for managing and utilizing Azure Open AI endpoints", - "x-typespec-generated": [ - { - "emitter": "@azure-tools/typespec-autorest" - } - ] - }, - "schemes": [ - "https" - ], - "x-ms-parameterized-host": { - "hostTemplate": "{endpoint}/openai", - "useSchemePrefix": false, - "parameters": [ - { - "name": "endpoint", - "in": "path", - "required": true, - "description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).", - "type": "string" - } - ] - }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "security": [ - { - "ApiKeyAuth": [] - }, - { - "OAuth2Auth": [ - "https://cognitiveservices.azure.com/.default" - ] - } - ], - "securityDefinitions": { - "ApiKeyAuth": { - "type": "apiKey", - "in": "header", - "name": "api-key" - }, - "OAuth2Auth": { - "type": "oauth2", - "flow": "implicit", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", - "scopes": { - "https://cognitiveservices.azure.com/.default": "" - } - } - }, - "tags": [], - "paths": { - "/deployments": { - "get": { - "operationId": "Deployments_ListDeployments", - "summary": "Gets the list of deployments owned by the Azure OpenAI resource.", - "description": "Gets the list of deployments owned by the Azure OpenAI resource.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/DeploymentList" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - }, - "post": { - "operationId": "Deployments_CreateDeployment", - "summary": "Creates a new deployment for the Azure OpenAI resource according to the given\nspecification.", - "description": "Creates a new deployment for the Azure OpenAI resource according to the given\nspecification.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "resource", - "in": "body", - "required": true, - "description": "The resource instance.", - "schema": { - "$ref": "#/definitions/Deployment" - } - } - ], - "responses": { - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "headers": { - "Location": { - "description": "The location of an instance of Deployment", - "type": "string", - "format": "uri" - } - }, - "schema": { - "$ref": "#/definitions/Deployment" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/deployments/{deploymentId}": { - "get": { - "operationId": "Deployments_GetDeployment", - "summary": "Gets details for a single deployment specified by the given deployment_id.", - "description": "Gets details for a single deployment specified by the given deployment_id.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "deploymentId", - "in": "path", - "required": true, - "description": "The identifier of the deployment", - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/Deployment" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - }, - "patch": { - "operationId": "Deployments_UpdateDeployment", - "summary": "Updates the mutable details of the deployment with the given deployment_id.", - "description": "Updates the mutable details of the deployment with the given deployment_id.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "deploymentId", - "in": "path", - "required": true, - "description": "The identifier of the deployment", - "type": "string" - }, - { - "name": "resource", - "in": "body", - "required": true, - "description": "The resource instance.", - "schema": { - "$ref": "#/definitions/DeploymentUpdate" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/Deployment" - } - }, - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "schema": { - "$ref": "#/definitions/Deployment" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - }, - "consumes": [ - "application/merge-patch+json" - ] - }, - "delete": { - "operationId": "Deployments_DeleteDeployment", - "summary": "Deletes the deployment specified by the given deployment_id.", - "description": "Deletes the deployment specified by the given deployment_id.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "deploymentId", - "in": "path", - "required": true, - "description": "The identifier of the deployment", - "type": "string" - } - ], - "responses": { - "204": { - "description": "There is no content to send for this request, but the headers may be useful. " - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/files": { - "get": { - "operationId": "Files_ListFiles", - "summary": "Gets a list of all files owned by the Azure OpenAI resource.\nThese include user uploaded content like files with purpose \"fine-tune\" for training or\nvalidation of fine-tunes models as well as files that are generated by the\nservice such as \"fine-tune-results\" which contains various metrics for the\ncorresponding fine-tune job.", - "description": "Gets a list of all files owned by the Azure OpenAI resource.\nThese include user uploaded content like files with purpose \"fine-tune\" for training or\nvalidation of fine-tunes models\nas well as files that are generated by the\nservice such as \"fine-tune-results\" which contains various metrics for the\ncorresponding fine-tune job.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/FileList" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - }, - "post": { - "operationId": "Files_UploadFile", - "summary": "Creates a new file entity by uploading data from a local machine. Uploaded\nfiles can, for example, be used for training or evaluating fine-tuned models.", - "description": "Creates a new file entity by uploading data from a local machine. Uploaded\nfiles can, for example, be used for training or evaluating fine-tuned models.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "resource", - "in": "body", - "required": true, - "description": "The resource instance.", - "schema": { - "$ref": "#/definitions/File" - } - } - ], - "responses": { - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "headers": { - "Location": { - "description": "The location of an instance of File", - "type": "string", - "format": "uri" - } - }, - "schema": { - "$ref": "#/definitions/File" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/files/{fileId}": { - "get": { - "operationId": "Files_GetFile", - "summary": "Gets details for a single file specified by the given file_id including status,\nsize, purpose, etc.", - "description": "Gets details for a single file specified by the given file_id including status,\nsize, purpose, etc.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "fileId", - "in": "path", - "required": true, - "description": "The identity of this item.", - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/File" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - }, - "delete": { - "operationId": "Files_DeleteFile", - "summary": "Deletes the file with the given file_id.\nDeletion is also allowed if a file\nwas used, e.g., as training file in a fine-tune job.", - "description": "Deletes the file with the given file_id.\nDeletion is also allowed if a file\nwas used, e.g., as training file in a fine-tune job.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "fileId", - "in": "path", - "required": true, - "description": "The identity of this item.", - "type": "string" - } - ], - "responses": { - "204": { - "description": "There is no content to send for this request, but the headers may be useful. " - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/files/{fileId}/content": { - "get": { - "operationId": "Files_GetFileContent", - "summary": "Gets the content of the file specified by the given file_id.\nFiles can be user\nuploaded content or generated by the service like result metrics of a fine-tune\njob.", - "description": "Gets the content of the file specified by the given file_id.\nFiles can be user\nuploaded content or generated by the service like result metrics of a fine-tune\njob.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "fileId", - "in": "path", - "required": true, - "description": "The identity of this item.", - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/FileContent" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/files/import": { - "post": { - "operationId": "Files_ImportFile", - "summary": "Creates a new file entity by importing data from a provided url. Uploaded files\ncan, for example, be used for training or evaluating fine-tuned models.", - "description": "Creates a new file entity by importing data from a provided url. Uploaded files\ncan, for example, be used for training or evaluating fine-tuned models.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "body", - "in": "body", - "required": true, - "description": "expected schema for the body of the completion post request", - "schema": { - "$ref": "#/definitions/FileImport" - } - } - ], - "responses": { - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "headers": { - "location": { - "description": "Location of the newly created item", - "type": "string", - "format": "uri" - } - }, - "schema": { - "$ref": "#/definitions/File" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/fine-tunes": { - "get": { - "operationId": "FineTunes_ListFineTunes", - "summary": "Gets a list of all fine-tune jobs owned by the Azure OpenAI resource.\nThe details that are returned for each fine-tune job contain besides its\nidentifier the base model, training and validation files, hyper parameters,\ntime stamps, status and events. Events are created when the job status\nchanges, e.g. running or complete, and when results are uploaded.", - "description": "Gets a list of all fine-tune jobs owned by the Azure OpenAI resource.\nThe details that are returned for each fine-tune job contain besides its\nidentifier the base model, training and validation files, hyper parameters,\ntime stamps, status and events. Events are created when the job status\nchanges, e.g. running or complete, and when results are uploaded.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/FineTuneList" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - }, - "post": { - "operationId": "FineTunes_CreateFineTune", - "summary": "Creates a job that fine-tunes a specified model from a given training\nfile.\nResponse includes details of the enqueued job including job status and\nhyper parameters.\nThe name of the fine-tuned model is added to the response\nonce complete.", - "description": "Creates a job that fine-tunes a specified model from a given training\nfile.\nResponse includes details of the enqueued job including job status and\nhyper parameters.\nThe name of the fine-tuned model is added to the response\nonce complete.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/FineTuneCreation" - } - } - ], - "responses": { - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "headers": { - "location": { - "description": "Location of the newly created item", - "type": "string", - "format": "uri" - } - }, - "schema": { - "$ref": "#/definitions/FineTune" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/fine-tunes/{fineTuneId}": { - "get": { - "operationId": "FineTunes_GetFineTune", - "summary": "Gets details for a single fine-tune job specified by the given\nfine_tune_id.\nThe details contain the base model, training and validation\nfiles, hyper parameters, time stamps, status and events.\nEvents are created\nwhen the job status changes, e.g. running or complete, and when results are\nuploaded.", - "description": "Gets details for a single fine-tune job specified by the given\nfine_tune_id.\nThe details contain the base model, training and validation\nfiles, hyper parameters, time stamps, status and events.\nEvents are created\nwhen the job status changes, e.g. running or complete, and when results are\nuploaded.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "fineTuneId", - "in": "path", - "required": true, - "description": "The identity of this item.", - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/FineTune" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - }, - "delete": { - "operationId": "FineTunes_DeleteFineTune", - "summary": "Deletes the fine-tune job specified by the given fine_tune_id.", - "description": "Deletes the fine-tune job specified by the given fine_tune_id.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "fineTuneId", - "in": "path", - "required": true, - "description": "The identity of this item.", - "type": "string" - } - ], - "responses": { - "204": { - "description": "There is no content to send for this request, but the headers may be useful. " - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/fine-tunes/{fineTuneId}/cancel": { - "post": { - "operationId": "FineTunes_CancelFineTune", - "summary": "Cancels the processing of the fine-tune job specified by the given fine_tune_id.", - "description": "Cancels the processing of the fine-tune job specified by the given fine_tune_id.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "fineTuneId", - "in": "path", - "required": true, - "description": "The identity of this item.", - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/FineTune" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/fine-tunes/{fineTuneId}/listFineTuneEvents": { - "get": { - "operationId": "FineTunes_ListFineTuneEvents", - "summary": "List events for the fine-tune job specified by the given fine_tune_id.\nEvents are created when the job status changes, e.g. running or\ncomplete, and when results are uploaded.", - "description": "List events for the fine-tune job specified by the given fine_tune_id.\nEvents are created when the job status changes, e.g. running or\ncomplete, and when results are uploaded.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "fineTuneId", - "in": "path", - "required": true, - "description": "The identity of this item.", - "type": "string" - }, - { - "name": "stream", - "in": "query", - "required": true, - "description": "A flag indicating whether to stream events for the fine-tune job. If set to true,\nevents will be sent as data-only server-sent events as they become available. The stream will terminate with\na data: [DONE] message when the job is finished (succeeded, cancelled, or failed).\nIf set to false, only events generated so far will be returned..", - "type": "boolean" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/EventList" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/models": { - "get": { - "operationId": "Models_ListModels", - "summary": "Gets a list of all models that are accessible by the Azure OpenAI\nresource.\nThese include base models as well as all successfully completed\nfine-tuned models owned by the Azure OpenAI resource.", - "description": "Gets a list of all models that are accessible by the Azure OpenAI\nresource.\nThese include base models as well as all successfully completed\nfine-tuned models owned by the Azure OpenAI resource.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/ModelList" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - }, - "/models/{model_id}": { - "get": { - "operationId": "Models_GetModel", - "summary": "Gets details for the model specified by the given model_id.", - "description": "Gets details for the model specified by the given model_id.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "model_id", - "in": "path", - "required": true, - "description": "The identity of this item.", - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/Model" - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - } - } - } - } - } - }, - "definitions": { - "Azure.Core.Foundations.Error": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "One of a server-defined set of error codes." - }, - "message": { - "type": "string", - "description": "A human-readable representation of the error." - }, - "target": { - "type": "string", - "description": "The target of the error." - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/Azure.Core.Foundations.Error" - }, - "x-ms-identifiers": [], - "x-typespec-name": "Azure.Core.Foundations.Error[]", - "description": "An array of details about specific errors that led to this reported error." - }, - "innererror": { - "$ref": "#/definitions/Azure.Core.Foundations.InnerError", - "description": "An object containing more specific information than the current object about the error." - } - }, - "description": "The error object.", - "required": [ - "code", - "message", - "details" - ] - }, - "Azure.Core.Foundations.ErrorResponse": { - "type": "object", - "properties": { - "error": { - "$ref": "#/definitions/Azure.Core.Foundations.Error", - "description": "The error object." - } - }, - "description": "A response containing error details.", - "required": [ - "error" - ] - }, - "Azure.Core.Foundations.InnerError": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "One of a server-defined set of error codes." - }, - "innererror": { - "$ref": "#/definitions/Azure.Core.Foundations.InnerError", - "description": "Inner error." - } - }, - "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", - "required": [ - "code" - ] - }, - "Capabilities": { - "type": "object", - "properties": { - "fine_tune": { - "type": "boolean", - "description": "A value indicating whether a model can be used for fine tuning.", - "readOnly": true - }, - "inference": { - "type": "boolean", - "description": "A value indicating whether a model can be deployed.", - "readOnly": true - }, - "completion": { - "type": "boolean", - "description": "A value indicating whether a model supports completion.", - "readOnly": true - }, - "embeddings": { - "type": "boolean", - "description": "A value indicating whether a model supports embeddings.", - "readOnly": true - }, - "scale_types": { - "type": "array", - "items": { - "$ref": "#/definitions/ScaleType" - }, - "x-typespec-name": "ScaleType[]", - "description": "The supported scale types for deployments of this model.", - "readOnly": true - } - }, - "description": "The capabilities of a base or fine tune model." - }, - "CreatedResponse": { - "type": "object", - "properties": {}, - "description": "Created Response" - }, - "Deployment": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/State", - "description": "The state of a job or item.", - "readOnly": true - }, - "created_at": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was created (in unix epochs).", - "readOnly": true - }, - "updated_at": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was modified last (in unix epochs).", - "readOnly": true - }, - "id": { - "type": "string", - "description": "The identifier of the deployment", - "readOnly": true - }, - "model": { - "type": "string", - "description": "The OpenAI model to deploy. Can be a base model or a fine tune." - }, - "owner": { - "type": "string", - "description": "The owner of this deployment. For Azure OpenAI only \"organization-owner\" is\nsupported.", - "readOnly": true - }, - "scale_settings": { - "$ref": "#/definitions/ScaleSettings", - "description": "The scale settings of a deployment. It defines the modes for scaling and the\nreserved capacity." - } - }, - "description": "Deployments manage the reserved quota for Azure OpenAI models and make them\navailable for inference requests.", - "required": [ - "status", - "created_at", - "updated_at", - "id", - "model", - "scale_settings" - ] - }, - "DeploymentList": { - "type": "object", - "properties": { - "object": { - "type": "string", - "enum": [ - "deployment" - ], - "x-ms-enum": { - "modelAsString": false - }, - "description": "Defines the type of this object" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Deployment" - }, - "x-typespec-name": "Deployment[]", - "description": "The list of Deployments" - } - } - }, - "DeploymentUpdate": { - "type": "object", - "properties": { - "model": { - "type": "string", - "description": "The OpenAI model to deploy. Can be a base model or a fine tune." - }, - "scale_settings": { - "$ref": "#/definitions/ScaleSettings", - "description": "The scale settings of a deployment. It defines the modes for scaling and the\nreserved capacity." - } - }, - "description": "Deployments manage the reserved quota for Azure OpenAI models and make them\navailable for inference requests." - }, - "Deprecation": { - "type": "object", - "properties": { - "fine_tune_end_date": { - "type": "integer", - "format": "int32", - "description": "The end date of fine tune support of this model. Will be `null` for fine tune\nmodels.", - "readOnly": true - }, - "inference": { - "type": "integer", - "format": "int32", - "description": "The end date of inference support of this model.", - "readOnly": true - } - }, - "description": "Defines the dates of deprecation for the different use cases of a\nmodel.\nUsually base models support 1 year of fine tuning after creation.\nInference is typically supported 2 years after creation of base or\nfine tuned\nmodels. The exact dates are specified in the properties." - }, - "ErrorCode": { - "type": "string", - "enum": [ - "conflict", - "invalidPayload", - "forbidden", - "notFound", - "unexpectedEntityState", - "itemDoesAlreadyExist", - "serviceUnavailable", - "internalFailure", - "quotaExceeded" - ], - "x-ms-enum": { - "name": "ErrorCode", - "modelAsString": true, - "values": [ - { - "name": "Conflict", - "value": "conflict" - }, - { - "name": "InvalidPayload", - "value": "invalidPayload" - }, - { - "name": "Forbidden", - "value": "forbidden" - }, - { - "name": "NotFound", - "value": "notFound" - }, - { - "name": "UnexpectedEntityState", - "value": "unexpectedEntityState" - }, - { - "name": "ItemDoesAlreadyExist", - "value": "itemDoesAlreadyExist" - }, - { - "name": "ServiceUnavailable", - "value": "serviceUnavailable" - }, - { - "name": "InternalFailure", - "value": "internalFailure" - }, - { - "name": "QuotaExceeded", - "value": "quotaExceeded" - } - ] - } - }, - "ErrorCodeKnownValues": { - "type": "string", - "enum": [ - "conflict", - "invalidPayload", - "forbidden", - "notFound", - "unexpectedEntityState", - "itemDoesAlreadyExist", - "serviceUnavailable", - "internalFailure", - "quotaExceeded" - ], - "x-ms-enum": { - "name": "ErrorCodeKnownValues", - "modelAsString": true, - "values": [ - { - "name": "Conflict", - "value": "conflict" - }, - { - "name": "InvalidPayload", - "value": "invalidPayload" - }, - { - "name": "Forbidden", - "value": "forbidden" - }, - { - "name": "NotFound", - "value": "notFound" - }, - { - "name": "UnexpectedEntityState", - "value": "unexpectedEntityState" - }, - { - "name": "ItemDoesAlreadyExist", - "value": "itemDoesAlreadyExist" - }, - { - "name": "ServiceUnavailable", - "value": "serviceUnavailable" - }, - { - "name": "InternalFailure", - "value": "internalFailure" - }, - { - "name": "QuotaExceeded", - "value": "quotaExceeded" - } - ] - } - }, - "Event": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "created_at": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this event was created (in unix epochs).", - "readOnly": true - }, - "level": { - "$ref": "#/definitions/LogLevel", - "description": "The verbosity level of an event.", - "readOnly": true - }, - "message": { - "type": "string", - "description": "The message describing the event. This can be a change of state, e.g.,\nenqueued, started, failed or completed, or other events like uploaded results.", - "readOnly": true - } - }, - "description": "Event" - }, - "EventList": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of this object" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Event" - }, - "x-ms-identifiers": [], - "x-typespec-name": "Event[]", - "description": "The list of Events" - } - } - }, - "File": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/State", - "description": "The state of a job or item.", - "readOnly": true - }, - "created_at": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was created (in unix epochs).", - "readOnly": true - }, - "updated_at": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was modified last (in unix epochs).", - "readOnly": true - }, - "id": { - "type": "string", - "description": "The identity of this item.", - "readOnly": true - }, - "bytes": { - "type": "integer", - "format": "int32", - "description": "The size of this file when available (can be null). File sizes larger than\n2^53-1 are not supported to ensure compatibility\nwith JavaScript integers.", - "readOnly": true - }, - "purpose": { - "$ref": "#/definitions/Purpose", - "description": "The intended purpose of the uploaded documents. Use \"fine-tune\" for\nfine-tuning. This allows us to validate the format of the uploaded file." - }, - "filename": { - "type": "string", - "description": "The name of the file." - } - }, - "description": "A file is a document usable for training and validation. It can also be a\nservice generated document with result details.", - "required": [ - "id", - "purpose", - "filename" - ] - }, - "FileContent": { - "type": "object", - "properties": { - "purpose": { - "$ref": "#/definitions/Purpose", - "description": "The intended purpose of the uploaded documents. Use \"fine-tune\" for\nfine-tuning. This allows us to validate the format of the uploaded file." - }, - "file": { - "type": "string", - "format": "byte", - "description": "Gets or sets the file to upload into Azure OpenAI." - } - }, - "description": "content of uploaded file", - "required": [ - "purpose", - "file" - ] - }, - "FileImport": { - "type": "object", - "properties": { - "purpose": { - "$ref": "#/definitions/Purpose", - "description": "The intended purpose of the uploaded documents. Use \"fine-tune\" for\nfine-tuning. This allows us to validate the format of the uploaded file." - }, - "filename": { - "type": "string", - "description": "The name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file\nto be uploaded.\nIf the `purpose` is set to \"fine-tune\", each line is a JSON\nrecord with \"prompt\" and \"completion\" fields representing your training\nexamples." - }, - "content_url": { - "type": "string", - "description": "The url to download the document from (can be SAS url of a blob or any other\nexternal url accessible with a GET request)." - } - }, - "description": "Defines a document to import from an external content url to be usable with\nAzure OpenAI.", - "required": [ - "purpose", - "filename", - "content_url" - ] - }, - "FileList": { - "type": "object", - "properties": { - "object": { - "type": "string", - "enum": [ - "file" - ], - "x-ms-enum": { - "modelAsString": false - }, - "description": "Defines the type of this object" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/File" - }, - "x-typespec-name": "File[]", - "description": "The list of Files" - } - } - }, - "FineTune": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/State", - "description": "The state of a job or item.", - "readOnly": true - }, - "created_at": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was created (in unix epochs).", - "readOnly": true - }, - "updated_at": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was modified last (in unix epochs).", - "readOnly": true - }, - "id": { - "type": "string", - "description": "The identity of this item.", - "readOnly": true - }, - "model": { - "type": "string", - "description": "The identifier of the base model used for the fine-tune." - }, - "fine_tuned_model": { - "type": "string", - "description": "The identifier of the resulting fine tuned model. This property is only\npopulated for successfully completed fine-tune runs.\nUse this identifier to\ncreate a deployment for inferencing.", - "readOnly": true - }, - "training_files": { - "type": "array", - "items": { - "$ref": "#/definitions/File" - }, - "x-typespec-name": "File[]", - "description": "The files that are used for training the fine tuned model." - }, - "validation_files": { - "type": "array", - "items": { - "$ref": "#/definitions/File" - }, - "x-typespec-name": "File[]", - "description": "The files that are used to evaluate the fine tuned model during training." - }, - "result_files": { - "type": "array", - "items": { - "$ref": "#/definitions/File" - }, - "x-typespec-name": "File[]", - "description": "The result files containing training and evaluation metrics in csv format.\nThe\nfile is only available for successfully completed fine-tune runs.", - "readOnly": true - }, - "events": { - "type": "array", - "items": { - "$ref": "#/definitions/Event" - }, - "x-ms-identifiers": [], - "x-typespec-name": "Event[]", - "description": "The events that show the progress of the fine-tune run including queued,\nrunning and completed.", - "readOnly": true - }, - "organisation_id": { - "type": "string", - "description": "The organisation id of this fine tune job. Unused on Azure OpenAI;\ncompatibility for OpenAI only.", - "readOnly": true - }, - "user_id": { - "type": "string", - "description": "The user id of this fine tune job. Unused on Azure OpenAI; compatibility for\nOpenAI only.", - "readOnly": true - }, - "hyperparams": { - "$ref": "#/definitions/HyperParameters", - "description": "The hyper parameter settings used in a fine tune job." - } - }, - "description": "Fine tuning is a job to tailor a model to specific training data.", - "required": [ - "id", - "model", - "training_files" - ] - }, - "FineTuneCreation": { - "type": "object", - "properties": { - "model": { - "type": "string", - "description": "The identifier of the base model used for this fine-tune." - }, - "training_file": { - "type": "string", - "description": "The file that is used for training this fine tuned model." - }, - "validation_file": { - "type": "string", - "description": "The file that is used to evaluate the fine tuned model during training." - }, - "hyperparams": { - "$ref": "#/definitions/HyperParameters", - "description": "The hyper parameter settings used in a fine tune job." - } - }, - "description": "Defines the values of a fine tune job.", - "required": [ - "model", - "training_file" - ] - }, - "FineTuneList": { - "type": "object", - "properties": { - "object": { - "type": "string", - "enum": [ - "fine-tune" - ], - "x-ms-enum": { - "modelAsString": false - }, - "description": "Defines the type of this object" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/FineTune" - }, - "x-typespec-name": "FineTune[]", - "description": "The list of FineTunes" - } - } - }, - "HyperParameters": { - "type": "object", - "properties": { - "batch_size": { - "type": "integer", - "format": "int32", - "description": "The batch size to use for training. The batch size is the number of training\nexamples used to train a single forward and backward pass.\nIn general, we've\nfound that larger batch sizes tend to work better for larger datasets.\nThe\ndefault value as well as the maximum value for this property are specific to a\nbase model." - }, - "learning_rate_multiplier": { - "type": "number", - "format": "float", - "description": "The learning rate multiplier to use for training. The fine-tuning learning rate\nis the original learning rate used for pre-training multiplied by this\nvalue.\nLarger learning rates tend to perform better with larger batch\nsizes.\nWe recommend experimenting with values in the range 0.02 to 0.2 to see\nwhat produces the best results." - }, - "n_epochs": { - "type": "integer", - "format": "int32", - "description": "The number of epochs to train the model for. An epoch refers to one full cycle\nthrough the training dataset." - }, - "prompt_loss_weight": { - "type": "number", - "format": "float", - "description": "The weight to use for loss on the prompt tokens. This controls how much the\nmodel tries to learn to generate the prompt\n(as compared to the completion\nwhich always has a weight of 1.0), and can add a stabilizing effect to training\nwhen completions are short.\nIf prompts are extremely long (relative to\ncompletions), it may make sense to reduce this weight so as to avoid\nover-prioritizing learning the prompt." - }, - "compute_classification_metrics": { - "type": "boolean", - "description": "A value indicating whether to compute classification metrics.\nIf set, we\ncalculate classification-specific metrics such as accuracy and F-1 score using\nthe validation set at the end of every epoch.\nThese metrics can be viewed in\nthe results file. In order to compute classification metrics, you must provide\na validation_file.Additionally,\nyou must specify classification_n_classes for\nmulticlass classification or classification_positive_class for binary\nclassification." - }, - "classification_n_classes": { - "type": "integer", - "format": "int32", - "description": "The number of classes in a classification task.\nThis parameter is required for\nmulticlass classification." - }, - "classification_positive_class": { - "type": "string", - "description": "The positive class in binary classification.\nThis parameter is needed to\ngenerate precision, recall, and F1 metrics when doing binary classification." - }, - "classification_betas": { - "type": "array", - "items": { - "type": "number", - "format": "float" - }, - "x-typespec-name": "float32[]", - "description": "The classification beta values. If this is provided, we calculate F-beta scores\nat the specified beta values.\nThe F-beta score is a generalization of F-1\nscore. This is only used for binary classification.\nWith a beta of 1 (i.e.the\nF-1 score), precision and recall are given the same weight.\nA larger beta\nscore puts more weight on recall and less on precision. A smaller beta score\nputs more weight on precision and less on recall." - } - }, - "description": "The hyper parameter settings used in a fine tune job." - }, - "InnerErrorCode": { - "type": "string", - "enum": [ - "invalidPayload" - ], - "x-ms-enum": { - "name": "InnerErrorCode", - "modelAsString": true, - "values": [ - { - "name": "InvalidPayload", - "value": "invalidPayload" - } - ] - } - }, - "InnerErrorCodeKnownValues": { - "type": "string", - "enum": [ - "invalidPayload" - ], - "x-ms-enum": { - "name": "InnerErrorCodeKnownValues", - "modelAsString": true, - "values": [ - { - "name": "InvalidPayload", - "value": "invalidPayload" - } - ] - } - }, - "LogLevel": { - "type": "string", - "enum": [ - "info", - "warning", - "error" - ], - "x-ms-enum": { - "name": "LogLevel", - "modelAsString": true, - "values": [ - { - "name": "Info", - "value": "info" - }, - { - "name": "Warning", - "value": "warning" - }, - { - "name": "Error", - "value": "error" - } - ] - } - }, - "ManualScaleSettings": { - "type": "object", - "properties": { - "capacity": { - "type": "integer", - "format": "int32", - "description": "The constant reserved capacity of the inference endpoint for this deployment." - } - }, - "description": "Settings for the manual scale type.", - "required": [ - "capacity" - ], - "allOf": [ - { - "$ref": "#/definitions/ScaleSettings" - } - ], - "x-ms-discriminator-value": "manual" - }, - "Model": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/TypeDiscriminator", - "description": "Defines the type of an object.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/State", - "description": "The state of a job or item.", - "readOnly": true - }, - "created_at": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was created (in unix epochs).", - "readOnly": true - }, - "updated_at": { - "type": "integer", - "format": "int32", - "description": "A timestamp when this job or item was modified last (in unix epochs).", - "readOnly": true - }, - "id": { - "type": "string", - "description": "The identity of this item.", - "readOnly": true - }, - "model": { - "type": "string", - "description": "The base model ID if this is a fine tune model; otherwise `null`.", - "readOnly": true - }, - "fine_tune": { - "type": "string", - "description": "The fine tune job ID if this is a fine tune model; otherwise `null`.", - "readOnly": true - }, - "capabilities": { - "$ref": "#/definitions/Capabilities", - "description": "The capabilities of a base or fine tune model." - }, - "deprecation": { - "$ref": "#/definitions/Deprecation", - "description": "Defines the dates of deprecation for the different use cases of a\nmodel.\nUsually base models support 1 year of fine tuning after creation.\nInference is typically supported 2 years after creation of base or\nfine tuned\nmodels. The exact dates are specified in the properties." - } - }, - "description": "A model is either a base model or the result of a successful fine tune job.", - "required": [ - "id" - ] - }, - "ModelList": { - "type": "object", - "properties": { - "object": { - "type": "string", - "enum": [ - "model" - ], - "x-ms-enum": { - "modelAsString": false - }, - "description": "Defines the type of this object" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/Model" - }, - "x-typespec-name": "Model[]", - "description": "The list of Models" - } - } - }, - "Purpose": { - "type": "string", - "enum": [ - "fine-tune", - "fine-tune-results" - ], - "x-ms-enum": { - "name": "Purpose", - "modelAsString": true, - "values": [ - { - "name": "FineTune", - "value": "fine-tune" - }, - { - "name": "FineTuneResults", - "value": "fine-tune-results" - } - ] - } - }, - "PurposeKnownValues": { - "type": "string", - "enum": [ - "fine-tune", - "fine-tune-results" - ], - "x-ms-enum": { - "name": "PurposeKnownValues", - "modelAsString": true, - "values": [ - { - "name": "FineTune", - "value": "fine-tune" - }, - { - "name": "FineTuneResults", - "value": "fine-tune-results" - } - ] - } - }, - "ScaleSettings": { - "type": "object", - "properties": { - "scale_type": { - "type": "string", - "description": "Discriminator property for ScaleSettings." - } - }, - "description": "The scale settings of a deployment. It defines the modes for scaling and the\nreserved capacity.", - "discriminator": "scale_type", - "required": [ - "scale_type" - ] - }, - "ScaleType": { - "type": "string", - "enum": [ - "manual", - "standard" - ], - "x-ms-enum": { - "name": "ScaleType", - "modelAsString": true, - "values": [ - { - "name": "Manual", - "value": "manual" - }, - { - "name": "Standard", - "value": "standard" - } - ] - } - }, - "ScaleTypeKnownValues": { - "type": "string", - "enum": [ - "manual", - "standard" - ], - "x-ms-enum": { - "name": "ScaleTypeKnownValues", - "modelAsString": true, - "values": [ - { - "name": "Manual", - "value": "manual" - }, - { - "name": "Standard", - "value": "standard" - } - ] - } - }, - "StandardScaleSettings": { - "type": "object", - "properties": {}, - "description": "Settings for the standard scale type.", - "allOf": [ - { - "$ref": "#/definitions/ScaleSettings" - } - ], - "x-ms-discriminator-value": "standard" - }, - "State": { - "type": "string", - "enum": [ - "notRunning", - "running", - "succeeded", - "canceled", - "failed", - "deleted" - ], - "x-ms-enum": { - "name": "State", - "modelAsString": true, - "values": [ - { - "name": "NotRunning", - "value": "notRunning" - }, - { - "name": "Running", - "value": "running" - }, - { - "name": "Succeeded", - "value": "succeeded" - }, - { - "name": "Canceled", - "value": "canceled" - }, - { - "name": "Failed", - "value": "failed" - }, - { - "name": "Deleted", - "value": "deleted" - } - ] - } - }, - "TypeDiscriminator": { - "type": "string", - "enum": [ - "list", - "fine-tune", - "file", - "fine-tune-event", - "model", - "deployment" - ], - "x-ms-enum": { - "name": "TypeDiscriminator", - "modelAsString": true, - "values": [ - { - "name": "List", - "value": "list" - }, - { - "name": "FineTune", - "value": "fine-tune" - }, - { - "name": "File", - "value": "file" - }, - { - "name": "FineTuneEvent", - "value": "fine-tune-event" - }, - { - "name": "Model", - "value": "model" - }, - { - "name": "Deployment", - "value": "deployment" - } - ] - } - }, - "TypeDiscriminatorKnownValues": { - "type": "string", - "enum": [ - "list", - "fine-tune", - "file", - "fine-tune-event", - "model", - "deployment" - ], - "x-ms-enum": { - "name": "TypeDiscriminatorKnownValues", - "modelAsString": true, - "values": [ - { - "name": "List", - "value": "list" - }, - { - "name": "FineTune", - "value": "fine-tune" - }, - { - "name": "File", - "value": "file" - }, - { - "name": "FineTuneEvent", - "value": "fine-tune-event" - }, - { - "name": "Model", - "value": "model" - }, - { - "name": "Deployment", - "value": "deployment" - } - ] - } - }, - "Versions": { - "type": "string", - "enum": [ - "2022-06-01-preview" - ], - "x-ms-enum": { - "name": "Versions", - "modelAsString": true, - "values": [ - { - "name": "v2022_06_01_preview", - "value": "2022-06-01-preview" - } - ] - } - } - }, - "parameters": { - "Azure.Core.Foundations.ApiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "description": "The API version to use for this operation.", - "x-ms-client-name": "apiVersion", - "minLength": 1, - "type": "string", - "x-ms-parameter-location": "method" - } - } -} diff --git a/specification/cognitiveservices/OpenAI.Authoring/common.tsp b/specification/cognitiveservices/OpenAI.Authoring/common.tsp deleted file mode 100644 index d72f1d55552d..000000000000 --- a/specification/cognitiveservices/OpenAI.Authoring/common.tsp +++ /dev/null @@ -1,104 +0,0 @@ -import "@typespec/rest"; -import "@typespec/http"; - -using TypeSpec.Rest; -using TypeSpec.Http; -using Azure.Core; -using Azure.Core.Traits; -using Azure.Core.Traits.Private; - -namespace Azure.OpenAI; - -// TODO: enum value types not supported in csharp emitter -enum TypeDiscriminatorKnownValues { - List: "list", - FineTune: "fine-tune", - File: "file", - FineTuneEvent: "fine-tune-event", - Model: "model", - Deployment: "deployment", -} - -@knownValues(TypeDiscriminatorKnownValues) -scalar TypeDiscriminator extends string; - -enum ScaleTypeKnownValues { - Manual: "manual", - Standard: "standard", -} - -@knownValues(ScaleTypeKnownValues) -scalar ScaleType extends string; - -enum ErrorCodeKnownValues { - Conflict: "conflict", - InvalidPayload: "invalidPayload", - Forbidden: "forbidden", - NotFound: "notFound", - UnexpectedEntityState: "unexpectedEntityState", - ItemDoesAlreadyExist: "itemDoesAlreadyExist", - ServiceUnavailable: "serviceUnavailable", - InternalFailure: "internalFailure", - QuotaExceeded: "quotaExceeded", -} - -@knownValues(ErrorCodeKnownValues) -scalar ErrorCode extends string; - -enum InnerErrorCodeKnownValues { - InvalidPayload: "invalidPayload", -} - -@knownValues(InnerErrorCodeKnownValues) -scalar InnerErrorCode extends string; - -enum PurposeKnownValues { - FineTune: "fine-tune", - FineTuneResults: "fine-tune-results", -} - -@knownValues(PurposeKnownValues) -scalar Purpose extends string; - -enum State { - NotRunning: "notRunning", - Running: "running", - Succeeded: "succeeded", - Canceled: "canceled", - Failed: "failed", - Deleted: "deleted", -} - -enum LogLevel { - Info: "info", - Warning: "warning", - Error: "error", -} - -@doc("Created Response") -model CreatedResponse { - @doc("The status code") - @statusCode - statusCode: 201; - - @doc("Location of the newly created item") - @header - location: url; -} - -#suppress "@azure-tools/typespec-azure-core/documentation-required" "Template" -#suppress "@azure-tools/typespec-providerhub/no-inline-model" "This operation signature is not used in Azure Resource Manager operations (yet)" -@TypeSpec.Rest.createsResource(TResource) -op CustomResourceCreateWithServiceProvidedName< - TResource extends object, - Traits extends object = {} -> is Azure.Core.Foundations.ResourceCollectionOperation< - TResource, - Azure.Core.Foundations.ResourceBody & - TraitProperties, - Azure.Core.Foundations.LocationOfCreatedResourceResponse & - TResource & - TraitProperties, - Traits, - Azure.Core.Foundations.ErrorResponse ->; diff --git a/specification/cognitiveservices/OpenAI.Authoring/deployment.tsp b/specification/cognitiveservices/OpenAI.Authoring/deployment.tsp deleted file mode 100644 index 6b1b98eca9cf..000000000000 --- a/specification/cognitiveservices/OpenAI.Authoring/deployment.tsp +++ /dev/null @@ -1,44 +0,0 @@ -import "@azure-tools/typespec-azure-core"; -import "./models/deployment.models.tsp"; -import "./serviceCustomizations.tsp"; - -namespace Azure.OpenAI; - -using TypeSpec.Http; -using Azure.Core; - -interface Deployments { - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." - @summary("Gets the list of deployments owned by the Azure OpenAI resource.") - @doc("Gets the list of deployments owned by the Azure OpenAI resource.") - @route("/") - @get - // TODO: enum value types not supported in csharp emitter, change string literal to TypeDiscriminatorKnownValues enum when fixed - ListDeployments is ServiceCustomizations.OpenAIListOperation< - Deployment, - "deployment" - >; - - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Existing spec" - @summary(""" -Creates a new deployment for the Azure OpenAI resource according to the given -specification. -""") - @doc(""" -Creates a new deployment for the Azure OpenAI resource according to the given -specification. -""") - CreateDeployment is CustomResourceCreateWithServiceProvidedName; - - @summary("Gets details for a single deployment specified by the given deployment_id.") - @doc("Gets details for a single deployment specified by the given deployment_id.") - GetDeployment is ResourceRead; - - @summary("Updates the mutable details of the deployment with the given deployment_id.") - @doc("Updates the mutable details of the deployment with the given deployment_id.") - UpdateDeployment is ResourceCreateOrUpdate; - - @summary("Deletes the deployment specified by the given deployment_id.") - @doc("Deletes the deployment specified by the given deployment_id.") - DeleteDeployment is ResourceDelete; -} diff --git a/specification/cognitiveservices/OpenAI.Authoring/file.tsp b/specification/cognitiveservices/OpenAI.Authoring/file.tsp deleted file mode 100644 index d407c28d2fe2..000000000000 --- a/specification/cognitiveservices/OpenAI.Authoring/file.tsp +++ /dev/null @@ -1,104 +0,0 @@ -import "@azure-tools/typespec-azure-core"; -import "@typespec/rest"; -import "@typespec/http"; -import "./models/file.models.tsp"; -import "./serviceCustomizations.tsp"; - -namespace Azure.OpenAI; - -using TypeSpec.Rest; -using TypeSpec.Http; -using Azure.Core; - -interface Files { - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." - @summary(""" -Gets a list of all files owned by the Azure OpenAI resource. -These include user uploaded content like files with purpose "fine-tune" for training or -validation of fine-tunes models as well as files that are generated by the -service such as "fine-tune-results" which contains various metrics for the -corresponding fine-tune job. -""") - @doc(""" -Gets a list of all files owned by the Azure OpenAI resource. -These include user uploaded content like files with purpose \"fine-tune\" for training or -validation of fine-tunes models -as well as files that are generated by the -service such as \"fine-tune-results\" which contains various metrics for the -corresponding fine-tune job. -""") - @route("/") - @get - // TODO: enum value types not supported in csharp emitter, change string literal to TypeDiscriminatorKnownValues enum when fixed - ListFiles is ServiceCustomizations.OpenAIListOperation; - - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Existing spec" - @summary(""" -Creates a new file entity by uploading data from a local machine. Uploaded -files can, for example, be used for training or evaluating fine-tuned models. -""") - @doc(""" -Creates a new file entity by uploading data from a local machine. Uploaded -files can, for example, be used for training or evaluating fine-tuned models. -""") - UploadFile is CustomResourceCreateWithServiceProvidedName; - - @summary(""" -Gets details for a single file specified by the given file_id including status, -size, purpose, etc. -""") - @doc(""" -Gets details for a single file specified by the given file_id including status, -size, purpose, etc. -""") - GetFile is ResourceRead; - - @summary(""" -Deletes the file with the given file_id. -Deletion is also allowed if a file -was used, e.g., as training file in a fine-tune job. -""") - @doc(""" -Deletes the file with the given file_id. -Deletion is also allowed if a file -was used, e.g., as training file in a fine-tune job. -""") - DeleteFile is ResourceDelete; - - @summary(""" -Gets the content of the file specified by the given file_id. -Files can be user -uploaded content or generated by the service like result metrics of a fine-tune -job. -""") - @doc(""" -Gets the content of the file specified by the given file_id. -Files can be user -uploaded content or generated by the service like result metrics of a fine-tune -job. -""") - @get - @action("content") - @actionSeparator("/") - GetFileContent is ResourceAction; - - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." - @summary(""" -Creates a new file entity by importing data from a provided url. Uploaded files -can, for example, be used for training or evaluating fine-tuned models. -""") - @doc(""" -Creates a new file entity by importing data from a provided url. Uploaded files -can, for example, be used for training or evaluating fine-tuned models. -""") - @route("/files/import") - @post - ImportFile is Foundations.Operation< - { - @doc("expected schema for the body of the completion post request") - @body - body: FileImport; - }, - File & CreatedResponse - >; -} diff --git a/specification/cognitiveservices/OpenAI.Authoring/finetune.tsp b/specification/cognitiveservices/OpenAI.Authoring/finetune.tsp deleted file mode 100644 index 30d053e2661e..000000000000 --- a/specification/cognitiveservices/OpenAI.Authoring/finetune.tsp +++ /dev/null @@ -1,115 +0,0 @@ -import "@azure-tools/typespec-azure-core"; -import "@typespec/rest"; -import "@typespec/http"; -import "./models/finetune.models.tsp"; -import "./serviceCustomizations.tsp"; - -namespace Azure.OpenAI; - -using TypeSpec.Rest; -using TypeSpec.Http; -using Azure.Core; - -interface FineTunes { - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." - @summary(""" -Gets a list of all fine-tune jobs owned by the Azure OpenAI resource. -The details that are returned for each fine-tune job contain besides its -identifier the base model, training and validation files, hyper parameters, -time stamps, status and events. Events are created when the job status -changes, e.g. running or complete, and when results are uploaded. -""") - @doc(""" -Gets a list of all fine-tune jobs owned by the Azure OpenAI resource. -The details that are returned for each fine-tune job contain besides its -identifier the base model, training and validation files, hyper parameters, -time stamps, status and events. Events are created when the job status -changes, e.g. running or complete, and when results are uploaded. -""") - @route("/") - @get - // TODO: enum value types not supported in csharp emitter, change string literal to TypeDiscriminatorKnownValues enum when fixed - ListFineTunes is ServiceCustomizations.OpenAIListOperation< - FineTune, - "fine-tune" - >; - - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." - @summary(""" -Creates a job that fine-tunes a specified model from a given training -file. -Response includes details of the enqueued job including job status and -hyper parameters. -The name of the fine-tuned model is added to the response -once complete. -""") - @doc(""" -Creates a job that fine-tunes a specified model from a given training -file. -Response includes details of the enqueued job including job status and -hyper parameters. -The name of the fine-tuned model is added to the response -once complete. -""") - @route("/fine-tunes") - @post - CreateFineTune is Foundations.Operation< - FineTuneCreation, - FineTune & CreatedResponse - >; - - @summary(""" -Gets details for a single fine-tune job specified by the given -fine_tune_id. -The details contain the base model, training and validation -files, hyper parameters, time stamps, status and events. -Events are created -when the job status changes, e.g. running or complete, and when results are -uploaded. -""") - @doc(""" -Gets details for a single fine-tune job specified by the given -fine_tune_id. -The details contain the base model, training and validation -files, hyper parameters, time stamps, status and events. -Events are created -when the job status changes, e.g. running or complete, and when results are -uploaded. -""") - GetFineTune is ResourceRead; - - @summary("Deletes the fine-tune job specified by the given fine_tune_id.") - @doc("Deletes the fine-tune job specified by the given fine_tune_id.") - DeleteFineTune is ResourceDelete; - - #suppress "@azure-tools/cadl-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." - @summary(""" -List events for the fine-tune job specified by the given fine_tune_id. -Events are created when the job status changes, e.g. running or -complete, and when results are uploaded. -""") - @doc(""" -List events for the fine-tune job specified by the given fine_tune_id. -Events are created when the job status changes, e.g. running or -complete, and when results are uploaded. -""") - @TypeSpec.Rest.actionSeparator("/") - @get - ListFineTuneEvents is Azure.Core.ResourceAction< - FineTune, - { - @doc("A flag indicating whether to stream events for the fine-tune job. If set to true,\nevents will be sent as data-only server-sent events as they become available. The stream will terminate with\na data: [DONE] message when the job is finished (succeeded, cancelled, or failed).\nIf set to false, only events generated so far will be returned..") - @query - stream: boolean; - }, - ServiceCustomizations.OpenAiList - >; - - // #suppress "@azure-tools/cadl-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." - @summary("Cancels the processing of the fine-tune job specified by the given fine_tune_id.") - @doc("Cancels the processing of the fine-tune job specified by the given fine_tune_id.") - @post - @action("cancel") - @actionSeparator("/") - CancelFineTune is ResourceAction; -} diff --git a/specification/cognitiveservices/OpenAI.Authoring/main.tsp b/specification/cognitiveservices/OpenAI.Authoring/main.tsp deleted file mode 100644 index f2172fef3acc..000000000000 --- a/specification/cognitiveservices/OpenAI.Authoring/main.tsp +++ /dev/null @@ -1,45 +0,0 @@ -import "@typespec/rest"; -import "@typespec/http"; -import "@typespec/versioning"; -import "./common.tsp"; -import "./deployment.tsp"; -import "./file.tsp"; -import "./finetune.tsp"; -import "./model.routes.tsp"; - -using TypeSpec.Rest; -using TypeSpec.Http; -using TypeSpec.Versioning; - -#suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" -@useAuth( - ApiKeyAuth | OAuth2Auth<[ - { - type: OAuth2FlowType.implicit, - authorizationUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", - scopes: ["https://cognitiveservices.azure.com/.default"], - } - ]> -) -@service({ - title: "Azure OpenAI API", -}) -@versioned(Azure.OpenAI.Versions) -@server( - "{endpoint}/openai", - "API for managing and utilizing Azure Open AI endpoints", - { - @doc(""" -Supported Cognitive Services endpoints (protocol and hostname, for example: -https://westus.api.cognitive.microsoft.com). -""") - endpoint: string, - } -) -@doc("API for managing and utilizing Azure Open AI endpoints") -namespace Azure.OpenAI; - -enum Versions { - @useDependency(Azure.Core.Versions.v1_0_Preview_1) - v2022_06_01_preview: "2022-06-01-preview", -} diff --git a/specification/cognitiveservices/OpenAI.Authoring/model.routes.tsp b/specification/cognitiveservices/OpenAI.Authoring/model.routes.tsp deleted file mode 100644 index befafec9cf1d..000000000000 --- a/specification/cognitiveservices/OpenAI.Authoring/model.routes.tsp +++ /dev/null @@ -1,35 +0,0 @@ -import "@azure-tools/typespec-azure-core"; -import "@typespec/rest"; -import "@typespec/http"; -import "./models/model.models.tsp"; -import "./serviceCustomizations.tsp"; - -namespace Azure.OpenAI; - -using TypeSpec.Rest; -using TypeSpec.Http; -using Azure.Core; - -interface Models { - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation." - @summary(""" -Gets a list of all models that are accessible by the Azure OpenAI -resource. -These include base models as well as all successfully completed -fine-tuned models owned by the Azure OpenAI resource. -""") - @doc(""" -Gets a list of all models that are accessible by the Azure OpenAI -resource. -These include base models as well as all successfully completed -fine-tuned models owned by the Azure OpenAI resource. -""") - @route("/") - @get - // TODO: enum value types not supported in csharp emitter, change string literal to TypeDiscriminatorKnownValues enum when fixed - ListModels is ServiceCustomizations.OpenAIListOperation; - - @summary("Gets details for the model specified by the given model_id.") - @doc("Gets details for the model specified by the given model_id.") - GetModel is ResourceRead; -} diff --git a/specification/cognitiveservices/OpenAI.Authoring/models/deployment.models.tsp b/specification/cognitiveservices/OpenAI.Authoring/models/deployment.models.tsp deleted file mode 100644 index ad6b41d233d8..000000000000 --- a/specification/cognitiveservices/OpenAI.Authoring/models/deployment.models.tsp +++ /dev/null @@ -1,61 +0,0 @@ -import "@typespec/rest"; -import "@typespec/http"; - -using TypeSpec.Rest; -using TypeSpec.Rest.Resource; - -namespace Azure.OpenAI; - -@doc(""" -Deployments manage the reserved quota for Azure OpenAI models and make them -available for inference requests. -""") -@resource("deployments") -model Deployment { - @doc("Defines the type of an object.") - @visibility("read") - object?: TypeDiscriminator; - - @doc("The state of a job or item.") - @visibility("read") - status: State; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc("A timestamp when this job or item was created (in unix epochs).") - @visibility("read") - created_at: int32; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc("A timestamp when this job or item was modified last (in unix epochs).") - @visibility("read") - updated_at: int32; - - @doc("The identifier of the deployment") - @key("deploymentId") - @visibility("read") - id: string; - - @doc("The OpenAI model to deploy. Can be a base model or a fine tune.") - `model`: string; - - @doc(""" -The owner of this deployment. For Azure OpenAI only \"organization-owner\" is -supported. -""") - @visibility("read") - owner?: string; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc(""" -The scale settings of a deployment. It defines the modes for scaling and the -reserved capacity. -""") - scale_settings: ScaleSettings; -} - -@doc(""" -The scale settings of a deployment. It defines the modes for scaling and the -reserved capacity. -""") -@discriminator("scale_type") -model ScaleSettings {} diff --git a/specification/cognitiveservices/OpenAI.Authoring/models/file.models.tsp b/specification/cognitiveservices/OpenAI.Authoring/models/file.models.tsp deleted file mode 100644 index ab6c9737cbdf..000000000000 --- a/specification/cognitiveservices/OpenAI.Authoring/models/file.models.tsp +++ /dev/null @@ -1,95 +0,0 @@ -import "@typespec/rest"; -import "@typespec/http"; -import "@azure-tools/typespec-azure-core"; - -using TypeSpec.Rest; -using Azure.Core; - -namespace Azure.OpenAI; - -@doc(""" -A file is a document usable for training and validation. It can also be a -service generated document with result details. -""") -@resource("files") -model File { - @doc("Defines the type of an object.") - @visibility("read") - object?: TypeDiscriminator; - - @doc("The state of a job or item.") - @visibility("read") - status?: State; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc("A timestamp when this job or item was created (in unix epochs).") - @visibility("read") - created_at?: int32; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc("A timestamp when this job or item was modified last (in unix epochs).") - @visibility("read") - updated_at?: int32; - - @doc("The identity of this item.") - @visibility("read") - @key("fileId") - id: string; - - @doc(""" -The size of this file when available (can be null). File sizes larger than -2^53-1 are not supported to ensure compatibility -with JavaScript integers. -""") - @visibility("read") - bytes?: int32; - - @doc(""" -The intended purpose of the uploaded documents. Use \"fine-tune\" for -fine-tuning. This allows us to validate the format of the uploaded file. -""") - purpose: Purpose; - - @doc("The name of the file.") - filename: string; -} - -@doc(""" -Defines a document to import from an external content url to be usable with -Azure OpenAI. -""") -model FileImport { - @doc(""" -The intended purpose of the uploaded documents. Use \"fine-tune\" for -fine-tuning. This allows us to validate the format of the uploaded file. -""") - purpose: Purpose; - - @doc(""" -The name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file -to be uploaded. -If the `purpose` is set to \"fine-tune\", each line is a JSON -record with \"prompt\" and \"completion\" fields representing your training -examples. -""") - filename: string; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc(""" -The url to download the document from (can be SAS url of a blob or any other -external url accessible with a GET request). -""") - content_url: string; -} - -@doc("content of uploaded file") -model FileContent { - @doc(""" -The intended purpose of the uploaded documents. Use \"fine-tune\" for -fine-tuning. This allows us to validate the format of the uploaded file. -""") - purpose: Purpose; - - @doc("Gets or sets the file to upload into Azure OpenAI.") - file: bytes; -} diff --git a/specification/cognitiveservices/OpenAI.Authoring/models/finetune.models.tsp b/specification/cognitiveservices/OpenAI.Authoring/models/finetune.models.tsp deleted file mode 100644 index 28264fbbed00..000000000000 --- a/specification/cognitiveservices/OpenAI.Authoring/models/finetune.models.tsp +++ /dev/null @@ -1,224 +0,0 @@ -import "@typespec/rest"; -import "@typespec/http"; -import "@azure-tools/typespec-azure-core"; - -using TypeSpec.Http; -using TypeSpec.Rest; -using Azure.Core; - -namespace Azure.OpenAI; - -@doc("Fine tuning is a job to tailor a model to specific training data.") -@resource("fine-tunes") -model FineTune { - @doc("Defines the type of an object.") - @visibility("read") - object?: TypeDiscriminator; - - @doc("The state of a job or item.") - @visibility("read") - status?: State; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc("A timestamp when this job or item was created (in unix epochs).") - @visibility("read") - created_at?: int32; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc("A timestamp when this job or item was modified last (in unix epochs).") - @visibility("read") - updated_at?: int32; - - @doc("The identity of this item.") - @visibility("read") - @key("fineTuneId") - id: string; - - @doc("The identifier of the base model used for the fine-tune.") - `model`: string; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc(""" -The identifier of the resulting fine tuned model. This property is only -populated for successfully completed fine-tune runs. -Use this identifier to -create a deployment for inferencing. -""") - @visibility("read") - fine_tuned_model?: string; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc("The files that are used for training the fine tuned model.") - training_files: File[]; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc("The files that are used to evaluate the fine tuned model during training.") - validation_files?: File[]; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc(""" -The result files containing training and evaluation metrics in csv format. -The -file is only available for successfully completed fine-tune runs. -""") - @visibility("read") - result_files?: File[]; - - @doc(""" -The events that show the progress of the fine-tune run including queued, -running and completed. -""") - @visibility("read") - events?: Event[]; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc(""" -The organisation id of this fine tune job. Unused on Azure OpenAI; -compatibility for OpenAI only. -""") - @visibility("read") - organisation_id?: string; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc(""" -The user id of this fine tune job. Unused on Azure OpenAI; compatibility for -OpenAI only. -""") - @visibility("read") - user_id?: string; - - @doc("The hyper parameter settings used in a fine tune job.") - hyperparams?: HyperParameters; -} - -@doc("Event") -model Event { - @doc("Defines the type of an object.") - @visibility("read") - object?: TypeDiscriminator; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc("A timestamp when this event was created (in unix epochs).") - @visibility("read") - created_at?: int32; - - @doc("The verbosity level of an event.") - @visibility("read") - level?: LogLevel; - - @doc(""" -The message describing the event. This can be a change of state, e.g., -enqueued, started, failed or completed, or other events like uploaded results. -""") - @visibility("read") - message?: string; -} - -@doc("The hyper parameter settings used in a fine tune job.") -model HyperParameters { - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc(""" -The batch size to use for training. The batch size is the number of training -examples used to train a single forward and backward pass. -In general, we've -found that larger batch sizes tend to work better for larger datasets. -The -default value as well as the maximum value for this property are specific to a -base model. -""") - batch_size?: int32; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc(""" -The learning rate multiplier to use for training. The fine-tuning learning rate -is the original learning rate used for pre-training multiplied by this -value. -Larger learning rates tend to perform better with larger batch -sizes. -We recommend experimenting with values in the range 0.02 to 0.2 to see -what produces the best results. -""") - learning_rate_multiplier?: float32; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc(""" -The number of epochs to train the model for. An epoch refers to one full cycle -through the training dataset. -""") - n_epochs?: int32; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc(""" -The weight to use for loss on the prompt tokens. This controls how much the -model tries to learn to generate the prompt -(as compared to the completion -which always has a weight of 1.0), and can add a stabilizing effect to training -when completions are short. -If prompts are extremely long (relative to -completions), it may make sense to reduce this weight so as to avoid -over-prioritizing learning the prompt. -""") - prompt_loss_weight?: float32; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc(""" -A value indicating whether to compute classification metrics. -If set, we -calculate classification-specific metrics such as accuracy and F-1 score using -the validation set at the end of every epoch. -These metrics can be viewed in -the results file. In order to compute classification metrics, you must provide -a validation_file.Additionally, -you must specify classification_n_classes for -multiclass classification or classification_positive_class for binary -classification. -""") - compute_classification_metrics?: boolean; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc(""" -The number of classes in a classification task. -This parameter is required for -multiclass classification. -""") - classification_n_classes?: int32; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc(""" -The positive class in binary classification. -This parameter is needed to -generate precision, recall, and F1 metrics when doing binary classification. -""") - classification_positive_class?: string; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc(""" -The classification beta values. If this is provided, we calculate F-beta scores -at the specified beta values. -The F-beta score is a generalization of F-1 -score. This is only used for binary classification. -With a beta of 1 (i.e.the -F-1 score), precision and recall are given the same weight. -A larger beta -score puts more weight on recall and less on precision. A smaller beta score -puts more weight on precision and less on recall. -""") - classification_betas?: float32[]; -} - -@doc("Defines the values of a fine tune job.") -model FineTuneCreation { - @doc("The identifier of the base model used for this fine-tune.") - `model`: string; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc("The file that is used for training this fine tuned model.") - training_file: string; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc("The file that is used to evaluate the fine tuned model during training.") - validation_file?: string; - - @doc("The hyper parameter settings used in a fine tune job.") - hyperparams?: HyperParameters; -} diff --git a/specification/cognitiveservices/OpenAI.Authoring/models/model.models.tsp b/specification/cognitiveservices/OpenAI.Authoring/models/model.models.tsp deleted file mode 100644 index 0b86b0987a93..000000000000 --- a/specification/cognitiveservices/OpenAI.Authoring/models/model.models.tsp +++ /dev/null @@ -1,123 +0,0 @@ -import "@typespec/rest"; -import "@typespec/http"; -import "@azure-tools/typespec-azure-core"; - -using TypeSpec.Http; -using TypeSpec.Rest; -using Azure.Core; - -namespace Azure.OpenAI; - -@doc("A model is either a base model or the result of a successful fine tune job.") -@resource("models") -model Model { - @doc("Defines the type of an object.") - @visibility("read") - object?: TypeDiscriminator; - - @doc("The state of a job or item.") - @visibility("read") - status?: State; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc("A timestamp when this job or item was created (in unix epochs).") - @visibility("read") - created_at?: int32; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc("A timestamp when this job or item was modified last (in unix epochs).") - @visibility("read") - updated_at?: int32; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc("The identity of this item.") - @visibility("read") - @key("model_id") - id: string; - - @doc("The base model ID if this is a fine tune model; otherwise `null`.") - @visibility("read") - `model`?: string; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc("The fine tune job ID if this is a fine tune model; otherwise `null`.") - @visibility("read") - fine_tune?: string; - - @doc("The capabilities of a base or fine tune model.") - capabilities?: Capabilities; - - @doc(""" -Defines the dates of deprecation for the different use cases of a -model. -Usually base models support 1 year of fine tuning after creation. -Inference is typically supported 2 years after creation of base or -fine tuned -models. The exact dates are specified in the properties. -""") - deprecation?: Deprecation; -} - -@doc("The capabilities of a base or fine tune model.") -model Capabilities { - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc("A value indicating whether a model can be used for fine tuning.") - @visibility("read") - fine_tune?: boolean; - - @doc("A value indicating whether a model can be deployed.") - @visibility("read") - inference?: boolean; - - @doc("A value indicating whether a model supports completion.") - @visibility("read") - completion?: boolean; - - @doc("A value indicating whether a model supports embeddings.") - @visibility("read") - embeddings?: boolean; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc("The supported scale types for deployments of this model.") - @visibility("read") - scale_types?: ScaleType[]; -} - -@doc(""" -Defines the dates of deprecation for the different use cases of a -model. -Usually base models support 1 year of fine tuning after creation. -Inference is typically supported 2 years after creation of base or -fine tuned -models. The exact dates are specified in the properties. -""") -model Deprecation { - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc(""" -The end date of fine tune support of this model. Will be `null` for fine tune -models. -""") - @visibility("read") - fine_tune_end_date?: int32; - - @doc("The end date of inference support of this model.") - @visibility("read") - inference?: int32; -} - -@doc("Settings for the manual scale type.") -model ManualScaleSettings extends ScaleSettings { - @doc("The constant reserved capacity of the inference endpoint for this deployment.") - capacity: int32; - - #suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" - @doc("Defines how scaling operations will be executed.") - scale_type: "manual"; -} - -#suppress "@azure-tools/typespec-azure-core/casing-style" "Existing spec" -@doc("Settings for the standard scale type.") -model StandardScaleSettings extends ScaleSettings { - @doc("Defines how scaling operations will be executed.") - scale_type: "standard"; -} diff --git a/specification/cognitiveservices/OpenAI.Authoring/serviceCustomizations.tsp b/specification/cognitiveservices/OpenAI.Authoring/serviceCustomizations.tsp deleted file mode 100644 index 5fd88218ad7d..000000000000 --- a/specification/cognitiveservices/OpenAI.Authoring/serviceCustomizations.tsp +++ /dev/null @@ -1,16 +0,0 @@ -import "@azure-tools/typespec-azure-core"; -import "./common.tsp"; - -namespace Azure.OpenAI.ServiceCustomizations; - -@friendlyName("{name}List", T) -model OpenAiList { - @doc("Defines the type of this object") - object?: TType; - @doc("The list of {name}s", T) - data?: T[]; -} - -// TODO: enum value types not supported in csharp emitter, change TypeDiscriminator to TypeDiscriminatorKnownValues enum when fixed -#suppress "@azure-tools/typespec-azure-core/documentation-required" "Internal template - no need for public documentation" -op OpenAIListOperation is Azure.Core.Foundations.ResourceList>; diff --git a/specification/cognitiveservices/OpenAI.Authoring/swagger-to-cadl.sh b/specification/cognitiveservices/OpenAI.Authoring/swagger-to-cadl.sh deleted file mode 100644 index 6b312842e7ce..000000000000 --- a/specification/cognitiveservices/OpenAI.Authoring/swagger-to-cadl.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -autorest --reset -autorest --require=README.md --cadl-init --use=https://aka.ms/autorest.cadl --output-folder="." --input-file="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cognitiveservices/data-plane/AzureOpenAI/authoring/preview/2022-06-01-preview/azureopenai.json" \ No newline at end of file diff --git a/specification/cognitiveservices/OpenAI.Authoring/tspconfig.yaml b/specification/cognitiveservices/OpenAI.Authoring/tspconfig.yaml deleted file mode 100644 index 3785c43fcd7f..000000000000 --- a/specification/cognitiveservices/OpenAI.Authoring/tspconfig.yaml +++ /dev/null @@ -1,20 +0,0 @@ -emit: - - "@azure-tools/typespec-autorest" -# - "@azure-tools/typespec-apiview" -options: - "@azure-tools/typespec-autorest": - azure-resource-provider-folder: "cadl-output" - emitter-output-dir: "{project-root}" - output-file: "{azure-resource-provider-folder}/{version}/openapi.json" -# Uncomment this line and add "@azure-tools/cadl-python" to your package.json to generate Python code -# "@azure-tools/cadl-python": -# "basic-setup-py": true -# "package-version": -# "package-name": -# "output-path": -# Uncomment this line and add "@azure-tools/cadl-java" to your package.json to generate Java code -# "@azure-tools/cadl-java": true -# Uncomment this line and add "@azure-tools/cadl-csharp" to your package.json to generate C# code -# "@azure-tools/cadl-csharp": true -# Uncomment this line and add "@azure-tools/cadl-typescript" to your package.json to generate Typescript code -# "@azure-tools/cadl-typescript": true