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

[TextAnalytics] [Conversations] Update method naming in client.tsp #29622

Merged
merged 60 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
840df97
[TA] [Conversations] Update naming in client.tsp
Jun 27, 2024
8b877df
enable model-namespaces
Jun 27, 2024
ec4b777
fix tsv errors
Jun 28, 2024
014a436
small change
Jun 28, 2024
96b0f2a
Add prediction base
Jun 28, 2024
28ee478
one more rename
Jun 28, 2024
841ba59
another rename
Jun 28, 2024
08fe4a8
some missed ones
Jun 29, 2024
8fe8017
small change
Jun 29, 2024
59f3e2c
rename
Jun 29, 2024
4f6d750
ta change
Jun 29, 2024
fa52df6
Add HC namespace
Jun 29, 2024
318b271
casing + remove hc folder
Jun 29, 2024
c1a507c
Merge branch 'main' into bidishac/client-naming
bidisha-c Jun 29, 2024
07a6230
remove sentenceSentiment override
Jun 29, 2024
1b3921a
Merge branch 'bidishac/client-naming' of https://github.com/bidisha-c…
Jun 29, 2024
298f920
another one
Jun 29, 2024
d8ca64f
update
Jun 29, 2024
7521be6
renames
Jun 29, 2024
5ee0b10
disable protocol methods
Jun 29, 2024
60b4a71
tsp compile
Jun 29, 2024
8b0d18c
Update naming conventions
quentinRobinson Jul 8, 2024
bca40c1
Merge branch 'main' into bidishac/client-naming
bidisha-c Jul 10, 2024
f3226da
Add AAD auth
Jul 16, 2024
72f590e
Merge branch 'main' into bidishac/client-naming
bidisha-c Jul 16, 2024
b463c2f
renames
Jul 16, 2024
d782096
change
Jul 16, 2024
f5c5b52
update TextAnalytics TSP for sdk
quentinRobinson Jul 16, 2024
3cf3fe3
rename for Conversations SDK
quentinRobinson Jul 16, 2024
6818d02
remove duplicates
quentinRobinson Jul 16, 2024
233d8c1
update config
quentinRobinson Jul 16, 2024
750985f
Removed duplicates in naming
quentinRobinson Jul 16, 2024
0f42f6e
fix client names and operation names
Jul 16, 2024
90e740e
Merge branch 'bidishac/client-naming' of https://github.com/bidisha-c…
Jul 16, 2024
45f72f1
update
Jul 16, 2024
e614e4a
Fix the casing of the result
Jul 17, 2024
c356900
Merge branch 'main' into bidishac/client-naming
bidisha-c Jul 17, 2024
4e5b44a
fix Text SDK errors
quentinRobinson Jul 17, 2024
8eeb7eb
Merge branch 'bidishac/client-naming' of https://github.com/bidisha-c…
quentinRobinson Jul 17, 2024
d48e4e7
fix AnalyzeTextLROResultsKind access level
quentinRobinson Jul 17, 2024
76f7507
bugfix AbstractiveSummarizationLROTask parameters to be optional
quentinRobinson Jul 17, 2024
36e96a0
typo
Jul 18, 2024
301ed03
align
Jul 18, 2024
6fad1db
update Text client name to TextAnalysis
quentinRobinson Jul 18, 2024
f4ca504
Merge branch 'main' into bidishac/client-naming
bidisha-c Jul 18, 2024
e4921e2
Merge branch 'main' into bidishac/client-naming
bidisha-c Jul 19, 2024
44726fc
Fix the examples
Jul 19, 2024
c84d891
Merge branch 'bidishac/client-naming' of https://github.com/bidisha-c…
Jul 19, 2024
9014f05
Add tsv compile
Jul 19, 2024
d8069c8
Missed file
Jul 19, 2024
57ad557
rename issue
Jul 19, 2024
33f0e78
Merge branch 'main' into bidishac/client-naming
bidisha-c Jul 22, 2024
24eb341
Fix input polymorphism
Jul 22, 2024
1a2b0fb
Update clientName
Jul 22, 2024
b6d92ff
remove model namespace
quentinRobinson Jul 24, 2024
f072941
Backcompat
Jul 24, 2024
4a8f668
Merge branch 'bidishac/client-naming' of https://github.com/bidisha-c…
Jul 24, 2024
c463ca9
small update
Jul 29, 2024
641e095
update client
Jul 29, 2024
c2d9d8f
Merge branch 'main' into bidishac/client-naming
bidisha-c Jul 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
975 changes: 939 additions & 36 deletions specification/cognitiveservices/Language.AnalyzeText/client.tsp

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions specification/cognitiveservices/Language.AnalyzeText/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.Core;
using Azure.Core.Traits;

