context.dev 1.3.0 → 1.5.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 +37 -0
- data/README.md +1 -1
- data/lib/context_dev/client.rb +0 -4
- data/lib/context_dev/internal/type/base_model.rb +3 -3
- data/lib/context_dev/internal/util.rb +3 -1
- data/lib/context_dev/models/brand_identify_from_transaction_params.rb +65 -1
- data/lib/context_dev/models/brand_identify_from_transaction_response.rb +190 -5
- data/lib/context_dev/models/brand_retrieve_by_email_params.rb +65 -0
- data/lib/context_dev/models/brand_retrieve_by_email_response.rb +190 -5
- data/lib/context_dev/models/brand_retrieve_by_isin_params.rb +65 -0
- data/lib/context_dev/models/brand_retrieve_by_isin_response.rb +190 -5
- data/lib/context_dev/models/brand_retrieve_by_name_params.rb +70 -5
- data/lib/context_dev/models/brand_retrieve_by_name_response.rb +190 -5
- data/lib/context_dev/models/brand_retrieve_by_ticker_params.rb +65 -0
- data/lib/context_dev/models/brand_retrieve_by_ticker_response.rb +190 -5
- data/lib/context_dev/models/brand_retrieve_params.rb +68 -5
- data/lib/context_dev/models/brand_retrieve_response.rb +190 -5
- data/lib/context_dev/models/industry_retrieve_naics_params.rb +4 -4
- data/lib/context_dev/models/{style_extract_fonts_params.rb → web_extract_fonts_params.rb} +18 -7
- data/lib/context_dev/models/{style_extract_fonts_response.rb → web_extract_fonts_response.rb} +5 -5
- data/lib/context_dev/models/{style_extract_styleguide_params.rb → web_extract_styleguide_params.rb} +8 -5
- data/lib/context_dev/models/{style_extract_styleguide_response.rb → web_extract_styleguide_response.rb} +147 -80
- data/lib/context_dev/models/web_screenshot_params.rb +19 -6
- data/lib/context_dev/models/web_web_scrape_html_params.rb +14 -1
- data/lib/context_dev/models/web_web_scrape_md_params.rb +13 -3
- data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +2 -3
- data/lib/context_dev/models.rb +4 -4
- data/lib/context_dev/resources/brand.rb +9 -13
- data/lib/context_dev/resources/industry.rb +3 -3
- data/lib/context_dev/resources/web.rb +85 -20
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +4 -5
- data/rbi/context_dev/client.rbi +0 -3
- data/rbi/context_dev/models/brand_identify_from_transaction_params.rbi +325 -2
- data/rbi/context_dev/models/brand_identify_from_transaction_response.rbi +859 -6
- data/rbi/context_dev/models/brand_retrieve_by_email_params.rbi +325 -0
- data/rbi/context_dev/models/brand_retrieve_by_email_response.rbi +859 -6
- data/rbi/context_dev/models/brand_retrieve_by_isin_params.rbi +325 -0
- data/rbi/context_dev/models/brand_retrieve_by_isin_response.rbi +859 -6
- data/rbi/context_dev/models/brand_retrieve_by_name_params.rbi +331 -6
- data/rbi/context_dev/models/brand_retrieve_by_name_response.rbi +859 -6
- data/rbi/context_dev/models/brand_retrieve_by_ticker_params.rbi +325 -0
- data/rbi/context_dev/models/brand_retrieve_by_ticker_response.rbi +859 -6
- data/rbi/context_dev/models/brand_retrieve_params.rbi +328 -6
- data/rbi/context_dev/models/brand_retrieve_response.rbi +859 -6
- data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +6 -6
- data/rbi/context_dev/models/{style_extract_fonts_params.rbi → web_extract_fonts_params.rbi} +27 -7
- data/rbi/context_dev/models/{style_extract_fonts_response.rbi → web_extract_fonts_response.rbi} +6 -9
- data/rbi/context_dev/models/{style_extract_styleguide_params.rbi → web_extract_styleguide_params.rbi} +12 -6
- data/rbi/context_dev/models/{style_extract_styleguide_response.rbi → web_extract_styleguide_response.rbi} +232 -94
- data/rbi/context_dev/models/web_screenshot_params.rbi +31 -8
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +19 -1
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +17 -2
- data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +2 -4
- data/rbi/context_dev/models.rbi +4 -5
- data/rbi/context_dev/resources/brand.rbi +10 -16
- data/rbi/context_dev/resources/industry.rbi +4 -4
- data/rbi/context_dev/resources/web.rbi +81 -17
- data/sig/context_dev/client.rbs +0 -2
- data/sig/context_dev/models/brand_identify_from_transaction_params.rbs +131 -1
- data/sig/context_dev/models/brand_identify_from_transaction_response.rbs +342 -5
- data/sig/context_dev/models/brand_retrieve_by_email_params.rbs +131 -1
- data/sig/context_dev/models/brand_retrieve_by_email_response.rbs +342 -5
- data/sig/context_dev/models/brand_retrieve_by_isin_params.rbs +131 -1
- data/sig/context_dev/models/brand_retrieve_by_isin_response.rbs +342 -5
- data/sig/context_dev/models/brand_retrieve_by_name_params.rbs +131 -1
- data/sig/context_dev/models/brand_retrieve_by_name_response.rbs +342 -5
- data/sig/context_dev/models/brand_retrieve_by_ticker_params.rbs +131 -1
- data/sig/context_dev/models/brand_retrieve_by_ticker_response.rbs +342 -5
- data/sig/context_dev/models/brand_retrieve_params.rbs +131 -1
- data/sig/context_dev/models/brand_retrieve_response.rbs +342 -5
- data/sig/context_dev/models/{style_extract_styleguide_params.rbs → web_extract_fonts_params.rbs} +2 -2
- data/sig/context_dev/models/{style_extract_fonts_response.rbs → web_extract_fonts_response.rbs} +6 -6
- data/sig/context_dev/models/{style_extract_fonts_params.rbs → web_extract_styleguide_params.rbs} +13 -5
- data/sig/context_dev/models/{style_extract_styleguide_response.rbs → web_extract_styleguide_response.rbs} +147 -95
- data/sig/context_dev/models/web_screenshot_params.rbs +11 -2
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +8 -1
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +7 -0
- data/sig/context_dev/models.rbs +4 -4
- data/sig/context_dev/resources/web.rbs +18 -1
- metadata +14 -17
- data/lib/context_dev/resources/style.rb +0 -76
- data/rbi/context_dev/resources/style.rbi +0 -60
- data/sig/context_dev/resources/style.rbs +0 -20
|
@@ -8,7 +8,7 @@ module ContextDev
|
|
|
8
8
|
include ContextDev::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
10
|
# @!attribute url
|
|
11
|
-
# Full URL to scrape
|
|
11
|
+
# Full URL to scrape into LLM usable Markdown (must include http:// or https://
|
|
12
12
|
# protocol)
|
|
13
13
|
#
|
|
14
14
|
# @return [String]
|
|
@@ -26,6 +26,14 @@ module ContextDev
|
|
|
26
26
|
# @return [Boolean, nil]
|
|
27
27
|
optional :include_links, ContextDev::Internal::Type::Boolean
|
|
28
28
|
|
|
29
|
+
# @!attribute max_age_ms
|
|
30
|
+
# Return a cached result if a prior scrape for the same parameters exists and is
|
|
31
|
+
# younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
|
|
32
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
|
|
33
|
+
#
|
|
34
|
+
# @return [Integer, nil]
|
|
35
|
+
optional :max_age_ms, Integer
|
|
36
|
+
|
|
29
37
|
# @!attribute shorten_base64_images
|
|
30
38
|
# Shorten base64-encoded image data in the Markdown output
|
|
31
39
|
#
|
|
@@ -39,16 +47,18 @@ module ContextDev
|
|
|
39
47
|
# @return [Boolean, nil]
|
|
40
48
|
optional :use_main_content_only, ContextDev::Internal::Type::Boolean
|
|
41
49
|
|
|
42
|
-
# @!method initialize(url:, include_images: nil, include_links: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {})
|
|
50
|
+
# @!method initialize(url:, include_images: nil, include_links: nil, max_age_ms: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {})
|
|
43
51
|
# Some parameter documentations has been truncated, see
|
|
44
52
|
# {ContextDev::Models::WebWebScrapeMdParams} for more details.
|
|
45
53
|
#
|
|
46
|
-
# @param url [String] Full URL to scrape
|
|
54
|
+
# @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr
|
|
47
55
|
#
|
|
48
56
|
# @param include_images [Boolean] Include image references in Markdown output
|
|
49
57
|
#
|
|
50
58
|
# @param include_links [Boolean] Preserve hyperlinks in Markdown output
|
|
51
59
|
#
|
|
60
|
+
# @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
|
|
61
|
+
#
|
|
52
62
|
# @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output
|
|
53
63
|
#
|
|
54
64
|
# @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars,
|
|
@@ -8,8 +8,7 @@ module ContextDev
|
|
|
8
8
|
include ContextDev::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
10
|
# @!attribute domain
|
|
11
|
-
# Domain
|
|
12
|
-
# automatically normalized and validated.
|
|
11
|
+
# Domain to build a sitemap for
|
|
13
12
|
#
|
|
14
13
|
# @return [String]
|
|
15
14
|
required :domain, String
|
|
@@ -25,7 +24,7 @@ module ContextDev
|
|
|
25
24
|
# Some parameter documentations has been truncated, see
|
|
26
25
|
# {ContextDev::Models::WebWebScrapeSitemapParams} for more details.
|
|
27
26
|
#
|
|
28
|
-
# @param domain [String] Domain
|
|
27
|
+
# @param domain [String] Domain to build a sitemap for
|
|
29
28
|
#
|
|
30
29
|
# @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi
|
|
31
30
|
#
|
data/lib/context_dev/models.rb
CHANGED
|
@@ -61,14 +61,14 @@ module ContextDev
|
|
|
61
61
|
|
|
62
62
|
IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams
|
|
63
63
|
|
|
64
|
-
StyleExtractFontsParams = ContextDev::Models::StyleExtractFontsParams
|
|
65
|
-
|
|
66
|
-
StyleExtractStyleguideParams = ContextDev::Models::StyleExtractStyleguideParams
|
|
67
|
-
|
|
68
64
|
UtilityPrefetchByEmailParams = ContextDev::Models::UtilityPrefetchByEmailParams
|
|
69
65
|
|
|
70
66
|
UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams
|
|
71
67
|
|
|
68
|
+
WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams
|
|
69
|
+
|
|
70
|
+
WebExtractStyleguideParams = ContextDev::Models::WebExtractStyleguideParams
|
|
71
|
+
|
|
72
72
|
WebScreenshotParams = ContextDev::Models::WebScreenshotParams
|
|
73
73
|
|
|
74
74
|
WebWebCrawlMdParams = ContextDev::Models::WebWebCrawlMdParams
|
|
@@ -13,7 +13,7 @@ module ContextDev
|
|
|
13
13
|
#
|
|
14
14
|
# @param domain [String] Domain name to retrieve brand data for (e.g., 'example.com', 'google.com'). Cann
|
|
15
15
|
#
|
|
16
|
-
# @param force_language [Symbol, ContextDev::Models::BrandRetrieveParams::ForceLanguage] Optional parameter to force the language of the retrieved brand data.
|
|
16
|
+
# @param force_language [Symbol, ContextDev::Models::BrandRetrieveParams::ForceLanguage] Optional parameter to force the language of the retrieved brand data.
|
|
17
17
|
#
|
|
18
18
|
# @param max_speed [Boolean] Optional parameter to optimize the API call for maximum speed. When set to true,
|
|
19
19
|
#
|
|
@@ -83,9 +83,8 @@ module ContextDev
|
|
|
83
83
|
# {ContextDev::Models::BrandRetrieveByEmailParams} for more details.
|
|
84
84
|
#
|
|
85
85
|
# Retrieve brand information using an email address while detecting disposable and
|
|
86
|
-
# free email addresses.
|
|
87
|
-
#
|
|
88
|
-
# (like gmail.com, yahoo.com) will throw a 422 error.
|
|
86
|
+
# free email addresses. Disposable and free email addresses (like gmail.com,
|
|
87
|
+
# yahoo.com) will throw a 422 error.
|
|
89
88
|
#
|
|
90
89
|
# @overload retrieve_by_email(email:, force_language: nil, max_speed: nil, timeout_ms: nil, request_options: {})
|
|
91
90
|
#
|
|
@@ -118,8 +117,7 @@ module ContextDev
|
|
|
118
117
|
# {ContextDev::Models::BrandRetrieveByIsinParams} for more details.
|
|
119
118
|
#
|
|
120
119
|
# Retrieve brand information using an ISIN (International Securities
|
|
121
|
-
# Identification Number).
|
|
122
|
-
# ISIN and returns its brand data.
|
|
120
|
+
# Identification Number).
|
|
123
121
|
#
|
|
124
122
|
# @overload retrieve_by_isin(isin:, force_language: nil, max_speed: nil, timeout_ms: nil, request_options: {})
|
|
125
123
|
#
|
|
@@ -151,14 +149,13 @@ module ContextDev
|
|
|
151
149
|
# Some parameter documentations has been truncated, see
|
|
152
150
|
# {ContextDev::Models::BrandRetrieveByNameParams} for more details.
|
|
153
151
|
#
|
|
154
|
-
# Retrieve brand information using a company name.
|
|
155
|
-
# company by name and returns its brand data.
|
|
152
|
+
# Retrieve brand information using a company name.
|
|
156
153
|
#
|
|
157
154
|
# @overload retrieve_by_name(name:, country_gl: nil, force_language: nil, max_speed: nil, timeout_ms: nil, request_options: {})
|
|
158
155
|
#
|
|
159
156
|
# @param name [String] Company name to retrieve brand data for (e.g., 'Apple Inc', 'Microsoft Corporati
|
|
160
157
|
#
|
|
161
|
-
# @param country_gl [Symbol, ContextDev::Models::BrandRetrieveByNameParams::CountryGl] Optional country code (GL parameter) to specify the country
|
|
158
|
+
# @param country_gl [Symbol, ContextDev::Models::BrandRetrieveByNameParams::CountryGl] Optional country code hint (GL parameter) to specify the country for the company
|
|
162
159
|
#
|
|
163
160
|
# @param force_language [Symbol, ContextDev::Models::BrandRetrieveByNameParams::ForceLanguage] Optional parameter to force the language of the retrieved brand data.
|
|
164
161
|
#
|
|
@@ -186,8 +183,7 @@ module ContextDev
|
|
|
186
183
|
# Some parameter documentations has been truncated, see
|
|
187
184
|
# {ContextDev::Models::BrandRetrieveByTickerParams} for more details.
|
|
188
185
|
#
|
|
189
|
-
# Retrieve brand information using a stock ticker symbol.
|
|
190
|
-
# the company associated with the ticker and returns its brand data.
|
|
186
|
+
# Retrieve brand information using a stock ticker symbol.
|
|
191
187
|
#
|
|
192
188
|
# @overload retrieve_by_ticker(ticker:, force_language: nil, max_speed: nil, ticker_exchange: nil, timeout_ms: nil, request_options: {})
|
|
193
189
|
#
|
|
@@ -222,8 +218,8 @@ module ContextDev
|
|
|
222
218
|
# {ContextDev::Models::BrandRetrieveSimplifiedParams} for more details.
|
|
223
219
|
#
|
|
224
220
|
# Returns a simplified version of brand data containing only essential
|
|
225
|
-
# information: domain, title, colors, logos, and backdrops.
|
|
226
|
-
#
|
|
221
|
+
# information: domain, title, colors, logos, and backdrops. Optimized for faster
|
|
222
|
+
# responses and reduced data transfer.
|
|
227
223
|
#
|
|
228
224
|
# @overload retrieve_simplified(domain:, timeout_ms: nil, request_options: {})
|
|
229
225
|
#
|
|
@@ -6,11 +6,11 @@ module ContextDev
|
|
|
6
6
|
# Some parameter documentations has been truncated, see
|
|
7
7
|
# {ContextDev::Models::IndustryRetrieveNaicsParams} for more details.
|
|
8
8
|
#
|
|
9
|
-
#
|
|
9
|
+
# Classify any brand into 2022 NAICS industry codes from its domain or name.
|
|
10
10
|
#
|
|
11
11
|
# @overload retrieve_naics(input:, max_results: nil, min_results: nil, timeout_ms: nil, request_options: {})
|
|
12
12
|
#
|
|
13
|
-
# @param input [String] Brand domain or title to retrieve NAICS code for. If a valid domain is provided
|
|
13
|
+
# @param input [String] Brand domain or title to retrieve NAICS code for. If a valid domain is provided,
|
|
14
14
|
#
|
|
15
15
|
# @param max_results [Integer] Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults to 5
|
|
16
16
|
#
|
|
@@ -28,7 +28,7 @@ module ContextDev
|
|
|
28
28
|
query = ContextDev::Internal::Util.encode_query_params(parsed)
|
|
29
29
|
@client.request(
|
|
30
30
|
method: :get,
|
|
31
|
-
path: "
|
|
31
|
+
path: "web/naics",
|
|
32
32
|
query: query.transform_keys(
|
|
33
33
|
max_results: "maxResults",
|
|
34
34
|
min_results: "minResults",
|
|
@@ -3,15 +3,76 @@
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Resources
|
|
5
5
|
class Web
|
|
6
|
+
# Some parameter documentations has been truncated, see
|
|
7
|
+
# {ContextDev::Models::WebExtractFontsParams} for more details.
|
|
8
|
+
#
|
|
9
|
+
# Scrape font information from a website including font families, usage
|
|
10
|
+
# statistics, fallbacks, and element/word counts.
|
|
11
|
+
#
|
|
12
|
+
# @overload extract_fonts(direct_url: nil, domain: nil, timeout_ms: nil, request_options: {})
|
|
13
|
+
#
|
|
14
|
+
# @param direct_url [String] A specific URL to fetch fonts from directly, bypassing domain resolution (e.g.,
|
|
15
|
+
#
|
|
16
|
+
# @param domain [String] Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The domai
|
|
17
|
+
#
|
|
18
|
+
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
|
|
19
|
+
#
|
|
20
|
+
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
21
|
+
#
|
|
22
|
+
# @return [ContextDev::Models::WebExtractFontsResponse]
|
|
23
|
+
#
|
|
24
|
+
# @see ContextDev::Models::WebExtractFontsParams
|
|
25
|
+
def extract_fonts(params = {})
|
|
26
|
+
parsed, options = ContextDev::WebExtractFontsParams.dump_request(params)
|
|
27
|
+
query = ContextDev::Internal::Util.encode_query_params(parsed)
|
|
28
|
+
@client.request(
|
|
29
|
+
method: :get,
|
|
30
|
+
path: "web/fonts",
|
|
31
|
+
query: query.transform_keys(direct_url: "directUrl", timeout_ms: "timeoutMS"),
|
|
32
|
+
model: ContextDev::Models::WebExtractFontsResponse,
|
|
33
|
+
options: options
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Some parameter documentations has been truncated, see
|
|
38
|
+
# {ContextDev::Models::WebExtractStyleguideParams} for more details.
|
|
39
|
+
#
|
|
40
|
+
# Extract a comprehensive design system from a website including colors,
|
|
41
|
+
# typography, spacing, shadows, and UI components.
|
|
42
|
+
#
|
|
43
|
+
# @overload extract_styleguide(direct_url: nil, domain: nil, timeout_ms: nil, request_options: {})
|
|
44
|
+
#
|
|
45
|
+
# @param direct_url [String] A specific URL to fetch the styleguide from directly, bypassing domain resolutio
|
|
46
|
+
#
|
|
47
|
+
# @param domain [String] Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The
|
|
48
|
+
#
|
|
49
|
+
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
|
|
50
|
+
#
|
|
51
|
+
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
52
|
+
#
|
|
53
|
+
# @return [ContextDev::Models::WebExtractStyleguideResponse]
|
|
54
|
+
#
|
|
55
|
+
# @see ContextDev::Models::WebExtractStyleguideParams
|
|
56
|
+
def extract_styleguide(params = {})
|
|
57
|
+
parsed, options = ContextDev::WebExtractStyleguideParams.dump_request(params)
|
|
58
|
+
query = ContextDev::Internal::Util.encode_query_params(parsed)
|
|
59
|
+
@client.request(
|
|
60
|
+
method: :get,
|
|
61
|
+
path: "web/styleguide",
|
|
62
|
+
query: query.transform_keys(direct_url: "directUrl", timeout_ms: "timeoutMS"),
|
|
63
|
+
model: ContextDev::Models::WebExtractStyleguideResponse,
|
|
64
|
+
options: options
|
|
65
|
+
)
|
|
66
|
+
end
|
|
67
|
+
|
|
6
68
|
# Some parameter documentations has been truncated, see
|
|
7
69
|
# {ContextDev::Models::WebScreenshotParams} for more details.
|
|
8
70
|
#
|
|
9
|
-
# Capture a screenshot of a website.
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
# the uploaded screenshot image hosted on our CDN.
|
|
71
|
+
# Capture a screenshot of a website.
|
|
72
|
+
#
|
|
73
|
+
# @overload screenshot(direct_url: nil, domain: nil, full_screenshot: nil, page: nil, prioritize: nil, request_options: {})
|
|
13
74
|
#
|
|
14
|
-
# @
|
|
75
|
+
# @param direct_url [String] A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https
|
|
15
76
|
#
|
|
16
77
|
# @param domain [String] Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domai
|
|
17
78
|
#
|
|
@@ -26,13 +87,13 @@ module ContextDev
|
|
|
26
87
|
# @return [ContextDev::Models::WebScreenshotResponse]
|
|
27
88
|
#
|
|
28
89
|
# @see ContextDev::Models::WebScreenshotParams
|
|
29
|
-
def screenshot(params)
|
|
90
|
+
def screenshot(params = {})
|
|
30
91
|
parsed, options = ContextDev::WebScreenshotParams.dump_request(params)
|
|
31
92
|
query = ContextDev::Internal::Util.encode_query_params(parsed)
|
|
32
93
|
@client.request(
|
|
33
94
|
method: :get,
|
|
34
|
-
path: "
|
|
35
|
-
query: query.transform_keys(full_screenshot: "fullScreenshot"),
|
|
95
|
+
path: "web/screenshot",
|
|
96
|
+
query: query.transform_keys(direct_url: "directUrl", full_screenshot: "fullScreenshot"),
|
|
36
97
|
model: ContextDev::Models::WebScreenshotResponse,
|
|
37
98
|
options: options
|
|
38
99
|
)
|
|
@@ -42,8 +103,7 @@ module ContextDev
|
|
|
42
103
|
# {ContextDev::Models::WebWebCrawlMdParams} for more details.
|
|
43
104
|
#
|
|
44
105
|
# Performs a crawl starting from a given URL, extracts page content as Markdown,
|
|
45
|
-
# and returns results for all crawled pages.
|
|
46
|
-
# domain as the starting URL. Costs 1 credit per successful page crawled.
|
|
106
|
+
# and returns results for all crawled pages.
|
|
47
107
|
#
|
|
48
108
|
# @overload web_crawl_md(url:, follow_subdomains: nil, include_images: nil, include_links: nil, max_depth: nil, max_pages: nil, shorten_base64_images: nil, url_regex: nil, use_main_content_only: nil, request_options: {})
|
|
49
109
|
#
|
|
@@ -81,12 +141,17 @@ module ContextDev
|
|
|
81
141
|
)
|
|
82
142
|
end
|
|
83
143
|
|
|
144
|
+
# Some parameter documentations has been truncated, see
|
|
145
|
+
# {ContextDev::Models::WebWebScrapeHTMLParams} for more details.
|
|
146
|
+
#
|
|
84
147
|
# Scrapes the given URL and returns the raw HTML content of the page.
|
|
85
148
|
#
|
|
86
|
-
# @overload web_scrape_html(url:, request_options: {})
|
|
149
|
+
# @overload web_scrape_html(url:, max_age_ms: nil, request_options: {})
|
|
87
150
|
#
|
|
88
151
|
# @param url [String] Full URL to scrape (must include http:// or https:// protocol)
|
|
89
152
|
#
|
|
153
|
+
# @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
|
|
154
|
+
#
|
|
90
155
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
91
156
|
#
|
|
92
157
|
# @return [ContextDev::Models::WebWebScrapeHTMLResponse]
|
|
@@ -98,7 +163,7 @@ module ContextDev
|
|
|
98
163
|
@client.request(
|
|
99
164
|
method: :get,
|
|
100
165
|
path: "web/scrape/html",
|
|
101
|
-
query: query,
|
|
166
|
+
query: query.transform_keys(max_age_ms: "maxAgeMs"),
|
|
102
167
|
model: ContextDev::Models::WebWebScrapeHTMLResponse,
|
|
103
168
|
options: options
|
|
104
169
|
)
|
|
@@ -132,17 +197,18 @@ module ContextDev
|
|
|
132
197
|
# Some parameter documentations has been truncated, see
|
|
133
198
|
# {ContextDev::Models::WebWebScrapeMdParams} for more details.
|
|
134
199
|
#
|
|
135
|
-
# Scrapes the given URL
|
|
136
|
-
# result.
|
|
200
|
+
# Scrapes the given URL into LLM usable Markdown.
|
|
137
201
|
#
|
|
138
|
-
# @overload web_scrape_md(url:, include_images: nil, include_links: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {})
|
|
202
|
+
# @overload web_scrape_md(url:, include_images: nil, include_links: nil, max_age_ms: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {})
|
|
139
203
|
#
|
|
140
|
-
# @param url [String] Full URL to scrape
|
|
204
|
+
# @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr
|
|
141
205
|
#
|
|
142
206
|
# @param include_images [Boolean] Include image references in Markdown output
|
|
143
207
|
#
|
|
144
208
|
# @param include_links [Boolean] Preserve hyperlinks in Markdown output
|
|
145
209
|
#
|
|
210
|
+
# @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
|
|
211
|
+
#
|
|
146
212
|
# @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output
|
|
147
213
|
#
|
|
148
214
|
# @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars,
|
|
@@ -161,6 +227,7 @@ module ContextDev
|
|
|
161
227
|
query: query.transform_keys(
|
|
162
228
|
include_images: "includeImages",
|
|
163
229
|
include_links: "includeLinks",
|
|
230
|
+
max_age_ms: "maxAgeMs",
|
|
164
231
|
shorten_base64_images: "shortenBase64Images",
|
|
165
232
|
use_main_content_only: "useMainContentOnly"
|
|
166
233
|
),
|
|
@@ -172,13 +239,11 @@ module ContextDev
|
|
|
172
239
|
# Some parameter documentations has been truncated, see
|
|
173
240
|
# {ContextDev::Models::WebWebScrapeSitemapParams} for more details.
|
|
174
241
|
#
|
|
175
|
-
#
|
|
176
|
-
# Supports sitemap index files (recursive), parallel fetching with concurrency
|
|
177
|
-
# control, deduplication, and filters out non-page resources (images, PDFs, etc.).
|
|
242
|
+
# Crawl an entire website's sitemap and return all discovered page URLs.
|
|
178
243
|
#
|
|
179
244
|
# @overload web_scrape_sitemap(domain:, max_links: nil, request_options: {})
|
|
180
245
|
#
|
|
181
|
-
# @param domain [String] Domain
|
|
246
|
+
# @param domain [String] Domain to build a sitemap for
|
|
182
247
|
#
|
|
183
248
|
# @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi
|
|
184
249
|
#
|
data/lib/context_dev/version.rb
CHANGED
data/lib/context_dev.rb
CHANGED
|
@@ -74,14 +74,14 @@ require_relative "context_dev/models/brand_retrieve_simplified_params"
|
|
|
74
74
|
require_relative "context_dev/models/brand_retrieve_simplified_response"
|
|
75
75
|
require_relative "context_dev/models/industry_retrieve_naics_params"
|
|
76
76
|
require_relative "context_dev/models/industry_retrieve_naics_response"
|
|
77
|
-
require_relative "context_dev/models/style_extract_fonts_params"
|
|
78
|
-
require_relative "context_dev/models/style_extract_fonts_response"
|
|
79
|
-
require_relative "context_dev/models/style_extract_styleguide_params"
|
|
80
|
-
require_relative "context_dev/models/style_extract_styleguide_response"
|
|
81
77
|
require_relative "context_dev/models/utility_prefetch_by_email_params"
|
|
82
78
|
require_relative "context_dev/models/utility_prefetch_by_email_response"
|
|
83
79
|
require_relative "context_dev/models/utility_prefetch_params"
|
|
84
80
|
require_relative "context_dev/models/utility_prefetch_response"
|
|
81
|
+
require_relative "context_dev/models/web_extract_fonts_params"
|
|
82
|
+
require_relative "context_dev/models/web_extract_fonts_response"
|
|
83
|
+
require_relative "context_dev/models/web_extract_styleguide_params"
|
|
84
|
+
require_relative "context_dev/models/web_extract_styleguide_response"
|
|
85
85
|
require_relative "context_dev/models/web_screenshot_params"
|
|
86
86
|
require_relative "context_dev/models/web_screenshot_response"
|
|
87
87
|
require_relative "context_dev/models/web_web_crawl_md_params"
|
|
@@ -98,6 +98,5 @@ require_relative "context_dev/models"
|
|
|
98
98
|
require_relative "context_dev/resources/ai"
|
|
99
99
|
require_relative "context_dev/resources/brand"
|
|
100
100
|
require_relative "context_dev/resources/industry"
|
|
101
|
-
require_relative "context_dev/resources/style"
|
|
102
101
|
require_relative "context_dev/resources/utility"
|
|
103
102
|
require_relative "context_dev/resources/web"
|
data/rbi/context_dev/client.rbi
CHANGED