firecrawl-sdk 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 925d1d1e2e21f65f6ff043a07d8689f5e29b41d72b1b8791334af47d76153819
4
- data.tar.gz: 8e70053a8eabd4d2ff100386c4bb7c4fd2bea7ec119dedf2151d21c404e41e31
3
+ metadata.gz: d02f8409836cbb0811734f56c0eeebf590ad09596f86edb863fa8ca4532833b1
4
+ data.tar.gz: 37fb91eaebc98e5cb3feea6b4e0fb8b7543acc1c75b23f0c4c64f6f815501fbc
5
5
  SHA512:
6
- metadata.gz: ce98788dd3a379d575f97962b597224115463b28adf19870b0820c2a6e60c4fa44ce4b58d039843022e38d0027254e8808f3704552bc401994497c040f752233
7
- data.tar.gz: 7349d8f5d5a63d54364b7b1c1afef54b0d16930d6b107b97bb3ba933fc404ec45559ec8ab4a0e0551f142c108fb70e24ea30bfecf2562d01e0b182163e0e9eea
6
+ metadata.gz: ed4a232b9c66bc1b525f33fe358bb1a0e1b2bf197c3e51a971f11b016958f0f1e0af5b729a8e738a4e56a99bf97824aa335d763924d26c5a8eaa5102ee68ccd5
7
+ data.tar.gz: cecb039f3026016df71f208f5e2989f8c86e9edc7d7e25fdb390e855962ecdba115411e8b2f4b97e3fcbca8cb8517e3d31c9f6b7daafdcfd05004b69365e0971
@@ -26,7 +26,7 @@ module Firecrawl
26
26
 
27
27
  def to_h
28
28
  {
29
- "formats" => formats,
29
+ "formats" => formats&.map { |fmt| format_value(fmt) },
30
30
  "headers" => headers,
31
31
  "includeTags" => include_tags,
32
32
  "excludeTags" => exclude_tags,
@@ -69,6 +69,10 @@ module Firecrawl
69
69
  fmt.respond_to?(:type) ? fmt.type : nil
70
70
  end
71
71
  end
72
+
73
+ def format_value(fmt)
74
+ fmt.respond_to?(:to_h) ? fmt.to_h : fmt
75
+ end
72
76
  end
73
77
  end
74
78
  end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Firecrawl
4
+ module Models
5
+ # Query format for asking a question about page content.
6
+ class QueryFormat
7
+ MODE_FREEFORM = "freeform"
8
+ MODE_DIRECT_QUOTE = "directQuote"
9
+
10
+ attr_reader :prompt, :mode
11
+
12
+ def initialize(prompt:, mode: nil)
13
+ unless mode.nil? || [MODE_FREEFORM, MODE_DIRECT_QUOTE].include?(mode)
14
+ raise ArgumentError, "query mode must be 'freeform' or 'directQuote'"
15
+ end
16
+
17
+ @prompt = prompt
18
+ @mode = mode
19
+ end
20
+
21
+ def to_h
22
+ {
23
+ "type" => "query",
24
+ "prompt" => prompt,
25
+ "mode" => mode,
26
+ }.compact
27
+ end
28
+
29
+ def type
30
+ "query"
31
+ end
32
+ end
33
+ end
34
+ end
@@ -20,7 +20,7 @@ module Firecrawl
20
20
 
21
21
  def to_h
22
22
  {
23
- "formats" => formats,
23
+ "formats" => formats&.map { |fmt| format_value(fmt) },
24
24
  "headers" => headers,
25
25
  "includeTags" => include_tags,
26
26
  "excludeTags" => exclude_tags,
@@ -41,6 +41,12 @@ module Firecrawl
41
41
  "integration" => integration,
42
42
  }.compact
43
43
  end
44
+
45
+ private
46
+
47
+ def format_value(fmt)
48
+ fmt.respond_to?(:to_h) ? fmt.to_h : fmt
49
+ end
44
50
  end
45
51
  end
46
52
  end
@@ -5,8 +5,8 @@ module Firecrawl
5
5
  # Options for a web search request.
6
6
  class SearchOptions
7
7
  FIELDS = %i[
8
- sources categories limit tbs location ignore_invalid_urls
9
- timeout scrape_options integration
8
+ sources categories include_domains exclude_domains limit tbs location
9
+ ignore_invalid_urls timeout scrape_options integration
10
10
  ].freeze
11
11
 
12
12
  attr_reader(*FIELDS)
@@ -19,6 +19,8 @@ module Firecrawl
19
19
  {
20
20
  "sources" => sources,
21
21
  "categories" => categories,
22
+ "includeDomains" => include_domains,
23
+ "excludeDomains" => exclude_domains,
22
24
  "limit" => limit,
23
25
  "tbs" => tbs,
24
26
  "location" => location,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Firecrawl
4
- VERSION = "1.3.0"
4
+ VERSION = "1.3.1"
5
5
  end
data/lib/firecrawl.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require_relative "firecrawl/version"
4
4
  require_relative "firecrawl/errors"
5
5
  require_relative "firecrawl/http_client"
6
+ require_relative "firecrawl/models/query_format"
6
7
  require_relative "firecrawl/models/document"
7
8
  require_relative "firecrawl/models/scrape_options"
8
9
  require_relative "firecrawl/models/crawl_options"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firecrawl-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firecrawl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-04-30 00:00:00.000000000 Z
11
+ date: 2026-05-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A type-safe Ruby client for the Firecrawl v2 API. Supports scraping,
14
14
  crawling, batch scraping, URL mapping, web search, and AI agent operations.
@@ -40,6 +40,7 @@ files:
40
40
  - lib/firecrawl/models/map_options.rb
41
41
  - lib/firecrawl/models/parse_file.rb
42
42
  - lib/firecrawl/models/parse_options.rb
43
+ - lib/firecrawl/models/query_format.rb
43
44
  - lib/firecrawl/models/scrape_options.rb
44
45
  - lib/firecrawl/models/search_data.rb
45
46
  - lib/firecrawl/models/search_options.rb