Class: Google::Apis::DeveloperknowledgeV1alpha::DocumentChunk
- Inherits:
-
Object
- Object
- Google::Apis::DeveloperknowledgeV1alpha::DocumentChunk
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/developerknowledge_v1alpha/classes.rb,
lib/google/apis/developerknowledge_v1alpha/representations.rb,
lib/google/apis/developerknowledge_v1alpha/representations.rb
Overview
A DocumentChunk represents a piece of content from a Document in the
DeveloperKnowledge corpus. To fetch the entire document content, pass the
parent to DeveloperKnowledge.GetDocument or DeveloperKnowledge.
BatchGetDocuments.
Instance Attribute Summary collapse
-
#content ⇒ String
Output only.
-
#document ⇒ Google::Apis::DeveloperknowledgeV1alpha::Document
A Document represents a page of documentation in the Developer Knowledge corpus, like the page at https://docs.cloud.google.com/storage/docs/creating- buckets.
-
#id ⇒ String
Output only.
-
#parent ⇒ String
Output only.
-
#relevance_score ⇒ Float
Output only.
Instance Method Summary collapse
-
#initialize(**args) ⇒ DocumentChunk
constructor
A new instance of DocumentChunk.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ DocumentChunk
Returns a new instance of DocumentChunk.
331 332 333 |
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 331 def initialize(**args) update!(**args) end |
Instance Attribute Details
#content ⇒ String
Output only. Contains the content of the document chunk.
Corresponds to the JSON property content
301 302 303 |
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 301 def content @content end |
#document ⇒ Google::Apis::DeveloperknowledgeV1alpha::Document
A Document represents a page of documentation in the Developer Knowledge
corpus, like the page at https://docs.cloud.google.com/storage/docs/creating-
buckets.
Corresponds to the JSON property document
308 309 310 |
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 308 def document @document end |
#id ⇒ String
Output only. Specifies the ID of this chunk within the document. The chunk ID
is unique within a document, but not globally unique across documents. The
chunk ID is not stable and may change over time.
Corresponds to the JSON property id
315 316 317 |
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 315 def id @id end |
#parent ⇒ String
Output only. Contains the resource name of the document this chunk is from.
Format: documents/uri_without_scheme`Example:documents/docs.cloud.google.
com/storage/docs/creating-buckets
Corresponds to the JSON propertyparent`
322 323 324 |
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 322 def parent @parent end |
#relevance_score ⇒ Float
Output only. Represents the relevance score of the chunk to the search query.
Higher score indicates higher chunk relevance. The score is in range [0.0, 1.0]
.
Corresponds to the JSON property relevanceScore
329 330 331 |
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 329 def relevance_score @relevance_score end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
336 337 338 339 340 341 342 |
# File 'lib/google/apis/developerknowledge_v1alpha/classes.rb', line 336 def update!(**args) @content = args[:content] if args.key?(:content) @document = args[:document] if args.key?(:document) @id = args[:id] if args.key?(:id) @parent = args[:parent] if args.key?(:parent) @relevance_score = args[:relevance_score] if args.key?(:relevance_score) end |