Class: Google::Cloud::DiscoveryEngine::V1beta::AssistantGroundedContent

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/discoveryengine/v1beta/assist_answer.rb

Overview

A piece of content and possibly its grounding information.

Not all content needs grounding. Phrases like "Of course, I will gladly search it for you." do not need grounding.

Defined Under Namespace

Classes: TextGroundingMetadata

Instance Attribute Summary collapse

Instance Attribute Details

#citation_metadata::Google::Cloud::DiscoveryEngine::V1beta::CitationMetadata

Returns Source attribution of the generated content. See also https://cloud.google.com/vertex-ai/generative-ai/docs/learn/overview#citation_check.



287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'proto_docs/google/cloud/discoveryengine/v1beta/assist_answer.rb', line 287

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

  # Grounding details for text sources.
  # @!attribute [rw] segments
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::AssistantGroundedContent::TextGroundingMetadata::Segment>]
  #     Grounding information for parts of the text.
  # @!attribute [rw] visual_segments
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::AssistantGroundedContent::TextGroundingMetadata::VisualSegment>]
  #     Grounding information for parts of the visual content.
  # @!attribute [rw] references
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::AssistantGroundedContent::TextGroundingMetadata::Reference>]
  #     References for the grounded text.
  class TextGroundingMetadata
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Grounding information for a segment of the text.
    # @!attribute [rw] start_index
    #   @return [::Integer]
    #     Zero-based index indicating the start of the segment, measured in bytes
    #     of a UTF-8 string (i.e. characters encoded on multiple bytes have a
    #     length of more than one).
    # @!attribute [rw] end_index
    #   @return [::Integer]
    #     End of the segment, exclusive.
    # @!attribute [rw] reference_indices
    #   @return [::Array<::Integer>]
    #     References for the segment.
    # @!attribute [rw] grounding_score
    #   @return [::Float]
    #     Score for the segment.
    # @!attribute [rw] text
    #   @return [::String]
    #     The text segment itself.
    class Segment
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Grounding information for a visual segment.
    # @!attribute [rw] reference_indices
    #   @return [::Array<::Integer>]
    #     References for the visual segment.
    # @!attribute [rw] content_id
    #   @return [::String]
    #     The content id of the visual segment. In order to display the citation
    #     of the visual element, this content_id needs to match with the
    #     `grounded_content.content_metadata.content_id` field.
    class VisualSegment
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Referenced content and related document metadata.
    # @!attribute [rw] content
    #   @return [::String]
    #     Referenced text content.
    # @!attribute [rw] code_snippet
    #   @return [::String]
    #     Chunk of code snippet from the referenced document.
    # @!attribute [rw] document_metadata
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::AssistantGroundedContent::TextGroundingMetadata::Reference::DocumentMetadata]
    #     Document metadata.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Document metadata.
      # @!attribute [rw] language
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::AssistantGroundedContent::TextGroundingMetadata::Reference::DocumentMetadata::Language]
      # @!attribute [rw] document
      #   @return [::String]
      #     Document resource name.
      # @!attribute [rw] uri
      #   @return [::String]
      #     URI for the document. It may contain a URL that redirects to the
      #     actual website.
      # @!attribute [rw] title
      #   @return [::String]
      #     Title.
      # @!attribute [rw] page_identifier
      #   @return [::String]
      #     Page identifier.
      # @!attribute [rw] domain
      #   @return [::String]
      #     Domain name from the document URI. Note that the `uri` field may
      #     contain a URL that redirects to the actual website, in which case
      #     this will contain the domain name of the target site.
      # @!attribute [rw] mime_type
      #   @return [::String]
      #     The mime type of the document.
      #     https://www.iana.org/assignments/media-types/media-types.xhtml.
      class DocumentMetadata
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Language of the referenced content. For now, it is only used for
        # code.
        module Language
          LANGUAGE_UNSPECIFIED = 0

          PYTHON = 1

          SQL = 2
        end
      end
    end
  end
end

#content::Google::Cloud::DiscoveryEngine::V1beta::AssistantContent

Returns The content.



