Class: Mindee::Parsing::Common::Extras::RAGExtra

Inherits:
Object
  • Object
show all
Defined in:
lib/mindee/parsing/common/extras/rag_extra.rb

Overview

Retrieval-Augmented Generation extra.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_prediction) ⇒ RAGExtra

Returns a new instance of RAGExtra.



13
14
15
# File 'lib/mindee/parsing/common/extras/rag_extra.rb', line 13

def initialize(raw_prediction)
  @matching_document_id = raw_prediction['matching_document_id'] if raw_prediction['matching_document_id']
end

Instance Attribute Details

#matching_document_idString? (readonly)

ID of the matching document

Returns:

  • (String, nil)


11
12
13
# File 'lib/mindee/parsing/common/extras/rag_extra.rb', line 11

def matching_document_id
  @matching_document_id
end

Instance Method Details

#to_sObject



17
18
19
# File 'lib/mindee/parsing/common/extras/rag_extra.rb', line 17

def to_s
  @matching_document_id || ''
end