[CognitiveServices] LUIS Runtime API Spec#2051
Conversation
| "hostTemplate": "{AzureRegion}.api.cognitive.microsoft.com", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "../../../Common/ExtendedRegions.json#/parameters/AzureRegion" |
There was a problem hiding this comment.
For GA, what is the region list that should be included?
Should the BasicRegion or ExtendedRegion sets be used instead?
There was a problem hiding this comment.
If neither of these fit LUIS' profile, feel free to create your own AzureRegion definitions within the spec.
There was a problem hiding this comment.
Thanks, still awaiting confirmation.
There was a problem hiding this comment.
@pcostantini when you've got confirmation, ping and we can merge this.
There was a problem hiding this comment.
Hi @fearthecowboy ,
Just got confirmation, the ExtendedRegions.json is the one to be used, so no further changes are needed.
Thanks!
| "/{appId}": { | ||
| "get": { | ||
| "description": "Gets the published endpoint predictions for the given query.", | ||
| "operationId": "Prediction_GetPredictionsFromEndpointViaGet", |
There was a problem hiding this comment.
We use operationId to represent the group/method that gets generated for the SDKs.
The format should be <method-group>_<method-name> .
Ideally, something like Predictions_List (and let the description and parameters speak for themselves)
There was a problem hiding this comment.
Updated to Predictions_Resolve
| }, | ||
| "entities": { | ||
| "type": "array", | ||
| "x-nullable": true, |
There was a problem hiding this comment.
Is there a reason you're explicitly marking things x-nullable: true ?
That affects code-generation in some specific ways, but shouldn't be used so liberally without a definite reason.
Most of what you've marked here would be nullable anyway.
There was a problem hiding this comment.
Removed all x-nullable: true
| }, | ||
| "post": { | ||
| "description": "Gets the published endpoint prediction for the given long query.", | ||
| "operationId": "Prediction_GetPredictionsFromEndpointViaPost", |
There was a problem hiding this comment.
Are there any fundamental differences between using the GET and POST endpoints?
again this should be Predictions_List or something. Although, you can't have two methods with the same operation id, so if they are functionally the same, call the GET one Predictions_List2 and call this one Predictions_List and we'll give you the configuration to suppress generating the code for the GET (since the SDK caller won't ever care which one it's using)
If there are fundamental differences between GET and POST , we should examine them and see what we can do.
There was a problem hiding this comment.
ACK. The API allows using GET or POST, but the end-result is the same and the parameters constraints are the same too.
For the SDK generation the POST can be used instead. Do you have the configuration required to disable an operation? (Please take a look at the current C# generation @ https://github.com/southworkscom/azure-sdk-for-net/blob/cognitiveservices-luis-runtime-sdk/src/SDKs/CognitiveServices/dataPlane/Language/LUIS-Runtime/Generated/PredictionExtensions.cs#L50 )
fearthecowboy
left a comment
There was a problem hiding this comment.
Overall, this spec still needs descriptions on all properties, parameters and model classes.
After that, we can generate the code and see if it looks like a usable SDK; after looking at this, I'm not exactly sure what the API is actually supposed to do...
| "type": "object", | ||
| "properties": { | ||
| "query": { | ||
| "type": "string", |
There was a problem hiding this comment.
You need description fields on all your properties.
There was a problem hiding this comment.
Added description to all parameters and attributes
| "type": "string" | ||
| }, | ||
| "startIndex": { | ||
| "type": "number" |
There was a problem hiding this comment.
It would be a good idea to have maximum and minimum values for numbers if you can.
There was a problem hiding this comment.
Added description with their meaning. These values change based on the input. They represent a match within the input query
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "A JSON object containing the predictions.", |
There was a problem hiding this comment.
You shouldn't describe the payload in terms of encoding or transport, (ie, remove A JSON object containing the ) -- Give a description that describes what the output is. (What exactly is a list of predictions?)
There was a problem hiding this comment.
Updated along with entity's description and their attributes
| "in": "path", | ||
| "type": "string", | ||
| "required": true, | ||
| "description": "Format - guid. The application ID." |
There was a problem hiding this comment.
What is the application ID used for?
There was a problem hiding this comment.
Added description for the Luis Application ID
|
Hi @fearthecowboy , Both GET and POST operation are the same... For the SDK Generation, do you have the configuration required to disable an operation? Thanks! |
|
Hi There, I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result: File: AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback Thanks for your co-operation. |
| ## Runtime 2.0 | ||
| These settings apply only when `--tag=runtime_2_0` is specified on the command line. | ||
|
|
||
| ``` yaml $(tag) == 'runtime_2_0' |
There was a problem hiding this comment.
Change this section to this:
``` yaml $(tag) == 'runtime_2_0'
input-file: v2.0/LUIS-Runtime.json
# remove Resolve2 from code-generation (since the POST and GET operations are functionally identical. )
directive:
remove-operation: Prediction_Resolve2
```It will suppress Resolve2 from getting code generation
| "description": "The LUIS application ID (Guid)." | ||
| }, | ||
| { | ||
| "name": "q", |
There was a problem hiding this comment.
On the q parameters, we should probably add:
"x-ms-client-name":"query",in so the parameter name is query rather than q in the generated code (do this on Resolve2 as well, just for completion sake)
|
|
||
| ### Runtime 2.0 - CSharp Settings | ||
| These settings apply only when `--csharp` is specified on the command line. | ||
| ``` yaml $(csharp) |
There was a problem hiding this comment.
And, let's change this (uses new feature!)
csharp:
override-client-name: LuisRuntimeAPI
sync-methods: None
license-header: MICROSOFT_MIT_NO_VERSION
azure-arm: false
namespace: Microsoft.Azure.CognitiveServices.Language.LUIS
output-folder: $(csharp-sdks-folder)/CognitiveServices/dataPlane/Language/LUIS-Runtime/Generated
clear-output-folder: true
# csharp has support for modelAsExtensible now; replace modelAsString with that.
directive:
from: swagger-document
where: $..['x-ms-enum']
transform: >
if( $['modelAsString'] ) {
$['modelAsExtensible'] = true;
$['modelAsString'] = false;
}
|
I'm pretty good with this, just a couple minor tweaks that I've provided, and I think we're good-to-go.
|
|
Hi There, I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result: File: AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback Thanks for your co-operation. |
|
Hi @fearthecowboy , |
|
No modification for AutorestCI/azure-sdk-for-ruby |
|
No modification for AutorestCI/azure-sdk-for-python |
|
No modification for AutorestCI/azure-sdk-for-node |
This PR includes the API Spec for the LUIS Runtime endpoint (Predictions):
https://westus.dev.cognitive.microsoft.com/docs/services/5819c76f40a6350ce09de1ac/operations/5819c77140a63516d81aee78
This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.
PR information
api-versionin the path should match theapi-versionin the spec).Quality of Swagger