Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CLU and CT Language authoring 2022-03-01-preview APIs #17033

Closed

Conversation

moabba
Copy link
Member

@moabba moabba commented Dec 9, 2021

MSFT employees can try out our new experience at OpenAPI Hub - one location for using our validation tools and finding your workflow.

Changelog

Add a changelog entry for this PR by answering the following questions:

  1. What's the purpose of the update?
    • new service onboarding
    • new API version
    • update existing version for new feature
    • update existing version to fix swagger quality issue in s360
    • Other, please clarify
  2. When are you targeting to deploy the new service/feature to public regions? Please provide the date or, if the date is not yet available, the month.
    February 2022.
  3. When do you expect to publish the swagger? Please provide date or, the the date is not yet available, the month.
    Mid-January 2022.
  4. If updating an existing version, please select the specific langauge SDKs and CLIs that must be refreshed after the swagger is published.
    • SDK of .NET (need service team to ensure code readiness)
    • SDK of Python
    • SDK of Java
    • SDK of Js
    • SDK of Go
    • PowerShell
    • CLI
    • Terraform
    • No refresh required for updates in this PR

Contribution checklist:

If any further question about AME onboarding or validation tools, please view the FAQ.

ARM API Review Checklist

Applicability: ⚠️

If your changes encompass only the following scenarios, you should SKIP this section, as these scenarios do not require ARM review.

  • Change to data plane APIs
  • Adding new properties
  • All removals

Otherwise your PR may be subject to ARM review requirements. Complete the following:

  • Check this box if any of the following apply to the PR so that label "WaitForARMFeedback" will be added automatically to begin ARM API Review. Failure to comply may result in delays to the manifest.

    • Adding a new service
    • Adding new API(s)
    • Adding a new API version
      -[ ] To review changes efficiently, ensure you copy the existing version into the new directory structure for first commit and then push new changes, including version updates, in separate commits.
  • Ensure you've reviewed following guidelines including ARM resource provider contract and REST guidelines. Estimated time (4 hours). This is required before you can request review from ARM API Review board.

  • If you are blocked on ARM review and want to get the PR merged with urgency, please get the ARM oncall for reviews (RP Manifest Approvers team under Azure Resource Manager service) from IcM and reach out to them.

Breaking Change Review Checklist

If any of the following scenarios apply to the PR, request approval from the Breaking Change Review Board as defined in the Breaking Change Policy.

  • Removing API(s) in a stable version
  • Removing properties in a stable version
  • Removing API version(s) in a stable version
  • Updating API in a stable or public preview version with Breaking Change Validation errors
  • Updating API(s) in public preview over 1 year (refer to Retirement of Previews)

Action: to initiate an evaluation of the breaking change, create a new intake using the template for breaking changes. Addition details on the process and office hours are on the Breaking change Wiki.

Please follow the link to find more details on PR review process.

@moabba moabba requested a review from yangyuan as a code owner December 9, 2021 15:41
@openapi-workflow-bot
Copy link

