@@ -25,6 +25,12 @@ class WebScrapeParams < ContextDev::Internal::Type::BaseModel
2525 # @return [ContextDev::Models::WebScrapeParams::ImageParams, nil]
2626 optional :image_params , -> { ContextDev ::WebScrapeParams ::ImageParams } , api_name : :imageParams
2727
28+ # @!attribute json_params
29+ # Required when formats.json is true.
30+ #
31+ # @return [ContextDev::Models::WebScrapeParams::JsonParams, nil]
32+ optional :json_params , -> { ContextDev ::WebScrapeParams ::JsonParams } , api_name : :jsonParams
33+
2834 # @!attribute markdown_params
2935 # Markdown options. Requires formats.markdown: true.
3036 #
@@ -86,7 +92,7 @@ class WebScrapeParams < ContextDev::Internal::Type::BaseModel
8692 # @return [Symbol, ContextDev::Models::WebScrapeParams::Zdr, nil]
8793 optional :zdr , enum : -> { ContextDev ::WebScrapeParams ::Zdr }
8894
89- # @!method initialize(formats:, url:, image_params: nil, markdown_params: nil, max_age_ms: nil, parse_params: nil, screenshot_params: nil, shared_params: nil, tags: nil, timeout_opts: nil, zdr: nil, request_options: {})
95+ # @!method initialize(formats:, url:, image_params: nil, json_params: nil, markdown_params: nil, max_age_ms: nil, parse_params: nil, screenshot_params: nil, shared_params: nil, tags: nil, timeout_opts: nil, zdr: nil, request_options: {})
9096 # Some parameter documentations has been truncated, see
9197 # {ContextDev::Models::WebScrapeParams} for more details.
9298 #
@@ -96,6 +102,8 @@ class WebScrapeParams < ContextDev::Internal::Type::BaseModel
96102 #
97103 # @param image_params [ContextDev::Models::WebScrapeParams::ImageParams] Image options. Requires formats.images: true.
98104 #
105+ # @param json_params [ContextDev::Models::WebScrapeParams::JsonParams] Required when formats.json is true.
106+ #
99107 # @param markdown_params [ContextDev::Models::WebScrapeParams::MarkdownParams] Markdown options. Requires formats.markdown: true.
100108 #
101109 # @param max_age_ms [Integer] Maximum age of each cached output. Defaults to 1 day; 0 fetches fresh and update
@@ -133,6 +141,15 @@ class Formats < ContextDev::Internal::Type::BaseModel
133141 # @return [Boolean, nil]
134142 optional :images , ContextDev ::Internal ::Type ::Boolean
135143
144+ # @!attribute json
145+ # Page data extracted by an LLM from the page Markdown into jsonParams.schema;
146+ # values carried only in attributes or CSS classes need formats.parse instead.
147+ # Adds four credits when the page has text to extract; when shared content filters
148+ # leave no text the result is an empty object and only the base price applies.
149+ #
150+ # @return [Boolean, nil]
151+ optional :json , ContextDev ::Internal ::Type ::Boolean
152+
136153 # @!attribute markdown
137154 # Page content as Markdown.
138155 #
@@ -151,7 +168,10 @@ class Formats < ContextDev::Internal::Type::BaseModel
151168 # @return [Boolean, nil]
152169 optional :screenshot , ContextDev ::Internal ::Type ::Boolean
153170
154- # @!method initialize(bytes: nil, html: nil, images: nil, markdown: nil, parse: nil, screenshot: nil)
171+ # @!method initialize(bytes: nil, html: nil, images: nil, json: nil, markdown: nil, parse: nil, screenshot: nil)
172+ # Some parameter documentations has been truncated, see
173+ # {ContextDev::Models::WebScrapeParams::Formats} for more details.
174+ #
155175 # Outputs to return. Enable at least one; omitted formats are false.
156176 #
157177 # @param bytes [Boolean] The original HTTP response body.
@@ -160,6 +180,8 @@ class Formats < ContextDev::Internal::Type::BaseModel
160180 #
161181 # @param images [Boolean] Images found on the page.
162182 #
183+ # @param json [Boolean] Page data extracted by an LLM from the page Markdown into jsonParams.schema; val
184+ #
163185 # @param markdown [Boolean] Page content as Markdown.
164186 #
165187 # @param parse [Boolean] Fields selected by parseParams.rules.
@@ -218,6 +240,35 @@ module Enrich
218240 end
219241 end
220242
243+ class JsonParams < ContextDev ::Internal ::Type ::BaseModel
244+ # @!attribute schema
245+ # JSON Schema for the returned object. Must describe a top-level object; at most
246+ # 50 KB serialized. Optional fields the page does not state are omitted, or null
247+ # when their type allows null, while required non-nullable fields always receive a
248+ # best-effort value, so prefer nullable or optional fields for data a page may
249+ # omit. Zod users can pass the output of z.toJSONSchema().
250+ #
251+ # @return [Hash{Symbol=>Object}]
252+ required :schema , ContextDev ::Internal ::Type ::HashOf [ ContextDev ::Internal ::Type ::Unknown ]
253+
254+ # @!attribute instructions
255+ # Optional guidance on which facts to prioritize or how to interpret schema
256+ # fields.
257+ #
258+ # @return [String, nil]
259+ optional :instructions , String
260+
261+ # @!method initialize(schema:, instructions: nil)
262+ # Some parameter documentations has been truncated, see
263+ # {ContextDev::Models::WebScrapeParams::JsonParams} for more details.
264+ #
265+ # Required when formats.json is true.
266+ #
267+ # @param schema [Hash{Symbol=>Object}] JSON Schema for the returned object. Must describe a top-level object; at most 5
268+ #
269+ # @param instructions [String] Optional guidance on which facts to prioritize or how to interpret schema fields
270+ end
271+
221272 class MarkdownParams < ContextDev ::Internal ::Type ::BaseModel
222273 # @!attribute include_images
223274 #
0 commit comments