context.dev 1.26.0 → 1.28.0

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.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/models/web_extract_competitors_params.rb +44 -0
  5. data/lib/context_dev/models/web_extract_competitors_response.rb +157 -0
  6. data/lib/context_dev/models/web_web_scrape_html_params.rb +11 -1
  7. data/lib/context_dev/models/web_web_scrape_images_params.rb +11 -1
  8. data/lib/context_dev/models/web_web_scrape_md_params.rb +11 -1
  9. data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +11 -1
  10. data/lib/context_dev/models.rb +2 -0
  11. data/lib/context_dev/resources/web.rb +43 -4
  12. data/lib/context_dev/version.rb +1 -1
  13. data/lib/context_dev.rb +2 -0
  14. data/rbi/context_dev/models/web_extract_competitors_params.rbi +74 -0
  15. data/rbi/context_dev/models/web_extract_competitors_response.rbi +297 -0
  16. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +15 -0
  17. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +15 -0
  18. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +15 -0
  19. data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +15 -0
  20. data/rbi/context_dev/models.rbi +2 -0
  21. data/rbi/context_dev/resources/web.rbi +44 -0
  22. data/sig/context_dev/models/web_extract_competitors_params.rbs +36 -0
  23. data/sig/context_dev/models/web_extract_competitors_response.rbs +130 -0
  24. data/sig/context_dev/models/web_web_scrape_html_params.rbs +7 -0
  25. data/sig/context_dev/models/web_web_scrape_images_params.rbs +7 -0
  26. data/sig/context_dev/models/web_web_scrape_md_params.rbs +7 -0
  27. data/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +7 -0
  28. data/sig/context_dev/models.rbs +2 -0
  29. data/sig/context_dev/resources/web.rbs +11 -0
  30. metadata +8 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb1eb49bd2c33309910f98a48b129a07a32707a85e5a832277226ee555d22780
4
- data.tar.gz: 4c7410af11f9f6f69145a70f37e1c613fe9a90d6b2ea99acc061c10ae9119716
3
+ metadata.gz: d3053b0240426586c72a3ff1876ef8965d555cc938b5cf82bc69dc8d728b3c13
4
+ data.tar.gz: 3cbe46d917bc4abca8abe5f1af719b66de6eb2c78b912f5846ed769412975579
5
5
  SHA512:
