context.dev 1.34.0 → 1.36.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.
@@ -8,11 +8,19 @@ module ContextDev
8
8
  include ContextDev::Internal::Type::RequestParameters
9
9
 
10
10
  # @!attribute query
11
- # Natural-language search query.
11
+ # Search query. Accepts natural language as well as Google-style search operators
12
+ # such as `site:`, `-site:`, `inurl:`, `intitle:`, quoted phrases, and `OR`.
12
13
  #
13
14
  # @return [String]
14
15
  required :query, String
15
16
 
17
+ # @!attribute country
18
+ # Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific
19
+ # country (maps to Google's `gl` parameter). Example: "us", "gb", "de".
20
+ #
21
+ # @return [Symbol, ContextDev::Models::WebSearchParams::Country, nil]
22
+ optional :country, enum: -> { ContextDev::WebSearchParams::Country }
23
+
16
24
  # @!attribute exclude_domains
17
25
  # Blocklist — drop results from these domains. Example: ["pinterest.com",
18
26
  # "reddit.com"].
@@ -41,6 +49,12 @@ module ContextDev
41
49
  -> { ContextDev::WebSearchParams::MarkdownOptions },
42
50
  api_name: :markdownOptions
43
51
 
52
+ # @!attribute num_results
53
+ # Number of results to request and return (10–100). Defaults to 10.
54
+ #
55
+ # @return [Integer, nil]
56
+ optional :num_results, Integer, api_name: :numResults
57
+
44
58
  # @!attribute query_fanout
45
59
  # Expand the query into multiple parallel variants for broader recall.
46
60
  #
@@ -55,11 +69,13 @@ module ContextDev
55
69
  # @return [Integer, nil]
56
70
  optional :timeout_ms, Integer, api_name: :timeoutMS
57
71
 
58
- # @!method initialize(query:, exclude_domains: nil, freshness: nil, include_domains: nil, markdown_options: nil, query_fanout: nil, timeout_ms: nil, request_options: {})
72
+ # @!method initialize(query:, country: nil, exclude_domains: nil, freshness: nil, include_domains: nil, markdown_options: nil, num_results: nil, query_fanout: nil, timeout_ms: nil, request_options: {})
59
73
  # Some parameter documentations has been truncated, see
60
74
  # {ContextDev::Models::WebSearchParams} for more details.
61
75
  #
62
- # @param query [String] Natural-language search query.
76
+ # @param query [String] Search query. Accepts natural language as well as Google-style search operators
77
+ #
78
+ # @param country [Symbol, ContextDev::Models::WebSearchParams::Country] Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific cou
63
79
  #
64
80
  # @param exclude_domains [Array<String>] Blocklist — drop results from these domains. Example: ["pinterest.com", "reddit.
65
81
  #
@@ -69,12 +85,263 @@ module ContextDev
69
85
  #
70
86
  # @param markdown_options [ContextDev::Models::WebSearchParams::MarkdownOptions] Inline Markdown scraping for each result. Set `enabled: true` to activate.
71
87
  #
88
+ # @param num_results [Integer] Number of results to request and return (10–100). Defaults to 10.
89
+ #
72
90
  # @param query_fanout [Boolean] Expand the query into multiple parallel variants for broader recall.
73
91
  #
74
92
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
75
93
  #
76
94
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
77
95
 
