Repository navigation
language: allow raw request objects to annotate() #1998
Description
Activity
- addedapi: languageIssues related to the Cloud Natural Language API API.Issues related to the Cloud Natural Language API API.
on Feb 15, 2017 I think
annotatewas meant to accept a raw API request object in the form of https://cloud.google.com/natural-language/docs/reference/rest/v1/documents/annotateText#features, but it didn't end up that way. So instead of explaining the mapping ofentitiestoextractEntities, we should allow this request to "just work":vision.annotate({ extractEntities: true, extractSyntax: true }, function() {})
So if they're using the upstream API docs as a reference, they won't need to use our aliases.
that should work. Thanks!
- changed the title
[-][Language] features property name should refer to the actual vocabulary in the API references[/-][+]language: allow raw request objects to `annotate()`[/+]on Feb 16, 2017 - addedpriority: p0Highest priority. Critical issue. P0 implies highest priority.Highest priority. Critical issue. P0 implies highest priority.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
on Feb 27, 2017 - added a commit that references this issue
on Mar 1, 2017 Well, sorry for my misunderstanding, but I think the point of this feedback is the documentation and therefore simply allowing the those fields additionally isn't the solution (that would be a good thing to do though). The comments for those features fields should be updated in addition.
I think what we want is:
- Option aliases stay the same
- Add "(Alias for
options.fullNameVariant)" (reference: https://github.com/GoogleCloudPlatform/google-cloud-node/blob/764f010d1c557f3be30aaf7e64246937a7ea352d/packages/compute/src/region.js#L257) - Update this link to https://cloud.google.com/natural-language/docs/reference/rest/v1/documents/annotateText#features
Since we're in there, and since it's a pattern in other areas of the API, it would also be nice to allow the full name variants to work as well.
Current options vocabulary is good and we can keep it -- what API team cares is the relationship with the API documentations. Thus probably only the updating the link could be sufficient? @monattar for the confirmation.
- added a commit that references this issue
on Mar 18, 2026
From internal feedback from the API team:
https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/packages/language/src/document.js#L235
annotatehas options for features, named asentities,sentiment, andsyntax. They are different from the terms in the API reference, thus, we should put the references in the comments of each features (entities->extractEntities,syntax->extractSyntax,sentiment->extractDocumentSentiment). Also better to have a link to https://cloud.google.com/natural-language/docs/reference/rest/v1/documents/annotateText#featurescc: @monattar