Class: Firecrawl::Models::JsonFormat
- Inherits:
-
Object
- Object
- Firecrawl::Models::JsonFormat
- Defined in:
- lib/firecrawl/models/query_format.rb
Overview
JSON format for extracting structured data from page content using a schema.
Instance Attribute Summary collapse
-
#check_prompt_injection ⇒ Object
readonly
Returns the value of attribute check_prompt_injection.
-
#prompt ⇒ Object
readonly
Returns the value of attribute prompt.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
Instance Method Summary collapse
-
#initialize(schema: nil, prompt: nil, check_prompt_injection: nil) ⇒ JsonFormat
constructor
A new instance of JsonFormat.
- #to_h ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(schema: nil, prompt: nil, check_prompt_injection: nil) ⇒ JsonFormat
Returns a new instance of JsonFormat.
49 50 51 52 53 |
# File 'lib/firecrawl/models/query_format.rb', line 49 def initialize(schema: nil, prompt: nil, check_prompt_injection: nil) @schema = schema @prompt = prompt @check_prompt_injection = check_prompt_injection end |
Instance Attribute Details
#check_prompt_injection ⇒ Object (readonly)
Returns the value of attribute check_prompt_injection.
47 48 49 |
# File 'lib/firecrawl/models/query_format.rb', line 47 def check_prompt_injection @check_prompt_injection end |
#prompt ⇒ Object (readonly)
Returns the value of attribute prompt.
47 48 49 |
# File 'lib/firecrawl/models/query_format.rb', line 47 def prompt @prompt end |
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
47 48 49 |
# File 'lib/firecrawl/models/query_format.rb', line 47 def schema @schema end |
Instance Method Details
#to_h ⇒ Object
55 56 57 58 59 60 61 62 |
# File 'lib/firecrawl/models/query_format.rb', line 55 def to_h { "type" => "json", "schema" => schema, "prompt" => prompt, "checkPromptInjection" => check_prompt_injection, }.compact end |
#type ⇒ Object
64 65 66 |
# File 'lib/firecrawl/models/query_format.rb', line 64 def type "json" end |