96
+ # Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific
97
+ # country (maps to Google's `gl` parameter). Example: "us", "gb", "de".
98
+ module Country
99
+ extend ContextDev::Internal::Type::Enum
100
+
101
+ AF = :af
102
+ AL = :al
103
+ DZ = :dz
104
+ AS = :as
105
+ AD = :ad
106
+ AO = :ao
107
+ AI = :ai
108
+ AQ = :aq
109
+ AG = :ag
110
+ AR = :ar
111
+ AM = :am
112
+ AW = :aw
113
+ AU = :au
114
+ AT = :at
115
+ AZ = :az
116
+ BS = :bs
117
+ BH = :bh
118
+ BD = :bd
119
+ BB = :bb
120
+ BY = :by
121
+ BE = :be
122
+ BZ = :bz
123
+ BJ = :bj
124
+ BM = :bm
125
+ BT = :bt
126
+ BO = :bo
127
+ BA = :ba
128
+ BW = :bw
129
+ BV = :bv
130
+ BR = :br
131
+ IO = :io
132
+ BN = :bn
133
+ BG = :bg
134
+ BF = :bf
135
+ BI = :bi
136
+ KH = :kh
137
+ CM = :cm
138
+ CA = :ca
139
+ CV = :cv
140
+ KY = :ky
141
+ CF = :cf
142
+ TD = :td
143
+ CL = :cl
144
+ CN = :cn
145
+ CX = :cx
146
+ CC = :cc
147
+ CO = :co
148
+ KM = :km
149
+ CG = :cg
150
+ CD = :cd
151
+ CK = :ck
152
+ CR = :cr
153
+ CI = :ci
154
+ HR = :hr
155
+ CU = :cu
156
+ CY = :cy
157
+ CZ = :cz
158
+ DK = :dk
159
+ DJ = :dj
160
+ DM = :dm
161
+ DO = :do
162
+ EC = :ec
163
+ EG = :eg
164
+ SV = :sv
165
+ GQ = :gq
166
+ ER = :er
167
+ EE = :ee
168
+ ET = :et
169
+ FK = :fk
170
+ FO = :fo
171
+ FJ = :fj
172
+ FI = :fi
173
+ FR = :fr
174
+ GF = :gf
175
+ PF = :pf
176
+ TF = :tf
177
+ GA = :ga
178
+ GM = :gm
179
+ GE = :ge
180
+ DE = :de
181
+ GH = :gh
182
+ GI = :gi
183
+ GR = :gr
184
+ GL = :gl
185
+ GD = :gd
186
+ GP = :gp
187
+ GU = :gu
188
+ GT = :gt
189
+ GN = :gn
190
+ GW = :gw
191
+ GY = :gy
192
+ HT = :ht
193
+ HM = :hm
194
+ VA = :va
195
+ HN = :hn
196
+ HK = :hk
197
+ HU = :hu
198
+ IS = :is
199
+ IN = :in
200
+ ID = :id
201
+ IR = :ir
202
+ IQ = :iq
203
+ IE = :ie
204
+ IL = :il
205
+ IT = :it
206
+ JM = :jm
207
+ JP = :jp
208
+ JO = :jo
209
+ KZ = :kz
210
+ KE = :ke
211
+ KI = :ki
212
+ KP = :kp
213
+ KR = :kr
214
+ KW = :kw
215
+ KG = :kg
216
+ LA = :la
217
+ LV = :lv
218
+ LB = :lb
219
+ LS = :ls
220
+ LR = :lr
221
+ LY = :ly
222
+ LI = :li
223
+ LT = :lt
224
+ LU = :lu
225
+ MO = :mo
226
+ MK = :mk
227
+ MG = :mg
228
+ MW = :mw
229
+ MY = :my
230
+ MV = :mv
231
+ ML = :ml
232
+ MT = :mt
233
+ MH = :mh
234
+ MQ = :mq
235
+ MR = :mr
236
+ MU = :mu
237
+ YT = :yt
238
+ MX = :mx
239
+ FM = :fm
240
+ MD = :md
241
+ MC = :mc
242
+ MN = :mn
243
+ MS = :ms
244
+ MA = :ma
245
+ MZ = :mz
246
+ MM = :mm
247
+ NA = :na
248
+ NR = :nr
249
+ NP = :np
250
+ NL = :nl
251
+ AN = :an
252
+ NC = :nc
253
+ NZ = :nz
254
+ NI = :ni
255
+ NE = :ne
256
+ NG = :ng
257
+ NU = :nu
258
+ NF = :nf
259
+ MP = :mp
260
+ NO = :no
261
+ OM = :om
262
+ PK = :pk
263
+ PW = :pw
264
+ PS = :ps
265
+ PA = :pa
266
+ PG = :pg
267
+ PY = :py
268
+ PE = :pe
269
+ PH = :ph
270
+ PN = :pn
271
+ PL = :pl
272
+ PT = :pt
273
+ PR = :pr
274
+ QA = :qa
275
+ RE = :re
276
+ RO = :ro
277
+ RU = :ru
278
+ RW = :rw
279
+ SH = :sh
280
+ KN = :kn
281
+ LC = :lc
282
+ PM = :pm
283
+ VC = :vc
284
+ WS = :ws
285
+ SM = :sm
286
+ ST = :st
287
+ SA = :sa
288
+ SN = :sn
289
+ RS = :rs
290
+ SC = :sc
291
+ SL = :sl
292
+ SG = :sg
293
+ SK = :sk
294
+ SI = :si
295
+ SB = :sb
296
+ SO = :so
297
+ ZA = :za
298
+ GS = :gs
299
+ ES = :es
300
+ LK = :lk
301
+ SD = :sd
302
+ SR = :sr
303
+ SJ = :sj
304
+ SZ = :sz
305
+ SE = :se
306
+ CH = :ch
307
+ SY = :sy
308
+ TW = :tw
309
+ TJ = :tj
310
+ TZ = :tz
311
+ TH = :th
312
+ TL = :tl
313
+ TG = :tg
314
+ TK = :tk
315
+ TO = :to
316
+ TT = :tt
317
+ TN = :tn
318
+ TR = :tr
319
+ TM = :tm
320
+ TC = :tc
321
+ TV = :tv
322
+ UG = :ug
323
+ UA = :ua
324
+ AE = :ae
325
+ GB = :gb
326
+ US = :us
327
+ UM = :um
328
+ UY = :uy
329
+ UZ = :uz
330
+ VU = :vu
331
+ VE = :ve
332
+ VN = :vn
333
+ VG = :vg
334
+ VI = :vi
335
+ WF = :wf
336
+ EH = :eh
337
+ YE = :ye
338
+ ZM = :zm
339
+ ZW = :zw
340
+
341
+ # @!method self.values
342
+ # @return [Array<Symbol>]
343
+ end
344
+
78
345
  # Restrict results to content published within this window.
