context.dev 1.25.0 → 1.27.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 +18 -0
- data/README.md +1 -1
- data/lib/context_dev/models/web_extract_competitors_params.rb +44 -0
- data/lib/context_dev/models/web_extract_competitors_response.rb +157 -0
- data/lib/context_dev/models/web_extract_params.rb +8 -8
- data/lib/context_dev/models.rb +2 -0
- data/lib/context_dev/resources/web.rb +34 -5
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +2 -0
- data/rbi/context_dev/models/web_extract_competitors_params.rbi +74 -0
- data/rbi/context_dev/models/web_extract_competitors_response.rbi +297 -0
- data/rbi/context_dev/models/web_extract_params.rbi +14 -14
- data/rbi/context_dev/models.rbi +2 -0
- data/rbi/context_dev/resources/web.rbi +33 -11
- data/sig/context_dev/models/web_extract_competitors_params.rbs +36 -0
- data/sig/context_dev/models/web_extract_competitors_response.rbs +130 -0
- data/sig/context_dev/models.rbs +2 -0
- data/sig/context_dev/resources/web.rbs +7 -0
- metadata +8 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8f2f6c8c373d61ab07f5969d5f7f9bb52539093279b41b09a5e7bbefc6d4bd9e
|
|
4
|
+
data.tar.gz: d4afbf2bb5144a50a0b9930321c3ab8b3d193fd1a01da993ae2285a226a32597
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6e38d8989d26cecb219a1dcbb39d29c4f7bc92d9dda81de355959267ceeaa1c1587ea778163a1ce5267afcff70d36ac666b6b442226ba359ca0c82465b8bb05a
|
|
7
|
+
data.tar.gz: b9a94c13fc5cc8bf84c84bfbd46277e519d878bfc74f6d82f4e941bf01adf4bb9b9197f2eb32f06d722624a410ee703b351beb7f1d0ff51f7228f7addd5ea75d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.27.0 (2026-06-01)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.26.0...v1.27.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.26.0...v1.27.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([e3971dc](https://github.com/context-dot-dev/context-ruby-sdk/commit/e3971dcc3b94f5b998562f8ecb82a292cc8f00bd))
|
|
10
|
+
|
|
11
|
+
## 1.26.0 (2026-06-01)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v1.25.0...v1.26.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.25.0...v1.26.0)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **api:** api update ([d442168](https://github.com/context-dot-dev/context-ruby-sdk/commit/d442168b67accce12463e36f03630f155c1c7be3))
|
|
18
|
+
* **api:** api update ([f3a97c1](https://github.com/context-dot-dev/context-ruby-sdk/commit/f3a97c19ef01be5e6cf1ce7ecfa26c972edfdf33))
|
|
19
|
+
* **api:** api update ([8d8abf7](https://github.com/context-dot-dev/context-ruby-sdk/commit/8d8abf7c1600bce17ea26aa245f41b2e3199f722))
|
|
20
|
+
|
|
3
21
|
## 1.25.0 (2026-05-31)
|
|
4
22
|
|
|
5
23
|
Full Changelog: [v1.24.0...v1.25.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.24.0...v1.25.0)
|
data/README.md
CHANGED
|
@@ -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
|
|
@@ -23,12 +23,12 @@ module ContextDev
|
|
|
23
23
|
required :url, String
|
|
24
24
|
|
|
25
25
|
# @!attribute fact_check
|
|
26
|
-
# When true
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
#
|
|
26
|
+
# When true, every returned value must be grounded in facts stated on the page;
|
|
27
|
+
# fields that cannot be supported by the page are returned as null/empty. When
|
|
28
|
+
# false (default), the model may make reasonable inferences and derivations from
|
|
29
|
+
# the page content (e.g. ideal customer, competitor analysis, recommendations)
|
|
30
|
+
# while keeping verifiable specifics (names, quotes, URLs, dates, metrics)
|
|
31
|
+
# faithful to the source.
|
|
32
32
|
#
|
|
33
33
|
# @return [Boolean, nil]
|
|
34
34
|
optional :fact_check, ContextDev::Internal::Type::Boolean, api_name: :factCheck
|
|
@@ -54,7 +54,7 @@ module ContextDev
|
|
|
54
54
|
|
|
55
55
|
# @!attribute max_age_ms
|
|
56
56
|
# Return cached scrape results if a prior scrape for the same parameters is
|
|
57
|
-
# younger than this many milliseconds.
|
|
57
|
+
# younger than this many milliseconds. Defaults to 7 days (604800000 ms).
|
|
58
58
|
#
|
|
59
59
|
# @return [Integer, nil]
|
|
60
60
|
optional :max_age_ms, Integer, api_name: :maxAgeMs
|
|
@@ -93,7 +93,7 @@ module ContextDev
|
|
|
93
93
|
#
|
|
94
94
|
# @param url [String] The starting website URL to crawl and extract from. Must include http:// or http
|
|
95
95
|
#
|
|
96
|
-
# @param fact_check [Boolean] When true
|
|
96
|
+
# @param fact_check [Boolean] When true, every returned value must be grounded in facts stated on the page; fi
|
|
97
97
|
#
|
|
98
98
|
# @param follow_subdomains [Boolean] When true, follow links on subdomains of the starting URL's domain.
|
|
99
99
|
#
|
data/lib/context_dev/models.rb
CHANGED
|
@@ -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
|
|
@@ -6,10 +6,8 @@ module ContextDev
|
|
|
6
6
|
# Some parameter documentations has been truncated, see
|
|
7
7
|
# {ContextDev::Models::WebExtractParams} for more details.
|
|
8
8
|
#
|
|
9
|
-
# Crawl a website,
|
|
10
|
-
#
|
|
11
|
-
# response data object. This endpoint does not accept targeted page-type
|
|
12
|
-
# selection.
|
|
9
|
+
# Crawl a website, use the provided JSON Schema and instructions to prioritize
|
|
10
|
+
# relevant internal links, and extract structured data from the selected pages.
|
|
13
11
|
#
|
|
14
12
|
# @overload extract(schema:, url:, fact_check: nil, follow_subdomains: nil, include_frames: nil, instructions: nil, max_age_ms: nil, pdf: nil, stop_after_ms: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {})
|
|
15
13
|
#
|
|
@@ -17,7 +15,7 @@ module ContextDev
|
|
|
17
15
|
#
|
|
18
16
|
# @param url [String] The starting website URL to crawl and extract from. Must include http:// or http
|
|
19
17
|
#
|
|
20
|
-
# @param fact_check [Boolean] When true
|
|
18
|
+
# @param fact_check [Boolean] When true, every returned value must be grounded in facts stated on the page; fi
|
|
21
19
|
#
|
|
22
20
|
# @param follow_subdomains [Boolean] When true, follow links on subdomains of the starting URL's domain.
|
|
23
21
|
#
|
|
@@ -51,6 +49,37 @@ module ContextDev
|
|
|
51
49
|
)
|
|
52
50
|
end
|
|
53
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
|
+
|
|
54
83
|
# Some parameter documentations has been truncated, see
|
|
55
84
|
# {ContextDev::Models::WebExtractFontsParams} for more details.
|
|
56
85
|
#
|
data/lib/context_dev/version.rb
CHANGED
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
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Models
|
|
5
|
+
class WebExtractCompetitorsResponse < ContextDev::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
ContextDev::Models::WebExtractCompetitorsResponse,
|
|
10
|
+
ContextDev::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Direct competitors ordered by relevance and confidence.
|
|
15
|
+
sig do
|
|
16
|
+
returns(
|
|
17
|
+
T::Array[
|
|
18
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Competitor
|
|
19
|
+
]
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
attr_accessor :competitors
|
|
23
|
+
|
|
24
|
+
# Normalized input domain.
|
|
25
|
+
sig { returns(String) }
|
|
26
|
+
attr_accessor :domain
|
|
27
|
+
|
|
28
|
+
# Status of the response.
|
|
29
|
+
sig do
|
|
30
|
+
returns(
|
|
31
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Status::TaggedSymbol
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
attr_accessor :status
|
|
35
|
+
|
|
36
|
+
# Target company profile inferred from the landing page.
|
|
37
|
+
sig { returns(ContextDev::Models::WebExtractCompetitorsResponse::Target) }
|
|
38
|
+
attr_reader :target
|
|
39
|
+
|
|
40
|
+
sig do
|
|
41
|
+
params(
|
|
42
|
+
target:
|
|
43
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Target::OrHash
|
|
44
|
+
).void
|
|
45
|
+
end
|
|
46
|
+
attr_writer :target
|
|
47
|
+
|
|
48
|
+
sig do
|
|
49
|
+
params(
|
|
50
|
+
competitors:
|
|
51
|
+
T::Array[
|
|
52
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Competitor::OrHash
|
|
53
|
+
],
|
|
54
|
+
domain: String,
|
|
55
|
+
status:
|
|
56
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Status::OrSymbol,
|
|
57
|
+
target:
|
|
58
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Target::OrHash
|
|
59
|
+
).returns(T.attached_class)
|
|
60
|
+
end
|
|
61
|
+
def self.new(
|
|
62
|
+
# Direct competitors ordered by relevance and confidence.
|
|
63
|
+
competitors:,
|
|
64
|
+
# Normalized input domain.
|
|
65
|
+
domain:,
|
|
66
|
+
# Status of the response.
|
|
67
|
+
status:,
|
|
68
|
+
# Target company profile inferred from the landing page.
|
|
69
|
+
target:
|
|
70
|
+
)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
sig do
|
|
74
|
+
override.returns(
|
|
75
|
+
{
|
|
76
|
+
competitors:
|
|
77
|
+
T::Array[
|
|
78
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Competitor
|
|
79
|
+
],
|
|
80
|
+
domain: String,
|
|
81
|
+
status:
|
|
82
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Status::TaggedSymbol,
|
|
83
|
+
target: ContextDev::Models::WebExtractCompetitorsResponse::Target
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
end
|
|
87
|
+
def to_hash
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
class Competitor < ContextDev::Internal::Type::BaseModel
|
|
91
|
+
OrHash =
|
|
92
|
+
T.type_alias do
|
|
93
|
+
T.any(
|
|
94
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Competitor,
|
|
95
|
+
ContextDev::Internal::AnyHash
|
|
96
|
+
)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Confidence that this company is a direct competitor.
|
|
100
|
+
sig do
|
|
101
|
+
returns(
|
|
102
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence::TaggedSymbol
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
attr_accessor :confidence
|
|
106
|
+
|
|
107
|
+
# Short description of the competitor.
|
|
108
|
+
sig { returns(String) }
|
|
109
|
+
attr_accessor :description
|
|
110
|
+
|
|
111
|
+
# Competitor's normalized official domain.
|
|
112
|
+
sig { returns(String) }
|
|
113
|
+
attr_accessor :domain
|
|
114
|
+
|
|
115
|
+
# Competitor company or product name.
|
|
116
|
+
sig { returns(String) }
|
|
117
|
+
attr_accessor :name
|
|
118
|
+
|
|
119
|
+
# Search result URLs used as evidence for this competitor.
|
|
120
|
+
sig { returns(T::Array[String]) }
|
|
121
|
+
attr_accessor :source_urls
|
|
122
|
+
|
|
123
|
+
# Competitor website URL.
|
|
124
|
+
sig { returns(String) }
|
|
125
|
+
attr_accessor :url
|
|
126
|
+
|
|
127
|
+
sig do
|
|
128
|
+
params(
|
|
129
|
+
confidence:
|
|
130
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence::OrSymbol,
|
|
131
|
+
description: String,
|
|
132
|
+
domain: String,
|
|
133
|
+
name: String,
|
|
134
|
+
source_urls: T::Array[String],
|
|
135
|
+
url: String
|
|
136
|
+
).returns(T.attached_class)
|
|
137
|
+
end
|
|
138
|
+
def self.new(
|
|
139
|
+
# Confidence that this company is a direct competitor.
|
|
140
|
+
confidence:,
|
|
141
|
+
# Short description of the competitor.
|
|
142
|
+
description:,
|
|
143
|
+
# Competitor's normalized official domain.
|
|
144
|
+
domain:,
|
|
145
|
+
# Competitor company or product name.
|
|
146
|
+
name:,
|
|
147
|
+
# Search result URLs used as evidence for this competitor.
|
|
148
|
+
source_urls:,
|
|
149
|
+
# Competitor website URL.
|
|
150
|
+
url:
|
|
151
|
+
)
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
sig do
|
|
155
|
+
override.returns(
|
|
156
|
+
{
|
|
157
|
+
confidence:
|
|
158
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence::TaggedSymbol,
|
|
159
|
+
description: String,
|
|
160
|
+
domain: String,
|
|
161
|
+
name: String,
|
|
162
|
+
source_urls: T::Array[String],
|
|
163
|
+
url: String
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
end
|
|
167
|
+
def to_hash
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Confidence that this company is a direct competitor.
|
|
171
|
+
module Confidence
|
|
172
|
+
extend ContextDev::Internal::Type::Enum
|
|
173
|
+
|
|
174
|
+
TaggedSymbol =
|
|
175
|
+
T.type_alias do
|
|
176
|
+
T.all(
|
|
177
|
+
Symbol,
|
|
178
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence
|
|
179
|
+
)
|
|
180
|
+
end
|
|
181
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
182
|
+
|
|
183
|
+
HIGH =
|
|
184
|
+
T.let(
|
|
185
|
+
:high,
|
|
186
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence::TaggedSymbol
|
|
187
|
+
)
|
|
188
|
+
MEDIUM =
|
|
189
|
+
T.let(
|
|
190
|
+
:medium,
|
|
191
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence::TaggedSymbol
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
sig do
|
|
195
|
+
override.returns(
|
|
196
|
+
T::Array[
|
|
197
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Competitor::Confidence::TaggedSymbol
|
|
198
|
+
]
|
|
199
|
+
)
|
|
200
|
+
end
|
|
201
|
+
def self.values
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Status of the response.
|
|
207
|
+
module Status
|
|
208
|
+
extend ContextDev::Internal::Type::Enum
|
|
209
|
+
|
|
210
|
+
TaggedSymbol =
|
|
211
|
+
T.type_alias do
|
|
212
|
+
T.all(
|
|
213
|
+
Symbol,
|
|
214
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Status
|
|
215
|
+
)
|
|
216
|
+
end
|
|
217
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
218
|
+
|
|
219
|
+
OK =
|
|
220
|
+
T.let(
|
|
221
|
+
:ok,
|
|
222
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Status::TaggedSymbol
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
sig do
|
|
226
|
+
override.returns(
|
|
227
|
+
T::Array[
|
|
228
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Status::TaggedSymbol
|
|
229
|
+
]
|
|
230
|
+
)
|
|
231
|
+
end
|
|
232
|
+
def self.values
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
class Target < ContextDev::Internal::Type::BaseModel
|
|
237
|
+
OrHash =
|
|
238
|
+
T.type_alias do
|
|
239
|
+
T.any(
|
|
240
|
+
ContextDev::Models::WebExtractCompetitorsResponse::Target,
|
|
241
|
+
ContextDev::Internal::AnyHash
|
|
242
|
+
)
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# Company or product name inferred from the landing page.
|
|
246
|
+
sig { returns(String) }
|
|
247
|
+
attr_accessor :company_name
|
|
248
|
+
|
|
249
|
+
# Specific operating field, product category, or market.
|
|
250
|
+
sig { returns(String) }
|
|
251
|
+
attr_accessor :field
|
|
252
|
+
|
|
253
|
+
# One-sentence description of what the target company sells and who it serves.
|
|
254
|
+
sig { returns(String) }
|
|
255
|
+
attr_accessor :field_description
|
|
256
|
+
|
|
257
|
+
# Resolved URL used for the landing page analysis.
|
|
258
|
+
sig { returns(String) }
|
|
259
|
+
attr_accessor :website_url
|
|
260
|
+
|
|
261
|
+
# Target company profile inferred from the landing page.
|
|
262
|
+
sig do
|
|
263
|
+
params(
|
|
264
|
+
company_name: String,
|
|
265
|
+
field: String,
|
|
266
|
+
field_description: String,
|
|
267
|
+
website_url: String
|
|
268
|
+
).returns(T.attached_class)
|
|
269
|
+
end
|
|
270
|
+
def self.new(
|
|
271
|
+
# Company or product name inferred from the landing page.
|
|
272
|
+
company_name:,
|
|
273
|
+
# Specific operating field, product category, or market.
|
|
274
|
+
field:,
|
|
275
|
+
# One-sentence description of what the target company sells and who it serves.
|
|
276
|
+
field_description:,
|
|
277
|
+
# Resolved URL used for the landing page analysis.
|
|
278
|
+
website_url:
|
|
279
|
+
)
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
sig do
|
|
283
|
+
override.returns(
|
|
284
|
+
{
|
|
285
|
+
company_name: String,
|
|
286
|
+
field: String,
|
|
287
|
+
field_description: String,
|
|
288
|
+
website_url: String
|
|
289
|
+
}
|
|
290
|
+
)
|
|
291
|
+
end
|
|
292
|
+
def to_hash
|
|
293
|
+
end
|
|
294
|
+
end
|
|
295
|
+
end
|
|
296
|
+
end
|
|
297
|
+
end
|
|
@@ -22,12 +22,12 @@ module ContextDev
|
|
|
22
22
|
sig { returns(String) }
|
|
23
23
|
attr_accessor :url
|
|
24
24
|
|
|
25
|
-
# When true
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
#
|
|
25
|
+
# When true, every returned value must be grounded in facts stated on the page;
|
|
26
|
+
# fields that cannot be supported by the page are returned as null/empty. When
|
|
27
|
+
# false (default), the model may make reasonable inferences and derivations from
|
|
28
|
+
# the page content (e.g. ideal customer, competitor analysis, recommendations)
|
|
29
|
+
# while keeping verifiable specifics (names, quotes, URLs, dates, metrics)
|
|
30
|
+
# faithful to the source.
|
|
31
31
|
sig { returns(T.nilable(T::Boolean)) }
|
|
32
32
|
attr_reader :fact_check
|
|
33
33
|
|
|
@@ -57,7 +57,7 @@ module ContextDev
|
|
|
57
57
|
attr_writer :instructions
|
|
58
58
|
|
|
59
59
|
# Return cached scrape results if a prior scrape for the same parameters is
|
|
60
|
-
# younger than this many milliseconds.
|
|
60
|
+
# younger than this many milliseconds. Defaults to 7 days (604800000 ms).
|
|
61
61
|
sig { returns(T.nilable(Integer)) }
|
|
62
62
|
attr_reader :max_age_ms
|
|
63
63
|
|
|
@@ -118,12 +118,12 @@ module ContextDev
|
|
|
118
118
|
# The starting website URL to crawl and extract from. Must include http:// or
|
|
119
119
|
# https://.
|
|
120
120
|
url:,
|
|
121
|
-
# When true
|
|
122
|
-
#
|
|
123
|
-
#
|
|
124
|
-
#
|
|
125
|
-
#
|
|
126
|
-
#
|
|
121
|
+
# When true, every returned value must be grounded in facts stated on the page;
|
|
122
|
+
# fields that cannot be supported by the page are returned as null/empty. When
|
|
123
|
+
# false (default), the model may make reasonable inferences and derivations from
|
|
124
|
+
# the page content (e.g. ideal customer, competitor analysis, recommendations)
|
|
125
|
+
# while keeping verifiable specifics (names, quotes, URLs, dates, metrics)
|
|
126
|
+
# faithful to the source.
|
|
127
127
|
fact_check: nil,
|
|
128
128
|
# When true, follow links on subdomains of the starting URL's domain.
|
|
129
129
|
follow_subdomains: nil,
|
|
@@ -133,7 +133,7 @@ module ContextDev
|
|
|
133
133
|
# interpret fields in the schema.
|
|
134
134
|
instructions: nil,
|
|
135
135
|
# Return cached scrape results if a prior scrape for the same parameters is
|
|
136
|
-
# younger than this many milliseconds.
|
|
136
|
+
# younger than this many milliseconds. Defaults to 7 days (604800000 ms).
|
|
137
137
|
max_age_ms: nil,
|
|
138
138
|
pdf: nil,
|
|
139
139
|
# Soft time budget for the crawl in milliseconds.
|
data/rbi/context_dev/models.rbi
CHANGED
|
@@ -32,6 +32,8 @@ module ContextDev
|
|
|
32
32
|
|
|
33
33
|
UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams
|
|
34
34
|
|
|
35
|
+
WebExtractCompetitorsParams = ContextDev::Models::WebExtractCompetitorsParams
|
|
36
|
+
|
|
35
37
|
WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams
|
|
36
38
|
|
|
37
39
|
WebExtractParams = ContextDev::Models::WebExtractParams
|
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Resources
|
|
5
5
|
class Web
|
|
6
|
-
# Crawl a website,
|
|
7
|
-
#
|
|
8
|
-
# response data object. This endpoint does not accept targeted page-type
|
|
9
|
-
# selection.
|
|
6
|
+
# Crawl a website, use the provided JSON Schema and instructions to prioritize
|
|
7
|
+
# relevant internal links, and extract structured data from the selected pages.
|
|
10
8
|
sig do
|
|
11
9
|
params(
|
|
12
10
|
schema: T::Hash[Symbol, T.anything],
|
|
@@ -31,12 +29,12 @@ module ContextDev
|
|
|
31
29
|
# The starting website URL to crawl and extract from. Must include http:// or
|
|
32
30
|
# https://.
|
|
33
31
|
url:,
|
|
34
|
-
# When true
|
|
35
|
-
#
|
|
36
|
-
#
|
|
37
|
-
#
|
|
38
|
-
#
|
|
39
|
-
#
|
|
32
|
+
# When true, every returned value must be grounded in facts stated on the page;
|
|
33
|
+
# fields that cannot be supported by the page are returned as null/empty. When
|
|
34
|
+
# false (default), the model may make reasonable inferences and derivations from
|
|
35
|
+
# the page content (e.g. ideal customer, competitor analysis, recommendations)
|
|
36
|
+
# while keeping verifiable specifics (names, quotes, URLs, dates, metrics)
|
|
37
|
+
# faithful to the source.
|
|
40
38
|
fact_check: nil,
|
|
41
39
|
# When true, follow links on subdomains of the starting URL's domain.
|
|
42
40
|
follow_subdomains: nil,
|
|
@@ -46,7 +44,7 @@ module ContextDev
|
|
|
46
44
|
# interpret fields in the schema.
|
|
47
45
|
instructions: nil,
|
|
48
46
|
# Return cached scrape results if a prior scrape for the same parameters is
|
|
49
|
-
# younger than this many milliseconds.
|
|
47
|
+
# younger than this many milliseconds. Defaults to 7 days (604800000 ms).
|
|
50
48
|
max_age_ms: nil,
|
|
51
49
|
pdf: nil,
|
|
52
50
|
# Soft time budget for the crawl in milliseconds.
|
|
@@ -62,6 +60,30 @@ module ContextDev
|
|
|
62
60
|
)
|
|
63
61
|
end
|
|
64
62
|
|
|
63
|
+
# Analyze a company's landing page and web search evidence to return direct
|
|
64
|
+
# competitors for the same product or market.
|
|
65
|
+
sig do
|
|
66
|
+
params(
|
|
67
|
+
domain: String,
|
|
68
|
+
num_competitors: Integer,
|
|
69
|
+
timeout_ms: Integer,
|
|
70
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
71
|
+
).returns(ContextDev::Models::WebExtractCompetitorsResponse)
|
|
72
|
+
end
|
|
73
|
+
def extract_competitors(
|
|
74
|
+
# Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
|
|
75
|
+
# and normalized to their domain.
|
|
76
|
+
domain:,
|
|
77
|
+
# Exact number of direct competitors to return. Defaults to 5.
|
|
78
|
+
num_competitors: nil,
|
|
79
|
+
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
80
|
+
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
81
|
+
# value is 300000ms (5 minutes).
|
|
82
|
+
timeout_ms: nil,
|
|
83
|
+
request_options: {}
|
|
84
|
+
)
|
|
85
|
+
end
|
|
86
|
+
|
|
65
87
|
# Scrape font information from a website including font families, usage
|
|
66
88
|
# statistics, fallbacks, and element/word counts.
|
|
67
89
|
sig do
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
module ContextDev
|
|
2
|
+
module Models
|
|
3
|
+
type web_extract_competitors_params =
|
|
4
|
+
{ domain: String, num_competitors: Integer, timeout_ms: Integer }
|
|
5
|
+
& ContextDev::Internal::Type::request_parameters
|
|
6
|
+
|
|
7
|
+
class WebExtractCompetitorsParams < ContextDev::Internal::Type::BaseModel
|
|
8
|
+
extend ContextDev::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include ContextDev::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
attr_accessor domain: String
|
|
12
|
+
|
|
13
|
+
attr_reader num_competitors: Integer?
|
|
14
|
+
|
|
15
|
+
def num_competitors=: (Integer) -> Integer
|
|
16
|
+
|
|
17
|
+
attr_reader timeout_ms: Integer?
|
|
18
|
+
|
|
19
|
+
def timeout_ms=: (Integer) -> Integer
|
|
20
|
+
|
|
21
|
+
def initialize: (
|
|
22
|
+
domain: String,
|
|
23
|
+
?num_competitors: Integer,
|
|
24
|
+
?timeout_ms: Integer,
|
|
25
|
+
?request_options: ContextDev::request_opts
|
|
26
|
+
) -> void
|
|
27
|
+
|
|
28
|
+
def to_hash: -> {
|
|
29
|
+
domain: String,
|
|
30
|
+
num_competitors: Integer,
|
|
31
|
+
timeout_ms: Integer,
|
|
32
|
+
request_options: ContextDev::RequestOptions
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
module ContextDev
|
|
2
|
+
module Models
|
|
3
|
+
type web_extract_competitors_response =
|
|
4
|
+
{
|
|
5
|
+
competitors: ::Array[ContextDev::Models::WebExtractCompetitorsResponse::Competitor],
|
|
6
|
+
domain: String,
|
|
7
|
+
status: ContextDev::Models::WebExtractCompetitorsResponse::status,
|
|
8
|
+
target: ContextDev::Models::WebExtractCompetitorsResponse::Target
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
class WebExtractCompetitorsResponse < ContextDev::Internal::Type::BaseModel
|
|
12
|
+
attr_accessor competitors: ::Array[ContextDev::Models::WebExtractCompetitorsResponse::Competitor]
|
|
13
|
+
|
|
14
|
+
attr_accessor domain: String
|
|
15
|
+
|
|
16
|
+
attr_accessor status: ContextDev::Models::WebExtractCompetitorsResponse::status
|
|
17
|
+
|
|
18
|
+
attr_accessor target: ContextDev::Models::WebExtractCompetitorsResponse::Target
|
|
19
|
+
|
|
20
|
+
def initialize: (
|
|
21
|
+
competitors: ::Array[ContextDev::Models::WebExtractCompetitorsResponse::Competitor],
|
|
22
|
+
domain: String,
|
|
23
|
+
status: ContextDev::Models::WebExtractCompetitorsResponse::status,
|
|
24
|
+
target: ContextDev::Models::WebExtractCompetitorsResponse::Target
|
|
25
|
+
) -> void
|
|
26
|
+
|
|
27
|
+
def to_hash: -> {
|
|
28
|
+
competitors: ::Array[ContextDev::Models::WebExtractCompetitorsResponse::Competitor],
|
|
29
|
+
domain: String,
|
|
30
|
+
status: ContextDev::Models::WebExtractCompetitorsResponse::status,
|
|
31
|
+
target: ContextDev::Models::WebExtractCompetitorsResponse::Target
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
type competitor =
|
|
35
|
+
{
|
|
36
|
+
confidence: ContextDev::Models::WebExtractCompetitorsResponse::Competitor::confidence,
|
|
37
|
+
description: String,
|
|
38
|
+
domain: String,
|
|
39
|
+
name: String,
|
|
40
|
+
source_urls: ::Array[String],
|
|
41
|
+
url: String
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
class Competitor < ContextDev::Internal::Type::BaseModel
|
|
45
|
+
attr_accessor confidence: ContextDev::Models::WebExtractCompetitorsResponse::Competitor::confidence
|
|
46
|
+
|
|
47
|
+
attr_accessor description: String
|
|
48
|
+
|
|
49
|
+
attr_accessor domain: String
|
|
50
|
+
|
|
51
|
+
attr_accessor name: String
|
|
52
|
+
|
|
53
|
+
attr_accessor source_urls: ::Array[String]
|
|
54
|
+
|
|
55
|
+
attr_accessor url: String
|
|
56
|
+
|
|
57
|
+
def initialize: (
|
|
58
|
+
confidence: ContextDev::Models::WebExtractCompetitorsResponse::Competitor::confidence,
|
|
59
|
+
description: String,
|
|
60
|
+
domain: String,
|
|
61
|
+
name: String,
|
|
62
|
+
source_urls: ::Array[String],
|
|
63
|
+
url: String
|
|
64
|
+
) -> void
|
|
65
|
+
|
|
66
|
+
def to_hash: -> {
|
|
67
|
+
confidence: ContextDev::Models::WebExtractCompetitorsResponse::Competitor::confidence,
|
|
68
|
+
description: String,
|
|
69
|
+
domain: String,
|
|
70
|
+
name: String,
|
|
71
|
+
source_urls: ::Array[String],
|
|
72
|
+
url: String
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
type confidence = :high | :medium
|
|
76
|
+
|
|
77
|
+
module Confidence
|
|
78
|
+
extend ContextDev::Internal::Type::Enum
|
|
79
|
+
|
|
80
|
+
HIGH: :high
|
|
81
|
+
MEDIUM: :medium
|
|
82
|
+
|
|
83
|
+
def self?.values: -> ::Array[ContextDev::Models::WebExtractCompetitorsResponse::Competitor::confidence]
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
type status = :ok
|
|
88
|
+
|
|
89
|
+
module Status
|
|
90
|
+
extend ContextDev::Internal::Type::Enum
|
|
91
|
+
|
|
92
|
+
OK: :ok
|
|
93
|
+
|
|
94
|
+
def self?.values: -> ::Array[ContextDev::Models::WebExtractCompetitorsResponse::status]
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
type target =
|
|
98
|
+
{
|
|
99
|
+
company_name: String,
|
|
100
|
+
field: String,
|
|
101
|
+
field_description: String,
|
|
102
|
+
website_url: String
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
class Target < ContextDev::Internal::Type::BaseModel
|
|
106
|
+
attr_accessor company_name: String
|
|
107
|
+
|
|
108
|
+
attr_accessor field: String
|
|
109
|
+
|
|
110
|
+
attr_accessor field_description: String
|
|
111
|
+
|
|
112
|
+
attr_accessor website_url: String
|
|
113
|
+
|
|
114
|
+
def initialize: (
|
|
115
|
+
company_name: String,
|
|
116
|
+
field: String,
|
|
117
|
+
field_description: String,
|
|
118
|
+
website_url: String
|
|
119
|
+
) -> void
|
|
120
|
+
|
|
121
|
+
def to_hash: -> {
|
|
122
|
+
company_name: String,
|
|
123
|
+
field: String,
|
|
124
|
+
field_description: String,
|
|
125
|
+
website_url: String
|
|
126
|
+
}
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
end
|
data/sig/context_dev/models.rbs
CHANGED
|
@@ -27,6 +27,8 @@ module ContextDev
|
|
|
27
27
|
|
|
28
28
|
class UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams
|
|
29
29
|
|
|
30
|
+
class WebExtractCompetitorsParams = ContextDev::Models::WebExtractCompetitorsParams
|
|
31
|
+
|
|
30
32
|
class WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams
|
|
31
33
|
|
|
32
34
|
class WebExtractParams = ContextDev::Models::WebExtractParams
|
|
@@ -16,6 +16,13 @@ module ContextDev
|
|
|
16
16
|
?request_options: ContextDev::request_opts
|
|
17
17
|
) -> ContextDev::Models::WebExtractResponse
|
|
18
18
|
|
|
19
|
+
def extract_competitors: (
|
|
20
|
+
domain: String,
|
|
21
|
+
?num_competitors: Integer,
|
|
22
|
+
?timeout_ms: Integer,
|
|
23
|
+
?request_options: ContextDev::request_opts
|
|
24
|
+
) -> ContextDev::Models::WebExtractCompetitorsResponse
|
|
25
|
+
|
|
19
26
|
def extract_fonts: (
|
|
20
27
|
?direct_url: String,
|
|
21
28
|
?domain: String,
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: context.dev
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.27.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Context Dev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-06-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|
|
@@ -97,6 +97,8 @@ files:
|
|
|
97
97
|
- lib/context_dev/models/utility_prefetch_by_email_response.rb
|
|
98
98
|
- lib/context_dev/models/utility_prefetch_params.rb
|
|
99
99
|
- lib/context_dev/models/utility_prefetch_response.rb
|
|
100
|
+
- lib/context_dev/models/web_extract_competitors_params.rb
|
|
101
|
+
- lib/context_dev/models/web_extract_competitors_response.rb
|
|
100
102
|
- lib/context_dev/models/web_extract_fonts_params.rb
|
|
101
103
|
- lib/context_dev/models/web_extract_fonts_response.rb
|
|
102
104
|
- lib/context_dev/models/web_extract_params.rb
|
|
@@ -172,6 +174,8 @@ files:
|
|
|
172
174
|
- rbi/context_dev/models/utility_prefetch_by_email_response.rbi
|
|
173
175
|
- rbi/context_dev/models/utility_prefetch_params.rbi
|
|
174
176
|
- rbi/context_dev/models/utility_prefetch_response.rbi
|
|
177
|
+
- rbi/context_dev/models/web_extract_competitors_params.rbi
|
|
178
|
+
- rbi/context_dev/models/web_extract_competitors_response.rbi
|
|
175
179
|
- rbi/context_dev/models/web_extract_fonts_params.rbi
|
|
176
180
|
- rbi/context_dev/models/web_extract_fonts_response.rbi
|
|
177
181
|
- rbi/context_dev/models/web_extract_params.rbi
|
|
@@ -246,6 +250,8 @@ files:
|
|
|
246
250
|
- sig/context_dev/models/utility_prefetch_by_email_response.rbs
|
|
247
251
|
- sig/context_dev/models/utility_prefetch_params.rbs
|
|
248
252
|
- sig/context_dev/models/utility_prefetch_response.rbs
|
|
253
|
+
- sig/context_dev/models/web_extract_competitors_params.rbs
|
|
254
|
+
- sig/context_dev/models/web_extract_competitors_response.rbs
|
|
249
255
|
- sig/context_dev/models/web_extract_fonts_params.rbs
|
|
250
256
|
- sig/context_dev/models/web_extract_fonts_response.rbs
|
|
251
257
|
- sig/context_dev/models/web_extract_params.rbs
|