6
- metadata.gz: 13e5b25d98899a354e90fdf559ea5b3ed8d1140a543f538a7909691a92ecb49917e87398f2da8b3759aad2751487c02e4b89e4738f15febe9bc10995825c4660
7
- data.tar.gz: b82dee66dd6c01d5a4edb347097a978708714164cbe4460b7da394f0440b297afcc602bf52cc3cf597e3fe8638559b953bafe0288512e883f1d3b2957fc62cea
6
+ metadata.gz: 36f207582130d9e38c3704b516f4927062f00f3b5b5f60cfbcf6a171f5081afed1c0c540810611a000d6a869bf9127a97b50d5a69c723da8aa18d2ae1ebda5b1
7
+ data.tar.gz: 1a27a3872ba648463b321aee475780bf0c42142a33ae6d39453364727ec290645be4e53750afb9db0d3fe3b2a15b722338a1494d3a2271c483eea43d460fd70f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.28.0 (2026-06-06)
4
+
5
+ Full Changelog: [v1.27.0...v1.28.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.27.0...v1.28.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([22eb08f](https://github.com/context-dot-dev/context-ruby-sdk/commit/22eb08f65d1001052f1bd247a4d60e2680bb33ea))
10
+
11
+ ## 1.27.0 (2026-06-01)
12
+
13
+ Full Changelog: [v1.26.0...v1.27.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.26.0...v1.27.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** manual updates ([e3971dc](https://github.com/context-dot-dev/context-ruby-sdk/commit/e3971dcc3b94f5b998562f8ecb82a292cc8f00bd))
18
+
3
19
  ## 1.26.0 (2026-06-01)
4
20
 
5
21
  Full Changelog: [v1.25.0...v1.26.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.25.0...v1.26.0)
data/README.md CHANGED
@@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
26
26
  <!-- x-release-please-start-version -->
27
27
 
28
28
  ```ruby
29
- gem "context.dev", "~> 1.26.0"
29
+ gem "context.dev", "~> 1.28.0"
30
30
  ```
31
31
 
32
32
  <!-- x-release-please-end -->
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ContextDev
4
+ module Models
5
+ # @see ContextDev::Resources::Web#extract_competitors
6
+ class WebExtractCompetitorsParams < ContextDev::Internal::Type::BaseModel
7
+ extend ContextDev::Internal::Type::RequestParameters::Converter
8
+ include ContextDev::Internal::Type::RequestParameters
9
+
10
+ # @!attribute domain
11
+ # Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
12
+ # and normalized to their domain.
13
+ #
14
+ # @return [String]
15
+ required :domain, String
16
+
17
+ # @!attribute num_competitors
18
+ # Exact number of direct competitors to return. Defaults to 5.
19
+ #
20
+ # @return [Integer, nil]
21
+ optional :num_competitors, Integer
22
+
23
+ # @!attribute timeout_ms
24
+ # Optional timeout in milliseconds for the request. If the request takes longer
25
+ # than this value, it will be aborted with a 408 status code. Maximum allowed
26
+ # value is 300000ms (5 minutes).
27
+ #
28
+ # @return [Integer, nil]
29
+ optional :timeout_ms, Integer
30
+
31
+ # @!method initialize(domain:, num_competitors: nil, timeout_ms: nil, request_options: {})
32
+ # Some parameter documentations has been truncated, see
33
+ # {ContextDev::Models::WebExtractCompetitorsParams} for more details.
34
+ #
35
+ # @param domain [String] Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
36
+ #
37
+ # @param num_competitors [Integer] Exact number of direct competitors to return. Defaults to 5.
38
+ #
39
+ # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
40
+ #
41
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,157 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ContextDev
4
+ module Models
5
+ # @see ContextDev::Resources::Web#extract_competitors
6
+ class WebExtractCompetitorsResponse < ContextDev::Internal::Type::BaseModel
7
+ # @!attribute competitors
8
+ # Direct competitors ordered by relevance and confidence.
9
+ #
10
+ # @return [Array<ContextDev::Models::WebExtractCompetitorsResponse::Competitor>]
11
+ required :competitors,
12
+ -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::WebExtractCompetitorsResponse::Competitor] }
13
+
14
+ # @!attribute domain
15
+ # Normalized input domain.
16
+ #
17
+ # @return [String]
18
+ required :domain, String
19
+
20
+ # @!attribute status
21
+ # Status of the response.
22
+ #
23
+ # @return [Symbol, ContextDev::Models::WebExtractCompetitorsResponse::Status]
24
+ required :status, enum: -> { ContextDev::Models::WebExtractCompetitorsResponse::Status }
25
+
26
+ # @!attribute target
27
+ # Target company profile inferred from the landing page.
28
+ #
29
+ # @return [ContextDev::Models::WebExtractCompetitorsResponse::Target]
30
+ required :target, -> { ContextDev::Models::WebExtractCompetitorsResponse::Target }
31
+
32
+ # @!method initialize(competitors:, domain:, status:, target:)
33
+ # @param competitors [Array<ContextDev::Models::WebExtractCompetitorsResponse::Competitor>] Direct competitors ordered by relevance and confidence.
34
+ #
35
+ # @param domain [String] Normalized input domain.
36
+ #
37
+ # @param status [Symbol, ContextDev::Models::WebExtractCompetitorsResponse::Status] Status of the response.
38
+ #
39
+ # @param target [ContextDev::Models::WebExtractCompetitorsResponse::Target] Target company profile inferred from the landing page.
40
+
41
+ class Competitor < ContextDev::Internal::Type::BaseModel
42
+ # @!attribute confidence
43
+ # Confidence that this company is a direct competitor.
44
+ #
45
+ # @return [Symbol, ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence]
46
+ required :confidence,
47
+ enum: -> { ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence }
48
+
49
+ # @!attribute description
50
+ # Short description of the competitor.
51
+ #
52
+ # @return [String]
53
+ required :description, String
54
+
55
+ # @!attribute domain
56
+ # Competitor's normalized official domain.
57
+ #
58
+ # @return [String]
59
+ required :domain, String
60
+
61
+ # @!attribute name
62
+ # Competitor company or product name.
63
+ #
64
+ # @return [String]
65
+ required :name, String
66
+
67
+ # @!attribute source_urls
68
+ # Search result URLs used as evidence for this competitor.
69
+ #
70
+ # @return [Array<String>]
71
+ required :source_urls, ContextDev::Internal::Type::ArrayOf[String], api_name: :sourceUrls
72
+
73
+ # @!attribute url
74
+ # Competitor website URL.
75
+ #
76
+ # @return [String]
77
+ required :url, String
78
+
79
+ # @!method initialize(confidence:, description:, domain:, name:, source_urls:, url:)
80
+ # @param confidence [Symbol, ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence] Confidence that this company is a direct competitor.
81
+ #
82
+ # @param description [String] Short description of the competitor.
83
+ #
84
+ # @param domain [String] Competitor's normalized official domain.
85
+ #
86
+ # @param name [String] Competitor company or product name.
87
+ #
88
+ # @param source_urls [Array<String>] Search result URLs used as evidence for this competitor.
89
+ #
90
+ # @param url [String] Competitor website URL.
91
+
92
+ # Confidence that this company is a direct competitor.
93
+ #
94
+ # @see ContextDev::Models::WebExtractCompetitorsResponse::Competitor#confidence
95
+ module Confidence
96
+ extend ContextDev::Internal::Type::Enum
97
+
98
+ HIGH = :high
99
+ MEDIUM = :medium
100
+
101
+ # @!method self.values
102
+ # @return [Array<Symbol>]
103
+ end
104
+ end
105
+
106
+ # Status of the response.
107
+ #
108
+ # @see ContextDev::Models::WebExtractCompetitorsResponse#status
109
+ module Status
110
+ extend ContextDev::Internal::Type::Enum
111
+
112
+ OK = :ok
113
+
114
+ # @!method self.values
115
+ # @return [Array<Symbol>]
116
+ end
117
+
118
+ # @see ContextDev::Models::WebExtractCompetitorsResponse#target
119
+ class Target < ContextDev::Internal::Type::BaseModel
120
+ # @!attribute company_name
121
+ # Company or product name inferred from the landing page.
122
+ #
123
+ # @return [String]
124
+ required :company_name, String, api_name: :companyName
125
+
126
+ # @!attribute field
127
+ # Specific operating field, product category, or market.
128
+ #
129
+ # @return [String]
130
+ required :field, String
131
+
132
+ # @!attribute field_description
133
+ # One-sentence description of what the target company sells and who it serves.
134
+ #
135
+ # @return [String]
136
+ required :field_description, String, api_name: :fieldDescription
137
+
138
+ # @!attribute website_url
139
+ # Resolved URL used for the landing page analysis.
140
+ #
141
+ # @return [String]
142
+ required :website_url, String, api_name: :websiteUrl
143
+
144
+ # @!method initialize(company_name:, field:, field_description:, website_url:)
145
+ # Target company profile inferred from the landing page.
146
+ #
147
+ # @param company_name [String] Company or product name inferred from the landing page.
148
+ #
149
+ # @param field [String] Specific operating field, product category, or market.
150
+ #
151
+ # @param field_description [String] One-sentence description of what the target company sells and who it serves.
152
+ #
153
+ # @param website_url [String] Resolved URL used for the landing page analysis.
154
+ end
155
+ end
156
+ end
157
+ end
@@ -13,6 +13,14 @@ module ContextDev
13
13
  # @return [String]
14
14
  required :url, String
15
15
 
16
+ # @!attribute headers
17
+ # Optional outbound HTTP headers forwarded only to the target URL, sent as
18
+ # deep-object query params such as headers[X-Custom]=value. When provided, caching
19
+ # is bypassed: the result is neither read from nor written to cache.
20
+ #
21
+ # @return [Hash{Symbol=>String}, nil]
22
+ optional :headers, ContextDev::Internal::Type::HashOf[String]
23
+
16
24
  # @!attribute include_frames
17
25
  # When true, iframes are rendered inline into the returned HTML.
18
26
  #
@@ -49,12 +57,14 @@ module ContextDev
49
57
  # @return [Integer, nil]
50
58
  optional :wait_for_ms, Integer
51
59
 
52
- # @!method initialize(url:, include_frames: nil, max_age_ms: nil, pdf: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {})
60
+ # @!method initialize(url:, headers: nil, include_frames: nil, max_age_ms: nil, pdf: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {})
53
61
  # Some parameter documentations has been truncated, see
54
62
  # {ContextDev::Models::WebWebScrapeHTMLParams} for more details.
55
63
  #
56
64
  # @param url [String] Full URL to scrape (must include http:// or https:// protocol)
57
65
  #
66
+ # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
67
+ #
58
68
  # @param include_frames [Boolean] When true, iframes are rendered inline into the returned HTML.
59
69
  #
60
70
  # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
@@ -20,6 +20,14 @@ module ContextDev
20
20
  # @return [ContextDev::Models::WebWebScrapeImagesParams::Enrichment, nil]
21
21
  optional :enrichment, -> { ContextDev::WebWebScrapeImagesParams::Enrichment }
22
22
 
23
+ # @!attribute headers
24
+ # Optional outbound HTTP headers forwarded only to the target URL, sent as
25
+ # deep-object query params such as headers[X-Custom]=value. When provided, caching
26
+ # is bypassed: the result is neither read from nor written to cache.
27
+ #
28
+ # @return [Hash{Symbol=>String}, nil]
29
+ optional :headers, ContextDev::Internal::Type::HashOf[String]
30
+
23
31
  # @!attribute max_age_ms
24
32
  # Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1
25
33
  # day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days).
@@ -42,7 +50,7 @@ module ContextDev
42
50
  # @return [Integer, nil]
43
51
  optional :wait_for_ms, Integer
44
52
 
45
- # @!method initialize(url:, enrichment: nil, max_age_ms: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {})
53
+ # @!method initialize(url:, enrichment: nil, headers: nil, max_age_ms: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {})
46
54
  # Some parameter documentations has been truncated, see
47
55
  # {ContextDev::Models::WebWebScrapeImagesParams} for more details.
48
56
  #
@@ -50,6 +58,8 @@ module ContextDev
50
58
  #
51
59
  # @param enrichment [ContextDev::Models::WebWebScrapeImagesParams::Enrichment] Optional per-image processing, sent as deep-object query params such as enrichme
52
60
  #
61
+ # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
62
+ #
53
63
  # @param max_age_ms [Integer] Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1
54
64
  #
55
65
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
@@ -14,6 +14,14 @@ module ContextDev
14
14
  # @return [String]
15
15
  required :url, String
16
16
 
17
+ # @!attribute headers
18
+ # Optional outbound HTTP headers forwarded only to the target URL, sent as
19
+ # deep-object query params such as headers[X-Custom]=value. When provided, caching
20
+ # is bypassed: the result is neither read from nor written to cache.
21
+ #
22
+ # @return [Hash{Symbol=>String}, nil]
23
+ optional :headers, ContextDev::Internal::Type::HashOf[String]
24
+
17
25
  # @!attribute include_frames
18
26
  # When true, the contents of iframes are rendered to Markdown.
19
27
  #
@@ -75,12 +83,14 @@ module ContextDev
75
83
  # @return [Integer, nil]
76
84
  optional :wait_for_ms, Integer
77
85
 
78
- # @!method initialize(url:, include_frames: nil, include_images: nil, include_links: nil, max_age_ms: nil, pdf: nil, shorten_base64_images: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {})
86
+ # @!method initialize(url:, headers: nil, include_frames: nil, include_images: nil, include_links: nil, max_age_ms: nil, pdf: nil, shorten_base64_images: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {})
79
87
  # Some parameter documentations has been truncated, see
80
88
  # {ContextDev::Models::WebWebScrapeMdParams} for more details.
81
89
  #
82
90
  # @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr
83
91
  #
92
+ # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
93
+ #
84
94
  # @param include_frames [Boolean] When true, the contents of iframes are rendered to Markdown.
85
95
  #
86
96
  # @param include_images [Boolean] Include image references in Markdown output
@@ -13,6 +13,14 @@ module ContextDev
13
13
  # @return [String]
14
14
  required :domain, String
15
15
 
16
+ # @!attribute headers
17
+ # Optional outbound HTTP headers forwarded only to the target URL, sent as
18
+ # deep-object query params such as headers[X-Custom]=value. When provided, caching
19
+ # is bypassed: the result is neither read from nor written to cache.
20
+ #
21
+ # @return [Hash{Symbol=>String}, nil]
22
+ optional :headers, ContextDev::Internal::Type::HashOf[String]
23
+
16
24
  # @!attribute max_links
17
25
  # Maximum number of links to return from the sitemap crawl. Defaults to 10,000.
18
26
  # Minimum is 1, maximum is 100,000.
@@ -35,12 +43,14 @@ module ContextDev
35
43
  # @return [String, nil]
36
44
  optional :url_regex, String
37
45
 
38
- # @!method initialize(domain:, max_links: nil, timeout_ms: nil, url_regex: nil, request_options: {})
46
+ # @!method initialize(domain:, headers: nil, max_links: nil, timeout_ms: nil, url_regex: nil, request_options: {})
39
47
  # Some parameter documentations has been truncated, see
40
48
  # {ContextDev::Models::WebWebScrapeSitemapParams} for more details.
41
49
  #
42
50
  # @param domain [String] Domain to build a sitemap for
43
51
  #
52
+ # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
53
+ #
44
54
  # @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi
45
55
  #
46
56
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
@@ -67,6 +67,8 @@ module ContextDev
67
67
 
68
68
  UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams
69
69
 
70
+ WebExtractCompetitorsParams = ContextDev::Models::WebExtractCompetitorsParams
71
+
70
72
  WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams
71
73
 
72
74
  WebExtractParams = ContextDev::Models::WebExtractParams
@@ -49,6 +49,37 @@ module ContextDev
49
49
  )
50
50
  end
51
51
 
52
+ # Some parameter documentations has been truncated, see
53
+ # {ContextDev::Models::WebExtractCompetitorsParams} for more details.
54
+ #
55
+ # Analyze a company's landing page and web search evidence to return direct
56
+ # competitors for the same product or market.
57
+ #
58
+ # @overload extract_competitors(domain:, num_competitors: nil, timeout_ms: nil, request_options: {})
59
+ #
60
+ # @param domain [String] Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
61
+ #
62
+ # @param num_competitors [Integer] Exact number of direct competitors to return. Defaults to 5.
63
+ #
64
+ # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
65
+ #
66
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
67
+ #
68
+ # @return [ContextDev::Models::WebExtractCompetitorsResponse]
69
+ #
70
+ # @see ContextDev::Models::WebExtractCompetitorsParams
71
+ def extract_competitors(params)
72
+ parsed, options = ContextDev::WebExtractCompetitorsParams.dump_request(params)
73
+ query = ContextDev::Internal::Util.encode_query_params(parsed)
74
+ @client.request(
75
+ method: :get,
76
+ path: "web/competitors",
77
+ query: query.transform_keys(num_competitors: "numCompetitors", timeout_ms: "timeoutMS"),
78
+ model: ContextDev::Models::WebExtractCompetitorsResponse,
79
+ options: options
80
+ )
81
+ end
82
+
52
83
  # Some parameter documentations has been truncated, see
53
84
  # {ContextDev::Models::WebExtractFontsParams} for more details.
54
85
  #
@@ -268,10 +299,12 @@ module ContextDev
268
299
  #
269
300
  # Scrapes the given URL and returns the raw HTML content of the page.
270
301
  #
271
- # @overload web_scrape_html(url:, include_frames: nil, max_age_ms: nil, pdf: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {})
302
+ # @overload web_scrape_html(url:, headers: nil, include_frames: nil, max_age_ms: nil, pdf: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {})
272
303
  #
273
304
  # @param url [String] Full URL to scrape (must include http:// or https:// protocol)
274
305
  #
306
+ # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
307
+ #
275
308
  # @param include_frames [Boolean] When true, iframes are rendered inline into the returned HTML.
276
309
  #
277
310
  # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
@@ -312,12 +345,14 @@ module ContextDev
312
345
  # embeds. The base request costs 1 credit. When enrichment is enabled, the entire
313
346
  # call costs 5 credits.
314
347
  #
315
- # @overload web_scrape_images(url:, enrichment: nil, max_age_ms: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {})
348
+ # @overload web_scrape_images(url:, enrichment: nil, headers: nil, max_age_ms: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {})
316
349
  #
317
350
  # @param url [String] Page URL to inspect. Must include http:// or https://.
318
351
  #
319
352
  # @param enrichment [ContextDev::Models::WebWebScrapeImagesParams::Enrichment] Optional per-image processing, sent as deep-object query params such as enrichme
320
353
  #
354
+ # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
355
+ #
321
356
  # @param max_age_ms [Integer] Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1
322
357
  #
323
358
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
@@ -350,10 +385,12 @@ module ContextDev
350
385
  #
351
386
  # Scrapes the given URL into LLM usable Markdown.
352
387
  #
353
- # @overload web_scrape_md(url:, include_frames: nil, include_images: nil, include_links: nil, max_age_ms: nil, pdf: nil, shorten_base64_images: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {})
388
+ # @overload web_scrape_md(url:, headers: nil, include_frames: nil, include_images: nil, include_links: nil, max_age_ms: nil, pdf: nil, shorten_base64_images: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {})
354
389
  #
355
390
  # @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr
356
391
  #
392
+ # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
393
+ #
357
394
  # @param include_frames [Boolean] When true, the contents of iframes are rendered to Markdown.
358
395
  #
359
396
  # @param include_images [Boolean] Include image references in Markdown output
@@ -403,10 +440,12 @@ module ContextDev
403
440
  #
404
441
  # Crawl an entire website's sitemap and return all discovered page URLs.
405
442
  #
406
- # @overload web_scrape_sitemap(domain:, max_links: nil, timeout_ms: nil, url_regex: nil, request_options: {})
443
+ # @overload web_scrape_sitemap(domain:, headers: nil, max_links: nil, timeout_ms: nil, url_regex: nil, request_options: {})
407
444
  #
408
445
  # @param domain [String] Domain to build a sitemap for
409
446
  #
447
+ # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
448
+ #
410
449
  # @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi
411
450
  #
412
451
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContextDev
4
- VERSION = "1.26.0"
4
+ VERSION = "1.28.0"
5
5
  end
data/lib/context_dev.rb CHANGED
@@ -80,6 +80,8 @@ require_relative "context_dev/models/utility_prefetch_by_email_params"
80
80
  require_relative "context_dev/models/utility_prefetch_by_email_response"
81
81
  require_relative "context_dev/models/utility_prefetch_params"
82
82
  require_relative "context_dev/models/utility_prefetch_response"
83
+ require_relative "context_dev/models/web_extract_competitors_params"
84
+ require_relative "context_dev/models/web_extract_competitors_response"
83
85
  require_relative "context_dev/models/web_extract_fonts_params"
84
86
  require_relative "context_dev/models/web_extract_fonts_response"
85
87
  require_relative "context_dev/models/web_extract_params"
@@ -0,0 +1,74 @@
1
+ # typed: strong
2
+
3
+ module ContextDev
4
+ module Models
5
+ class WebExtractCompetitorsParams < ContextDev::Internal::Type::BaseModel
6
+ extend ContextDev::Internal::Type::RequestParameters::Converter
7
+ include ContextDev::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ ContextDev::WebExtractCompetitorsParams,
13
+ ContextDev::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
18
+ # and normalized to their domain.
19
+ sig { returns(String) }
20
+ attr_accessor :domain
21
+
22
+ # Exact number of direct competitors to return. Defaults to 5.
23
+ sig { returns(T.nilable(Integer)) }
24
+ attr_reader :num_competitors
25
+
26
+ sig { params(num_competitors: Integer).void }
27
+ attr_writer :num_competitors
28
+
29
+ # Optional timeout in milliseconds for the request. If the request takes longer
30
+ # than this value, it will be aborted with a 408 status code. Maximum allowed
31
+ # value is 300000ms (5 minutes).
32
+ sig { returns(T.nilable(Integer)) }
33
+ attr_reader :timeout_ms
34
+
35
+ sig { params(timeout_ms: Integer).void }
36
+ attr_writer :timeout_ms
37
+
38
+ sig do
39
+ params(
40
+ domain: String,
41
+ num_competitors: Integer,
42
+ timeout_ms: Integer,
43
+ request_options: ContextDev::RequestOptions::OrHash
44
+ ).returns(T.attached_class)
45
+ end
46
+ def self.new(
47
+ # Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
48
+ # and normalized to their domain.
49
+ domain:,
50
+ # Exact number of direct competitors to return. Defaults to 5.
51
+ num_competitors: nil,
52
+ # Optional timeout in milliseconds for the request. If the request takes longer
53
+ # than this value, it will be aborted with a 408 status code. Maximum allowed
54
+ # value is 300000ms (5 minutes).
55
+ timeout_ms: nil,
56
+ request_options: {}
57
+ )
58
+ end
59
+
60
+ sig do
61
+ override.returns(
62
+ {
63
+ domain: String,
64
+ num_competitors: Integer,
65
+ timeout_ms: Integer,
66
+ request_options: ContextDev::RequestOptions
67
+ }
68
+ )
69
+ end
70
+ def to_hash
71
+ end
72
+ end
73
+ end
74
+ end