Class: Google::Cloud::AIPlatform::V1::GenerateContentResponse

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/aiplatform/v1/prediction_service.rb

Overview

Response message for [PredictionService.GenerateContent].

Defined Under Namespace

Classes: PromptFeedback, UsageMetadata

Instance Attribute Summary collapse

Instance Attribute Details

#candidates::Array<::Google::Cloud::AIPlatform::V1::Candidate> (readonly)

Returns Output only. Generated candidates.

Returns:



559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
# File 'proto_docs/google/cloud/aiplatform/v1/prediction_service.rb', line 559

class GenerateContentResponse
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Content filter results for a prompt sent in the request.
  # @!attribute [r] block_reason
  #   @return [::Google::Cloud::AIPlatform::V1::GenerateContentResponse::PromptFeedback::BlockedReason]
  #     Output only. Blocked reason.
  # @!attribute [r] safety_ratings
  #   @return [::Array<::Google::Cloud::AIPlatform::V1::SafetyRating>]
  #     Output only. Safety ratings.
  # @!attribute [r] block_reason_message
  #   @return [::String]
  #     Output only. A readable block reason message.
  class PromptFeedback
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Blocked reason enumeration.
    module BlockedReason
      # Unspecified blocked reason.
      BLOCKED_REASON_UNSPECIFIED = 0

      # Candidates blocked due to safety.
      SAFETY = 1

      # Candidates blocked due to other reason.
      OTHER = 2

      # Candidates blocked due to the terms which are included from the
      # terminology blocklist.
      BLOCKLIST = 3

      # Candidates blocked due to prohibited content.
      PROHIBITED_CONTENT = 4
    end
  end

  # Usage metadata about response(s).
  # @!attribute [rw] prompt_token_count
  #   @return [::Integer]
  #     Number of tokens in the request. When `cached_content` is set, this is
  #     still the total effective prompt size meaning this includes the number of
  #     tokens in the cached content.
  # @!attribute [rw] candidates_token_count
  #   @return [::Integer]
  #     Number of tokens in the response(s).
  # @!attribute [rw] total_token_count
  #   @return [::Integer]
  #     Total token count for prompt and response candidates.
  class UsageMetadata
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#model_version::String (readonly)

Returns Output only. The model version used to generate the response.

Returns:

  • (::String)

    Output only. The model version used to generate the response.



559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
# File 'proto_docs/google/cloud/aiplatform/v1/prediction_service.rb', line 559

class GenerateContentResponse
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Content filter results for a prompt sent in the request.
  # @!attribute [r] block_reason
  #   @return [::Google::Cloud::AIPlatform::V1::GenerateContentResponse::PromptFeedback::BlockedReason]
  #     Output only. Blocked reason.
  # @!attribute [r] safety_ratings
  #   @return [::Array<::Google::Cloud::AIPlatform::V1::SafetyRating>]
  #     Output only. Safety ratings.
  # @!attribute [r] block_reason_message
  #   @return [::String]
  #     Output only. A readable block reason message.
  class PromptFeedback
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Blocked reason enumeration.
    module BlockedReason
      # Unspecified blocked reason.
      BLOCKED_REASON_UNSPECIFIED = 0

      # Candidates blocked due to safety.
      SAFETY = 1

      # Candidates blocked due to other reason.
      OTHER = 2

      # Candidates blocked due to the terms which are included from the
      # terminology blocklist.
      BLOCKLIST = 3

      # Candidates blocked due to prohibited content.
      PROHIBITED_CONTENT = 4
    end
  end

  # Usage metadata about response(s).
  # @!attribute [rw] prompt_token_count
  #   @return [::Integer]
  #     Number of tokens in the request. When `cached_content` is set, this is
  #     still the total effective prompt size meaning this includes the number of
  #     tokens in the cached content.
  # @!attribute [rw] candidates_token_count
  #   @return [::Integer]
  #     Number of tokens in the response(s).
  # @!attribute [rw] total_token_count
  #   @return [::Integer]
  #     Total token count for prompt and response candidates.
  class UsageMetadata
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#prompt_feedback::Google::Cloud::AIPlatform::V1::GenerateContentResponse::PromptFeedback (readonly)

