context.dev 2.9.0 → 2.11.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/README.md +1 -1
- data/lib/context_dev/client.rb +5 -0
- data/lib/context_dev/models/batch_get_results_response.rb +33 -3
- data/lib/context_dev/models/batch_submit_params.rb +44 -316
- data/lib/context_dev/models/brand_retrieve_response.rb +29 -1
- data/lib/context_dev/models/brand_retrieve_simplified_response.rb +30 -1
- data/lib/context_dev/models/brand_search_params.rb +41 -3
- data/lib/context_dev/models/news_search_params.rb +467 -0
- data/lib/context_dev/models/news_search_response.rb +284 -0
- data/lib/context_dev/models/parse_handle_params.rb +15 -144
- data/lib/context_dev/models/person_enrich_response.rb +61 -1
- data/lib/context_dev/models/utility_prefetch_params.rb +19 -16
- data/lib/context_dev/models/utility_prefetch_response.rb +4 -5
- data/lib/context_dev/models/web_screenshot_params.rb +16 -31
- data/lib/context_dev/models/web_web_crawl_md_response.rb +30 -1
- data/lib/context_dev/models/web_web_scrape_html_params.rb +15 -153
- data/lib/context_dev/models/web_web_scrape_html_response.rb +30 -1
- data/lib/context_dev/models/web_web_scrape_images_params.rb +12 -124
- data/lib/context_dev/models/web_web_scrape_md_params.rb +35 -238
- data/lib/context_dev/models/web_web_scrape_md_response.rb +41 -2
- data/lib/context_dev/models.rb +2 -0
- data/lib/context_dev/resources/brand.rb +10 -11
- data/lib/context_dev/resources/news.rb +51 -0
- data/lib/context_dev/resources/parse.rb +5 -5
- data/lib/context_dev/resources/utility.rb +7 -6
- data/lib/context_dev/resources/web.rb +30 -24
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +3 -0
- data/rbi/context_dev/client.rbi +4 -0
- data/rbi/context_dev/models/batch_get_results_response.rbi +71 -2
- data/rbi/context_dev/models/batch_submit_params.rbi +58 -592
- data/rbi/context_dev/models/brand_retrieve_response.rbi +80 -3
- data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +80 -3
- data/rbi/context_dev/models/brand_search_params.rbi +71 -2
- data/rbi/context_dev/models/news_search_params.rbi +1294 -0
- data/rbi/context_dev/models/news_search_response.rbi +489 -0
- data/rbi/context_dev/models/parse_handle_params.rbi +20 -316
- data/rbi/context_dev/models/person_enrich_response.rbi +87 -0
- data/rbi/context_dev/models/utility_prefetch_params.rbi +24 -16
- data/rbi/context_dev/models/utility_prefetch_response.rbi +8 -6
- data/rbi/context_dev/models/web_screenshot_params.rbi +23 -71
- data/rbi/context_dev/models/web_web_crawl_md_response.rbi +67 -0
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +20 -356
- data/rbi/context_dev/models/web_web_scrape_html_response.rbi +65 -0
- data/rbi/context_dev/models/web_web_scrape_images_params.rbi +16 -287
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +47 -551
- data/rbi/context_dev/models/web_web_scrape_md_response.rbi +80 -0
- data/rbi/context_dev/models.rbi +2 -0
- data/rbi/context_dev/resources/brand.rbi +14 -9
- data/rbi/context_dev/resources/news.rbi +46 -0
- data/rbi/context_dev/resources/parse.rbi +5 -21
- data/rbi/context_dev/resources/utility.rbi +8 -6
- data/rbi/context_dev/resources/web.rbi +34 -66
- data/sig/context_dev/client.rbs +2 -0
- data/sig/context_dev/models/batch_get_results_response.rbs +21 -0
- data/sig/context_dev/models/batch_submit_params.rbs +54 -144
- data/sig/context_dev/models/brand_retrieve_response.rbs +33 -3
- data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +33 -3
- data/sig/context_dev/models/brand_search_params.rbs +38 -1
- data/sig/context_dev/models/news_search_params.rbs +532 -0
- data/sig/context_dev/models/news_search_response.rbs +206 -0
- data/sig/context_dev/models/parse_handle_params.rbs +25 -90
- data/sig/context_dev/models/person_enrich_response.rbs +31 -0
- data/sig/context_dev/models/utility_prefetch_params.rbs +2 -1
- data/sig/context_dev/models/utility_prefetch_response.rbs +2 -1
- data/sig/context_dev/models/web_screenshot_params.rbs +12 -18
- data/sig/context_dev/models/web_web_crawl_md_response.rbs +21 -0
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +24 -94
- data/sig/context_dev/models/web_web_scrape_html_response.rbs +21 -0
- data/sig/context_dev/models/web_web_scrape_images_params.rbs +20 -72
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +46 -148
- data/sig/context_dev/models/web_web_scrape_md_response.rbs +28 -0
- data/sig/context_dev/models.rbs +2 -0
- data/sig/context_dev/resources/brand.rbs +3 -0
- data/sig/context_dev/resources/news.rbs +17 -0
- data/sig/context_dev/resources/parse.rbs +5 -5
- data/sig/context_dev/resources/web.rbs +13 -11
- metadata +11 -2
|
@@ -63,75 +63,33 @@ module ContextDev
|
|
|
63
63
|
attr_writer :headers
|
|
64
64
|
|
|
65
65
|
# When true, the contents of iframes are rendered to Markdown.
|
|
66
|
-
sig
|
|
67
|
-
returns(
|
|
68
|
-
T.nilable(
|
|
69
|
-
T.any(
|
|
70
|
-
T::Boolean,
|
|
71
|
-
ContextDev::WebWebScrapeMdParams::IncludeFrames::OrSymbol
|
|
72
|
-
)
|
|
73
|
-
)
|
|
74
|
-
)
|
|
75
|
-
end
|
|
66
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
76
67
|
attr_reader :include_frames
|
|
77
68
|
|
|
78
|
-
sig
|
|
79
|
-
params(
|
|
80
|
-
include_frames:
|
|
81
|
-
T.any(
|
|
82
|
-
T::Boolean,
|
|
83
|
-
ContextDev::WebWebScrapeMdParams::IncludeFrames::OrSymbol
|
|
84
|
-
)
|
|
85
|
-
).void
|
|
86
|
-
end
|
|
69
|
+
sig { params(include_frames: T::Boolean).void }
|
|
87
70
|
attr_writer :include_frames
|
|
88
71
|
|
|
72
|
+
# When true, the response also includes an `html` field with the page HTML the
|
|
73
|
+
# Markdown was converted from — the same body the Scrape HTML endpoint returns for
|
|
74
|
+
# the equivalent request.
|
|
75
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
76
|
+
attr_reader :include_html
|
|
77
|
+
|
|
78
|
+
sig { params(include_html: T::Boolean).void }
|
|
79
|
+
attr_writer :include_html
|
|
80
|
+
|
|
89
81
|
# Include image references in Markdown output
|
|
90
|
-
sig
|
|
91
|
-
returns(
|
|
92
|
-
T.nilable(
|
|
93
|
-
T.any(
|
|
94
|
-
T::Boolean,
|
|
95
|
-
ContextDev::WebWebScrapeMdParams::IncludeImages::OrSymbol
|
|
96
|
-
)
|
|
97
|
-
)
|
|
98
|
-
)
|
|
99
|
-
end
|
|
82
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
100
83
|
attr_reader :include_images
|
|
101
84
|
|
|
102
|
-
sig
|
|
103
|
-
params(
|
|
104
|
-
include_images:
|
|
105
|
-
T.any(
|
|
106
|
-
T::Boolean,
|
|
107
|
-
ContextDev::WebWebScrapeMdParams::IncludeImages::OrSymbol
|
|
108
|
-
)
|
|
109
|
-
).void
|
|
110
|
-
end
|
|
85
|
+
sig { params(include_images: T::Boolean).void }
|
|
111
86
|
attr_writer :include_images
|
|
112
87
|
|
|
113
88
|
# Preserve hyperlinks in Markdown output
|
|
114
|
-
sig
|
|
115
|
-
returns(
|
|
116
|
-
T.nilable(
|
|
117
|
-
T.any(
|
|
118
|
-
T::Boolean,
|
|
119
|
-
ContextDev::WebWebScrapeMdParams::IncludeLinks::OrSymbol
|
|
120
|
-
)
|
|
121
|
-
)
|
|
122
|
-
)
|
|
123
|
-
end
|
|
89
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
124
90
|
attr_reader :include_links
|
|
125
91
|
|
|
126
|
-
sig
|
|
127
|
-
params(
|
|
128
|
-
include_links:
|
|
129
|
-
T.any(
|
|
130
|
-
T::Boolean,
|
|
131
|
-
ContextDev::WebWebScrapeMdParams::IncludeLinks::OrSymbol
|
|
132
|
-
)
|
|
133
|
-
).void
|
|
134
|
-
end
|
|
92
|
+
sig { params(include_links: T::Boolean).void }
|
|
135
93
|
attr_writer :include_links
|
|
136
94
|
|
|
137
95
|
# CSS selectors. When provided, only matching HTML subtrees (and their
|
|
@@ -157,51 +115,17 @@ module ContextDev
|
|
|
157
115
|
# When true, waits briefly for CSS and transition animations to settle before
|
|
158
116
|
# converting to Markdown. Defaults to false. This adds a bit of latency in
|
|
159
117
|
# exchange for more stable output on animated pages.
|
|
160
|
-
sig
|
|
161
|
-
returns(
|
|
162
|
-
T.nilable(
|
|
163
|
-
T.any(
|
|
164
|
-
T::Boolean,
|
|
165
|
-
ContextDev::WebWebScrapeMdParams::SettleAnimations::OrSymbol
|
|
166
|
-
)
|
|
167
|
-
)
|
|
168
|
-
)
|
|
169
|
-
end
|
|
118
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
170
119
|
attr_reader :settle_animations
|
|
171
120
|
|
|
172
|
-
sig
|
|
173
|
-
params(
|
|
174
|
-
settle_animations:
|
|
175
|
-
T.any(
|
|
176
|
-
T::Boolean,
|
|
177
|
-
ContextDev::WebWebScrapeMdParams::SettleAnimations::OrSymbol
|
|
178
|
-
)
|
|
179
|
-
).void
|
|
180
|
-
end
|
|
121
|
+
sig { params(settle_animations: T::Boolean).void }
|
|
181
122
|
attr_writer :settle_animations
|
|
182
123
|
|
|
183
124
|
# Shorten base64-encoded image data in the Markdown output
|
|
184
|
-
sig
|
|
185
|
-
returns(
|
|
186
|
-
T.nilable(
|
|
187
|
-
T.any(
|
|
188
|
-
T::Boolean,
|
|
189
|
-
ContextDev::WebWebScrapeMdParams::ShortenBase64Images::OrSymbol
|
|
190
|
-
)
|
|
191
|
-
)
|
|
192
|
-
)
|
|
193
|
-
end
|
|
125
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
194
126
|
attr_reader :shorten_base64_images
|
|
195
127
|
|
|
196
|
-
sig
|
|
197
|
-
params(
|
|
198
|
-
shorten_base64_images:
|
|
199
|
-
T.any(
|
|
200
|
-
T::Boolean,
|
|
201
|
-
ContextDev::WebWebScrapeMdParams::ShortenBase64Images::OrSymbol
|
|
202
|
-
)
|
|
203
|
-
).void
|
|
204
|
-
end
|
|
128
|
+
sig { params(shorten_base64_images: T::Boolean).void }
|
|
205
129
|
attr_writer :shorten_base64_images
|
|
206
130
|
|
|
207
131
|
# Optional comma-separated caller-defined tags for tracking this request. Tags are
|
|
@@ -224,27 +148,10 @@ module ContextDev
|
|
|
224
148
|
|
|
225
149
|
# Extract only the main content of the page, excluding headers, footers, sidebars,
|
|
226
150
|
# and navigation
|
|
227
|
-
sig
|
|
228
|
-
returns(
|
|
229
|
-
T.nilable(
|
|
230
|
-
T.any(
|
|
231
|
-
T::Boolean,
|
|
232
|
-
ContextDev::WebWebScrapeMdParams::UseMainContentOnly::OrSymbol
|
|
233
|
-
)
|
|
234
|
-
)
|
|
235
|
-
)
|
|
236
|
-
end
|
|
151
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
237
152
|
attr_reader :use_main_content_only
|
|
238
153
|
|
|
239
|
-
sig
|
|
240
|
-
params(
|
|
241
|
-
use_main_content_only:
|
|
242
|
-
T.any(
|
|
243
|
-
T::Boolean,
|
|
244
|
-
ContextDev::WebWebScrapeMdParams::UseMainContentOnly::OrSymbol
|
|
245
|
-
)
|
|
246
|
-
).void
|
|
247
|
-
end
|
|
154
|
+
sig { params(use_main_content_only: T::Boolean).void }
|
|
248
155
|
attr_writer :use_main_content_only
|
|
249
156
|
|
|
250
157
|
# Optional browser wait time in milliseconds after initial page load before
|
|
@@ -279,41 +186,18 @@ module ContextDev
|
|
|
279
186
|
country: ContextDev::WebWebScrapeMdParams::Country::OrSymbol,
|
|
280
187
|
exclude_selectors: T.nilable(T::Array[String]),
|
|
281
188
|
headers: T::Hash[Symbol, String],
|
|
282
|
-
include_frames:
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
),
|
|
287
|
-
include_images:
|
|
288
|
-
T.any(
|
|
289
|
-
T::Boolean,
|
|
290
|
-
ContextDev::WebWebScrapeMdParams::IncludeImages::OrSymbol
|
|
291
|
-
),
|
|
292
|
-
include_links:
|
|
293
|
-
T.any(
|
|
294
|
-
T::Boolean,
|
|
295
|
-
ContextDev::WebWebScrapeMdParams::IncludeLinks::OrSymbol
|
|
296
|
-
),
|
|
189
|
+
include_frames: T::Boolean,
|
|
190
|
+
include_html: T::Boolean,
|
|
191
|
+
include_images: T::Boolean,
|
|
192
|
+
include_links: T::Boolean,
|
|
297
193
|
include_selectors: T.nilable(T::Array[String]),
|
|
298
194
|
max_age_ms: T.nilable(Integer),
|
|
299
195
|
pdf: ContextDev::WebWebScrapeMdParams::Pdf::OrHash,
|
|
300
|
-
settle_animations:
|
|
301
|
-
|
|
302
|
-
T::Boolean,
|
|
303
|
-
ContextDev::WebWebScrapeMdParams::SettleAnimations::OrSymbol
|
|
304
|
-
),
|
|
305
|
-
shorten_base64_images:
|
|
306
|
-
T.any(
|
|
307
|
-
T::Boolean,
|
|
308
|
-
ContextDev::WebWebScrapeMdParams::ShortenBase64Images::OrSymbol
|
|
309
|
-
),
|
|
196
|
+
settle_animations: T::Boolean,
|
|
197
|
+
shorten_base64_images: T::Boolean,
|
|
310
198
|
tags: T::Array[String],
|
|
311
199
|
timeout_ms: Integer,
|
|
312
|
-
use_main_content_only:
|
|
313
|
-
T.any(
|
|
314
|
-
T::Boolean,
|
|
315
|
-
ContextDev::WebWebScrapeMdParams::UseMainContentOnly::OrSymbol
|
|
316
|
-
),
|
|
200
|
+
use_main_content_only: T::Boolean,
|
|
317
201
|
wait_for_ms: T.nilable(Integer),
|
|
318
202
|
zdr: ContextDev::WebWebScrapeMdParams::Zdr::OrSymbol,
|
|
319
203
|
request_options: ContextDev::RequestOptions::OrHash
|
|
@@ -340,6 +224,10 @@ module ContextDev
|
|
|
340
224
|
headers: nil,
|
|
341
225
|
# When true, the contents of iframes are rendered to Markdown.
|
|
342
226
|
include_frames: nil,
|
|
227
|
+
# When true, the response also includes an `html` field with the page HTML the
|
|
228
|
+
# Markdown was converted from — the same body the Scrape HTML endpoint returns for
|
|
229
|
+
# the equivalent request.
|
|
230
|
+
include_html: nil,
|
|
343
231
|
# Include image references in Markdown output
|
|
344
232
|
include_images: nil,
|
|
345
233
|
# Preserve hyperlinks in Markdown output
|
|
@@ -400,41 +288,18 @@ module ContextDev
|
|
|
400
288
|
country: ContextDev::WebWebScrapeMdParams::Country::OrSymbol,
|
|
401
289
|
exclude_selectors: T.nilable(T::Array[String]),
|
|
402
290
|
headers: T::Hash[Symbol, String],
|
|
403
|
-
include_frames:
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
),
|
|
408
|
-
include_images:
|
|
409
|
-
T.any(
|
|
410
|
-
T::Boolean,
|
|
411
|
-
ContextDev::WebWebScrapeMdParams::IncludeImages::OrSymbol
|
|
412
|
-
),
|
|
413
|
-
include_links:
|
|
414
|
-
T.any(
|
|
415
|
-
T::Boolean,
|
|
416
|
-
ContextDev::WebWebScrapeMdParams::IncludeLinks::OrSymbol
|
|
417
|
-
),
|
|
291
|
+
include_frames: T::Boolean,
|
|
292
|
+
include_html: T::Boolean,
|
|
293
|
+
include_images: T::Boolean,
|
|
294
|
+
include_links: T::Boolean,
|
|
418
295
|
include_selectors: T.nilable(T::Array[String]),
|
|
419
296
|
max_age_ms: T.nilable(Integer),
|
|
420
297
|
pdf: ContextDev::WebWebScrapeMdParams::Pdf,
|
|
421
|
-
settle_animations:
|
|
422
|
-
|
|
423
|
-
T::Boolean,
|
|
424
|
-
ContextDev::WebWebScrapeMdParams::SettleAnimations::OrSymbol
|
|
425
|
-
),
|
|
426
|
-
shorten_base64_images:
|
|
427
|
-
T.any(
|
|
428
|
-
T::Boolean,
|
|
429
|
-
ContextDev::WebWebScrapeMdParams::ShortenBase64Images::OrSymbol
|
|
430
|
-
),
|
|
298
|
+
settle_animations: T::Boolean,
|
|
299
|
+
shorten_base64_images: T::Boolean,
|
|
431
300
|
tags: T::Array[String],
|
|
432
301
|
timeout_ms: Integer,
|
|
433
|
-
use_main_content_only:
|
|
434
|
-
T.any(
|
|
435
|
-
T::Boolean,
|
|
436
|
-
ContextDev::WebWebScrapeMdParams::UseMainContentOnly::OrSymbol
|
|
437
|
-
),
|
|
302
|
+
use_main_content_only: T::Boolean,
|
|
438
303
|
wait_for_ms: T.nilable(Integer),
|
|
439
304
|
zdr: ContextDev::WebWebScrapeMdParams::Zdr::OrSymbol,
|
|
440
305
|
request_options: ContextDev::RequestOptions
|
|
@@ -743,120 +608,6 @@ module ContextDev
|
|
|
743
608
|
end
|
|
744
609
|
end
|
|
745
610
|
|
|
746
|
-
# When true, the contents of iframes are rendered to Markdown.
|
|
747
|
-
module IncludeFrames
|
|
748
|
-
extend ContextDev::Internal::Type::Union
|
|
749
|
-
|
|
750
|
-
Variants =
|
|
751
|
-
T.type_alias do
|
|
752
|
-
T.any(
|
|
753
|
-
T::Boolean,
|
|
754
|
-
ContextDev::WebWebScrapeMdParams::IncludeFrames::TaggedSymbol
|
|
755
|
-
)
|
|
756
|
-
end
|
|
757
|
-
|
|
758
|
-
sig do
|
|
759
|
-
override.returns(
|
|
760
|
-
T::Array[ContextDev::WebWebScrapeMdParams::IncludeFrames::Variants]
|
|
761
|
-
)
|
|
762
|
-
end
|
|
763
|
-
def self.variants
|
|
764
|
-
end
|
|
765
|
-
|
|
766
|
-
TaggedSymbol =
|
|
767
|
-
T.type_alias do
|
|
768
|
-
T.all(Symbol, ContextDev::WebWebScrapeMdParams::IncludeFrames)
|
|
769
|
-
end
|
|
770
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
771
|
-
|
|
772
|
-
TRUE =
|
|
773
|
-
T.let(
|
|
774
|
-
:true,
|
|
775
|
-
ContextDev::WebWebScrapeMdParams::IncludeFrames::TaggedSymbol
|
|
776
|
-
)
|
|
777
|
-
FALSE =
|
|
778
|
-
T.let(
|
|
779
|
-
:false,
|
|
780
|
-
ContextDev::WebWebScrapeMdParams::IncludeFrames::TaggedSymbol
|
|
781
|
-
)
|
|
782
|
-
end
|
|
783
|
-
|
|
784
|
-
# Include image references in Markdown output
|
|
785
|
-
module IncludeImages
|
|
786
|
-
extend ContextDev::Internal::Type::Union
|
|
787
|
-
|
|
788
|
-
Variants =
|
|
789
|
-
T.type_alias do
|
|
790
|
-
T.any(
|
|
791
|
-
T::Boolean,
|
|
792
|
-
ContextDev::WebWebScrapeMdParams::IncludeImages::TaggedSymbol
|
|
793
|
-
)
|
|
794
|
-
end
|
|
795
|
-
|
|
796
|
-
sig do
|
|
797
|
-
override.returns(
|
|
798
|
-
T::Array[ContextDev::WebWebScrapeMdParams::IncludeImages::Variants]
|
|
799
|
-
)
|
|
800
|
-
end
|
|
801
|
-
def self.variants
|
|
802
|
-
end
|
|
803
|
-
|
|
804
|
-
TaggedSymbol =
|
|
805
|
-
T.type_alias do
|
|
806
|
-
T.all(Symbol, ContextDev::WebWebScrapeMdParams::IncludeImages)
|
|
807
|
-
end
|
|
808
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
809
|
-
|
|
810
|
-
TRUE =
|
|
811
|
-
T.let(
|
|
812
|
-
:true,
|
|
813
|
-
ContextDev::WebWebScrapeMdParams::IncludeImages::TaggedSymbol
|
|
814
|
-
)
|
|
815
|
-
FALSE =
|
|
816
|
-
T.let(
|
|
817
|
-
:false,
|
|
818
|
-
ContextDev::WebWebScrapeMdParams::IncludeImages::TaggedSymbol
|
|
819
|
-
)
|
|
820
|
-
end
|
|
821
|
-
|
|
822
|
-
# Preserve hyperlinks in Markdown output
|
|
823
|
-
module IncludeLinks
|
|
824
|
-
extend ContextDev::Internal::Type::Union
|
|
825
|
-
|
|
826
|
-
Variants =
|
|
827
|
-
T.type_alias do
|
|
828
|
-
T.any(
|
|
829
|
-
T::Boolean,
|
|
830
|
-
ContextDev::WebWebScrapeMdParams::IncludeLinks::TaggedSymbol
|
|
831
|
-
)
|
|
832
|
-
end
|
|
833
|
-
|
|
834
|
-
sig do
|
|
835
|
-
override.returns(
|
|
836
|
-
T::Array[ContextDev::WebWebScrapeMdParams::IncludeLinks::Variants]
|
|
837
|
-
)
|
|
838
|
-
end
|
|
839
|
-
def self.variants
|
|
840
|
-
end
|
|
841
|
-
|
|
842
|
-
TaggedSymbol =
|
|
843
|
-
T.type_alias do
|
|
844
|
-
T.all(Symbol, ContextDev::WebWebScrapeMdParams::IncludeLinks)
|
|
845
|
-
end
|
|
846
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
847
|
-
|
|
848
|
-
TRUE =
|
|
849
|
-
T.let(
|
|
850
|
-
:true,
|
|
851
|
-
ContextDev::WebWebScrapeMdParams::IncludeLinks::TaggedSymbol
|
|
852
|
-
)
|
|
853
|
-
FALSE =
|
|
854
|
-
T.let(
|
|
855
|
-
:false,
|
|
856
|
-
ContextDev::WebWebScrapeMdParams::IncludeLinks::TaggedSymbol
|
|
857
|
-
)
|
|
858
|
-
end
|
|
859
|
-
|
|
860
611
|
class Pdf < ContextDev::Internal::Type::BaseModel
|
|
861
612
|
OrHash =
|
|
862
613
|
T.type_alias do
|
|
@@ -878,52 +629,18 @@ module ContextDev
|
|
|
878
629
|
# replacing each recovered page's text with the OCR result while pages with a real
|
|
879
630
|
# text layer keep it. Billed at 1 credit per page OCR actually recovered, on top
|
|
880
631
|
# of the base request cost. When false, no OCR runs.
|
|
881
|
-
sig
|
|
882
|
-
returns(
|
|
883
|
-
T.nilable(
|
|
884
|
-
T.any(
|
|
885
|
-
T::Boolean,
|
|
886
|
-
ContextDev::WebWebScrapeMdParams::Pdf::Ocr::OrSymbol
|
|
887
|
-
)
|
|
888
|
-
)
|
|
889
|
-
)
|
|
890
|
-
end
|
|
632
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
891
633
|
attr_reader :ocr
|
|
892
634
|
|
|
893
|
-
sig
|
|
894
|
-
params(
|
|
895
|
-
ocr:
|
|
896
|
-
T.any(
|
|
897
|
-
T::Boolean,
|
|
898
|
-
ContextDev::WebWebScrapeMdParams::Pdf::Ocr::OrSymbol
|
|
899
|
-
)
|
|
900
|
-
).void
|
|
901
|
-
end
|
|
635
|
+
sig { params(ocr: T::Boolean).void }
|
|
902
636
|
attr_writer :ocr
|
|
903
637
|
|
|
904
638
|
# When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
|
|
905
639
|
# a 400 PDF_SKIPPED is returned.
|
|
906
|
-
sig
|
|
907
|
-
returns(
|
|
908
|
-
T.nilable(
|
|
909
|
-
T.any(
|
|
910
|
-
T::Boolean,
|
|
911
|
-
ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::OrSymbol
|
|
912
|
-
)
|
|
913
|
-
)
|
|
914
|
-
)
|
|
915
|
-
end
|
|
640
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
916
641
|
attr_reader :should_parse
|
|
917
642
|
|
|
918
|
-
sig
|
|
919
|
-
params(
|
|
920
|
-
should_parse:
|
|
921
|
-
T.any(
|
|
922
|
-
T::Boolean,
|
|
923
|
-
ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::OrSymbol
|
|
924
|
-
)
|
|
925
|
-
).void
|
|
926
|
-
end
|
|
643
|
+
sig { params(should_parse: T::Boolean).void }
|
|
927
644
|
attr_writer :should_parse
|
|
928
645
|
|
|
929
646
|
# First 1-based PDF page to parse. When omitted, parsing starts at the first page.
|
|
@@ -938,16 +655,8 @@ module ContextDev
|
|
|
938
655
|
sig do
|
|
939
656
|
params(
|
|
940
657
|
end_: Integer,
|
|
941
|
-
ocr:
|
|
942
|
-
|
|
943
|
-
T::Boolean,
|
|
944
|
-
ContextDev::WebWebScrapeMdParams::Pdf::Ocr::OrSymbol
|
|
945
|
-
),
|
|
946
|
-
should_parse:
|
|
947
|
-
T.any(
|
|
948
|
-
T::Boolean,
|
|
949
|
-
ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::OrSymbol
|
|
950
|
-
),
|
|
658
|
+
ocr: T::Boolean,
|
|
659
|
+
should_parse: T::Boolean,
|
|
951
660
|
start: Integer
|
|
952
661
|
).returns(T.attached_class)
|
|
953
662
|
end
|
|
@@ -972,227 +681,14 @@ module ContextDev
|
|
|
972
681
|
override.returns(
|
|
973
682
|
{
|
|
974
683
|
end_: Integer,
|
|
975
|
-
ocr:
|
|
976
|
-
|
|
977
|
-
T::Boolean,
|
|
978
|
-
ContextDev::WebWebScrapeMdParams::Pdf::Ocr::OrSymbol
|
|
979
|
-
),
|
|
980
|
-
should_parse:
|
|
981
|
-
T.any(
|
|
982
|
-
T::Boolean,
|
|
983
|
-
ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::OrSymbol
|
|
984
|
-
),
|
|
684
|
+
ocr: T::Boolean,
|
|
685
|
+
should_parse: T::Boolean,
|
|
985
686
|
start: Integer
|
|
986
687
|
}
|
|
987
688
|
)
|
|
988
689
|
end
|
|
989
690
|
def to_hash
|
|
990
691
|
end
|
|
991
|
-
|
|
992
|
-
# When true, OCR the selected PDF pages that have no usable text layer (scans),
|
|
993
|
-
# replacing each recovered page's text with the OCR result while pages with a real
|
|
994
|
-
# text layer keep it. Billed at 1 credit per page OCR actually recovered, on top
|
|
995
|
-
# of the base request cost. When false, no OCR runs.
|
|
996
|
-
module Ocr
|
|
997
|
-
extend ContextDev::Internal::Type::Union
|
|
998
|
-
|
|
999
|
-
Variants =
|
|
1000
|
-
T.type_alias do
|
|
1001
|
-
T.any(
|
|
1002
|
-
T::Boolean,
|
|
1003
|
-
ContextDev::WebWebScrapeMdParams::Pdf::Ocr::TaggedSymbol
|
|
1004
|
-
)
|
|
1005
|
-
end
|
|
1006
|
-
|
|
1007
|
-
sig do
|
|
1008
|
-
override.returns(
|
|
1009
|
-
T::Array[ContextDev::WebWebScrapeMdParams::Pdf::Ocr::Variants]
|
|
1010
|
-
)
|
|
1011
|
-
end
|
|
1012
|
-
def self.variants
|
|
1013
|
-
end
|
|
1014
|
-
|
|
1015
|
-
TaggedSymbol =
|
|
1016
|
-
T.type_alias do
|
|
1017
|
-
T.all(Symbol, ContextDev::WebWebScrapeMdParams::Pdf::Ocr)
|
|
1018
|
-
end
|
|
1019
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1020
|
-
|
|
1021
|
-
TRUE =
|
|
1022
|
-
T.let(
|
|
1023
|
-
:true,
|
|
1024
|
-
ContextDev::WebWebScrapeMdParams::Pdf::Ocr::TaggedSymbol
|
|
1025
|
-
)
|
|
1026
|
-
FALSE =
|
|
1027
|
-
T.let(
|
|
1028
|
-
:false,
|
|
1029
|
-
ContextDev::WebWebScrapeMdParams::Pdf::Ocr::TaggedSymbol
|
|
1030
|
-
)
|
|
1031
|
-
end
|
|
1032
|
-
|
|
1033
|
-
# When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and
|
|
1034
|
-
# a 400 PDF_SKIPPED is returned.
|
|
1035
|
-
module ShouldParse
|
|
1036
|
-
extend ContextDev::Internal::Type::Union
|
|
1037
|
-
|
|
1038
|
-
Variants =
|
|
1039
|
-
T.type_alias do
|
|
1040
|
-
T.any(
|
|
1041
|
-
T::Boolean,
|
|
1042
|
-
ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::TaggedSymbol
|
|
1043
|
-
)
|
|
1044
|
-
end
|
|
1045
|
-
|
|
1046
|
-
sig do
|
|
1047
|
-
override.returns(
|
|
1048
|
-
T::Array[
|
|
1049
|
-
ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::Variants
|
|
1050
|
-
]
|
|
1051
|
-
)
|
|
1052
|
-
end
|
|
1053
|
-
def self.variants
|
|
1054
|
-
end
|
|
1055
|
-
|
|
1056
|
-
TaggedSymbol =
|
|
1057
|
-
T.type_alias do
|
|
1058
|
-
T.all(Symbol, ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse)
|
|
1059
|
-
end
|
|
1060
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1061
|
-
|
|
1062
|
-
TRUE =
|
|
1063
|
-
T.let(
|
|
1064
|
-
:true,
|
|
1065
|
-
ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::TaggedSymbol
|
|
1066
|
-
)
|
|
1067
|
-
FALSE =
|
|
1068
|
-
T.let(
|
|
1069
|
-
:false,
|
|
1070
|
-
ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::TaggedSymbol
|
|
1071
|
-
)
|
|
1072
|
-
end
|
|
1073
|
-
end
|
|
1074
|
-
|
|
1075
|
-
# When true, waits briefly for CSS and transition animations to settle before
|
|
1076
|
-
# converting to Markdown. Defaults to false. This adds a bit of latency in
|
|
1077
|
-
# exchange for more stable output on animated pages.
|
|
1078
|
-
module SettleAnimations
|
|
1079
|
-
extend ContextDev::Internal::Type::Union
|
|
1080
|
-
|
|
1081
|
-
Variants =
|
|
1082
|
-
T.type_alias do
|
|
1083
|
-
T.any(
|
|
1084
|
-
T::Boolean,
|
|
1085
|
-
ContextDev::WebWebScrapeMdParams::SettleAnimations::TaggedSymbol
|
|
1086
|
-
)
|
|
1087
|
-
end
|
|
1088
|
-
|
|
1089
|
-
sig do
|
|
1090
|
-
override.returns(
|
|
1091
|
-
T::Array[
|
|
1092
|
-
ContextDev::WebWebScrapeMdParams::SettleAnimations::Variants
|
|
1093
|
-
]
|
|
1094
|
-
)
|
|
1095
|
-
end
|
|
1096
|
-
def self.variants
|
|
1097
|
-
end
|
|
1098
|
-
|
|
1099
|
-
TaggedSymbol =
|
|
1100
|
-
T.type_alias do
|
|
1101
|
-
T.all(Symbol, ContextDev::WebWebScrapeMdParams::SettleAnimations)
|
|
1102
|
-
end
|
|
1103
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1104
|
-
|
|
1105
|
-
TRUE =
|
|
1106
|
-
T.let(
|
|
1107
|
-
:true,
|
|
1108
|
-
ContextDev::WebWebScrapeMdParams::SettleAnimations::TaggedSymbol
|
|
1109
|
-
)
|
|
1110
|
-
FALSE =
|
|
1111
|
-
T.let(
|
|
1112
|
-
:false,
|
|
1113
|
-
ContextDev::WebWebScrapeMdParams::SettleAnimations::TaggedSymbol
|
|
1114
|
-
)
|
|
1115
|
-
end
|
|
1116
|
-
|
|
1117
|
-
# Shorten base64-encoded image data in the Markdown output
|
|
1118
|
-
module ShortenBase64Images
|
|
1119
|
-
extend ContextDev::Internal::Type::Union
|
|
1120
|
-
|
|
1121
|
-
Variants =
|
|
1122
|
-
T.type_alias do
|
|
1123
|
-
T.any(
|
|
1124
|
-
T::Boolean,
|
|
1125
|
-
ContextDev::WebWebScrapeMdParams::ShortenBase64Images::TaggedSymbol
|
|
1126
|
-
)
|
|
1127
|
-
end
|
|
1128
|
-
|
|
1129
|
-
sig do
|
|
1130
|
-
override.returns(
|
|
1131
|
-
T::Array[
|
|
1132
|
-
ContextDev::WebWebScrapeMdParams::ShortenBase64Images::Variants
|
|
1133
|
-
]
|
|
1134
|
-
)
|
|
1135
|
-
end
|
|
1136
|
-
def self.variants
|
|
1137
|
-
end
|
|
1138
|
-
|
|
1139
|
-
TaggedSymbol =
|
|
1140
|
-
T.type_alias do
|
|
1141
|
-
T.all(Symbol, ContextDev::WebWebScrapeMdParams::ShortenBase64Images)
|
|
1142
|
-
end
|
|
1143
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1144
|
-
|
|
1145
|
-
TRUE =
|
|
1146
|
-
T.let(
|
|
1147
|
-
:true,
|
|
1148
|
-
ContextDev::WebWebScrapeMdParams::ShortenBase64Images::TaggedSymbol
|
|
1149
|
-
)
|
|
1150
|
-
FALSE =
|
|
1151
|
-
T.let(
|
|
1152
|
-
:false,
|
|
1153
|
-
ContextDev::WebWebScrapeMdParams::ShortenBase64Images::TaggedSymbol
|
|
1154
|
-
)
|
|
1155
|
-
end
|
|
1156
|
-
|
|
1157
|
-
# Extract only the main content of the page, excluding headers, footers, sidebars,
|
|
1158
|
-
# and navigation
|
|
1159
|
-
module UseMainContentOnly
|
|
1160
|
-
extend ContextDev::Internal::Type::Union
|
|
1161
|
-
|
|
1162
|
-
Variants =
|
|
1163
|
-
T.type_alias do
|
|
1164
|
-
T.any(
|
|
1165
|
-
T::Boolean,
|
|
1166
|
-
ContextDev::WebWebScrapeMdParams::UseMainContentOnly::TaggedSymbol
|
|
1167
|
-
)
|
|
1168
|
-
end
|
|
1169
|
-
|
|
1170
|
-
sig do
|
|
1171
|
-
override.returns(
|
|
1172
|
-
T::Array[
|
|
1173
|
-
ContextDev::WebWebScrapeMdParams::UseMainContentOnly::Variants
|
|
1174
|
-
]
|
|
1175
|
-
)
|
|
1176
|
-
end
|
|
1177
|
-
def self.variants
|
|
1178
|
-
end
|
|
1179
|
-
|
|
1180
|
-
TaggedSymbol =
|
|
1181
|
-
T.type_alias do
|
|
1182
|
-
T.all(Symbol, ContextDev::WebWebScrapeMdParams::UseMainContentOnly)
|
|
1183
|
-
end
|
|
1184
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1185
|
-
|
|
1186
|
-
TRUE =
|
|
1187
|
-
T.let(
|
|
1188
|
-
:true,
|
|
1189
|
-
ContextDev::WebWebScrapeMdParams::UseMainContentOnly::TaggedSymbol
|
|
1190
|
-
)
|
|
1191
|
-
FALSE =
|
|
1192
|
-
T.let(
|
|
1193
|
-
:false,
|
|
1194
|
-
ContextDev::WebWebScrapeMdParams::UseMainContentOnly::TaggedSymbol
|
|
1195
|
-
)
|
|
1196
692
|
end
|
|
1197
693
|
|
|
1198
694
|
# Set to enabled to bypass shared caches and omit request and response content
|