Hi, @moabba Thanks for your PR. I am workflow bot for review process. Here are some small tips.

  • Please ensure to do self-check against checklists in first PR comment.
  • PR assignee is the person auto-assigned and responsible for your current PR reviewing and merging.
  • For specs comparison cross API versions, Use API Specs Comparison Report Generator
  • If there is CI failure(s), to fix CI error(s) is mandatory for PR merging; or you need to provide justification in PR comment for explanation. How to fix?

  • Any feedback about review process or workflow bot, pls contact swagger and tools team. [email protected]

    @openapi-workflow-bot
    Copy link

    [Call for Action] To better understand Azure service dev/test scenario, and support Azure service developer better on Swagger and REST API related tests in early phase, please help to fill in with this survey https://aka.ms/SurveyForEarlyPhase. It will take 5 to 10 minutes. If you already complete survey, please neglect this comment. Thanks.

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Dec 9, 2021

    Swagger pipeline restarted successfully, please wait for status update in this comment.

    1 similar comment
    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Dec 9, 2021

    Swagger pipeline restarted successfully, please wait for status update in this comment.

    @moabba
    Copy link
    Member Author

    moabba commented Dec 9, 2021

    @heaths This PR will probably have the same comments as the #16790 PR. We're targeting handling the other PR's comments and should also apply to this one as well.

    We'll have an API review, till the swagger specific changes are done.

    @openapi-workflow-bot
    Copy link

    Hi @moabba, Your PR has some issues. Please fix the CI sequentially by following the order of Avocado, semantic validation, model validation, breaking change, lintDiff. If you have any questions, please post your questions in this channel https://aka.ms/swaggersupport.

    TaskHow to fixPriority
    AvocadoFix-AvocadoHigh
    Semantic validationFix-SemanticValidation-ErrorHigh
    Model validationFix-ModelValidation-ErrorHigh
    LintDiffFix-LintDiffhigh
    If you need further help, please feedback via swagger feedback.

    }
    },
    "400": {
    "description": "This error can be returned if the request's parameters are incorrect meaning the required parameters are missing, malformed, or too large.\\r\\n\\r\\nThis error can be returned if the request's body is incorrect meaning the JSON is missing, malformed, or too large."
    Copy link
    Member

    @weidongxu-microsoft weidongxu-microsoft Dec 14, 2021

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    All error code needs an error schema. https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors

    And it need to have x-ms-error-response. https://azure.github.io/autorest/extensions/#x-ms-error-response

    Additionally it needs a "default" for other errors not covered here (e.g. 5xx).

    "description": "Creates a new or update a project.",
    "operationId": "Projects_CreateOrUpdateProject",
    "consumes": [
    "application/json"

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    "produces": [
    "application/json"
    ],
    "parameters": [
    Copy link
    Member

    @weidongxu-microsoft weidongxu-microsoft Dec 14, 2021

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    None of the API have api-version query parameter?

    I see api-version property in payload of PUT/POST (usual approach would be query parameter). However how do you handle GET request?

    Comment on lines 308 to 311
    "operation-location": {
    "description": "The location of the status API for monitoring the created job.",
    "type": "string"
    }
    Copy link
    Member

    @weidongxu-microsoft weidongxu-microsoft Dec 14, 2021

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    What will happen is the request if accepted, but response is lost to caller due to network issue?

    Also it helps to provide examples, so reviewer and tooling has some idea of your request/response. https://azure.github.io/autorest/extensions/#x-ms-examples

    "200": {
    "description": "List of all deployments.",
    "schema": {
    "$ref": "#/definitions/DeploymentObjectList"

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    This API appear to be pagination. Please use appropriate extension https://azure.github.io/autorest/extensions/#x-ms-pageable

    @ghost
    Copy link

    ghost commented Jan 2, 2022

    Hi, @moabba. Your PR has no update for 14 days and it is marked as stale PR. If no further update for over 14 days, the bot will close the PR. If you want to refresh the PR, please remove no-recent-activity label.

    @ghost ghost added the no-recent-activity label Jan 2, 2022
    Copy link
    Member

    @heaths heaths left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    You also need to update the data-plane/readme.md file and this should contain all the files for inference. Ideally, you should create a new api-version using https://aka.ms/openapihub from the latest stable or preview version (in this case, preview).

    api-versions should generally be additive, and right not the entire inference APIs are missing and code cannot be correctly generated since necessary entries are missing from the readme.md (that OpenAPI Hub would create).

    @ghost ghost removed the no-recent-activity label Jan 13, 2022
    @moabba moabba changed the title Add CLU and CT Language authoring 2022-02-01-preview APIs Add CLU and CT Language authoring 2022-03-01-preview APIs Jan 13, 2022
    Copy link
    Member

    @heaths heaths left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Still no update to readme.md in the data-plane root, nor is common.json here or other swaggers that are being authored for conversation analysis. You're also missing endpoint samples needed for doc generation and validation. The latter could be done with a new tracking bug, but has to be done before we can release.

    @@ -213,9 +213,6 @@
    "post": {
    "description": "Triggers a job to export project data in JSON format.",
    "operationId": "Projects_TriggerExportProjectJob",
    "consumes": [
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    So what does it consume?

    @@ -225,20 +222,16 @@
    "type": "string"
    },
    {
    "in": "header",
    "in": "query",
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    The projectName above should come from common.json, which you're missing in this branch. You need to start from the existing CLU preview version in the release/cognitiveservices/clu-2021-11-01-preview branch.

    Comment on lines +1015 to +1031
    {
    "in": "query",
    "name": "top",
    "description": "The number of utterances to be returned.",
    "type": "string"
    },
    {
    "in": "query",
    "name": "skip",
    "description": "The offset in the response.",
    "type": "string"
    },
    {
    "in": "query",
    "name": "maxpagesize",
    "description": "The maximum number of utterances per page.",
    "type": "string"
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    These will be common parameters and should also be defined in common.json.

    Comment on lines +1238 to +1252
    "400": {
    "description": "This error can be returned if the request's parameters are incorrect meaning the required parameters are missing, malformed, or too large.\\r\\n\\r\\nThis error can be returned if the request's body is incorrect meaning the JSON is missing, malformed, or too large."
    },
    "401": {
    "description": "You do not have access. \\r\\n\\r\\nReasons can include:\\r\\n\\r\\n* used endpoint subscription key, instead of authoring key\\r\\n* invalid, malformed, or empty authoring key\\r\\n* authoring key doesn't match region\\r\\n* you are not the owner or collaborator\\r\\n* invalid order of API calls."
    },
    "403": {
    "description": "Total monthly key quota limit exceeded."
    },
    "404": {
    "description": "The project or the job does not exist."
    },
    "429": {
    "description": "Rate limit is exceeded."
    }
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Do not document all errors. Just default that references common.json#/definitions/AzureError (or something like that - see the existing preview swagger for details).

    Comment on lines 1306 to 1314
    "in": "query",
    "name": "projectType",
    "description": "The CLU project type to get the supported languages for.",
    "name": "projectKind",
    "description": "The project kind to get the supported languages for.",
    "required": true,
    "type": "string"
    "type": "string",
    "enum": [
    "conversation",
    "workflow"
    ]
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    This parameter is also defined common.json, IIRC.

    Comment on lines +1396 to +1410
    "400": {
    "description": "This error can be returned if the request's parameters are incorrect meaning the required parameters are missing, malformed, or too large.\\r\\n\\r\\nThis error can be returned if the request's body is incorrect meaning the JSON is missing, malformed, or too large."
    },
    "401": {
    "description": "You do not have access. \\r\\n\\r\\nReasons can include:\\r\\n\\r\\n* used endpoint subscription key, instead of authoring key\\r\\n* invalid, malformed, or empty authoring key\\r\\n* authoring key doesn't match region\\r\\n* you are not the owner or collaborator\\r\\n* invalid order of API calls."
    },
    "403": {
    "description": "Total monthly key quota limit exceeded."
    },
    "404": {
    "description": "The project does not exist."
    },
    "429": {
    "description": "Rate limit is exceeded."
    }
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Don't define errors explicitly. See my previous comment for details (I'll not repeat, so please correct all instances).

    ],
    "type": "object",
    "properties": {
    "jobId": {
    "description": "Gets or sets the jobId.",
    "description": "Gets or sets the job id.",
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    "description": "Gets or sets the job id.",
    "description": "Gets or sets the job ID.",

    Comment on lines +1679 to +1686
    "kind": {
    "description": "Represents the evaluation kind. By default, the evaluation kind is set to percentage.",
    "enum": [
    "percentage",
    "set"
    ],
    "type": "string"
    },
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Is this or any other enum ever returned? If so, it should use the modelAsString extension.

    "properties": {
    "f1": {
    "format": "double",
    "description": "Represents the model precision",
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    1. Make sure this represents a double from 0 to 1, as is typical across the Language pillar.
    2. Update the docs to say that as well.

    "$ref": "#/definitions/TrainingJobStatusResult"
    },
    "jobId": {
    "description": "Gets or sets the jobId.",
    "description": "Gets or sets the job id.",
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    "description": "Gets or sets the job id.",
    "description": "Gets or sets the job ID.",

    Check elsewhere as well, in case I missed one. ID is a pseudo-acronym and should be capitalized.

    @moabba
    Copy link
    Member Author

    moabba commented Jan 14, 2022

    @heaths The state of the current PR is for API review. We'll update the swagger file to be suitable for this repo once the APIs stabilize from a review perspective.

    @heaths
    Copy link
    Member

    heaths commented Jan 14, 2022

    It would still be good to pull in common.json and use its definitions when defined to make sure your service actually accomodates any differences. The Language pillar is trying to consolidate around common patterns as well, and this will help detect any differences.

    @heaths
    Copy link
    Member

    heaths commented Jan 14, 2022

    From internal discussion, since this apparently isn't meant to be complete but only enough for a review, you should be targeting a feature branch. Azure REST guidelines are that any version in main - preview or stable - is immutable (at least for breaking changes, which even adding a property is). I recommend creating one from the current Cognitive Language release feature branch, copying over common.json, and starting from there.

    You don't have to start completely over, though. Assuming you're in your current topic branch for this PR:

    git fetch upstream release/cognitiveservices/clu-2021-11-01-preview
    git rebase FETCH_HEAD

    common.json should show up in 2021-11-01-preview which you can copy over into your release folder as well.

    @mikekistler mikekistler requested a review from bexxx January 19, 2022 16:58
    "running",
    "succeeded",
    "failed",
    "cancelled",
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    }
    },
    "dataset": {
    "description": "The dataset for this utterance. Allowed values are 'Train' and 'Test'.",
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Allowed values are 'Train' and 'Test'.

    consider adding enum values?

    }
    }
    },
    "LanguageGetObject": {
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Get

    Does it make sense to have this be part of the name?

    }
    }
    },
    "CreateOrReplaceDeploymentJobObject": {
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Object

    consider removing this suffix, seems not to add meaning to the type name.

    "/projects/{projectName}/models/{trainedModelName}/evaluation/predictions": {
    "get": {
    "description": "Get trained model evaluation predictions.",
    "operationId": "Models_GetTrainedModelEvaluationPredictions",
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Models_

    consider not adding the collection name to the operationid to ensure there are no duplicate names. This will generate quite some ugly method names in generated clients when the generator uses this id as the generated method name.

    Ideally the second part of this operationid is already unique.

    "/projects/{projectName}/train/jobs": {
    "get": {
    "description": "Get training jobs.",
    "operationId": "Training_GetTrainingJobsList",
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    List

    consider omitting this part

    },
    "403": {
    "description": "Total monthly key quota limit exceeded."
    },
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    are those codes really returned when getting the job status?

    }
    }
    },
    "/projects/global/prebuiltEntities": {
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    E

    inconsistent spelling. There are locations separated with - like deletion-jobs and here there is casing used (where it will be all lower cased anyway). Should this be prebuilt-entities?

    "description": "Represents the model F1 score",
    "type": "number"
    },
    "truePositivesCount": {
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    truePositivesCount

    board: do we usually specify min/max when they are unlikely to change? Here min=0 seems like a good boundary.

    @ghost
    Copy link

    ghost commented Feb 13, 2022

    Hi, @moabba. Your PR has no update for 14 days and it is marked as stale PR. If no further update for over 14 days, the bot will close the PR. If you want to refresh the PR, please remove no-recent-activity label.

    @ghost ghost added the no-recent-activity label Feb 13, 2022
    @moabba moabba requested a review from a team as a code owner February 16, 2022 15:42
    @ghost ghost removed the no-recent-activity label Feb 16, 2022
    @czubair czubair requested a review from johanste February 23, 2022 00:46
    Copy link
    Member

    @heaths heaths left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Where are the rest of the files like ConversationAnalysis.json - the inference APIs - in this directory? While the Language RP has been a bit of a problem having many different related-but-separate APIs, each feature like CLU needs to be complete i.e., you need both inference and authoring APIs here.

    @ChongTang
    Copy link
    Contributor

    Hi @moabba , instead of the main branch, we should target this branch: dev-cognitiveservices-Language-2022-03-01-preview.

    @ghost
    Copy link

    ghost commented Mar 27, 2022

    Hi, @moabba. Your PR has no update for 14 days and it is marked as stale PR. If no further update for over 14 days, the bot will close the PR. If you want to refresh the PR, please remove no-recent-activity label.

    @ghost ghost added the no-recent-activity label Mar 27, 2022
    @heaths
    Copy link
    Member

    heaths commented Mar 28, 2022

    Is this PR still valid?

    @ghost ghost removed the no-recent-activity label Mar 28, 2022
    }
    }
    },
    "DeploymentJobStatusObject": {

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Deployment job should return a snapshot of a deployment so that users can reason what has been deployed and what model is used to do the inference. Essentially, modelId should be returned.

    @heaths
    Copy link
    Member

    heaths commented Apr 12, 2022

    @moabba 2022-03-01-preview has been merged to main. Making these changes now would be considered breaking and require exemption. Alternatively, you could punt to the cognitiveservices-Language-2022-04-01-preview branch, or close this PR if no longer needed.

    @moabba
    Copy link
    Member Author

    moabba commented Apr 15, 2022

    Further changes will be done in this PR #18694

    @moabba moabba closed this Apr 15, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    [Language Service - Authoring, Custom Text, CLU] REST API Review of Concept Naming in Language Service
    8 participants