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

(SAMPLES) Missing argument type when initializing an input Document #2021

Open
kuhanaklobasa opened this issue May 1, 2024 · 0 comments
Open
Assignees

Comments

@kuhanaklobasa
Copy link

All google-cloud-language samples that initialize an input Document class are missing the required field type.
Example: https://cloud.google.com/python/docs/reference/language/latest/google.cloud.language_v2.services.language_service.LanguageServiceAsyncClient#google_cloud_language_v2_services_language_service_LanguageServiceAsyncClient_moderate_text
Current:

# Initialize request argument(s)
document = language_v2.Document()
document.content = "content_value"

Fix (1):

# Initialize request argument(s)
document = language_v2.Document()
document.type = language_v2.Document.Type.PLAIN_TEXT
document.content = "content_value"

Fix (2):

# Initialize request argument(s)
document = language_v2.Document(type=language_v2.Document.Type.PLAIN_TEXT)
document.content = "content_value"
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

No branches or pull requests

2 participants