287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'proto_docs/google/cloud/discoveryengine/v1beta/assist_answer.rb', line 287

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

  # Grounding details for text sources.
  # @!attribute [rw] segments
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::AssistantGroundedContent::TextGroundingMetadata::Segment>]
  #     Grounding information for parts of the text.
  # @!attribute [rw] visual_segments
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::AssistantGroundedContent::TextGroundingMetadata::VisualSegment>]
  #     Grounding information for parts of the visual content.
  # @!attribute [rw] references
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::AssistantGroundedContent::TextGroundingMetadata::Reference>]
  #     References for the grounded text.
  class TextGroundingMetadata
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Grounding information for a segment of the text.
    # @!attribute [rw] start_index
    #   @return [::Integer]
    #     Zero-based index indicating the start of the segment, measured in bytes
    #     of a UTF-8 string (i.e. characters encoded on multiple bytes have a
    #     length of more than one).
    # @!attribute [rw] end_index
    #   @return [::Integer]
    #     End of the segment, exclusive.
    # @!attribute [rw] reference_indices
    #   @return [::Array<::Integer>]
    #     References for the segment.
    # @!attribute [rw] grounding_score
    #   @return [::Float]
    #     Score for the segment.
    # @!attribute [rw] text
    #   @return [::String]
    #     The text segment itself.
    class Segment
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Grounding information for a visual segment.
    # @!attribute [rw] reference_indices
    #   @return [::Array<::Integer>]
    #     References for the visual segment.
    # @!attribute [rw] content_id
    #   @return [::String]
    #     The content id of the visual segment. In order to display the citation
    #     of the visual element, this content_id needs to match with the
    #     `grounded_content.content_metadata.content_id` field.
    class VisualSegment
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Referenced content and related document metadata.
    # @!attribute [rw] content
    #   @return [::String]
    #     Referenced text content.
    # @!attribute [rw] code_snippet
    #   @return [::String]
    #     Chunk of code snippet from the referenced document.
    # @!attribute [rw] document_metadata
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::AssistantGroundedContent::TextGroundingMetadata::Reference::DocumentMetadata]
    #     Document metadata.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Document metadata.
      # @!attribute [rw] language
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::AssistantGroundedContent::TextGroundingMetadata::Reference::DocumentMetadata::Language]
      # @!attribute [rw] document
      #   @return [::String]
      #     Document resource name.
      # @!attribute [rw] uri
      #   @return [::String]
      #     URI for the document. It may contain a URL that redirects to the
      #     actual website.
      # @!attribute [rw] title
      #   @return [::String]
      #     Title.
      # @!attribute [rw] page_identifier
      #   @return [::String]
      #     Page identifier.
      # @!attribute [rw] domain
      #   @return [::String]
      #     Domain name from the document URI. Note that the `uri` field may
      #     contain a URL that redirects to the actual website, in which case
      #     this will contain the domain name of the target site.
      # @!attribute [rw] mime_type
      #   @return [::String]
      #     The mime type of the document.
      #     https://www.iana.org/assignments/media-types/media-types.xhtml.
      class DocumentMetadata
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Language of the referenced content. For now, it is only used for
        # code.
        module Language
          LANGUAGE_UNSPECIFIED = 0

          PYTHON = 1

          SQL = 2
        end
      end
    end
  end
end

#text_grounding_metadata::Google::Cloud::DiscoveryEngine::V1beta::AssistantGroundedContent::TextGroundingMetadata

Returns Metadata for grounding based on text sources.

Returns:



287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'proto_docs/google/cloud/discoveryengine/v1beta/assist_answer.rb', line 287

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

  # Grounding details for text sources.
  # @!attribute [rw] segments
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::AssistantGroundedContent::TextGroundingMetadata::Segment>]
  #     Grounding information for parts of the text.
  # @!attribute [rw] visual_segments
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::AssistantGroundedContent::TextGroundingMetadata::VisualSegment>]
  #     Grounding information for parts of the visual content.
  # @!attribute [rw] references
  #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1beta::AssistantGroundedContent::TextGroundingMetadata::Reference>]
  #     References for the grounded text.
  class TextGroundingMetadata
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Grounding information for a segment of the text.
    # @!attribute [rw] start_index
    #   @return [::Integer]
    #     Zero-based index indicating the start of the segment, measured in bytes
    #     of a UTF-8 string (i.e. characters encoded on multiple bytes have a
    #     length of more than one).
    # @!attribute [rw] end_index
    #   @return [::Integer]
    #     End of the segment, exclusive.
    # @!attribute [rw] reference_indices
    #   @return [::Array<::Integer>]
    #     References for the segment.
    # @!attribute [rw] grounding_score
    #   @return [::Float]
    #     Score for the segment.
    # @!attribute [rw] text
    #   @return [::String]
    #     The text segment itself.
    class Segment
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Grounding information for a visual segment.
    # @!attribute [rw] reference_indices
    #   @return [::Array<::Integer>]
    #     References for the visual segment.
    # @!attribute [rw] content_id
    #   @return [::String]
    #     The content id of the visual segment. In order to display the citation
    #     of the visual element, this content_id needs to match with the
    #     `grounded_content.content_metadata.content_id` field.
    class VisualSegment
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Referenced content and related document metadata.
    # @!attribute [rw] content
    #   @return [::String]
    #     Referenced text content.
    # @!attribute [rw] code_snippet
    #   @return [::String]
    #     Chunk of code snippet from the referenced document.
    # @!attribute [rw] document_metadata
    #   @return [::Google::Cloud::DiscoveryEngine::V1beta::AssistantGroundedContent::TextGroundingMetadata::Reference::DocumentMetadata]
    #     Document metadata.
    class Reference
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Document metadata.
      # @!attribute [rw] language
      #   @return [::Google::Cloud::DiscoveryEngine::V1beta::AssistantGroundedContent::TextGroundingMetadata::Reference::DocumentMetadata::Language]
      # @!attribute [rw] document
      #   @return [::String]
      #     Document resource name.
      # @!attribute [rw] uri
      #   @return [::String]
      #     URI for the document. It may contain a URL that redirects to the
      #     actual website.
      # @!attribute [rw] title
      #   @return [::String]
      #     Title.
      # @!attribute [rw] page_identifier
      #   @return [::String]
      #     Page identifier.
      # @!attribute [rw] domain
      #   @return [::String]
      #     Domain name from the document URI. Note that the `uri` field may
      #     contain a URL that redirects to the actual website, in which case
      #     this will contain the domain name of the target site.
      # @!attribute [rw] mime_type
      #   @return [::String]
      #     The mime type of the document.
      #     https://www.iana.org/assignments/media-types/media-types.xhtml.
      class DocumentMetadata
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Language of the referenced content. For now, it is only used for
        # code.
        module Language
          LANGUAGE_UNSPECIFIED = 0

          PYTHON = 1

          SQL = 2
        end
      end
    end
  end
end