google-cloud-ces-v1beta 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -6
  3. data/lib/google/cloud/ces/v1beta/agent_card_pb.rb +3 -1
  4. data/lib/google/cloud/ces/v1beta/agent_pb.rb +3 -1
  5. data/lib/google/cloud/ces/v1beta/agent_service/client.rb +105 -1
  6. data/lib/google/cloud/ces/v1beta/agent_service/paths.rb +54 -11
  7. data/lib/google/cloud/ces/v1beta/agent_service/rest/client.rb +98 -1
  8. data/lib/google/cloud/ces/v1beta/agent_service/rest/service_stub.rb +62 -0
  9. data/lib/google/cloud/ces/v1beta/agent_service_pb.rb +3 -1
  10. data/lib/google/cloud/ces/v1beta/agent_service_services_pb.rb +2 -0
  11. data/lib/google/cloud/ces/v1beta/app_pb.rb +6 -1
  12. data/lib/google/cloud/ces/v1beta/app_version_pb.rb +1 -1
  13. data/lib/google/cloud/ces/v1beta/assistant_service/client.rb +1023 -0
  14. data/lib/google/cloud/ces/v1beta/assistant_service/credentials.rb +48 -0
  15. data/lib/google/cloud/ces/v1beta/assistant_service/paths.rb +73 -0
  16. data/lib/google/cloud/ces/v1beta/assistant_service/rest/client.rb +946 -0
  17. data/lib/google/cloud/ces/v1beta/assistant_service/rest/service_stub.rb +450 -0
  18. data/lib/google/cloud/ces/v1beta/assistant_service/rest.rb +55 -0
  19. data/lib/google/cloud/ces/v1beta/assistant_service.rb +57 -0
  20. data/lib/google/cloud/ces/v1beta/assistant_service_pb.rb +49 -0
  21. data/lib/google/cloud/ces/v1beta/assistant_service_services_pb.rb +57 -0
  22. data/lib/google/cloud/ces/v1beta/common_pb.rb +4 -1
  23. data/lib/google/cloud/ces/v1beta/conversation_pb.rb +1 -1
  24. data/lib/google/cloud/ces/v1beta/data_store_tool_pb.rb +2 -1
  25. data/lib/google/cloud/ces/v1beta/deployment_pb.rb +3 -1
  26. data/lib/google/cloud/ces/v1beta/evaluation_pb.rb +2 -1
  27. data/lib/google/cloud/ces/v1beta/evaluation_service/client.rb +2 -2
  28. data/lib/google/cloud/ces/v1beta/evaluation_service/rest/client.rb +2 -2
  29. data/lib/google/cloud/ces/v1beta/example_pb.rb +1 -1
  30. data/lib/google/cloud/ces/v1beta/guardrail_pb.rb +4 -1
  31. data/lib/google/cloud/ces/v1beta/rest.rb +1 -0
  32. data/lib/google/cloud/ces/v1beta/session_service/client.rb +333 -0
  33. data/lib/google/cloud/ces/v1beta/session_service/paths.rb +40 -0
  34. data/lib/google/cloud/ces/v1beta/session_service/rest/client.rb +314 -0
  35. data/lib/google/cloud/ces/v1beta/session_service/rest/service_stub.rb +180 -0
  36. data/lib/google/cloud/ces/v1beta/session_service_pb.rb +33 -1
  37. data/lib/google/cloud/ces/v1beta/session_service_services_pb.rb +14 -0
  38. data/lib/google/cloud/ces/v1beta/tool_pb.rb +1 -1
  39. data/lib/google/cloud/ces/v1beta/version.rb +1 -1
  40. data/lib/google/cloud/ces/v1beta.rb +1 -0
  41. data/proto_docs/google/api/field_info.rb +88 -0
  42. data/proto_docs/google/cloud/ces/v1beta/agent.rb +18 -2
  43. data/proto_docs/google/cloud/ces/v1beta/agent_card.rb +91 -0
  44. data/proto_docs/google/cloud/ces/v1beta/agent_service.rb +40 -0
  45. data/proto_docs/google/cloud/ces/v1beta/app.rb +113 -4
  46. data/proto_docs/google/cloud/ces/v1beta/app_version.rb +3 -0
  47. data/proto_docs/google/cloud/ces/v1beta/assistant_service.rb +452 -0
  48. data/proto_docs/google/cloud/ces/v1beta/common.rb +44 -0
  49. data/proto_docs/google/cloud/ces/v1beta/conversation.rb +4 -0
  50. data/proto_docs/google/cloud/ces/v1beta/data_store_tool.rb +16 -0
  51. data/proto_docs/google/cloud/ces/v1beta/deployment.rb +43 -2
  52. data/proto_docs/google/cloud/ces/v1beta/evaluation.rb +21 -5
  53. data/proto_docs/google/cloud/ces/v1beta/example.rb +23 -0
  54. data/proto_docs/google/cloud/ces/v1beta/guardrail.rb +88 -6
  55. data/proto_docs/google/cloud/ces/v1beta/session_service.rb +749 -11
  56. data/proto_docs/google/cloud/ces/v1beta/tool.rb +4 -0
  57. metadata +12 -1
@@ -83,6 +83,11 @@ module Google
83
83
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: []
84
84
  }
85
85
 
86
+ default_config.rpcs.stream_chat_ai_assistant.timeout = 3600.0
87
+ default_config.rpcs.stream_chat_ai_assistant.retry_policy = {
88
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: []
89
+ }
90
+
86
91
  default_config
87
92
  end
88
93
  yield @configure if block_given?
@@ -376,6 +381,294 @@ module Google
376
381
  raise ::Google::Cloud::Error.from_error(e)
377
382
  end
378
383
 
384
+ ##
385
+ # Runs Arc, the AI assistant, for the specified assistant session in a
386
+ # streaming fashion.
387
+ #
388
+ # @overload stream_chat_ai_assistant(request, options = nil)
389
+ # Pass arguments to `stream_chat_ai_assistant` via a request object, either of type
390
+ # {::Google::Cloud::Ces::V1beta::StreamChatAiAssistantRequest} or an equivalent Hash.
391
+ #
392
+ # @param request [::Google::Cloud::Ces::V1beta::StreamChatAiAssistantRequest, ::Hash]
393
+ # A request object representing the call parameters. Required. To specify no
394
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
395
+ # @param options [::Gapic::CallOptions, ::Hash]
396
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
397
+ #
398
+ # @overload stream_chat_ai_assistant(name: nil, message: nil, attached_gcs_uris: nil, context_token: nil, confirmation_response: nil, client_capabilities: nil, operation_completed_event: nil, resume_from_sequence_number: nil, attach_only: nil)
399
+ # Pass arguments to `stream_chat_ai_assistant` via keyword arguments. Note that at
400
+ # least one keyword argument is required. To specify no parameters, or to keep all
401
+ # the default parameter values, pass an empty Hash as a request object (see above).
402
+ #
403
+ # @param name [::String]
404
+ # Required. The assistant session to be used to run the assistant.
405
+ # Format:
406
+ # `projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}`
407
+ # @param message [::String]
408
+ # Optional. The message to send to the assistant agent. May be empty when
409
+ # `confirmation_response` is set (answering a pending confirmation without
410
+ # adding a new message); at least one of the two must be provided.
411
+ # @param attached_gcs_uris [::Array<::String>]
412
+ # Optional. Cloud Storage URIs for files uploaded by the user during this
413
+ # turn. Example: "gs://cxas-transient-uploads/uuid/prd.pdf"
414
+ # @param context_token [::String]
415
+ # Optional. Opaque onboarding context token returned by
416
+ # {::Google::Cloud::Ces::V1beta::SessionService::Rest::Client#generate_onboarding_suggestions SessionService.GenerateOnboardingSuggestions}.
417
+ # When set and still fresh, the server reuses the onboarding snapshot
418
+ # computed for the zero state instead of recomputing it for the first
419
+ # conversation turn.
420
+ # @param confirmation_response [::Google::Cloud::Ces::V1beta::AssistantConfirmationResponse, ::Hash]
421
+ # Optional. The user's answer to a pending
422
+ # {::Google::Cloud::Ces::V1beta::AssistantConfirmationRequest AssistantConfirmationRequest}.
423
+ # When set, the server resumes the paused agent with this answer instead of
424
+ # (or in addition to) starting a new prompt turn.
425
+ # @param client_capabilities [::Array<::Google::Cloud::Ces::V1beta::StreamChatAiAssistantRequest::ClientCapability>]
426
+ # Optional. Response features this client can render. The server only emits
427
+ # events that need a capability (e.g. `confirmation_request`) when the
428
+ # capability is declared, so older clients never receive events they would
429
+ # silently drop.
430
+ # @param operation_completed_event [::Google::Cloud::Ces::V1beta::OperationCompletedEvent, ::Hash]
431
+ # Optional. Resumes an assistant session paused waiting for a client-managed
432
+ # long-running operation to complete.
433
+ # @param resume_from_sequence_number [::Integer]
434
+ # Optional. Optional cursor to resume and replay events from an in-flight or
435
+ # completed turn.
436
+ # @param attach_only [::Boolean]
437
+ # Optional. Optional flag to attach to an existing in-flight turn without
438
+ # submitting a new message.
439
+ # @return [::Enumerable<::Google::Cloud::Ces::V1beta::StreamChatAiAssistantResponse>]
440
+ #
441
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
442
+ #
443
+ # @example Basic example
444
+ # require "google/cloud/ces/v1beta"
445
+ #
446
+ # # Create a client object. The client can be reused for multiple calls.
447
+ # client = Google::Cloud::Ces::V1beta::SessionService::Rest::Client.new
448
+ #
449
+ # # Create a request. To set request fields, pass in keyword arguments.
450
+ # request = Google::Cloud::Ces::V1beta::StreamChatAiAssistantRequest.new
451
+ #
452
+ # # Call the stream_chat_ai_assistant method to start streaming.
453
+ # output = client.stream_chat_ai_assistant request
454
+ #
455
+ # # The returned object is a streamed enumerable yielding elements of type
456
+ # # ::Google::Cloud::Ces::V1beta::StreamChatAiAssistantResponse
457
+ # output.each do |current_response|
458
+ # p current_response
459
+ # end
460
+ #
461
+ def stream_chat_ai_assistant request, options = nil
462
+ raise ::ArgumentError, "request must be provided" if request.nil?
463
+
464
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Ces::V1beta::StreamChatAiAssistantRequest
465
+
466
+ # Converts hash and nil to an options object
467
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
468
+
469
+ # Customize the options with defaults
470
+ call_metadata = @config.rpcs.stream_chat_ai_assistant.metadata.to_h
471
+
472
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
473
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
474
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
475
+ gapic_version: ::Google::Cloud::Ces::V1beta::VERSION,
476
+ transports_version_send: [:rest]
477
+
478
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
479
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
480
+
481
+ options.apply_defaults timeout: @config.rpcs.stream_chat_ai_assistant.timeout,
482
+ metadata: call_metadata,
483
+ retry_policy: @config.rpcs.stream_chat_ai_assistant.retry_policy
484
+
485
+ options.apply_defaults timeout: @config.timeout,
486
+ metadata: @config.metadata,
487
+ retry_policy: @config.retry_policy
488
+
489
+ ::Gapic::Rest::ServerStream.new(
490
+ ::Google::Cloud::Ces::V1beta::StreamChatAiAssistantResponse,
491
+ ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q|
492
+ @session_service_stub.stream_chat_ai_assistant request, options do |chunk|
493
+ in_q.deq
494
+ out_q.enq chunk
495
+ end
496
+ end
497
+ )
498
+ rescue ::Gapic::Rest::Error => e
499
+ raise ::Google::Cloud::Error.from_error(e)
500
+ end
501
+
502
+ ##
503
+ # Cancels the assistant session's in-flight turn, if any: the explicit user
504
+ # stop for a turn running detached from any stream. A cancel landing on a
505
+ # task that does not host the turn preempts it through the session turn
506
+ # epoch instead, ending it within one lease renewal.
507
+ #
508
+ # @overload cancel_assistant_turn(request, options = nil)
509
+ # Pass arguments to `cancel_assistant_turn` via a request object, either of type
510
+ # {::Google::Cloud::Ces::V1beta::CancelAssistantTurnRequest} or an equivalent Hash.
511
+ #
512
+ # @param request [::Google::Cloud::Ces::V1beta::CancelAssistantTurnRequest, ::Hash]
513
+ # A request object representing the call parameters. Required. To specify no
514
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
515
+ # @param options [::Gapic::CallOptions, ::Hash]
516
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
517
+ #
518
+ # @overload cancel_assistant_turn(name: nil, turn_id: nil)
519
+ # Pass arguments to `cancel_assistant_turn` via keyword arguments. Note that at
520
+ # least one keyword argument is required. To specify no parameters, or to keep all
521
+ # the default parameter values, pass an empty Hash as a request object (see above).
522
+ #
523
+ # @param name [::String]
524
+ # Required. The assistant session whose in-flight turn to cancel.
525
+ # @param turn_id [::String]
526
+ # Optional. The turn to cancel; empty cancels whichever turn is running. A
527
+ # cancel naming a turn that is no longer the running one is a no-op.
528
+ # @yield [result, operation] Access the result along with the TransportOperation object
529
+ # @yieldparam result [::Google::Cloud::Ces::V1beta::CancelAssistantTurnResponse]
530
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
531
+ #
532
+ # @return [::Google::Cloud::Ces::V1beta::CancelAssistantTurnResponse]
533
+ #
534
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
535
+ #
536
+ # @example Basic example
537
+ # require "google/cloud/ces/v1beta"
538
+ #
539
+ # # Create a client object. The client can be reused for multiple calls.
540
+ # client = Google::Cloud::Ces::V1beta::SessionService::Rest::Client.new
541
+ #
542
+ # # Create a request. To set request fields, pass in keyword arguments.
543
+ # request = Google::Cloud::Ces::V1beta::CancelAssistantTurnRequest.new
544
+ #
545
+ # # Call the cancel_assistant_turn method.
546
+ # result = client.cancel_assistant_turn request
547
+ #
548
+ # # The returned object is of type Google::Cloud::Ces::V1beta::CancelAssistantTurnResponse.
549
+ # p result
550
+ #
551
+ def cancel_assistant_turn request, options = nil
552
+ raise ::ArgumentError, "request must be provided" if request.nil?
553
+
554
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Ces::V1beta::CancelAssistantTurnRequest
555
+
556
+ # Converts hash and nil to an options object
557
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
558
+
559
+ # Customize the options with defaults
560
+ call_metadata = @config.rpcs.cancel_assistant_turn.metadata.to_h
561
+
562
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
563
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
564
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
565
+ gapic_version: ::Google::Cloud::Ces::V1beta::VERSION,
566
+ transports_version_send: [:rest]
567
+
568
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
569
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
570
+
571
+ options.apply_defaults timeout: @config.rpcs.cancel_assistant_turn.timeout,
572
+ metadata: call_metadata,
573
+ retry_policy: @config.rpcs.cancel_assistant_turn.retry_policy
574
+
575
+ options.apply_defaults timeout: @config.timeout,
576
+ metadata: @config.metadata,
577
+ retry_policy: @config.retry_policy
578
+
579
+ @session_service_stub.cancel_assistant_turn request, options do |result, operation|
580
+ yield result, operation if block_given?
581
+ end
582
+ rescue ::Gapic::Rest::Error => e
583
+ raise ::Google::Cloud::Error.from_error(e)
584
+ end
585
+
586
+ ##
587
+ # Generates personalized onboarding suggestions for the Arc
588
+ # zero state: classifies the requesting user (new / exploring / returning)
589
+ # from their assistant-session history in the app and returns suggestion
590
+ # chips (resume a session, continue work, or start something new) to render
591
+ # before any message is sent.
592
+ #
593
+ # @overload generate_onboarding_suggestions(request, options = nil)
594
+ # Pass arguments to `generate_onboarding_suggestions` via a request object, either of type
595
+ # {::Google::Cloud::Ces::V1beta::GenerateOnboardingSuggestionsRequest} or an equivalent Hash.
596
+ #
597
+ # @param request [::Google::Cloud::Ces::V1beta::GenerateOnboardingSuggestionsRequest, ::Hash]
598
+ # A request object representing the call parameters. Required. To specify no
599
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
600
+ # @param options [::Gapic::CallOptions, ::Hash]
601
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
602
+ #
603
+ # @overload generate_onboarding_suggestions(name: nil, max_suggestions: nil)
604
+ # Pass arguments to `generate_onboarding_suggestions` via keyword arguments. Note that at
605
+ # least one keyword argument is required. To specify no parameters, or to keep all
606
+ # the default parameter values, pass an empty Hash as a request object (see above).
607
+ #
608
+ # @param name [::String]
609
+ # Required. The app whose zero state is being rendered.
610
+ # Format: `projects/{project}/locations/{location}/apps/{app}`
611
+ # @param max_suggestions [::Integer]
612
+ # Optional. Maximum number of suggestions to return. Defaults to 4 when
613
+ # unset.
614
+ # @yield [result, operation] Access the result along with the TransportOperation object
615
+ # @yieldparam result [::Google::Cloud::Ces::V1beta::GenerateOnboardingSuggestionsResponse]
616
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
617
+ #
618
+ # @return [::Google::Cloud::Ces::V1beta::GenerateOnboardingSuggestionsResponse]
619
+ #
620
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
621
+ #
622
+ # @example Basic example
623
+ # require "google/cloud/ces/v1beta"
624
+ #
625
+ # # Create a client object. The client can be reused for multiple calls.
626
+ # client = Google::Cloud::Ces::V1beta::SessionService::Rest::Client.new
627
+ #
628
+ # # Create a request. To set request fields, pass in keyword arguments.
629
+ # request = Google::Cloud::Ces::V1beta::GenerateOnboardingSuggestionsRequest.new
630
+ #
631
+ # # Call the generate_onboarding_suggestions method.
632
+ # result = client.generate_onboarding_suggestions request
633
+ #
634
+ # # The returned object is of type Google::Cloud::Ces::V1beta::GenerateOnboardingSuggestionsResponse.
635
+ # p result
636
+ #
637
+ def generate_onboarding_suggestions request, options = nil
638
+ raise ::ArgumentError, "request must be provided" if request.nil?
639
+
640
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Ces::V1beta::GenerateOnboardingSuggestionsRequest
641
+
642
+ # Converts hash and nil to an options object
643
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
644
+
645
+ # Customize the options with defaults
646
+ call_metadata = @config.rpcs.generate_onboarding_suggestions.metadata.to_h
647
+
648
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
649
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
650
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
651
+ gapic_version: ::Google::Cloud::Ces::V1beta::VERSION,
652
+ transports_version_send: [:rest]
653
+
654
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
655
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
656
+
657
+ options.apply_defaults timeout: @config.rpcs.generate_onboarding_suggestions.timeout,
658
+ metadata: call_metadata,
659
+ retry_policy: @config.rpcs.generate_onboarding_suggestions.retry_policy
660
+
661
+ options.apply_defaults timeout: @config.timeout,
662
+ metadata: @config.metadata,
663
+ retry_policy: @config.retry_policy
664
+
665
+ @session_service_stub.generate_onboarding_suggestions request, options do |result, operation|
666
+ yield result, operation if block_given?
667
+ end
668
+ rescue ::Gapic::Rest::Error => e
669
+ raise ::Google::Cloud::Error.from_error(e)
670
+ end
671
+
379
672
  ##
380
673
  # Configuration class for the SessionService REST API.
381
674
  #
@@ -541,6 +834,21 @@ module Google
541
834
  # @return [::Gapic::Config::Method]
542
835
  #
543
836
  attr_reader :stream_run_session
837
+ ##
838
+ # RPC-specific configuration for `stream_chat_ai_assistant`
839
+ # @return [::Gapic::Config::Method]
840
+ #
841
+ attr_reader :stream_chat_ai_assistant
842
+ ##
843
+ # RPC-specific configuration for `cancel_assistant_turn`
844
+ # @return [::Gapic::Config::Method]
845
+ #
846
+ attr_reader :cancel_assistant_turn
847
+ ##
848
+ # RPC-specific configuration for `generate_onboarding_suggestions`
849
+ # @return [::Gapic::Config::Method]
850
+ #
851
+ attr_reader :generate_onboarding_suggestions
544
852
 
545
853
  # @private
546
854
  def initialize parent_rpcs = nil
@@ -548,6 +856,12 @@ module Google
548
856
  @run_session = ::Gapic::Config::Method.new run_session_config
549
857
  stream_run_session_config = parent_rpcs.stream_run_session if parent_rpcs.respond_to? :stream_run_session
550
858
  @stream_run_session = ::Gapic::Config::Method.new stream_run_session_config
