Class: Firecrawl::Models::QueryFormat
- Inherits:
-
Object
- Object
- Firecrawl::Models::QueryFormat
- Defined in:
- lib/firecrawl/models/query_format.rb
Overview
Query format for asking a question about page content.
Constant Summary collapse
- MODE_FREEFORM =
"freeform"- MODE_DIRECT_QUOTE =
"directQuote"
Instance Attribute Summary collapse
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#prompt ⇒ Object
readonly
Returns the value of attribute prompt.
Instance Method Summary collapse
-
#initialize(prompt:, mode: nil) ⇒ QueryFormat
constructor
A new instance of QueryFormat.
- #to_h ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(prompt:, mode: nil) ⇒ QueryFormat
Returns a new instance of QueryFormat.
12 13 14 15 16 17 18 19 |
# File 'lib/firecrawl/models/query_format.rb', line 12 def initialize(prompt:, mode: nil) unless mode.nil? || [MODE_FREEFORM, MODE_DIRECT_QUOTE].include?(mode) raise ArgumentError, "query mode must be 'freeform' or 'directQuote'" end @prompt = prompt @mode = mode end |
Instance Attribute Details
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
10 11 12 |
# File 'lib/firecrawl/models/query_format.rb', line 10 def mode @mode end |
#prompt ⇒ Object (readonly)
Returns the value of attribute prompt.
10 11 12 |
# File 'lib/firecrawl/models/query_format.rb', line 10 def prompt @prompt end |
Instance Method Details
#to_h ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/firecrawl/models/query_format.rb', line 21 def to_h { "type" => "query", "prompt" => prompt, "mode" => mode, }.compact end |
#type ⇒ Object
29 30 31 |
# File 'lib/firecrawl/models/query_format.rb', line 29 def type "query" end |