Returns Output only. Content filter results for a prompt sent in the request. Note: Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations.

Returns:



559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
# File 'proto_docs/google/cloud/aiplatform/v1/prediction_service.rb', line 559

class GenerateContentResponse
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Content filter results for a prompt sent in the request.
  # @!attribute [r] block_reason
  #   @return [::Google::Cloud::AIPlatform::V1::GenerateContentResponse::PromptFeedback::BlockedReason]
  #     Output only. Blocked reason.
  # @!attribute [r] safety_ratings
  #   @return [::Array<::Google::Cloud::AIPlatform::V1::SafetyRating>]
  #     Output only. Safety ratings.
  # @!attribute [r] block_reason_message
  #   @return [::String]
  #     Output only. A readable block reason message.
  class PromptFeedback
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Blocked reason enumeration.
    module BlockedReason
      # Unspecified blocked reason.
      BLOCKED_REASON_UNSPECIFIED = 0

      # Candidates blocked due to safety.
      SAFETY = 1

      # Candidates blocked due to other reason.
      OTHER = 2

      # Candidates blocked due to the terms which are included from the
      # terminology blocklist.
      BLOCKLIST = 3

      # Candidates blocked due to prohibited content.
      PROHIBITED_CONTENT = 4
    end
  end

  # Usage metadata about response(s).
  # @!attribute [rw] prompt_token_count
  #   @return [::Integer]
  #     Number of tokens in the request. When `cached_content` is set, this is
  #     still the total effective prompt size meaning this includes the number of
  #     tokens in the cached content.
  # @!attribute [rw] candidates_token_count
  #   @return [::Integer]
  #     Number of tokens in the response(s).
  # @!attribute [rw] total_token_count
  #   @return [::Integer]
  #     Total token count for prompt and response candidates.
  class UsageMetadata
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#usage_metadata::Google::Cloud::AIPlatform::V1::GenerateContentResponse::UsageMetadata

Returns Usage metadata about the response(s).

Returns:



559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
# File 'proto_docs/google/cloud/aiplatform/v1/prediction_service.rb', line 559

class GenerateContentResponse
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Content filter results for a prompt sent in the request.
  # @!attribute [r] block_reason
  #   @return [::Google::Cloud::AIPlatform::V1::GenerateContentResponse::PromptFeedback::BlockedReason]
  #     Output only. Blocked reason.
  # @!attribute [r] safety_ratings
  #   @return [::Array<::Google::Cloud::AIPlatform::V1::SafetyRating>]
  #     Output only. Safety ratings.
  # @!attribute [r] block_reason_message
  #   @return [::String]
  #     Output only. A readable block reason message.
  class PromptFeedback
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Blocked reason enumeration.
    module BlockedReason
      # Unspecified blocked reason.
      BLOCKED_REASON_UNSPECIFIED = 0

      # Candidates blocked due to safety.
      SAFETY = 1

      # Candidates blocked due to other reason.
      OTHER = 2

      # Candidates blocked due to the terms which are included from the
      # terminology blocklist.
      BLOCKLIST = 3

      # Candidates blocked due to prohibited content.
      PROHIBITED_CONTENT = 4
    end
  end

  # Usage metadata about response(s).
  # @!attribute [rw] prompt_token_count
  #   @return [::Integer]
  #     Number of tokens in the request. When `cached_content` is set, this is
  #     still the total effective prompt size meaning this includes the number of
  #     tokens in the cached content.
  # @!attribute [rw] candidates_token_count
  #   @return [::Integer]
  #     Number of tokens in the response(s).
  # @!attribute [rw] total_token_count
  #   @return [::Integer]
  #     Total token count for prompt and response candidates.
  class UsageMetadata
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end