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

Adding custom non-batched return types for non-batch calls #6992

Merged
merged 1 commit into from
Jul 24, 2019

Conversation

assafi
Copy link
Contributor

@assafi assafi commented Jul 22, 2019

An update to v4.0.0 which has not been published yet (hence the same version number).
Adding custom non-batched return types for non-batch calls simplifying the callee code.

Previously, the non-batch methods would send a single document for analysis but return a batch response that can only contain a single document. Instead, we now return a single response from these methods and unwrap the list for you. The same is done for any potential errors and statistics responses.

Previously:

var result = client.DetectLanguage("This is a document written in English.");

// Printing detected languages
Console.WriteLine($"Language: {result.documents[0].DetectedLanguages[0].Name}");

And now:

var result = client.DetectLanguage("This is a document written in English.");

// Printing detected languages
Console.WriteLine($"Language: {result.DetectedLanguages[0].Name}");

This is a simplification over a batch service REST API that hasn't changed. Will be mainly used for example/documentation purposes.

@assafi
Copy link
Contributor Author

assafi commented Jul 22, 2019

Please refer to this recent PR for v4.0.0 changes.

@assafi
Copy link
Contributor Author

assafi commented Jul 22, 2019

@AlexGhiondea / @shahabhijeet - Could you please review?

@AlexGhiondea
Copy link
Contributor

@assafi I approved this PR. Going forward, would you mind adding more information/context to the PR? It helps to review the code knowing what motivated the change :).

@assafi
Copy link
Contributor Author

assafi commented Jul 24, 2019

@AlexGhiondea Thanks. I elaborated a bit more on the PR description.

@AlexGhiondea AlexGhiondea merged commit fcae227 into Azure:master Jul 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants