azure-sdk-for-js: SentimentResponse is missing SentimentBatchResult type

Describe the bug SentimentResponse type is missing the SentimentBatchResult type like the other types have.

The SentimentResponse type: https://github.com/Azure/azure-sdk-for-js/blob/878dfff792a0477b4c07df377ed0389433ff3b57/sdk/cognitiveservices/cognitiveservices-textanalytics/src/models/index.ts#L502

The DetectLanguageResponse type: https://github.com/Azure/azure-sdk-for-js/blob/878dfff792a0477b4c07df377ed0389433ff3b57/sdk/cognitiveservices/cognitiveservices-textanalytics/src/models/index.ts#L442

The SentimentBatchResult type already exists - just needs to be added to the SentimentResponse type definition.

Should I submit a pr?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

@Ethan-Arrowood To give you an update on this issue, we figured out and fixed the root cause, but since we’re in the middle of releasing a rewrite of the text analytics library, I’m not sure if we want to release a new version of the old package before the holidays.

As you mentioned, the API shape is in the package, just not connected to the result, so you should be able to work around this in your code with something like the following:

const result = (await client.sentiment(options)) as TextAnalyticsModels.SentimentBatchResult;

  console.log("The result is:");
  for (const document of result.documents!) {
    console.log(`Id: ${document.id}`);
    console.log(`Sentiment score: ${document.score}`);
  }

Does that unblock you for now until we can get a new package out?