Skip to content

Commit ec74c85

Browse files
AmichelangeloQi-2077sarkar-rajarshi
authored
Update packagename new spilt solution (Azure#38228)
* rename import to begin_import_assets avoid breaking changes * QuestionAnsweringProjectMetadata -> QuestionAnsweringProject (SDK review) * getSynonyms -> listSynonyms (SDK review) * rename * update Azure.AI.Language.QuestionAnswering to Azure.AI.Language.QuestionAnswering.Interface * update authoring * revert uncorrect changes * output-dir * correct formart * fix comments, get-> list * add rename for QuestionAnsweringProjectMetaData * extract model, rename format * Renamed ImportOptions → ImportQueryParameters Renamed ExportOptions → ExportQueryParameters Kept ImportJobOptions body outside ImportQueryParameters definition Applied @@clientName for Python to rename format (conflicts with built-in function) * tsp format * move ExportQueryParameters and ImportQueryParameters inside models.tsp --------- Co-authored-by: Qi Yin <[email protected]> Co-authored-by: Rajarshi Sarkar <[email protected]>
1 parent e7ba354 commit ec74c85

File tree

9 files changed

+317
-265
lines changed

9 files changed

+317
-265
lines changed

specification/cognitiveservices/data-plane/LanguageQuestionAnswering/readme.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
# Cognitive Services Language - Question Answering SDK
1+
# Cognitive Services Language - Question Answering Inference SDK
22

3-
This is the AutoRest configuration file the Cognitive Services Language - Question Answering SDK.
3+
This is the AutoRest configuration file for the Cognitive Services Language - Question Answering Inference SDK.
44

55
> see https://aka.ms/autorest
66
7+
## SDK package updates
8+
9+
The inference-related client and models are generated for the new .NET package `Azure.AI.Language.QuestionAnswering.Inference`. The existing `Azure.AI.Language.QuestionAnswering` package now type-forwards these types and has been bumped to the next major version.
10+
711
## Releases
812

913
The current preview release of Language is 2025-05-15-preview.

specification/cognitiveservices/data-plane/LanguageQuestionAnswering/tspconfig.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ options:
1313
examples-dir: "{project-root}/examples"
1414
output-file: "{version-status}/{version}/questionanswering.json"
1515
"@azure-tools/typespec-csharp":
16-
emitter-output-dir: "{output-dir}/{service-dir}/{namespace}"
16+
emitter-output-dir: "{output-dir}/{service-dir}/Azure.AI.Language.QuestionAnswering.Inference"
1717
clear-output-folder: true
1818
model-namespace: false
1919
namespace: "Azure.AI.Language.QuestionAnswering"
@@ -28,6 +28,6 @@ options:
2828
generate-sample: true
2929
flavor: azure
3030
"@azure-typespec/http-client-csharp":
31-
emitter-output-dir: "{output-dir}/{service-dir}/{namespace}"
31+
emitter-output-dir: "{output-dir}/{service-dir}/Azure.AI.Language.QuestionAnswering.Inference"
3232
namespace: Azure.AI.Language.QuestionAnswering
3333
model-namespace: false

specification/cognitiveservices/data-plane/LanguageQuestionAnsweringAuthoring/client.tsp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ interface QuestionAnsweringAuthoringClientOperations {
2828
getExportStatus is Language.QuestionAnswering.Authoring.QuestionAnsweringProjects.getExportStatus;
2929

3030
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "specified in routes.tsp"
31+
// Preserve previous Python method name to avoid breaking change: begin_import_assets
32+
@clientName("begin_import_assets", "python")
3133
`import` is Language.QuestionAnswering.Authoring.QuestionAnsweringProjects.`import`;
3234

3335
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "specified in routes.tsp"
@@ -41,12 +43,14 @@ interface QuestionAnsweringAuthoringClientOperations {
4143
listDeployments is Language.QuestionAnswering.Authoring.QuestionAnsweringProjects.listDeployments;
4244

4345
#suppress "@azure-tools/typespec-azure-core/use-standard-names" "specified in routes.tsp"
46+
@clientName("list_synonyms", "python")
4447
getSynonyms is Language.QuestionAnswering.Authoring.QuestionAnsweringProjects.getSynonyms;
4548

4649
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "specified in routes.tsp"
4750
updateSynonyms is Language.QuestionAnswering.Authoring.QuestionAnsweringProjects.updateSynonyms;
4851

4952
#suppress "@azure-tools/typespec-azure-core/use-standard-names" "specified in routes.tsp"
53+
@clientName("list_sources", "python")
5054
getSources is Language.QuestionAnswering.Authoring.QuestionAnsweringProjects.getSources;
5155

5256
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "specified in routes.tsp"
@@ -58,6 +62,7 @@ interface QuestionAnsweringAuthoringClientOperations {
5862
getUpdateSourcesStatus is Language.QuestionAnswering.Authoring.QuestionAnsweringProjects.getUpdateSourcesStatus;
5963

6064
#suppress "@azure-tools/typespec-azure-core/use-standard-names" "specified in routes.tsp"
65+
@clientName("list_qnas", "python")
6166
getQnas is Language.QuestionAnswering.Authoring.QuestionAnsweringProjects.getQnas;
6267

6368
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "specified in routes.tsp"
@@ -67,3 +72,7 @@ interface QuestionAnsweringAuthoringClientOperations {
6772
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "specified in routes.tsp"
6873
addFeedback is Language.QuestionAnswering.Authoring.QuestionAnsweringProjects.addFeedback;
6974
}
75+
76+
@@clientName(QuestionAnsweringProjectMetadata, "QuestionAnsweringProject");
77+
@@clientName(ExportQueryParameters.format, "fileFormat", "python");
78+
@@clientName(ImportQueryParameters.format, "fileFormat", "python");

specification/cognitiveservices/data-plane/LanguageQuestionAnsweringAuthoring/models.tsp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,33 @@ union AssestKind {
245245
synonyms: "synonyms",
246246
}
247247

248+
/**
249+
* Optional query parameters for the export operation.
250+
* Using a named model enables client-side renaming without breaking wire contract.
251+
*/
252+
model ExportQueryParameters {
253+
/** Knowledge base Import or Export format. */
254+
@query("format")
255+
format?: format = format.json;
256+
257+
/** Kind of the asset of the project. */
258+
@query("assetKind")
259+
assetKind?: AssestKind;
260+
}
261+
262+
/**
263+
* Optional query parameters for the import operation.
264+
*/
265+
model ImportQueryParameters {
266+
/** Knowledge base Import or Export format. */
267+
@query("format")
268+
format?: format = format.json;
269+
270+
/** Kind of the asset of the project. */
271+
@query("assetKind")
272+
assetKind?: AssestKind;
273+
}
274+
248275
/**
249276
* Supported source types.
250277
*/

specification/cognitiveservices/data-plane/LanguageQuestionAnsweringAuthoring/preview/2025-05-15-preview/questionanswering-authoring.json

Lines changed: 130 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -296,65 +296,10 @@
296296
"pattern": "^(?=[a-zA-Z0-9])[a-zA-Z0-9-]{0,98}[a-zA-Z0-9]$"
297297
},
298298
{
299-
"name": "format",
300-
"in": "query",
301-
"description": "Knowledge base Import or Export format.",
302-
"required": false,
303-
"type": "string",
304-
"default": "json",
305-
"enum": [
306-
"json",
307-
"tsv",
308-
"excel"
309-
],
310-
"x-ms-enum": {
311-
"name": "format",
312-
"modelAsString": true,
313-
"values": [
314-
{
315-
"name": "json",
316-
"value": "json",
317-
"description": "Export or Import QnA assets in JSON format."
318-
},
319-
{
320-
"name": "tsv",
321-
"value": "tsv",
322-
"description": "Export or Import knowledge base replica including all assets and metadata in\nExcel format."
323-
},
324-
{
325-
"name": "excel",
326-
"value": "excel",
327-
"description": "Export or Import knowledge base replica including all assets and metadata in\nTsv format."
328-
}
329-
]
330-
}
299+
"$ref": "#/parameters/ExportQueryParameters.format"
331300
},
332301
{
333-
"name": "assetKind",
334-
"in": "query",
335-
"description": "Kind of the asset of the project.",
336-
"required": false,
337-
"type": "string",
338-
"enum": [
339-
"qnas",
340-
"synonyms"
341-
],
342-
"x-ms-enum": {
343-
"name": "AssestKind",
344-
"modelAsString": true,
345-
"values": [
346-
{
347-
"name": "qnas",
348-
"value": "qnas",
349-
"description": "Question and Answers."
350-
},
351-
{
352-
"name": "synonyms",
353-
"value": "synonyms",
354-
"description": "Synonyms."
355-
}
356-
]
357-
}
302+
"$ref": "#/parameters/ExportQueryParameters.assetKind"
358303
}
359304
],
360305
"responses": {
@@ -410,65 +355,10 @@
410355
"pattern": "^(?=[a-zA-Z0-9])[a-zA-Z0-9-]{0,98}[a-zA-Z0-9]$"
411356
},
412357
{
413-
"name": "format",
414-
"in": "query",
415-
"description": "Knowledge base Import or Export format.",
416-
"required": false,
417-
"type": "string",
418-
"default": "json",
419-
"enum": [
420-
"json",
421-
"tsv",
422-
"excel"
423-
],
424-
"x-ms-enum": {
425-
"name": "format",
426-
"modelAsString": true,
427-
"values": [
428-
{
429-
"name": "json",
430-
"value": "json",
431-
"description": "Export or Import QnA assets in JSON format."
432-
},
433-
{
434-
"name": "tsv",
435-
"value": "tsv",
436-
"description": "Export or Import knowledge base replica including all assets and metadata in\nExcel format."
437-
},
438-
{
439-
"name": "excel",
440-
"value": "excel",
441-
"description": "Export or Import knowledge base replica including all assets and metadata in\nTsv format."
442-
}
443-
]
444-
}
358+
"$ref": "#/parameters/ImportQueryParameters.format"
445359
},
446360
{
447-
"name": "assetKind",
448-
"in": "query",
449-
"description": "Kind of the asset of the project.",
450-
"required": false,
451-
"type": "string",
452-
"enum": [
453-
"qnas",
454-
"synonyms"
455-
],
456-
"x-ms-enum": {
457-
"name": "AssestKind",
458-
"modelAsString": true,
459-
"values": [
460-
{
461-
"name": "qnas",
462-
"value": "qnas",
463-
"description": "Question and Answers."
464-
},
465-
{
466-
"name": "synonyms",
467-
"value": "synonyms",
468-
"description": "Synonyms."
469-
}
470-
]
471-
}
361+
"$ref": "#/parameters/ImportQueryParameters.assetKind"
472362
},
473363
{
474364
"name": "body",
@@ -3306,6 +3196,132 @@
33063196
"minLength": 1,
33073197
"x-ms-parameter-location": "method",
33083198
"x-ms-client-name": "apiVersion"
3199+
},
3200+
"ExportQueryParameters.assetKind": {
3201+
"name": "assetKind",
3202+
"in": "query",
3203+
"description": "Kind of the asset of the project.",
3204+
"required": false,
3205+
"type": "string",
3206+
"enum": [
3207+
"qnas",
3208+
"synonyms"
3209+
],
3210+
"x-ms-enum": {
3211+
"name": "AssestKind",
3212+
"modelAsString": true,
3213+
"values": [
3214+
{
3215+
"name": "qnas",
3216+
"value": "qnas",
3217+
"description": "Question and Answers."
3218+
},
3219+
{
3220+
"name": "synonyms",
3221+
"value": "synonyms",
3222+
"description": "Synonyms."
3223+
}
3224+
]
3225+
},
3226+
"x-ms-parameter-location": "method"
3227+
},
3228+
"ExportQueryParameters.format": {
3229+
"name": "format",
3230+
"in": "query",
3231+
"description": "Knowledge base Import or Export format.",
3232+
"required": false,
3233+
"type": "string",
3234+
"default": "json",
3235+
"enum": [
3236+
"json",
3237+
"tsv",
3238+
"excel"
3239+
],
3240+
"x-ms-enum": {
3241+
"name": "format",
3242+
"modelAsString": true,
3243+
"values": [
3244+
{
3245+
"name": "json",
3246+
"value": "json",
3247+
"description": "Export or Import QnA assets in JSON format."
3248+
},
3249+
{
3250+
"name": "tsv",
3251+
"value": "tsv",
3252+
"description": "Export or Import knowledge base replica including all assets and metadata in\nExcel format."
3253+
},
3254+
{
3255+
"name": "excel",
3256+
"value": "excel",
3257+
"description": "Export or Import knowledge base replica including all assets and metadata in\nTsv format."
3258+
}
3259+
]
3260+
},
3261+
"x-ms-parameter-location": "method"
3262+
},
3263+
"ImportQueryParameters.assetKind": {
3264+
"name": "assetKind",
3265+
"in": "query",
3266+
"description": "Kind of the asset of the project.",
3267+
"required": false,
3268+
"type": "string",
3269+
"enum": [
3270+
"qnas",
3271+
"synonyms"
3272+
],
3273+
"x-ms-enum": {
3274+
"name": "AssestKind",
3275+
"modelAsString": true,
3276+
"values": [
3277+
{
3278+
"name": "qnas",
3279+
"value": "qnas",
3280+
"description": "Question and Answers."
3281+
},
3282+
{
3283+
"name": "synonyms",
3284+
"value": "synonyms",
3285+
"description": "Synonyms."
3286+
}
3287+
]
3288+
},
3289+
"x-ms-parameter-location": "method"
3290+
},
3291+
"ImportQueryParameters.format": {
3292+
"name": "format",
3293+
"in": "query",
3294+
"description": "Knowledge base Import or Export format.",
3295+
"required": false,
3296+
"type": "string",
3297+
"default": "json",
3298+
"enum": [
3299+
"json",
3300+
"tsv",
3301+
"excel"
3302+
],
3303+
"x-ms-enum": {
3304+
"name": "format",
3305+
"modelAsString": true,
3306+
"values": [
3307+
{
3308+
"name": "json",
3309+
"value": "json",
3310+
"description": "Export or Import QnA assets in JSON format."
3311+
},
3312+
{
3313+
"name": "tsv",
3314+
"value": "tsv",
3315+
"description": "Export or Import knowledge base replica including all assets and metadata in\nExcel format."
3316+
},
3317+
{
3318+
"name": "excel",
3319+
"value": "excel",
3320+
"description": "Export or Import knowledge base replica including all assets and metadata in\nTsv format."
3321+
}
3322+
]
3323+
},
3324+
"x-ms-parameter-location": "method"
33093325
}
33103326
}
33113327
}

specification/cognitiveservices/data-plane/LanguageQuestionAnsweringAuthoring/readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ This is the AutoRest configuration file the Cognitive Services Language - Questi
44

55
> see https://aka.ms/autorest
66
7+
## SDK package updates
8+
9+
The authoring client continues to ship from the existing .NET package `Azure.AI.Language.QuestionAnswering`. Inference models and clients now live in the companion package `Azure.AI.Language.QuestionAnswering.Inference`, and the original package type-forwards those types so existing code keeps working after the split.
10+
711
## Releases
812

913
The current preview release of Language is 2025-05-15-preview.

0 commit comments

Comments
 (0)