79
346
  module Freshness
80
347
  extend ContextDev::Internal::Type::Enum
@@ -13,6 +13,14 @@ module ContextDev
13
13
  # @return [String]
14
14
  required :url, String
15
15
 
16
+ # @!attribute country
17
+ # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
18
+ # residential proxy exit location. Must be one of Context.dev's supported
19
+ # countries. When provided, Context.dev fetches the target page from that country.
20
+ #
21
+ # @return [Symbol, ContextDev::Models::WebWebCrawlMdParams::Country, nil]
22
+ optional :country, enum: -> { ContextDev::WebWebCrawlMdParams::Country }
23
+
16
24
  # @!attribute exclude_selectors
17
25
  # CSS selectors to remove before each crawled page is converted to Markdown.
18
26
  # Applied after includeSelectors. Exclusion takes precedence: an element matching
@@ -127,12 +135,14 @@ module ContextDev
127
135
  # @return [Integer, nil]
128
136
  optional :wait_for_ms, Integer, api_name: :waitForMs
129
137
 
130
- # @!method initialize(url:, exclude_selectors: nil, follow_subdomains: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, shorten_base64_images: nil, stop_after_ms: nil, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {})
138
+ # @!method initialize(url:, country: nil, exclude_selectors: nil, follow_subdomains: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, shorten_base64_images: nil, stop_after_ms: nil, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {})
131
139
  # Some parameter documentations has been truncated, see
132
140
  # {ContextDev::Models::WebWebCrawlMdParams} for more details.
133
141
  #
134
142
  # @param url [String] The starting URL for the crawl (must include http:// or https:// protocol)
135
143
  #
144
+ # @param country [Symbol, ContextDev::Models::WebWebCrawlMdParams::Country] Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev r
145
+ #
136
146
  # @param exclude_selectors [Array<String>] CSS selectors to remove before each crawled page is converted to Markdown. Appli
137
147
  #
138
148
  # @param follow_subdomains [Boolean] When true, follow links on subdomains of the starting URL's domain (e.g. docs.ex
@@ -167,6 +177,221 @@ module ContextDev
167
177
  #
168
178
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
169
179
 
