Class: Deepsearch::Engine::Steps::Rag::Values::Query
- Inherits:
-
Object
- Object
- Deepsearch::Engine::Steps::Rag::Values::Query
- Defined in:
- lib/deepsearch/engine/steps/rag/values/query.rb
Overview
Represents a user query that has been prepared for the RAG process. It enriches the original query text with LLM-generated tags to improve embedding quality and then computes the embedding vector.
Instance Attribute Summary collapse
-
#embedding ⇒ Object
readonly
Returns the value of attribute embedding.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text:) ⇒ Query
constructor
A new instance of Query.
Constructor Details
#initialize(text:) ⇒ Query
Returns a new instance of Query.
14 15 16 17 18 19 20 |
# File 'lib/deepsearch/engine/steps/rag/values/query.rb', line 14 def initialize(text:) raise ArgumentError, "Query text cannot be blank" if text.to_s.strip.empty? @text = text enriched_text = (text) = RubyLLM.(enriched_text).vectors end |
Instance Attribute Details
#embedding ⇒ Object (readonly)
Returns the value of attribute embedding.
12 13 14 |
# File 'lib/deepsearch/engine/steps/rag/values/query.rb', line 12 def end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
12 13 14 |
# File 'lib/deepsearch/engine/steps/rag/values/query.rb', line 12 def text @text end |