@@ -230,6 +230,25 @@ async def list_agents(
230
230
r"""Returns the list of all agents in the specified
231
231
location.
232
232
233
+
234
+ .. code-block::
235
+
236
+ from google.cloud import dialogflowcx_v3
237
+
238
+ def sample_list_agents():
239
+ # Create a client
240
+ client = dialogflowcx_v3.AgentsClient()
241
+
242
+ # Initialize request argument(s)
243
+ request = dialogflowcx_v3.ListAgentsRequest(
244
+ parent="parent_value",
245
+ )
246
+
247
+ # Make the request
248
+ page_result = client.list_agents(request=request)
249
+ for response in page_result:
250
+ print(response)
251
+
233
252
Args:
234
253
request (Union[google.cloud.dialogflowcx_v3.types.ListAgentsRequest, dict]):
235
254
The request object. The request message for
@@ -310,6 +329,25 @@ async def get_agent(
310
329
) -> agent .Agent :
311
330
r"""Retrieves the specified agent.
312
331
332
+ .. code-block::
333
+
334
+ from google.cloud import dialogflowcx_v3
335
+
336
+ def sample_get_agent():
337
+ # Create a client
338
+ client = dialogflowcx_v3.AgentsClient()
339
+
340
+ # Initialize request argument(s)
341
+ request = dialogflowcx_v3.GetAgentRequest(
342
+ name="name_value",
343
+ )
344
+
345
+ # Make the request
346
+ response = client.get_agent(request=request)
347
+
348
+ # Handle response
349
+ print(response)
350
+
313
351
Args:
314
352
request (Union[google.cloud.dialogflowcx_v3.types.GetAgentRequest, dict]):
315
353
The request object. The request message for
@@ -398,6 +436,32 @@ async def create_agent(
398
436
queries. See the `training
399
437
documentation <https://cloud.google.com/dialogflow/cx/docs/concept/training>`__.
400
438
439
+
440
+ .. code-block::
441
+
442
+ from google.cloud import dialogflowcx_v3
443
+
444
+ def sample_create_agent():
445
+ # Create a client
446
+ client = dialogflowcx_v3.AgentsClient()
447
+
448
+ # Initialize request argument(s)
449
+ agent = dialogflowcx_v3.Agent()
450
+ agent.display_name = "display_name_value"
451
+ agent.default_language_code = "default_language_code_value"
452
+ agent.time_zone = "time_zone_value"
453
+
454
+ request = dialogflowcx_v3.CreateAgentRequest(
455
+ parent="parent_value",
456
+ agent=agent,
457
+ )
458
+
459
+ # Make the request
460
+ response = client.create_agent(request=request)
461
+
462
+ # Handle response
463
+ print(response)
464
+
401
465
Args:
402
466
request (Union[google.cloud.dialogflowcx_v3.types.CreateAgentRequest, dict]):
403
467
The request object. The request message for
@@ -493,6 +557,31 @@ async def update_agent(
493
557
queries. See the `training
494
558
documentation <https://cloud.google.com/dialogflow/cx/docs/concept/training>`__.
495
559
560
+
561
+ .. code-block::
562
+
563
+ from google.cloud import dialogflowcx_v3
564
+
565
+ def sample_update_agent():
566
+ # Create a client
567
+ client = dialogflowcx_v3.AgentsClient()
568
+
569
+ # Initialize request argument(s)
570
+ agent = dialogflowcx_v3.Agent()
571
+ agent.display_name = "display_name_value"
572
+ agent.default_language_code = "default_language_code_value"
573
+ agent.time_zone = "time_zone_value"
574
+
575
+ request = dialogflowcx_v3.UpdateAgentRequest(
576
+ agent=agent,
577
+ )
578
+
579
+ # Make the request
580
+ response = client.update_agent(request=request)
581
+
582
+ # Handle response
583
+ print(response)
584
+
496
585
Args:
497
586
request (Union[google.cloud.dialogflowcx_v3.types.UpdateAgentRequest, dict]):
498
587
The request object. The request message for
@@ -586,6 +675,22 @@ async def delete_agent(
586
675
) -> None :
587
676
r"""Deletes the specified agent.
588
677
678
+ .. code-block::
679
+
680
+ from google.cloud import dialogflowcx_v3
681
+
682
+ def sample_delete_agent():
683
+ # Create a client
684
+ client = dialogflowcx_v3.AgentsClient()
685
+
686
+ # Initialize request argument(s)
687
+ request = dialogflowcx_v3.DeleteAgentRequest(
688
+ name="name_value",
689
+ )
690
+
691
+ # Make the request
692
+ response = client.delete_agent(request=request)
693
+
589
694
Args:
590
695
request (Union[google.cloud.dialogflowcx_v3.types.DeleteAgentRequest, dict]):
591
696
The request object. The request message for
@@ -659,6 +764,28 @@ async def export_agent(
659
764
- ``response``:
660
765
[ExportAgentResponse][google.cloud.dialogflow.cx.v3.ExportAgentResponse]
661
766
767
+
768
+ .. code-block::
769
+
770
+ from google.cloud import dialogflowcx_v3
771
+
772
+ def sample_export_agent():
773
+ # Create a client
774
+ client = dialogflowcx_v3.AgentsClient()
775
+
776
+ # Initialize request argument(s)
777
+ request = dialogflowcx_v3.ExportAgentRequest(
778
+ name="name_value",
779
+ )
780
+
781
+ # Make the request
782
+ operation = client.export_agent(request=request)
783
+
784
+ print("Waiting for operation to complete...")
785
+
786
+ response = operation.result()
787
+ print(response)
788
+
662
789
Args:
663
790
request (Union[google.cloud.dialogflowcx_v3.types.ExportAgentRequest, dict]):
664
791
The request object. The request message for
@@ -738,6 +865,29 @@ async def restore_agent(
738
865
queries. See the `training
739
866
documentation <https://cloud.google.com/dialogflow/cx/docs/concept/training>`__.
740
867
868
+
869
+ .. code-block::
870
+
871
+ from google.cloud import dialogflowcx_v3
872
+
873
+ def sample_restore_agent():
874
+ # Create a client
875
+ client = dialogflowcx_v3.AgentsClient()
876
+
877
+ # Initialize request argument(s)
878
+ request = dialogflowcx_v3.RestoreAgentRequest(
879
+ agent_uri="agent_uri_value",
880
+ name="name_value",
881
+ )
882
+
883
+ # Make the request
884
+ operation = client.restore_agent(request=request)
885
+
886
+ print("Waiting for operation to complete...")
887
+
888
+ response = operation.result()
889
+ print(response)
890
+
741
891
Args:
742
892
request (Union[google.cloud.dialogflowcx_v3.types.RestoreAgentRequest, dict]):
743
893
The request object. The request message for
@@ -811,6 +961,26 @@ async def validate_agent(
811
961
validated. Please call this API after the training is
812
962
completed to get the complete validation results.
813
963
964
+
965
+ .. code-block::
966
+
967
+ from google.cloud import dialogflowcx_v3
968
+
969
+ def sample_validate_agent():
970
+ # Create a client
971
+ client = dialogflowcx_v3.AgentsClient()
972
+
973
+ # Initialize request argument(s)
974
+ request = dialogflowcx_v3.ValidateAgentRequest(
975
+ name="name_value",
976
+ )
977
+
978
+ # Make the request
979
+ response = client.validate_agent(request=request)
980
+
981
+ # Handle response
982
+ print(response)
983
+
814
984
Args:
815
985
request (Union[google.cloud.dialogflowcx_v3.types.ValidateAgentRequest, dict]):
816
986
The request object. The request message for
@@ -862,6 +1032,26 @@ async def get_agent_validation_result(
862
1032
r"""Gets the latest agent validation result. Agent
863
1033
validation is performed when ValidateAgent is called.
864
1034
1035
+
1036
+ .. code-block::
1037
+
1038
+ from google.cloud import dialogflowcx_v3
1039
+
1040
+ def sample_get_agent_validation_result():
1041
+ # Create a client
1042
+ client = dialogflowcx_v3.AgentsClient()
1043
+
1044
+ # Initialize request argument(s)
1045
+ request = dialogflowcx_v3.GetAgentValidationResultRequest(
1046
+ name="name_value",
1047
+ )
1048
+
1049
+ # Make the request
1050
+ response = client.get_agent_validation_result(request=request)
1051
+
1052
+ # Handle response
1053
+ print(response)
1054
+
865
1055
Args:
866
1056
request (Union[google.cloud.dialogflowcx_v3.types.GetAgentValidationResultRequest, dict]):
867
1057
The request object. The request message for
0 commit comments