Skip to content

Commit

Permalink
Language.AnalyzeText and Language.Conversations migration to Typespec (
Browse files Browse the repository at this point in the history
…#27392)

* Adding example TypeSpec definition for CLU (#24309)

* setup

* modified CODEOWNERS

* new changes

* new changes

* new changes

* fixing validation errors

* Adding Models to Typespec for CLU (#24376)

* setup

* modified CODEOWNERS

* new changes

* new changes

* new changes

* fixing validation errors

* adding models

* added models

* resolved comments

* added AADToken

* defined AADToken as model

* added common.tsp

* edited formatting

* fixed syntax

* resolved comments

* removed required property

* changed ErrorResponse to a model

* model updates

* Adding Path Object to Typespec for CLU (#24597)

* added route

* added examples to path object

* fixed example file paths

* route changes

* removed union

* fixes

* fixes

* fixes

* fixes

* fixed example file paths

* removed example

* updated route

* rebase

* rebase

* rebase

* added examples to path object

* fixed example file paths

* rebase

* edited config

* added comment

* removed import

* added team as codeowners

* removed examples

* added version enum and edited tspconfig

* added doc decorators to enums

* added more doc decorators to enums

* validation fixes

* lint diff fix

* suppressed warnings

* supressed enum warnings and removed '/language' from hostTemplate

* Model Changes in TypeSpec for CLU (#24866)

* added route

* added examples to path object

* fixed example file paths

* route changes

* removed union

* fixes

* fixes

* fixes

* fixes

* fixed example file paths

* removed example

* updated route

* rebase

* rebase

* rebase

* added examples to path object

* fixed example file paths

* rebase

* edited config

* added comment

* removed import

* added team as codeowners

* removed examples

* added version enum and edited tspconfig

* added doc decorators to enums

* added more doc decorators to enums

* validation fixes

* lint diff fix

* suppressed warnings

* supressed enum warnings and removed '/language' from hostTemplate

* added projectedname decorator to some properties

* edits to models in common.tsp

* edited model properties in main.tsp

* TypeSpec updates for SDK generation (#24973)

* added route

* added examples to path object

* fixed example file paths

* route changes

* removed union

* fixes

* fixes

* fixes

* fixes

* fixed example file paths

* removed example

* updated route

* rebase

* rebase

* rebase

* added examples to path object

* fixed example file paths

* rebase

* edited config

* added comment

* removed import

* added team as codeowners

* removed examples

* added version enum and edited tspconfig

* added doc decorators to enums

* added more doc decorators to enums

* validation fixes

* lint diff fix

* suppressed warnings

* supressed enum warnings and removed '/language' from hostTemplate

* added projectedname decorator to some properties

* edits to models in common.tsp

* edited model properties in main.tsp

* fixed spacing

* updating config

* spacing fix

* modified service-dir path

* removed csharp

* tsp config changes

* removed autorest import

* LuisTargetIntentResult model update

* added csharp emitter

* model change

* removed autorest

* model property change

* modified model property

* useauth change

* capitalized endpoint

* changed endpoint to lowercase

* back to uppercase

* Added @convientAPI decorator for SDK Generation (#25179)

* added route

* added examples to path object

* fixed example file paths

* route changes

* removed union

* fixes

* fixes

* fixes

* fixes

* fixed example file paths

* removed example

* updated route

* rebase

* rebase

* rebase

* added examples to path object

* fixed example file paths

* rebase

* edited config

* added comment

* removed import

* added team as codeowners

* removed examples

* added version enum and edited tspconfig

* added doc decorators to enums

* added more doc decorators to enums

* validation fixes

* lint diff fix

* suppressed warnings

* supressed enum warnings and removed '/language' from hostTemplate

* added projectedname decorator to some properties

* edits to models in common.tsp

* edited model properties in main.tsp

* fixed spacing

* updating config

* spacing fix

* modified service-dir path

* removed csharp

* tsp config changes

* removed autorest import

* LuisTargetIntentResult model update

* added csharp emitter

* model change

* removed autorest

* model property change

* modified model property

* useauth change

* capitalized endpoint

* changed endpoint to lowercase

* back to uppercase

* sdk generation fix

* Removed discriminator from AnalyzeConversationTaskResult model (#25250)

* model change for sdk

* modified result property

* Added 2023-04-01 and 2023-04-15-preview version models to TypeSpec for Analyze Conversations (#24899)

Added 2023-04-01 and 2023-04-15-preview version models to TypeSpec for Analyze Conversations
---------

Co-authored-by: Quentin Robinson <32183739+quentinRobinson@users.noreply.github.com>

* moved to nonstandard LRO and general fixes

* fixed tsp

* added AnalyzeConversationPiiTask

* first commit for text analytics tsp

* second commit

* fixed refactoring errors

* refactor analyzetext

* fixed routes

* added 2023-04-01 ga version

* cleanup

* Cleanup

* general fixes

* updated tsp config and eng folder to match main

* Adding example TypeSpec definition for CLU (#24309)

* setup

* modified CODEOWNERS

* new changes

* new changes

* new changes

* fixing validation errors

* Adding Models to Typespec for CLU (#24376)

* setup

* modified CODEOWNERS

* new changes

* new changes

* new changes

* fixing validation errors

* adding models

* added models

* resolved comments

* added AADToken

* defined AADToken as model

* added common.tsp

* edited formatting

* fixed syntax

* resolved comments

* removed required property

* changed ErrorResponse to a model

* model updates

* Adding Path Object to Typespec for CLU (#24597)

* added route

* added examples to path object

* fixed example file paths

* route changes

* removed union

* fixes

* fixes

* fixes

* fixes

* fixed example file paths

* removed example

* updated route

* rebase

* rebase

* rebase

* added examples to path object

* fixed example file paths

* rebase

* edited config

* added comment

* removed import

* added team as codeowners

* removed examples

* added version enum and edited tspconfig

* added doc decorators to enums

* added more doc decorators to enums

* validation fixes

* lint diff fix

* suppressed warnings

* supressed enum warnings and removed '/language' from hostTemplate

* Model Changes in TypeSpec for CLU (#24866)

* added route

* added examples to path object

* fixed example file paths

* route changes

* removed union

* fixes

* fixes

* fixes

* fixes

* fixed example file paths

* removed example

* updated route

* rebase

* rebase

* rebase

* added examples to path object

* fixed example file paths

* rebase

* edited config

* added comment

* removed import

* added team as codeowners

* removed examples

* added version enum and edited tspconfig

* added doc decorators to enums

* added more doc decorators to enums

* validation fixes

* lint diff fix

* suppressed warnings

* supressed enum warnings and removed '/language' from hostTemplate

* added projectedname decorator to some properties

* edits to models in common.tsp

* edited model properties in main.tsp

* TypeSpec updates for SDK generation (#24973)

* added route

* added examples to path object

* fixed example file paths

* route changes

* removed union

* fixes

* fixes

* fixes

* fixes

* fixed example file paths

* removed example

* updated route

* rebase

* rebase

* rebase

* added examples to path object

* fixed example file paths

* rebase

* edited config

* added comment

* removed import

* added team as codeowners

* removed examples

* added version enum and edited tspconfig

* added doc decorators to enums

* added more doc decorators to enums

* validation fixes

* lint diff fix

* suppressed warnings

* supressed enum warnings and removed '/language' from hostTemplate

* added projectedname decorator to some properties

* edits to models in common.tsp

* edited model properties in main.tsp

* fixed spacing

* updating config

* spacing fix

* modified service-dir path

* removed csharp

* tsp config changes

* removed autorest import

* LuisTargetIntentResult model update

* added csharp emitter

* model change

* removed autorest

* model property change

* modified model property

* useauth change

* capitalized endpoint

* changed endpoint to lowercase

* back to uppercase

* Added @convientAPI decorator for SDK Generation (#25179)

* added route

* added examples to path object

* fixed example file paths

* route changes

* removed union

* fixes

* fixes

* fixes

* fixes

* fixed example file paths

* removed example

* updated route

* rebase

* rebase

* rebase

* added examples to path object

* fixed example file paths

* rebase

* edited config

* added comment

* removed import

* added team as codeowners

* removed examples

* added version enum and edited tspconfig

* added doc decorators to enums

* added more doc decorators to enums

* validation fixes

* lint diff fix

* suppressed warnings

* supressed enum warnings and removed '/language' from hostTemplate

* added projectedname decorator to some properties

* edits to models in common.tsp

* edited model properties in main.tsp

* fixed spacing

* updating config

* spacing fix

* modified service-dir path

* removed csharp

* tsp config changes

* removed autorest import

* LuisTargetIntentResult model update

* added csharp emitter

* model change

* removed autorest

* model property change

* modified model property

* useauth change

* capitalized endpoint

* changed endpoint to lowercase

* back to uppercase

* sdk generation fix

* Removed discriminator from AnalyzeConversationTaskResult model (#25250)

* model change for sdk

* modified result property

* Added 2023-04-01 and 2023-04-15-preview version models to TypeSpec for Analyze Conversations (#24899)

Added 2023-04-01 and 2023-04-15-preview version models to TypeSpec for Analyze Conversations
---------

Co-authored-by: Quentin Robinson <32183739+quentinRobinson@users.noreply.github.com>

* moved to nonstandard LRO and general fixes

* fixed tsp

* added AnalyzeConversationPiiTask

* first commit for text analytics tsp

* second commit

* fixed refactoring errors

* refactor analyzetext

* added 2023-04-01 ga version

* general fixes

* cleanup

* Cleanup

* updated tsp config and eng folder to match main

* reset som eng/* and package files to main

* update eng files

* reset files to main

* reset codeowners to main

* Add support for version 2023-11-15-preview in Language.AnalyzeText

* Added exmaples and updated added a language interface

* Add scriptCode property to DetectedLanguage model

* Fix general Typespec errors

* Remove exampleValidation.txt file

* revert file deletions

* Update entity recognition documentation

* Fix general typespec errors

* Update language detection examples

* removed unused refrences and fix errors

* updated LanguageConversations

* fix openapi pipeline errors

* fix more pipeline errors

* fixed typespec compile warnings

* remove examples from typespec for sdk generation

* tsv fixes

* Update SentimentResponse model and analyzetext.json for document response

* Update healthcare and summarization models

* Update SentimentResponseWithDocumentDetectedLanguage model

* fixed prettier checks

* TSV validation fixes

* Prettier fixes

* Rename C# project to AnalyzeText

* Add query parameter for generating summary

* ypeSpec Validation fixes

* fixed server endpoint

* fixed missing comma

* Remove x-ms-examples from analyzeconversations.json and analyzetext.json

* mitigate some breaking changes

* fixed some breaking changes

* breaking change fix

* more breaking change fixes

* fixed more breaking changes

* fixed breaking changes

* fixed more breaking changes

* fixed breaking change

* breaking changes

* reset unintended changes

* added examples back

* tsv fixes

* fixed examples

* Update Language.Conversations version 2023-11-15-preview doc

* fixed models and removed unneeded file

* fixed breaking changes

* fix breaking change

* more breaking changes

* fix breaking changes

* breaking chagnes fix

* commented examples due to not working with autorest

* quote autorest flavor

* removed flavor

* add clientname for Association

* rename for csharp

* rename for csharp

* bug fix on TemporalSpanMetadata

* removed invalid extends

* fix more bad extends

* Add docs for common.models.tsp

* Updated for entities and language

* remove the base object Record<Unknown>

* tsv fixes

* spell check and projectedName to encodedName

* fixed encodedname

* add docs to healthcare tsp

* Few more missing docs

* fix tsv errors

* tsv fixes

* Some more missing docs

* spec

* missing docs

* fixing typespec validation

* tsv fixes

* Fix swagger spell check errors

* fix type validation

* typo in /common.models.tsp

* Add @doc decorators to the Summarization typespec file

* More

* Add Keyphrase and sentiment

* .

* Update custom-words.txt to contain picometers

* Fix tsv error

* Rename the operation IDs in the examples to match

* Update examples for analyze-conversations

* tsv compile

* fix exclude parameter

* run tsv compile

* Address comments

* Some more changes

* remove 2023-04-15-preview

* remove @needsRoute

* Remove readme

* addressed PR comments

* removed @clientname from models

* revert removing QnA from analyze-conversations

* Add some docs

* Address doc comments

* fix spellcheck

* Remove Record<Unknown>

* small change

* fix analyze-conv sync

* fix km

* removing unnecessary QnA reference from analyze-conversations

* Update specification/cognitiveservices/Language.Conversations/main.tsp

Co-authored-by: catalinaperalta <catalinaperaltah@hotmail.com>

* Update specification/cognitiveservices/Language.AnalyzeText/client.tsp

Co-authored-by: catalinaperalta <catalinaperaltah@hotmail.com>

* Address comments

* Add client.tsp

* fx tsp

* tsv compile

* remove extra impor

* Update specification/cognitiveservices/Language.AnalyzeText/tspconfig.yaml

Co-authored-by: catalinaperalta <catalinaperaltah@hotmail.com>

* make enable?:true

* fix tsp

* address comment

* remaining comments

* use Azure.Core.Foundations.ErrorResponse

* Address comments of LuisResult

* Update doc comments

* tsv compile

---------

Co-authored-by: Zach-King2 <135664462+Zach-King2@users.noreply.github.com>
Co-authored-by: Bidisha Chakraborty <bidishac@microsoft.com>
Co-authored-by: Dimitry Vislov <dmitryvislov@microsoft.com>
Co-authored-by: Bidisha Chakraborty <29803402+bidisha-c@users.noreply.github.com>
Co-authored-by: Mohamed Abbas <moaba@microsoft.com>
Co-authored-by: catalinaperalta <catalinaperaltah@hotmail.com>
7 people authored Apr 17, 2024
1 parent b582344 commit 72d10f1
Showing 179 changed files with 42,884 additions and 11,968 deletions.
6 changes: 5 additions & 1 deletion custom-words.txt
Original file line number Diff line number Diff line change
@@ -2148,7 +2148,9 @@ phraselists
picocolors
picomatch
picometer
picometers
pids
piilro
pipelineruns
piqd
pitr
@@ -2355,6 +2357,7 @@ regionalized
regionproposals
registeredidentities
registryname
REGON
rehydrated
reimage
reimageall
@@ -3390,6 +3393,7 @@ yvalue
IAASVM
Picometer
Petabit
petabits
questionanswering
napt
Napt
@@ -4012,4 +4016,4 @@ opex
decomission
Decommisioned
Decommision
Serp
Serp
71 changes: 71 additions & 0 deletions specification/cognitiveservices/Language.AnalyzeText/client.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import "./main.tsp";
import "@azure-tools/typespec-client-generator-core";

using Language.AnalyzeText;
using Azure.ClientGenerator.Core;

namespace Language.AnalyzeTextClientCustomizations;

@@clientName(Tasks, "TasksStatus", "csharp");
@@clientName(State, "CurrentState", "csharp");
@@clientName(Error, "AnalyzeTextError", "csharp");
@@clientName(TaskParameters, "TaskContent", "csharp");
@@clientName(PreBuiltTaskParameters, "PreBuiltTaskContent", "csharp");
@@clientName(AbstractiveSummarizationTaskParametersBase,
"AbstractiveSummarizationTaskContentBase",
"csharp"
);
@@clientName(CustomTaskParameters, "CustomTaskContent", "csharp");
@@clientName(CustomEntitiesTaskParameters,
"CustomEntitiesTaskContent",
"csharp"
);
@@clientName(CustomSingleLabelClassificationTaskParameters,
"CustomSingleLabelClassificationTaskContent",
"csharp"
);
@@clientName(CustomMultiLabelClassificationTaskParameters,
"CustomMultiLabelClassificationTaskContent",
"csharp"
);
@@clientName(DynamicClassificationTaskParameters,
"DynamicClassificationTaskContent",
"csharp"
);
@@clientName(EntityLinkingTaskParameters, "EntityLinkingTaskContent", "csharp");
@@clientName(Match, "EntityLinkingMatch", "csharp");
@@clientName(EntitiesTaskParameters, "EntitiesTaskContent", "csharp");
@@clientName(Entity, "NamedEntity", "csharp");
@@clientName(EntityInferenceOptions, "EntityInferenceConfig", "csharp");
@@clientName(HealthcareTaskParameters, "HealthcareTaskContent", "csharp");
@@clientName(Temporality, "HealthcareAssertionTemporality", "csharp");
@@clientName(Conditionality, "HealthcareAssertionConditionality", "csharp");
@@clientName(Certainty, "HealthcareAssertionCertainty", "csharp");
@@clientName(Association, "HealthcareAssertionAssociation", "csharp");
@@clientName(KeyPhraseTaskParameters, "KeyPhraseTaskContent", "csharp");
@@clientName(LanguageDetectionTaskParameters,
"LanguageDetectionTaskContent",
"csharp"
);
@@clientName(PiiTaskParameters, "PiiTaskContent", "csharp");
@@clientName(SentimentAnalysisTaskParameters,
"SentimentAnalysisTaskContent",
"csharp"
);
@@clientName(SentimentResponse, "SentimentResult", "csharp");
@@clientName(CustomSentimentAnalysisTaskParameters,
"CustomSentimentAnalysisTaskContent",
"csharp"
);
@@clientName(ExtractiveSummarizationTaskParameters,
"ExtractiveSummarizationTaskContent",
"csharp"
);
@@clientName(AbstractiveSummarizationTaskParameters,
"AbstractiveSummarizationTaskContent",
"csharp"
);
@@clientName(CustomAbstractiveSummarizationTaskParameters,
"CustomAbstractiveSummarizationTaskContent",
"csharp"
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"operationId": "AnalyzeTextCancelJob",
"title": "SuccessfulAnalyzeTextJobsCancelRequest",
"parameters": {
"Ocp-Apim-Subscription-Key": "{API key}",
"api-version": "2022-05-01",
"Endpoint": "{Endpoint}",
"jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"
},
"responses": {
"202": {
"headers": {
"Operation-Location": "{Endpoint}/language/analyze-text/jobs/{jobId}?api-version=2022-05-01"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"operationId": "AnalyzeTextJobStatus",
"title": "SuccessfulAnalyzeTextJobsMultipleTaskStatusRequest",
"parameters": {
"Ocp-Apim-Subscription-Key": "{API key}",
"api-version": "2022-05-01",
"Endpoint": "{Endpoint}",
"jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"
},
"responses": {
"200": {
"headers": {},
"body": {
"createdDateTime": "2020-10-01T15:00:45Z",
"displayName": "Extracting Location & US Region",
"expirationDateTime": "2020-10-03T15:01:03Z",
"jobId": "c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18",
"lastUpdatedDateTime": "2020-10-01T15:01:03Z",
"status": "succeeded",
"tasks": {
"completed": 2,
"failed": 0,
"inProgress": 0,
"total": 2,
"items": [
{
"kind": "EntityRecognitionLROResults",
"taskName": "Recognize Entities",
"lastUpdateDateTime": "2020-10-01T15:01:03Z",
"status": "succeeded",
"results": {
"documents": [
{
"entities": [
{
"category": "Event",
"confidenceScore": 0.61,
"length": 4,
"offset": 18,
"text": "trip"
},
{
"category": "Location",
"confidenceScore": 0.82,
"length": 7,
"offset": 26,
"subcategory": "GPE",
"text": "Seattle"
},
{
"category": "DateTime",
"confidenceScore": 0.8,
"length": 9,
"offset": 34,
"subcategory": "DateRange",
"text": "last week"
}
],
"id": "1",
"warnings": []
},
{
"entities": [
{
"category": "Location",
"confidenceScore": 0.52,
"length": 3,
"offset": 14,
"subcategory": "GPE",
"text": "NYC"
},
{
"category": "DateTime",
"confidenceScore": 0.8,
"length": 8,
"offset": 18,
"subcategory": "Date",
"text": "tomorrow"
}
],
"id": "2",
"warnings": []
}
],
"errors": [],
"modelVersion": "2020-04-01"
}
},
{
"kind": "CustomEntityRecognitionLROResults",
"taskName": "Recognize US Regions",
"lastUpdateDateTime": "2020-10-01T15:01:03Z",
"status": "succeeded",
"results": {
"documents": [
{
"entities": [
{
"category": "USRegion",
"confidenceScore": 0.85,
"length": 17,
"offset": 45,
"text": "Pacific Northwest"
}
],
"id": "1",
"warnings": []
},
{
"entities": [
{
"category": "USRegion",
"confidenceScore": 0.88,
"length": 10,
"offset": 63,
"text": "East Coast"
}
],
"id": "2",
"warnings": []
}
],
"errors": [],
"projectName": "MyProject",
"deploymentName": "MyDeployment"
}
}
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"operationId": "AnalyzeTextSubmitJob",
"title": "SuccessfulAnalyzeTextJobsMultipleTaskSubmitRequest",
"parameters": {
"Ocp-Apim-Subscription-Key": "{API key}",
"api-version": "2022-05-01",
"Endpoint": "{Endpoint}",
"jobId": "{Job ID}",
"body": {
"displayName": "Extracting Location & US Region",
"analysisInput": {
"documents": [
{
"id": "1",
"language": "en",
"text": "I had a wonderful trip to Seattle last week."
},
{
"id": "2",
"language": "en",
"text": "I'm flying to NYC tomorrow. See you there."
}
]
},
"tasks": [
{
"kind": "EntityRecognition",
"taskName": "Recognize Entities",
"parameters": {
"modelVersion": "latest"
}
},
{
"kind": "CustomEntityRecognition",
"taskName": "Recognize US Regions",
"parameters": {
"projectName": "MyProject",
"deploymentName": "MyDeployment"
}
}
]
}
},
"responses": {
"202": {
"headers": {
"Operation-Location": "{endpoint}/language/analyze-text/jobs/{jobId}?api-version=2022-05-01"
}
}
}
}
Loading

0 comments on commit 72d10f1

Please sign in to comment.