Class: Firecrawl::Models::QueryFormat
- Inherits:
-
Object
- Object
- Firecrawl::Models::QueryFormat
- Defined in:
- lib/firecrawl/models/query_format.rb
Overview
Deprecated 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.
76 77 78 79 80 81 82 83 |
# File 'lib/firecrawl/models/query_format.rb', line 76 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.
74 75 76 |
# File 'lib/firecrawl/models/query_format.rb', line 74 def mode @mode end |
#prompt ⇒ Object (readonly)
Returns the value of attribute prompt.
74 75 76 |
# File 'lib/firecrawl/models/query_format.rb', line 74 def prompt @prompt end |
Instance Method Details
#to_h ⇒ Object
85 86 87 88 89 90 91 |
# File 'lib/firecrawl/models/query_format.rb', line 85 def to_h { "type" => "query", "prompt" => prompt, "mode" => mode, }.compact end |
#type ⇒ Object
93 94 95 |
# File 'lib/firecrawl/models/query_format.rb', line 93 def type "query" end |