859
+ stream_chat_ai_assistant_config = parent_rpcs.stream_chat_ai_assistant if parent_rpcs.respond_to? :stream_chat_ai_assistant
860
+ @stream_chat_ai_assistant = ::Gapic::Config::Method.new stream_chat_ai_assistant_config
861
+ cancel_assistant_turn_config = parent_rpcs.cancel_assistant_turn if parent_rpcs.respond_to? :cancel_assistant_turn
862
+ @cancel_assistant_turn = ::Gapic::Config::Method.new cancel_assistant_turn_config
863
+ generate_onboarding_suggestions_config = parent_rpcs.generate_onboarding_suggestions if parent_rpcs.respond_to? :generate_onboarding_suggestions
864
+ @generate_onboarding_suggestions = ::Gapic::Config::Method.new generate_onboarding_suggestions_config
551
865
 
552
866
  yield self if block_given?
553
867
  end
@@ -147,6 +147,120 @@ module Google
147
147
  ::Gapic::Rest::TransportOperation.new response
148
148
  end
149
149
 
150
+ ##
151
+ # Baseline implementation for the stream_chat_ai_assistant REST call
152
+ #
153
+ # @param request_pb [::Google::Cloud::Ces::V1beta::StreamChatAiAssistantRequest]
154
+ # A request object representing the call parameters. Required.
155
+ # @param options [::Gapic::CallOptions]
156
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
157
+ #
158
+ # @yieldparam chunk [::String] The chunk of data received during server streaming.
159
+ #
160
+ # @return [::Gapic::Rest::TransportOperation]
161
+ def stream_chat_ai_assistant(request_pb, options = nil, &)
162
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
163
+
164
+ verb, uri, query_string_params, body = ServiceStub.transcode_stream_chat_ai_assistant_request request_pb
165
+ query_string_params = if query_string_params.any?
166
+ query_string_params.to_h { |p| p.split "=", 2 }
167
+ else
168
+ {}
169
+ end
170
+
171
+ response = @client_stub.make_http_request(
172
+ verb,
173
+ uri: uri,
174
+ body: body || "",
175
+ params: query_string_params,
176
+ method_name: "stream_chat_ai_assistant",
177
+ options: options,
178
+ is_server_streaming: true,
179
+ &
180
+ )
181
+ ::Gapic::Rest::TransportOperation.new response
182
+ end
183
+
184
+ ##
185
+ # Baseline implementation for the cancel_assistant_turn REST call
186
+ #
187
+ # @param request_pb [::Google::Cloud::Ces::V1beta::CancelAssistantTurnRequest]
188
+ # A request object representing the call parameters. Required.
189
+ # @param options [::Gapic::CallOptions]
190
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
191
+ #
192
+ # @yield [result, operation] Access the result along with the TransportOperation object
193
+ # @yieldparam result [::Google::Cloud::Ces::V1beta::CancelAssistantTurnResponse]
194
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
195
+ #
196
+ # @return [::Google::Cloud::Ces::V1beta::CancelAssistantTurnResponse]
197
+ # A result object deserialized from the server's reply
198
+ def cancel_assistant_turn request_pb, options = nil
199
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
200
+
201
+ verb, uri, query_string_params, body = ServiceStub.transcode_cancel_assistant_turn_request request_pb
202
+ query_string_params = if query_string_params.any?
203
+ query_string_params.to_h { |p| p.split "=", 2 }
204
+ else
205
+ {}
206
+ end
207
+
208
+ response = @client_stub.make_http_request(
209
+ verb,
210
+ uri: uri,
211
+ body: body || "",
212
+ params: query_string_params,
213
+ method_name: "cancel_assistant_turn",
214
+ options: options
215
+ )
216
+ operation = ::Gapic::Rest::TransportOperation.new response
217
+ result = ::Google::Cloud::Ces::V1beta::CancelAssistantTurnResponse.decode_json response.body, ignore_unknown_fields: true
218
+ catch :response do
219
+ yield result, operation if block_given?
220
+ result
221
+ end
222
+ end
223
+
224
+ ##
225
+ # Baseline implementation for the generate_onboarding_suggestions REST call
226
+ #
227
+ # @param request_pb [::Google::Cloud::Ces::V1beta::GenerateOnboardingSuggestionsRequest]
228
+ # A request object representing the call parameters. Required.
229
+ # @param options [::Gapic::CallOptions]
230
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
231
+ #
232
+ # @yield [result, operation] Access the result along with the TransportOperation object
233
+ # @yieldparam result [::Google::Cloud::Ces::V1beta::GenerateOnboardingSuggestionsResponse]
234
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
235
+ #
236
+ # @return [::Google::Cloud::Ces::V1beta::GenerateOnboardingSuggestionsResponse]
237
+ # A result object deserialized from the server's reply
238
+ def generate_onboarding_suggestions request_pb, options = nil
239
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
240
+
241
+ verb, uri, query_string_params, body = ServiceStub.transcode_generate_onboarding_suggestions_request request_pb
242
+ query_string_params = if query_string_params.any?
243
+ query_string_params.to_h { |p| p.split "=", 2 }
244
+ else
245
+ {}
246
+ end
247
+
248
+ response = @client_stub.make_http_request(
249
+ verb,
250
+ uri: uri,
251
+ body: body || "",
252
+ params: query_string_params,
253
+ method_name: "generate_onboarding_suggestions",
254
+ options: options
255
+ )
256
+ operation = ::Gapic::Rest::TransportOperation.new response
257
+ result = ::Google::Cloud::Ces::V1beta::GenerateOnboardingSuggestionsResponse.decode_json response.body, ignore_unknown_fields: true
258
+ catch :response do
259
+ yield result, operation if block_given?
260
+ result
261
+ end
262
+ end
263
+
150
264
  ##
