@@ -209,6 +209,25 @@ async def get_agent(
209
209
) -> agent .Agent :
210
210
r"""Retrieves the specified agent.
211
211
212
+ .. code-block::
213
+
214
+ from google.cloud import dialogflow_v2
215
+
216
+ def sample_get_agent():
217
+ # Create a client
218
+ client = dialogflow_v2.AgentsClient()
219
+
220
+ # Initialize request argument(s)
221
+ request = dialogflow_v2.GetAgentRequest(
222
+ parent="parent_value",
223
+ )
224
+
225
+ # Make the request
226
+ response = client.get_agent(request=request)
227
+
228
+ # Handle the response
229
+ print(response)
230
+
212
231
Args:
213
232
request (Union[google.cloud.dialogflow_v2.types.GetAgentRequest, dict]):
214
233
The request object. The request message for
@@ -293,6 +312,32 @@ async def set_agent(
293
312
queries. See the `training
294
313
documentation <https://cloud.google.com/dialogflow/es/docs/training>`__.
295
314
315
+
316
+ .. code-block::
317
+
318
+ from google.cloud import dialogflow_v2
319
+
320
+ def sample_set_agent():
321
+ # Create a client
322
+ client = dialogflow_v2.AgentsClient()
323
+
324
+ # Initialize request argument(s)
325
+ agent = dialogflow_v2.Agent()
326
+ agent.parent = "parent_value"
327
+ agent.display_name = "display_name_value"
328
+ agent.default_language_code = "default_language_code_value"
329
+ agent.time_zone = "time_zone_value"
330
+
331
+ request = dialogflow_v2.SetAgentRequest(
332
+ agent=agent,
333
+ )
334
+
335
+ # Make the request
336
+ response = client.set_agent(request=request)
337
+
338
+ # Handle the response
339
+ print(response)
340
+
296
341
Args:
297
342
request (Union[google.cloud.dialogflow_v2.types.SetAgentRequest, dict]):
298
343
The request object. The request message for
@@ -373,6 +418,22 @@ async def delete_agent(
373
418
) -> None :
374
419
r"""Deletes the specified agent.
375
420
421
+ .. code-block::
422
+
423
+ from google.cloud import dialogflow_v2
424
+
425
+ def sample_delete_agent():
426
+ # Create a client
427
+ client = dialogflow_v2.AgentsClient()
428
+
429
+ # Initialize request argument(s)
430
+ request = dialogflow_v2.DeleteAgentRequest(
431
+ parent="parent_value",
432
+ )
433
+
434
+ # Make the request
435
+ client.delete_agent(request=request)
436
+
376
437
Args:
377
438
request (Union[google.cloud.dialogflow_v2.types.DeleteAgentRequest, dict]):
378
439
The request object. The request message for
@@ -443,6 +504,27 @@ async def search_agents(
443
504
wildcard project collection id "-". Refer to `List
444
505
Sub-Collections <https://cloud.google.com/apis/design/design_patterns#list_sub-collections>`__.
445
506
507
+
508
+ .. code-block::
509
+
510
+ from google.cloud import dialogflow_v2
511
+
512
+ def sample_search_agents():
513
+ # Create a client
514
+ client = dialogflow_v2.AgentsClient()
515
+
516
+ # Initialize request argument(s)
517
+ request = dialogflow_v2.SearchAgentsRequest(
518
+ parent="parent_value",
519
+ )
520
+
521
+ # Make the request
522
+ page_result = client.search_agents(request=request)
523
+
524
+ # Handle the response
525
+ for response in page_result:
526
+ print(response)
527
+
446
528
Args:
447
529
request (Union[google.cloud.dialogflow_v2.types.SearchAgentsRequest, dict]):
448
530
The request object. The request message for
@@ -537,6 +619,30 @@ async def train_agent(
537
619
queries. See the `training
538
620
documentation <https://cloud.google.com/dialogflow/es/docs/training>`__.
539
621
622
+
623
+ .. code-block::
624
+
625
+ from google.cloud import dialogflow_v2
626
+
627
+ def sample_train_agent():
628
+ # Create a client
629
+ client = dialogflow_v2.AgentsClient()
630
+
631
+ # Initialize request argument(s)
632
+ request = dialogflow_v2.TrainAgentRequest(
633
+ parent="parent_value",
634
+ )
635
+
636
+ # Make the request
637
+ operation = client.train_agent(request=request)
638
+
639
+ print("Waiting for operation to complete...")
640
+
641
+ response = operation.result()
642
+
643
+ # Handle the response
644
+ print(response)
645
+
540
646
Args:
541
647
request (Union[google.cloud.dialogflow_v2.types.TrainAgentRequest, dict]):
542
648
The request object. The request message for
@@ -639,6 +745,31 @@ async def export_agent(
639
745
- ``response``:
640
746
[ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse]
641
747
748
+
749
+ .. code-block::
750
+
751
+ from google.cloud import dialogflow_v2
752
+
753
+ def sample_export_agent():
754
+ # Create a client
755
+ client = dialogflow_v2.AgentsClient()
756
+
757
+ # Initialize request argument(s)
758
+ request = dialogflow_v2.ExportAgentRequest(
759
+ parent="parent_value",
760
+ agent_uri="agent_uri_value",
761
+ )
762
+
763
+ # Make the request
764
+ operation = client.export_agent(request=request)
765
+
766
+ print("Waiting for operation to complete...")
767
+
768
+ response = operation.result()
769
+
770
+ # Handle the response
771
+ print(response)
772
+
642
773
Args:
643
774
request (Union[google.cloud.dialogflow_v2.types.ExportAgentRequest, dict]):
644
775
The request object. The request message for
@@ -749,6 +880,31 @@ async def import_agent(
749
880
queries. See the `training
750
881
documentation <https://cloud.google.com/dialogflow/es/docs/training>`__.
751
882
883
+
884
+ .. code-block::
885
+
886
+ from google.cloud import dialogflow_v2
887
+
888
+ def sample_import_agent():
889
+ # Create a client
890
+ client = dialogflow_v2.AgentsClient()
891
+
892
+ # Initialize request argument(s)
893
+ request = dialogflow_v2.ImportAgentRequest(
894
+ agent_uri="agent_uri_value",
895
+ parent="parent_value",
896
+ )
897
+
898
+ # Make the request
899
+ operation = client.import_agent(request=request)
900
+
901
+ print("Waiting for operation to complete...")
902
+
903
+ response = operation.result()
904
+
905
+ # Handle the response
906
+ print(response)
907
+
752
908
Args:
753
909
request (Union[google.cloud.dialogflow_v2.types.ImportAgentRequest, dict]):
754
910
The request object. The request message for
@@ -845,6 +1001,31 @@ async def restore_agent(
845
1001
queries. See the `training
846
1002
documentation <https://cloud.google.com/dialogflow/es/docs/training>`__.
847
1003
1004
+
1005
+ .. code-block::
1006
+
1007
+ from google.cloud import dialogflow_v2
1008
+
1009
+ def sample_restore_agent():
1010
+ # Create a client
1011
+ client = dialogflow_v2.AgentsClient()
1012
+
1013
+ # Initialize request argument(s)
1014
+ request = dialogflow_v2.RestoreAgentRequest(
1015
+ agent_uri="agent_uri_value",
1016
+ parent="parent_value",
1017
+ )
1018
+
1019
+ # Make the request
1020
+ operation = client.restore_agent(request=request)
1021
+
1022
+ print("Waiting for operation to complete...")
1023
+
1024
+ response = operation.result()
1025
+
1026
+ # Handle the response
1027
+ print(response)
1028
+
848
1029
Args:
849
1030
request (Union[google.cloud.dialogflow_v2.types.RestoreAgentRequest, dict]):
850
1031
The request object. The request message for
@@ -917,6 +1098,26 @@ async def get_validation_result(
917
1098
performed during training time and is updated
918
1099
automatically when training is completed.
919
1100
1101
+
1102
+ .. code-block::
1103
+
1104
+ from google.cloud import dialogflow_v2
1105
+
1106
+ def sample_get_validation_result():
1107
+ # Create a client
1108
+ client = dialogflow_v2.AgentsClient()
1109
+
1110
+ # Initialize request argument(s)
1111
+ request = dialogflow_v2.GetValidationResultRequest(
1112
+ parent="parent_value",
1113
+ )
1114
+
1115
+ # Make the request
1116
+ response = client.get_validation_result(request=request)
1117
+
1118
+ # Handle the response
1119
+ print(response)
1120
+
920
1121
Args:
921
1122
request (Union[google.cloud.dialogflow_v2.types.GetValidationResultRequest, dict]):
922
1123
The request object. The request message for
0 commit comments