Class: Deepsearch::Engine::Steps::Rag::Values::Chunk

Inherits:
Object
  • Object
show all
Defined in:
lib/deepsearch/engine/steps/rag/values/chunk.rb

Overview

Represents a chunk of text from a document, along with its embedding and source URL. This is the fundamental unit of data used in the RAG process.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text:, embedding: nil, document_url: nil) ⇒ Chunk

Returns a new instance of Chunk.



13
14
15
16
17
# File 'lib/deepsearch/engine/steps/rag/values/chunk.rb', line 13

def initialize(text:, embedding: nil, document_url: nil)
  @text = text
  @embedding = embedding
  @document_url = document_url
end

Instance Attribute Details

#document_urlObject

Returns the value of attribute document_url.



11
12
13
# File 'lib/deepsearch/engine/steps/rag/values/chunk.rb', line 11

def document_url
  @document_url
end

#embeddingObject

Returns the value of attribute embedding.



11
12
13
# File 'lib/deepsearch/engine/steps/rag/values/chunk.rb', line 11

def embedding
  @embedding
end

#textObject

Returns the value of attribute text.



11
12
13
# File 'lib/deepsearch/engine/steps/rag/values/chunk.rb', line 11

def text
  @text
end