151
265
  # @private
152
266
  #
@@ -190,6 +304,72 @@ module Google
190
304
  )
191
305
  transcoder.transcode request_pb
192
306
  end
307
+
308
+ ##
309
+ # @private
310
+ #
311
+ # GRPC transcoding helper method for the stream_chat_ai_assistant REST call
312
+ #
313
+ # @param request_pb [::Google::Cloud::Ces::V1beta::StreamChatAiAssistantRequest]
314
+ # A request object representing the call parameters. Required.
315
+ # @return [Array(String, [String, nil], Hash{String => String})]
316
+ # Uri, Body, Query string parameters
317
+ def self.transcode_stream_chat_ai_assistant_request request_pb
318
+ transcoder = Gapic::Rest::GrpcTranscoder.new
319
+ .with_bindings(
320
+ uri_method: :post,
321
+ uri_template: "/v1beta/{name}:streamChatAiAssistant",
322
+ body: "*",
323
+ matches: [
324
+ ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/assistantSessions/[^/]+/?$}, false]
325
+ ]
326
+ )
327
+ transcoder.transcode request_pb
328
+ end
329
+
330
+ ##
331
+ # @private
332
+ #
333
+ # GRPC transcoding helper method for the cancel_assistant_turn REST call
334
+ #
335
+ # @param request_pb [::Google::Cloud::Ces::V1beta::CancelAssistantTurnRequest]
336
+ # A request object representing the call parameters. Required.
337
+ # @return [Array(String, [String, nil], Hash{String => String})]
338
+ # Uri, Body, Query string parameters
339
+ def self.transcode_cancel_assistant_turn_request request_pb
340
+ transcoder = Gapic::Rest::GrpcTranscoder.new
341
+ .with_bindings(
342
+ uri_method: :post,
343
+ uri_template: "/v1beta/{name}:cancelAssistantTurn",
344
+ body: "*",
345
+ matches: [
346
+ ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/assistantSessions/[^/]+/?$}, false]
347
+ ]
348
+ )
349
+ transcoder.transcode request_pb
350
+ end
351
+
352
+ ##
353
+ # @private
354
+ #
355
+ # GRPC transcoding helper method for the generate_onboarding_suggestions REST call
356
+ #
357
+ # @param request_pb [::Google::Cloud::Ces::V1beta::GenerateOnboardingSuggestionsRequest]
358
+ # A request object representing the call parameters. Required.
359
+ # @return [Array(String, [String, nil], Hash{String => String})]
360
+ # Uri, Body, Query string parameters
361
+ def self.transcode_generate_onboarding_suggestions_request request_pb
362
+ transcoder = Gapic::Rest::GrpcTranscoder.new
363
+ .with_bindings(
364
+ uri_method: :post,
365
+ uri_template: "/v1beta/{name}:generateOnboardingSuggestions",
366
+ body: "*",
367
+ matches: [
368
+ ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false]
369
+ ]
370
+ )
371
+ transcoder.transcode request_pb
372
+ end
193
373
  end
194
374
  end
195
375
  end