180
+ # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
181
+ # residential proxy exit location. Must be one of Context.dev's supported
182
+ # countries. When provided, Context.dev fetches the target page from that country.
183
+ module Country
184
+ extend ContextDev::Internal::Type::Enum
185
+
186
+ AD = :ad
187
+ AE = :ae
188
+ AF = :af
189
+ AG = :ag
190
+ AI = :ai
191
+ AL = :al
192
+ AM = :am
193
+ AO = :ao
194
+ AR = :ar
195
+ AT = :at
196
+ AU = :au
197
+ AW = :aw
198
+ AZ = :az
199
+ BA = :ba
200
+ BB = :bb
201
+ BD = :bd
202
+ BE = :be
203
+ BF = :bf
204
+ BG = :bg
205
+ BH = :bh
206
+ BI = :bi
207
+ BJ = :bj
208
+ BM = :bm
209
+ BN = :bn
210
+ BO = :bo
211
+ BQ = :bq
212
+ BR = :br
213
+ BS = :bs
214
+ BW = :bw
215
+ BY = :by
216
+ BZ = :bz
217
+ CA = :ca
218
+ CD = :cd
219
+ CF = :cf
220
+ CG = :cg
221
+ CH = :ch
222
+ CI = :ci
223
+ CL = :cl
224
+ CM = :cm
225
+ CN = :cn
226
+ CO = :co
227
+ CR = :cr
228
+ CV = :cv
229
+ CW = :cw
230
+ CY = :cy
231
+ CZ = :cz
232
+ DE = :de
233
+ DJ = :dj
234
+ DK = :dk
235
+ DM = :dm
236
+ DO = :do
237
+ DZ = :dz
238
+ EC = :ec
239
+ EE = :ee
240
+ EG = :eg
241
+ ES = :es
242
+ ET = :et
243
+ FI = :fi
244
+ FJ = :fj
245
+ FR = :fr
246
+ GA = :ga
247
+ GB = :gb
248
+ GD = :gd
249
+ GE = :ge
250
+ GF = :gf
251
+ GG = :gg
252
+ GH = :gh
253
+ GM = :gm
254
+ GN = :gn
255
+ GP = :gp
256
+ GQ = :gq
257
+ GR = :gr
258
+ GT = :gt
259
+ GU = :gu
260
+ GW = :gw
261
+ GY = :gy
262
+ HK = :hk
263
+ HN = :hn
264
+ HR = :hr
265
+ HT = :ht
266
+ HU = :hu
267
+ ID = :id
268
+ IE = :ie
269
+ IL = :il
270
+ IM = :im
271
+ IN = :in
272
+ IQ = :iq
273
+ IR = :ir
274
+ IS = :is
275
+ IT = :it
276
+ JE = :je
277
+ JM = :jm
278
+ JO = :jo
279
+ JP = :jp
280
+ KE = :ke
281
+ KG = :kg
282
+ KH = :kh
283
+ KN = :kn
284
+ KR = :kr
285
+ KW = :kw
286
+ KY = :ky
287
+ KZ = :kz
288
+ LA = :la
289
+ LB = :lb
290
+ LC = :lc
291
+ LK = :lk
292
+ LR = :lr
293
+ LS = :ls
294
+ LT = :lt
295
+ LU = :lu
296
+ LV = :lv
297
+ LY = :ly
298
+ MA = :ma
299
+ MC = :mc
300
+ MD = :md
301
+ ME = :me
302
+ MF = :mf
303
+ MG = :mg
304
+ MK = :mk
305
+ ML = :ml
306
+ MM = :mm
307
+ MN = :mn
308
+ MO = :mo
309
+ MQ = :mq
310
+ MR = :mr
311
+ MT = :mt
312
+ MU = :mu
313
+ MV = :mv
314
+ MW = :mw
315
+ MX = :mx
316
+ MY = :my
317
+ MZ = :mz
318
+ NA = :na
319
+ NC = :nc
320
+ NE = :ne
321
+ NG = :ng
322
+ NI = :ni
323
+ NL = :nl
324
+ NO = :no
325
+ NP = :np
326
+ NZ = :nz
327
+ OM = :om
328
+ PA = :pa
329
+ PE = :pe
330
+ PF = :pf
331
+ PG = :pg
332
+ PH = :ph
333
+ PK = :pk
334
+ PL = :pl
335
+ PR = :pr
336
+ PS = :ps
337
+ PT = :pt
338
+ PY = :py
339
+ QA = :qa
340
+ RE = :re
341
+ RO = :ro
342
+ RS = :rs
343
+ RU = :ru
344
+ RW = :rw
345
+ SA = :sa
346
+ SC = :sc
347
+ SD = :sd
348
+ SE = :se
349
+ SG = :sg
350
+ SI = :si
351
+ SK = :sk
352
+ SL = :sl
353
+ SM = :sm
354
+ SN = :sn
355
+ SO = :so
356
+ SR = :sr
357
+ SS = :ss
358
+ ST = :st
359
+ SV = :sv
360
+ SX = :sx
361
+ SY = :sy
362
+ SZ = :sz
363
+ TC = :tc
364
+ TD = :td
365
+ TG = :tg
366
+ TH = :th
367
+ TJ = :tj
368
+ TL = :tl
369
+ TM = :tm
370
+ TN = :tn
371
+ TR = :tr
372
+ TT = :tt
373
+ TW = :tw
374
+ TZ = :tz
375
+ UA = :ua
376
+ UG = :ug
377
+ US = :us
378
+ UY = :uy
379
+ UZ = :uz
380
+ VC = :vc
381
+ VE = :ve
382
+ VG = :vg
383
+ VI = :vi
384
+ VN = :vn
385
+ YE = :ye
386
+ YT = :yt
387
+ ZA = :za
388
+ ZM = :zm
389
+ ZW = :zw
390
+
391
+ # @!method self.values
392
+ # @return [Array<Symbol>]
393
+ end
394
+
170
395
  class Pdf < ContextDev::Internal::Type::BaseModel
171
396
  # @!attribute end_
172
397
  # Last 1-based PDF page to parse. When omitted, parsing ends at the last page.