Skip to content

Commit 3292029

Browse files
chore: use gapic-generator-python 0.63.2 (#333)
* chore: use gapic-generator-python 0.63.2 docs: add generated snippets PiperOrigin-RevId: 427792504 Source-Link: googleapis/googleapis@55b9e1e Source-Link: googleapis/googleapis-gen@bf4e86b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 310c508 commit 3292029

102 files changed

Lines changed: 10606 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/google-cloud-automl/google/cloud/automl_v1/services/auto_ml/async_client.py

Lines changed: 410 additions & 0 deletions
Large diffs are not rendered by default.

packages/google-cloud-automl/google/cloud/automl_v1/services/auto_ml/client.py

Lines changed: 428 additions & 0 deletions
Large diffs are not rendered by default.

packages/google-cloud-automl/google/cloud/automl_v1/services/prediction_service/async_client.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,30 @@ async def predict(
260260
- A row with column values matching the columns of the model,
261261
up to 5MB. Not available for FORECASTING ``prediction_type``.
262262
263+
264+
.. code-block::
265+
266+
from google.cloud import automl_v1
267+
268+
def sample_predict():
269+
# Create a client
270+
client = automl_v1.PredictionServiceClient()
271+
272+
# Initialize request argument(s)
273+
payload = automl_v1.ExamplePayload()
274+
payload.image.image_bytes = b'image_bytes_blob'
275+
276+
request = automl_v1.PredictRequest(
277+
name="name_value",
278+
payload=payload,
279+
)
280+
281+
# Make the request
282+
response = client.predict(request=request)
283+
284+
# Handle the response
285+
print(response)
286+
263287
Args:
264288
request (Union[google.cloud.automl_v1.types.PredictRequest, dict]):
265289
The request object. Request message for
@@ -401,6 +425,38 @@ async def batch_predict(
401425
- AutoML Natural Language Sentiment Analysis
402426
- AutoML Tables
403427
428+
429+
.. code-block::
430+
431+
from google.cloud import automl_v1
432+
433+
def sample_batch_predict():
434+
# Create a client
435+
client = automl_v1.PredictionServiceClient()
436+
437+
# Initialize request argument(s)
438+
input_config = automl_v1.BatchPredictInputConfig()
439+
input_config.gcs_source.input_uris = ['input_uris_value_1', 'input_uris_value_2']
440+
441+
output_config = automl_v1.BatchPredictOutputConfig()
442+
output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value"
443+
444+
request = automl_v1.BatchPredictRequest(
445+
name="name_value",
446+
input_config=input_config,
447+
output_config=output_config,
448+
)
449+
450+
# Make the request
451+
operation = client.batch_predict(request=request)
452+
453+
print("Waiting for operation to complete...")
454+
455+
response = operation.result()
456+
457+
# Handle the response
458+
print(response)
459+
404460
Args:
405461
request (Union[google.cloud.automl_v1.types.BatchPredictRequest, dict]):
406462
The request object. Request message for

packages/google-cloud-automl/google/cloud/automl_v1/services/prediction_service/client.py

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,31 @@ def predict(
459459
- A row with column values matching the columns of the model,
460460
up to 5MB. Not available for FORECASTING ``prediction_type``.
461461
462+
463+
464+
.. code-block::
465+
466+
from google.cloud import automl_v1
467+
468+
def sample_predict():
469+
# Create a client
470+
client = automl_v1.PredictionServiceClient()
471+
472+
# Initialize request argument(s)
473+
payload = automl_v1.ExamplePayload()
474+
payload.image.image_bytes = b'image_bytes_blob'
475+
476+
request = automl_v1.PredictRequest(
477+
name="name_value",
478+
payload=payload,
479+
)
480+
481+
# Make the request
482+
response = client.predict(request=request)
483+
484+
# Handle the response
485+
print(response)
486+
462487
Args:
463488
request (Union[google.cloud.automl_v1.types.PredictRequest, dict]):
464489
The request object. Request message for
@@ -599,6 +624,39 @@ def batch_predict(
599624
- AutoML Natural Language Sentiment Analysis
600625
- AutoML Tables
601626
627+
628+
629+
.. code-block::
630+
631+
from google.cloud import automl_v1
632+
633+
def sample_batch_predict():
634+
# Create a client
635+
client = automl_v1.PredictionServiceClient()
636+
637+
# Initialize request argument(s)
638+
input_config = automl_v1.BatchPredictInputConfig()
639+
input_config.gcs_source.input_uris = ['input_uris_value_1', 'input_uris_value_2']
640+
641+
output_config = automl_v1.BatchPredictOutputConfig()
642+
output_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value"
643+
644+
request = automl_v1.BatchPredictRequest(
645+
name="name_value",
646+
input_config=input_config,
647+
output_config=output_config,
648+
)
649+
650+
# Make the request
651+
operation = client.batch_predict(request=request)
652+
653+
print("Waiting for operation to complete...")
654+
655+
response = operation.result()
656+
657+
# Handle the response
658+
print(response)
659+
602660
Args:
603661
request (Union[google.cloud.automl_v1.types.BatchPredictRequest, dict]):
604662
The request object. Request message for

0 commit comments

Comments
 (0)