hc99 commited on
Commit
a2f980c
·
verified ·
1 Parent(s): 3193ef1

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_batch_cancel_pipeline_jobs_async.py +57 -0
  2. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_batch_cancel_pipeline_jobs_sync.py +57 -0
  3. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_batch_delete_pipeline_jobs_async.py +57 -0
  4. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_batch_delete_pipeline_jobs_sync.py +57 -0
  5. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_cancel_pipeline_job_sync.py +50 -0
  6. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_cancel_training_pipeline_async.py +50 -0
  7. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_create_pipeline_job_async.py +52 -0
  8. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_create_pipeline_job_sync.py +52 -0
  9. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_create_training_pipeline_async.py +58 -0
  10. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_create_training_pipeline_sync.py +58 -0
  11. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_delete_pipeline_job_sync.py +56 -0
  12. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_delete_training_pipeline_async.py +56 -0
  13. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_delete_training_pipeline_sync.py +56 -0
  14. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_get_pipeline_job_async.py +52 -0
  15. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_get_pipeline_job_sync.py +52 -0
  16. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_get_training_pipeline_async.py +52 -0
  17. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_get_training_pipeline_sync.py +52 -0
  18. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_list_pipeline_jobs_async.py +53 -0
  19. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_list_pipeline_jobs_sync.py +53 -0
  20. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_list_training_pipelines_async.py +53 -0
  21. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_direct_predict_async.py +52 -0
  22. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_direct_predict_sync.py +52 -0
  23. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_direct_raw_predict_async.py +52 -0
  24. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_direct_raw_predict_sync.py +52 -0
  25. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_explain_async.py +56 -0
  26. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_explain_sync.py +56 -0
  27. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_generate_content_async.py +56 -0
  28. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_generate_content_sync.py +56 -0
  29. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_predict_async.py +56 -0
  30. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_predict_sync.py +56 -0
  31. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_raw_predict_async.py +52 -0
  32. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_raw_predict_sync.py +52 -0
  33. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_server_streaming_predict_async.py +53 -0
  34. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_server_streaming_predict_sync.py +53 -0
  35. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_stream_direct_predict_async.py +63 -0
  36. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_stream_direct_predict_sync.py +63 -0
  37. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_stream_direct_raw_predict_async.py +63 -0
  38. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_stream_direct_raw_predict_sync.py +63 -0
  39. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_stream_generate_content_async.py +57 -0
  40. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_stream_generate_content_sync.py +57 -0
  41. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_stream_raw_predict_async.py +53 -0
  42. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_stream_raw_predict_sync.py +53 -0
  43. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_streaming_predict_async.py +63 -0
  44. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_streaming_predict_sync.py +63 -0
  45. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_streaming_raw_predict_async.py +63 -0
  46. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_streaming_raw_predict_sync.py +63 -0
  47. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_schedule_service_create_schedule_async.py +59 -0
  48. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_schedule_service_create_schedule_sync.py +59 -0
  49. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_schedule_service_delete_schedule_async.py +56 -0
  50. testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_schedule_service_delete_schedule_sync.py +56 -0
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_batch_cancel_pipeline_jobs_async.py ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for BatchCancelPipelineJobs
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_BatchCancelPipelineJobs_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_batch_cancel_pipeline_jobs():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.BatchCancelPipelineJobsRequest(
43
+ parent="parent_value",
44
+ names=['names_value1', 'names_value2'],
45
+ )
46
+
47
+ # Make the request
48
+ operation = client.batch_cancel_pipeline_jobs(request=request)
49
+
50
+ print("Waiting for operation to complete...")
51
+
52
+ response = (await operation).result()
53
+
54
+ # Handle the response
55
+ print(response)
56
+
57
+ # [END aiplatform_v1_generated_PipelineService_BatchCancelPipelineJobs_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_batch_cancel_pipeline_jobs_sync.py ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for BatchCancelPipelineJobs
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_BatchCancelPipelineJobs_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_batch_cancel_pipeline_jobs():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.BatchCancelPipelineJobsRequest(
43
+ parent="parent_value",
44
+ names=['names_value1', 'names_value2'],
45
+ )
46
+
47
+ # Make the request
48
+ operation = client.batch_cancel_pipeline_jobs(request=request)
49
+
50
+ print("Waiting for operation to complete...")
51
+
52
+ response = operation.result()
53
+
54
+ # Handle the response
55
+ print(response)
56
+
57
+ # [END aiplatform_v1_generated_PipelineService_BatchCancelPipelineJobs_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_batch_delete_pipeline_jobs_async.py ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for BatchDeletePipelineJobs
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_BatchDeletePipelineJobs_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_batch_delete_pipeline_jobs():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.BatchDeletePipelineJobsRequest(
43
+ parent="parent_value",
44
+ names=['names_value1', 'names_value2'],
45
+ )
46
+
47
+ # Make the request
48
+ operation = client.batch_delete_pipeline_jobs(request=request)
49
+
50
+ print("Waiting for operation to complete...")
51
+
52
+ response = (await operation).result()
53
+
54
+ # Handle the response
55
+ print(response)
56
+
57
+ # [END aiplatform_v1_generated_PipelineService_BatchDeletePipelineJobs_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_batch_delete_pipeline_jobs_sync.py ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for BatchDeletePipelineJobs
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_BatchDeletePipelineJobs_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_batch_delete_pipeline_jobs():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.BatchDeletePipelineJobsRequest(
43
+ parent="parent_value",
44
+ names=['names_value1', 'names_value2'],
45
+ )
46
+
47
+ # Make the request
48
+ operation = client.batch_delete_pipeline_jobs(request=request)
49
+
50
+ print("Waiting for operation to complete...")
51
+
52
+ response = operation.result()
53
+
54
+ # Handle the response
55
+ print(response)
56
+
57
+ # [END aiplatform_v1_generated_PipelineService_BatchDeletePipelineJobs_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_cancel_pipeline_job_sync.py ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for CancelPipelineJob
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_CancelPipelineJob_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_cancel_pipeline_job():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.CancelPipelineJobRequest(
43
+ name="name_value",
44
+ )
45
+
46
+ # Make the request
47
+ client.cancel_pipeline_job(request=request)
48
+
49
+
50
+ # [END aiplatform_v1_generated_PipelineService_CancelPipelineJob_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_cancel_training_pipeline_async.py ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for CancelTrainingPipeline
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_CancelTrainingPipeline_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_cancel_training_pipeline():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.CancelTrainingPipelineRequest(
43
+ name="name_value",
44
+ )
45
+
46
+ # Make the request
47
+ await client.cancel_training_pipeline(request=request)
48
+
49
+
50
+ # [END aiplatform_v1_generated_PipelineService_CancelTrainingPipeline_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_create_pipeline_job_async.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for CreatePipelineJob
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_CreatePipelineJob_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_create_pipeline_job():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.CreatePipelineJobRequest(
43
+ parent="parent_value",
44
+ )
45
+
46
+ # Make the request
47
+ response = await client.create_pipeline_job(request=request)
48
+
49
+ # Handle the response
50
+ print(response)
51
+
52
+ # [END aiplatform_v1_generated_PipelineService_CreatePipelineJob_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_create_pipeline_job_sync.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for CreatePipelineJob
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_CreatePipelineJob_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_create_pipeline_job():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.CreatePipelineJobRequest(
43
+ parent="parent_value",
44
+ )
45
+
46
+ # Make the request
47
+ response = client.create_pipeline_job(request=request)
48
+
49
+ # Handle the response
50
+ print(response)
51
+
52
+ # [END aiplatform_v1_generated_PipelineService_CreatePipelineJob_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_create_training_pipeline_async.py ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for CreateTrainingPipeline
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_CreateTrainingPipeline_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_create_training_pipeline():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ training_pipeline = aiplatform_v1.TrainingPipeline()
43
+ training_pipeline.display_name = "display_name_value"
44
+ training_pipeline.training_task_definition = "training_task_definition_value"
45
+ training_pipeline.training_task_inputs.null_value = "NULL_VALUE"
46
+
47
+ request = aiplatform_v1.CreateTrainingPipelineRequest(
48
+ parent="parent_value",
49
+ training_pipeline=training_pipeline,
50
+ )
51
+
52
+ # Make the request
53
+ response = await client.create_training_pipeline(request=request)
54
+
55
+ # Handle the response
56
+ print(response)
57
+
58
+ # [END aiplatform_v1_generated_PipelineService_CreateTrainingPipeline_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_create_training_pipeline_sync.py ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for CreateTrainingPipeline
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_CreateTrainingPipeline_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_create_training_pipeline():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ training_pipeline = aiplatform_v1.TrainingPipeline()
43
+ training_pipeline.display_name = "display_name_value"
44
+ training_pipeline.training_task_definition = "training_task_definition_value"
45
+ training_pipeline.training_task_inputs.null_value = "NULL_VALUE"
46
+
47
+ request = aiplatform_v1.CreateTrainingPipelineRequest(
48
+ parent="parent_value",
49
+ training_pipeline=training_pipeline,
50
+ )
51
+
52
+ # Make the request
53
+ response = client.create_training_pipeline(request=request)
54
+
55
+ # Handle the response
56
+ print(response)
57
+
58
+ # [END aiplatform_v1_generated_PipelineService_CreateTrainingPipeline_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_delete_pipeline_job_sync.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for DeletePipelineJob
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_DeletePipelineJob_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_delete_pipeline_job():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.DeletePipelineJobRequest(
43
+ name="name_value",
44
+ )
45
+
46
+ # Make the request
47
+ operation = client.delete_pipeline_job(request=request)
48
+
49
+ print("Waiting for operation to complete...")
50
+
51
+ response = operation.result()
52
+
53
+ # Handle the response
54
+ print(response)
55
+
56
+ # [END aiplatform_v1_generated_PipelineService_DeletePipelineJob_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_delete_training_pipeline_async.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for DeleteTrainingPipeline
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_DeleteTrainingPipeline_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_delete_training_pipeline():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.DeleteTrainingPipelineRequest(
43
+ name="name_value",
44
+ )
45
+
46
+ # Make the request
47
+ operation = client.delete_training_pipeline(request=request)
48
+
49
+ print("Waiting for operation to complete...")
50
+
51
+ response = (await operation).result()
52
+
53
+ # Handle the response
54
+ print(response)
55
+
56
+ # [END aiplatform_v1_generated_PipelineService_DeleteTrainingPipeline_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_delete_training_pipeline_sync.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for DeleteTrainingPipeline
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_DeleteTrainingPipeline_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_delete_training_pipeline():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.DeleteTrainingPipelineRequest(
43
+ name="name_value",
44
+ )
45
+
46
+ # Make the request
47
+ operation = client.delete_training_pipeline(request=request)
48
+
49
+ print("Waiting for operation to complete...")
50
+
51
+ response = operation.result()
52
+
53
+ # Handle the response
54
+ print(response)
55
+
56
+ # [END aiplatform_v1_generated_PipelineService_DeleteTrainingPipeline_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_get_pipeline_job_async.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for GetPipelineJob
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_GetPipelineJob_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_get_pipeline_job():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.GetPipelineJobRequest(
43
+ name="name_value",
44
+ )
45
+
46
+ # Make the request
47
+ response = await client.get_pipeline_job(request=request)
48
+
49
+ # Handle the response
50
+ print(response)
51
+
52
+ # [END aiplatform_v1_generated_PipelineService_GetPipelineJob_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_get_pipeline_job_sync.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for GetPipelineJob
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_GetPipelineJob_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_get_pipeline_job():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.GetPipelineJobRequest(
43
+ name="name_value",
44
+ )
45
+
46
+ # Make the request
47
+ response = client.get_pipeline_job(request=request)
48
+
49
+ # Handle the response
50
+ print(response)
51
+
52
+ # [END aiplatform_v1_generated_PipelineService_GetPipelineJob_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_get_training_pipeline_async.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for GetTrainingPipeline
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_GetTrainingPipeline_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_get_training_pipeline():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.GetTrainingPipelineRequest(
43
+ name="name_value",
44
+ )
45
+
46
+ # Make the request
47
+ response = await client.get_training_pipeline(request=request)
48
+
49
+ # Handle the response
50
+ print(response)
51
+
52
+ # [END aiplatform_v1_generated_PipelineService_GetTrainingPipeline_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_get_training_pipeline_sync.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for GetTrainingPipeline
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_GetTrainingPipeline_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_get_training_pipeline():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.GetTrainingPipelineRequest(
43
+ name="name_value",
44
+ )
45
+
46
+ # Make the request
47
+ response = client.get_training_pipeline(request=request)
48
+
49
+ # Handle the response
50
+ print(response)
51
+
52
+ # [END aiplatform_v1_generated_PipelineService_GetTrainingPipeline_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_list_pipeline_jobs_async.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for ListPipelineJobs
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_ListPipelineJobs_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_list_pipeline_jobs():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.ListPipelineJobsRequest(
43
+ parent="parent_value",
44
+ )
45
+
46
+ # Make the request
47
+ page_result = client.list_pipeline_jobs(request=request)
48
+
49
+ # Handle the response
50
+ async for response in page_result:
51
+ print(response)
52
+
53
+ # [END aiplatform_v1_generated_PipelineService_ListPipelineJobs_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_list_pipeline_jobs_sync.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for ListPipelineJobs
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_ListPipelineJobs_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_list_pipeline_jobs():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.ListPipelineJobsRequest(
43
+ parent="parent_value",
44
+ )
45
+
46
+ # Make the request
47
+ page_result = client.list_pipeline_jobs(request=request)
48
+
49
+ # Handle the response
50
+ for response in page_result:
51
+ print(response)
52
+
53
+ # [END aiplatform_v1_generated_PipelineService_ListPipelineJobs_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_pipeline_service_list_training_pipelines_async.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for ListTrainingPipelines
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PipelineService_ListTrainingPipelines_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_list_training_pipelines():
38
+ # Create a client
39
+ client = aiplatform_v1.PipelineServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.ListTrainingPipelinesRequest(
43
+ parent="parent_value",
44
+ )
45
+
46
+ # Make the request
47
+ page_result = client.list_training_pipelines(request=request)
48
+
49
+ # Handle the response
50
+ async for response in page_result:
51
+ print(response)
52
+
53
+ # [END aiplatform_v1_generated_PipelineService_ListTrainingPipelines_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_direct_predict_async.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for DirectPredict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_DirectPredict_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_direct_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.DirectPredictRequest(
43
+ endpoint="endpoint_value",
44
+ )
45
+
46
+ # Make the request
47
+ response = await client.direct_predict(request=request)
48
+
49
+ # Handle the response
50
+ print(response)
51
+
52
+ # [END aiplatform_v1_generated_PredictionService_DirectPredict_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_direct_predict_sync.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for DirectPredict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_DirectPredict_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_direct_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.DirectPredictRequest(
43
+ endpoint="endpoint_value",
44
+ )
45
+
46
+ # Make the request
47
+ response = client.direct_predict(request=request)
48
+
49
+ # Handle the response
50
+ print(response)
51
+
52
+ # [END aiplatform_v1_generated_PredictionService_DirectPredict_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_direct_raw_predict_async.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for DirectRawPredict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_DirectRawPredict_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_direct_raw_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.DirectRawPredictRequest(
43
+ endpoint="endpoint_value",
44
+ )
45
+
46
+ # Make the request
47
+ response = await client.direct_raw_predict(request=request)
48
+
49
+ # Handle the response
50
+ print(response)
51
+
52
+ # [END aiplatform_v1_generated_PredictionService_DirectRawPredict_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_direct_raw_predict_sync.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for DirectRawPredict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_DirectRawPredict_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_direct_raw_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.DirectRawPredictRequest(
43
+ endpoint="endpoint_value",
44
+ )
45
+
46
+ # Make the request
47
+ response = client.direct_raw_predict(request=request)
48
+
49
+ # Handle the response
50
+ print(response)
51
+
52
+ # [END aiplatform_v1_generated_PredictionService_DirectRawPredict_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_explain_async.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for Explain
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_Explain_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_explain():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ instances = aiplatform_v1.Value()
43
+ instances.null_value = "NULL_VALUE"
44
+
45
+ request = aiplatform_v1.ExplainRequest(
46
+ endpoint="endpoint_value",
47
+ instances=instances,
48
+ )
49
+
50
+ # Make the request
51
+ response = await client.explain(request=request)
52
+
53
+ # Handle the response
54
+ print(response)
55
+
56
+ # [END aiplatform_v1_generated_PredictionService_Explain_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_explain_sync.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for Explain
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_Explain_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_explain():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ instances = aiplatform_v1.Value()
43
+ instances.null_value = "NULL_VALUE"
44
+
45
+ request = aiplatform_v1.ExplainRequest(
46
+ endpoint="endpoint_value",
47
+ instances=instances,
48
+ )
49
+
50
+ # Make the request
51
+ response = client.explain(request=request)
52
+
53
+ # Handle the response
54
+ print(response)
55
+
56
+ # [END aiplatform_v1_generated_PredictionService_Explain_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_generate_content_async.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for GenerateContent
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_GenerateContent_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_generate_content():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ contents = aiplatform_v1.Content()
43
+ contents.parts.text = "text_value"
44
+
45
+ request = aiplatform_v1.GenerateContentRequest(
46
+ model="model_value",
47
+ contents=contents,
48
+ )
49
+
50
+ # Make the request
51
+ response = await client.generate_content(request=request)
52
+
53
+ # Handle the response
54
+ print(response)
55
+
56
+ # [END aiplatform_v1_generated_PredictionService_GenerateContent_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_generate_content_sync.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for GenerateContent
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_GenerateContent_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_generate_content():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ contents = aiplatform_v1.Content()
43
+ contents.parts.text = "text_value"
44
+
45
+ request = aiplatform_v1.GenerateContentRequest(
46
+ model="model_value",
47
+ contents=contents,
48
+ )
49
+
50
+ # Make the request
51
+ response = client.generate_content(request=request)
52
+
53
+ # Handle the response
54
+ print(response)
55
+
56
+ # [END aiplatform_v1_generated_PredictionService_GenerateContent_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_predict_async.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for Predict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_Predict_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ instances = aiplatform_v1.Value()
43
+ instances.null_value = "NULL_VALUE"
44
+
45
+ request = aiplatform_v1.PredictRequest(
46
+ endpoint="endpoint_value",
47
+ instances=instances,
48
+ )
49
+
50
+ # Make the request
51
+ response = await client.predict(request=request)
52
+
53
+ # Handle the response
54
+ print(response)
55
+
56
+ # [END aiplatform_v1_generated_PredictionService_Predict_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_predict_sync.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for Predict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_Predict_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ instances = aiplatform_v1.Value()
43
+ instances.null_value = "NULL_VALUE"
44
+
45
+ request = aiplatform_v1.PredictRequest(
46
+ endpoint="endpoint_value",
47
+ instances=instances,
48
+ )
49
+
50
+ # Make the request
51
+ response = client.predict(request=request)
52
+
53
+ # Handle the response
54
+ print(response)
55
+
56
+ # [END aiplatform_v1_generated_PredictionService_Predict_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_raw_predict_async.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for RawPredict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_RawPredict_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_raw_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.RawPredictRequest(
43
+ endpoint="endpoint_value",
44
+ )
45
+
46
+ # Make the request
47
+ response = await client.raw_predict(request=request)
48
+
49
+ # Handle the response
50
+ print(response)
51
+
52
+ # [END aiplatform_v1_generated_PredictionService_RawPredict_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_raw_predict_sync.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for RawPredict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_RawPredict_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_raw_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.RawPredictRequest(
43
+ endpoint="endpoint_value",
44
+ )
45
+
46
+ # Make the request
47
+ response = client.raw_predict(request=request)
48
+
49
+ # Handle the response
50
+ print(response)
51
+
52
+ # [END aiplatform_v1_generated_PredictionService_RawPredict_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_server_streaming_predict_async.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for ServerStreamingPredict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_ServerStreamingPredict_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_server_streaming_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.StreamingPredictRequest(
43
+ endpoint="endpoint_value",
44
+ )
45
+
46
+ # Make the request
47
+ stream = await client.server_streaming_predict(request=request)
48
+
49
+ # Handle the response
50
+ async for response in stream:
51
+ print(response)
52
+
53
+ # [END aiplatform_v1_generated_PredictionService_ServerStreamingPredict_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_server_streaming_predict_sync.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for ServerStreamingPredict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_ServerStreamingPredict_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_server_streaming_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.StreamingPredictRequest(
43
+ endpoint="endpoint_value",
44
+ )
45
+
46
+ # Make the request
47
+ stream = client.server_streaming_predict(request=request)
48
+
49
+ # Handle the response
50
+ for response in stream:
51
+ print(response)
52
+
53
+ # [END aiplatform_v1_generated_PredictionService_ServerStreamingPredict_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_stream_direct_predict_async.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for StreamDirectPredict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_StreamDirectPredict_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_stream_direct_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.StreamDirectPredictRequest(
43
+ endpoint="endpoint_value",
44
+ )
45
+
46
+ # This method expects an iterator which contains
47
+ # 'aiplatform_v1.StreamDirectPredictRequest' objects
48
+ # Here we create a generator that yields a single `request` for
49
+ # demonstrative purposes.
50
+ requests = [request]
51
+
52
+ def request_generator():
53
+ for request in requests:
54
+ yield request
55
+
56
+ # Make the request
57
+ stream = await client.stream_direct_predict(requests=request_generator())
58
+
59
+ # Handle the response
60
+ async for response in stream:
61
+ print(response)
62
+
63
+ # [END aiplatform_v1_generated_PredictionService_StreamDirectPredict_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_stream_direct_predict_sync.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for StreamDirectPredict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_StreamDirectPredict_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_stream_direct_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.StreamDirectPredictRequest(
43
+ endpoint="endpoint_value",
44
+ )
45
+
46
+ # This method expects an iterator which contains
47
+ # 'aiplatform_v1.StreamDirectPredictRequest' objects
48
+ # Here we create a generator that yields a single `request` for
49
+ # demonstrative purposes.
50
+ requests = [request]
51
+
52
+ def request_generator():
53
+ for request in requests:
54
+ yield request
55
+
56
+ # Make the request
57
+ stream = client.stream_direct_predict(requests=request_generator())
58
+
59
+ # Handle the response
60
+ for response in stream:
61
+ print(response)
62
+
63
+ # [END aiplatform_v1_generated_PredictionService_StreamDirectPredict_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_stream_direct_raw_predict_async.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for StreamDirectRawPredict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_StreamDirectRawPredict_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_stream_direct_raw_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.StreamDirectRawPredictRequest(
43
+ endpoint="endpoint_value",
44
+ )
45
+
46
+ # This method expects an iterator which contains
47
+ # 'aiplatform_v1.StreamDirectRawPredictRequest' objects
48
+ # Here we create a generator that yields a single `request` for
49
+ # demonstrative purposes.
50
+ requests = [request]
51
+
52
+ def request_generator():
53
+ for request in requests:
54
+ yield request
55
+
56
+ # Make the request
57
+ stream = await client.stream_direct_raw_predict(requests=request_generator())
58
+
59
+ # Handle the response
60
+ async for response in stream:
61
+ print(response)
62
+
63
+ # [END aiplatform_v1_generated_PredictionService_StreamDirectRawPredict_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_stream_direct_raw_predict_sync.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for StreamDirectRawPredict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_StreamDirectRawPredict_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_stream_direct_raw_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.StreamDirectRawPredictRequest(
43
+ endpoint="endpoint_value",
44
+ )
45
+
46
+ # This method expects an iterator which contains
47
+ # 'aiplatform_v1.StreamDirectRawPredictRequest' objects
48
+ # Here we create a generator that yields a single `request` for
49
+ # demonstrative purposes.
50
+ requests = [request]
51
+
52
+ def request_generator():
53
+ for request in requests:
54
+ yield request
55
+
56
+ # Make the request
57
+ stream = client.stream_direct_raw_predict(requests=request_generator())
58
+
59
+ # Handle the response
60
+ for response in stream:
61
+ print(response)
62
+
63
+ # [END aiplatform_v1_generated_PredictionService_StreamDirectRawPredict_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_stream_generate_content_async.py ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for StreamGenerateContent
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_StreamGenerateContent_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_stream_generate_content():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ contents = aiplatform_v1.Content()
43
+ contents.parts.text = "text_value"
44
+
45
+ request = aiplatform_v1.GenerateContentRequest(
46
+ model="model_value",
47
+ contents=contents,
48
+ )
49
+
50
+ # Make the request
51
+ stream = await client.stream_generate_content(request=request)
52
+
53
+ # Handle the response
54
+ async for response in stream:
55
+ print(response)
56
+
57
+ # [END aiplatform_v1_generated_PredictionService_StreamGenerateContent_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_stream_generate_content_sync.py ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for StreamGenerateContent
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_StreamGenerateContent_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_stream_generate_content():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ contents = aiplatform_v1.Content()
43
+ contents.parts.text = "text_value"
44
+
45
+ request = aiplatform_v1.GenerateContentRequest(
46
+ model="model_value",
47
+ contents=contents,
48
+ )
49
+
50
+ # Make the request
51
+ stream = client.stream_generate_content(request=request)
52
+
53
+ # Handle the response
54
+ for response in stream:
55
+ print(response)
56
+
57
+ # [END aiplatform_v1_generated_PredictionService_StreamGenerateContent_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_stream_raw_predict_async.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for StreamRawPredict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_StreamRawPredict_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_stream_raw_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.StreamRawPredictRequest(
43
+ endpoint="endpoint_value",
44
+ )
45
+
46
+ # Make the request
47
+ stream = await client.stream_raw_predict(request=request)
48
+
49
+ # Handle the response
50
+ async for response in stream:
51
+ print(response)
52
+
53
+ # [END aiplatform_v1_generated_PredictionService_StreamRawPredict_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_stream_raw_predict_sync.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for StreamRawPredict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_StreamRawPredict_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_stream_raw_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.StreamRawPredictRequest(
43
+ endpoint="endpoint_value",
44
+ )
45
+
46
+ # Make the request
47
+ stream = client.stream_raw_predict(request=request)
48
+
49
+ # Handle the response
50
+ for response in stream:
51
+ print(response)
52
+
53
+ # [END aiplatform_v1_generated_PredictionService_StreamRawPredict_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_streaming_predict_async.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for StreamingPredict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_StreamingPredict_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_streaming_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.StreamingPredictRequest(
43
+ endpoint="endpoint_value",
44
+ )
45
+
46
+ # This method expects an iterator which contains
47
+ # 'aiplatform_v1.StreamingPredictRequest' objects
48
+ # Here we create a generator that yields a single `request` for
49
+ # demonstrative purposes.
50
+ requests = [request]
51
+
52
+ def request_generator():
53
+ for request in requests:
54
+ yield request
55
+
56
+ # Make the request
57
+ stream = await client.streaming_predict(requests=request_generator())
58
+
59
+ # Handle the response
60
+ async for response in stream:
61
+ print(response)
62
+
63
+ # [END aiplatform_v1_generated_PredictionService_StreamingPredict_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_streaming_predict_sync.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for StreamingPredict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_StreamingPredict_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_streaming_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.StreamingPredictRequest(
43
+ endpoint="endpoint_value",
44
+ )
45
+
46
+ # This method expects an iterator which contains
47
+ # 'aiplatform_v1.StreamingPredictRequest' objects
48
+ # Here we create a generator that yields a single `request` for
49
+ # demonstrative purposes.
50
+ requests = [request]
51
+
52
+ def request_generator():
53
+ for request in requests:
54
+ yield request
55
+
56
+ # Make the request
57
+ stream = client.streaming_predict(requests=request_generator())
58
+
59
+ # Handle the response
60
+ for response in stream:
61
+ print(response)
62
+
63
+ # [END aiplatform_v1_generated_PredictionService_StreamingPredict_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_streaming_raw_predict_async.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for StreamingRawPredict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_StreamingRawPredict_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_streaming_raw_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.StreamingRawPredictRequest(
43
+ endpoint="endpoint_value",
44
+ )
45
+
46
+ # This method expects an iterator which contains
47
+ # 'aiplatform_v1.StreamingRawPredictRequest' objects
48
+ # Here we create a generator that yields a single `request` for
49
+ # demonstrative purposes.
50
+ requests = [request]
51
+
52
+ def request_generator():
53
+ for request in requests:
54
+ yield request
55
+
56
+ # Make the request
57
+ stream = await client.streaming_raw_predict(requests=request_generator())
58
+
59
+ # Handle the response
60
+ async for response in stream:
61
+ print(response)
62
+
63
+ # [END aiplatform_v1_generated_PredictionService_StreamingRawPredict_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_prediction_service_streaming_raw_predict_sync.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for StreamingRawPredict
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_PredictionService_StreamingRawPredict_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_streaming_raw_predict():
38
+ # Create a client
39
+ client = aiplatform_v1.PredictionServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.StreamingRawPredictRequest(
43
+ endpoint="endpoint_value",
44
+ )
45
+
46
+ # This method expects an iterator which contains
47
+ # 'aiplatform_v1.StreamingRawPredictRequest' objects
48
+ # Here we create a generator that yields a single `request` for
49
+ # demonstrative purposes.
50
+ requests = [request]
51
+
52
+ def request_generator():
53
+ for request in requests:
54
+ yield request
55
+
56
+ # Make the request
57
+ stream = client.streaming_raw_predict(requests=request_generator())
58
+
59
+ # Handle the response
60
+ for response in stream:
61
+ print(response)
62
+
63
+ # [END aiplatform_v1_generated_PredictionService_StreamingRawPredict_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_schedule_service_create_schedule_async.py ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for CreateSchedule
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_ScheduleService_CreateSchedule_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_create_schedule():
38
+ # Create a client
39
+ client = aiplatform_v1.ScheduleServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ schedule = aiplatform_v1.Schedule()
43
+ schedule.cron = "cron_value"
44
+ schedule.create_pipeline_job_request.parent = "parent_value"
45
+ schedule.display_name = "display_name_value"
46
+ schedule.max_concurrent_run_count = 2596
47
+
48
+ request = aiplatform_v1.CreateScheduleRequest(
49
+ parent="parent_value",
50
+ schedule=schedule,
51
+ )
52
+
53
+ # Make the request
54
+ response = await client.create_schedule(request=request)
55
+
56
+ # Handle the response
57
+ print(response)
58
+
59
+ # [END aiplatform_v1_generated_ScheduleService_CreateSchedule_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_schedule_service_create_schedule_sync.py ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for CreateSchedule
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_ScheduleService_CreateSchedule_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_create_schedule():
38
+ # Create a client
39
+ client = aiplatform_v1.ScheduleServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ schedule = aiplatform_v1.Schedule()
43
+ schedule.cron = "cron_value"
44
+ schedule.create_pipeline_job_request.parent = "parent_value"
45
+ schedule.display_name = "display_name_value"
46
+ schedule.max_concurrent_run_count = 2596
47
+
48
+ request = aiplatform_v1.CreateScheduleRequest(
49
+ parent="parent_value",
50
+ schedule=schedule,
51
+ )
52
+
53
+ # Make the request
54
+ response = client.create_schedule(request=request)
55
+
56
+ # Handle the response
57
+ print(response)
58
+
59
+ # [END aiplatform_v1_generated_ScheduleService_CreateSchedule_sync]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_schedule_service_delete_schedule_async.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for DeleteSchedule
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_ScheduleService_DeleteSchedule_async]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ async def sample_delete_schedule():
38
+ # Create a client
39
+ client = aiplatform_v1.ScheduleServiceAsyncClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.DeleteScheduleRequest(
43
+ name="name_value",
44
+ )
45
+
46
+ # Make the request
47
+ operation = client.delete_schedule(request=request)
48
+
49
+ print("Waiting for operation to complete...")
50
+
51
+ response = (await operation).result()
52
+
53
+ # Handle the response
54
+ print(response)
55
+
56
+ # [END aiplatform_v1_generated_ScheduleService_DeleteSchedule_async]
testbed/googleapis__python-aiplatform/samples/generated_samples/aiplatform_v1_generated_schedule_service_delete_schedule_sync.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # Generated code. DO NOT EDIT!
17
+ #
18
+ # Snippet for DeleteSchedule
19
+ # NOTE: This snippet has been automatically generated for illustrative purposes only.
20
+ # It may require modifications to work in your environment.
21
+
22
+ # To install the latest published package dependency, execute the following:
23
+ # python3 -m pip install google-cloud-aiplatform
24
+
25
+
26
+ # [START aiplatform_v1_generated_ScheduleService_DeleteSchedule_sync]
27
+ # This snippet has been automatically generated and should be regarded as a
28
+ # code template only.
29
+ # It will require modifications to work:
30
+ # - It may require correct/in-range values for request initialization.
31
+ # - It may require specifying regional endpoints when creating the service
32
+ # client as shown in:
33
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
34
+ from google.cloud import aiplatform_v1
35
+
36
+
37
+ def sample_delete_schedule():
38
+ # Create a client
39
+ client = aiplatform_v1.ScheduleServiceClient()
40
+
41
+ # Initialize request argument(s)
42
+ request = aiplatform_v1.DeleteScheduleRequest(
43
+ name="name_value",
44
+ )
45
+
46
+ # Make the request
47
+ operation = client.delete_schedule(request=request)
48
+
49
+ print("Waiting for operation to complete...")
50
+
51
+ response = operation.result()
52
+
53
+ # Handle the response
54
+ print(response)
55
+
56
+ # [END aiplatform_v1_generated_ScheduleService_DeleteSchedule_sync]