/** The language service API is a suite of natural language processing (NLP) skills built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction, language detection and question answering. Further documentation can be found in <a href=\"https://docs.microsoft.com/azure/cognitive-services/language-service/overview\">https://docs.microsoft.com/azure/cognitive-services/language-service/overview</a>.0 */
@useAuth(
TypeSpec.Http.ApiKeyAuth<
TypeSpec.Http.ApiKeyLocation.header,
"Ocp-Apim-Subscription-Key"
>
ApiKeyAuth<ApiKeyLocation.header, "Ocp-Apim-Subscription-Key"> | OAuth2Auth<[
{
type: OAuth2FlowType.authorizationCode,
authorizationUrl: "https://login.microsoftonline.com/common/oauth2/authorize",
tokenUrl: "https://login.microsoftonline.com/common/oauth2/token",
scopes: ["https://cognitiveservices.azure.com/.default"],
}
]>
)
@service({
title: "Microsoft Cognitive Language Service - Text Analysis",
Expand All @@ -39,7 +42,7 @@ using Azure.Core.Traits;
}
)
@versioned(Versions)
namespace Language.AnalyzeText;
namespace Language.Text;

/** Analyze Conversations Service Versions */
enum Versions {
Expand Down Expand Up @@ -67,7 +70,7 @@ alias languageOperations = ResourceOperations<ServiceTraits, ErrorResponse>;
@post
@route("/:analyze-text")
op analyzeText is RpcOperation<
AnalyzeTextTask & AnalyzeTextQueryParameters,
AnalyzeTextBody & AnalyzeTextQueryParameters,
AnalyzeTextTaskResult,
{},
ErrorResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ using TypeSpec.Versioning;
using Azure.Core;
using Azure.Core.Traits;

namespace Language.AnalyzeText;
namespace Language.Text;

/** These are the [Azure Active Directory OAuth2](https://docs.microsoft.com/azure/active-directory/develop/v1-overview) Flows. When paired with [Azure role-based access](https://docs.microsoft.com/azure/role-based-access-control/overview) control it can be used to control access to Azure Maps REST APIs. Azure role-based access controls are used to designate access to one or more Azure Maps resource account or sub-resources. Any user, group, or service principal can be granted access via a built-in role or a custom role composed of one or more permissions to Azure Maps REST APIs.\n\nTo implement scenarios, we recommend viewing [authentication concepts](https://aka.ms/amauth). In summary, this security definition provides a solution for modeling application(s) via objects capable of access control on specific APIs and scopes.\n\n#### Notes\n* This security definition **requires** the use of the `x-ms-client-id` header to indicate which Azure Maps resource the application is requesting access to. This can be acquired from the [Maps management API](https://aka.ms/amauthdetails).\n* \nThe `Authorization URL` is specific to the Azure public cloud instance. Sovereign clouds have unique Authorization URLs and Azure Active directory configurations. \n* \nThe Azure role-based access control is configured from the [Azure management plane](https://aka.ms/amrbac) via Azure portal, PowerShell, CLI, Azure SDKs, or REST APIs.\n* \nUsage of the [Azure Maps Web SDK](https://aka.ms/amaadmc) allows for configuration based setup of an application for multiple use cases.\n* Currently, Azure Active Directory [v1.0 or v2.0](https://docs.microsoft.com/azure/active-directory/develop/azure-ad-endpoint-comparison) supports Work, School, and Guests but does not support Personal accounts. */
#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Model types must use PascalCase"
Expand Down Expand Up @@ -485,9 +485,17 @@ model PreBuiltTaskParameters is TaskParameters {
modelVersion?: string = "latest";
}

alias AnalyzeTextBody = {
/** The input documents to analyze. */
@body
@clientName("analyzeTextInput", "csharp")
catalinaperalta marked this conversation as resolved.
Show resolved Hide resolved
body: AnalyzeTextTask;
};

alias ShowStatsQueryParameter = QueryParametersTrait<{
/** (Optional) if set to true, response will contain request and document level statistics. */
@query
@clientName("showStatistics", "csharp")
catalinaperalta marked this conversation as resolved.
Show resolved Hide resolved
showStats?: boolean;
}>;

Expand All @@ -508,6 +516,7 @@ alias AnalyzeTextJobQueryParameters = QueryParametersTrait<{
alias AnalyzeTextQueryParameters = {
/** (Optional) if set to true, response will contain request and document level statistics. */
@query
@clientName("showStatistics", "csharp")
showStats?: boolean;
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import "@typespec/versioning";

using Language.Text;
using Azure.ClientGenerator.Core;
using TypeSpec.Versioning;

namespace Language.AnalyzeText;
namespace Language.Text;
/** Supported parameters for a custom Healthcare task. */
@added(Versions.v2023_11_15_preview)
model CustomHealthcareTaskParameters is CustomTaskParameters {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;

namespace Language.AnalyzeText;
namespace Language.Text;

/** Supported parameters for a Custom Entities task. */
model CustomEntitiesTaskParameters is CustomTaskParameters {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "@azure-tools/typespec-client-generator-core";
using Azure.ClientGenerator.Core;
using TypeSpec.Versioning;

namespace Language.AnalyzeText;
namespace Language.Text;

/** Contains the analyze text Entity linking input. */
model AnalyzeTextEntityLinkingInput extends AnalyzeTextTask {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "@azure-tools/typespec-client-generator-core";
using Azure.ClientGenerator.Core;
using TypeSpec.Versioning;

namespace Language.AnalyzeText;
namespace Language.Text;

/** The entity recognition analyze text input task request. */
model AnalyzeTextEntityRecognitionInput extends AnalyzeTextTask {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "@azure-tools/typespec-azure-core";
using TypeSpec.Versioning;
using Azure.Core;

namespace Language.AnalyzeText;
namespace Language.Text;

/** Supported parameters for a Healthcare task. */
model HealthcareTaskParameters is PreBuiltTaskParameters {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "@azure-tools/typespec-client-generator-core";
using Azure.ClientGenerator.Core;
using TypeSpec.Versioning;

namespace Language.AnalyzeText;
namespace Language.Text;

@doc("Contains the analyze text KeyPhraseExtraction task input.")
model AnalyzeTextKeyPhraseExtractionInput extends AnalyzeTextTask {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "@azure-tools/typespec-client-generator-core";
using Azure.ClientGenerator.Core;
using TypeSpec.Versioning;

namespace Language.AnalyzeText;
namespace Language.Text;

/** Contains the language detection document analysis input. */
model LanguageDetectionAnalysisInput {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "@azure-tools/typespec-client-generator-core";
using Azure.ClientGenerator.Core;
using TypeSpec.Versioning;

namespace Language.AnalyzeText;
namespace Language.Text;

/** Contains the analyze text PIIEntityRecognition task input. */
#suppress "@azure-tools/typespec-azure-core/casing-style"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using Azure.ClientGenerator.Core;
using TypeSpec.Versioning;
using Azure.Core;

namespace Language.AnalyzeText;
namespace Language.Text;

/** Contains the analyze text SentimentAnalysis task input. */
model AnalyzeTextSentimentAnalysisInput extends AnalyzeTextTask {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "@azure-tools/typespec-client-generator-core";
using Azure.ClientGenerator.Core;
using TypeSpec.Versioning;

namespace Language.AnalyzeText;
namespace Language.Text;

/** Supported parameters for an Extractive Summarization task. */
@added(Versions.v2023_04_01)
Expand Down Expand Up @@ -107,7 +107,7 @@ model AbstractiveSummarizationLROTask extends AnalyzeTextLROTask {
kind: AnalyzeTextLROTaskKind.AbstractiveSummarization;

/** Parameters for the Abstractive Summarization task. */
parameters: AbstractiveSummarizationTaskParameters;
parameters?: AbstractiveSummarizationTaskParameters;
catalinaperalta marked this conversation as resolved.
Show resolved Hide resolved
}

/** Supported parameters for the pre-built Abstractive Summarization task. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ options:
"@azure-tools/typespec-csharp":
package-dir: "Azure.AI.Language.AnalyzeText"
clear-output-folder: true
model-namespace: false
namespace: "Azure.AI.Language.AnalyzeText"
model-namespace: true
namespace: "Azure.AI.Language.Text"
flavor: azure
generate-protocol-methods: true
Loading