context.dev 0.4.0 → 1.1.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 +27 -0
- data/README.md +1 -1
- data/lib/context_dev/internal/util.rb +1 -2
- data/lib/context_dev/models/web_web_scrape_images_response.rb +4 -0
- data/lib/context_dev/models/web_web_scrape_md_params.rb +10 -1
- data/lib/context_dev/resources/web.rb +8 -7
- data/lib/context_dev/version.rb +1 -1
- data/rbi/context_dev/models/web_web_scrape_images_response.rbi +20 -0
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +13 -0
- data/rbi/context_dev/resources/web.rbi +7 -5
- data/sig/context_dev/models/web_web_scrape_images_response.rbs +14 -1
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +8 -1
- data/sig/context_dev/resources/web.rbs +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 992781edb281733a62362aae314841eadb371c812bb605b62d95753e8dd98b66
|
|
4
|
+
data.tar.gz: 99bfe0d4870306b6d341e7fd305bb263ddb1d7daefce0fde7700b8ea2f2c313a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a8e792e0e07285853aac66b6d7e2643a38d8e832c68e56e29f52367081710386db7e8a6422241ae87b0e0f75796523f3f151b611889110c6ea3503b33d05c3c9
|
|
7
|
+
data.tar.gz: 475f8211124320e8e80cdebd5b5e28b1a575308ec021622fbc98604f547070c9f8c23b6a994468e1aa5db4dd747842bdeb5f307f26f3f4125bd49238b5a7b8b7
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.0 (2026-03-28)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.0.0...v1.1.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.0.0...v1.1.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([9ae9b10](https://github.com/context-dot-dev/context-ruby-sdk/commit/9ae9b108ce2737b42574a6f781103410a546f704))
|
|
10
|
+
* **api:** api update ([58ed755](https://github.com/context-dot-dev/context-ruby-sdk/commit/58ed7551637936ea3c007e28af3358eb96a339ca))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **internal:** correct multipart form field name encoding ([221d059](https://github.com/context-dot-dev/context-ruby-sdk/commit/221d0598148243acddae6c9679c949c07e1dcd7a))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Chores
|
|
19
|
+
|
|
20
|
+
* **ci:** support opting out of skipping builds on metadata-only commits ([aad82ac](https://github.com/context-dot-dev/context-ruby-sdk/commit/aad82ac90dd1c55ca4db05e63b70b46abded53e3))
|
|
21
|
+
|
|
22
|
+
## 1.0.0 (2026-03-25)
|
|
23
|
+
|
|
24
|
+
Full Changelog: [v0.4.0...v1.0.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v0.4.0...v1.0.0)
|
|
25
|
+
|
|
26
|
+
### Features
|
|
27
|
+
|
|
28
|
+
* **api:** api update ([4767618](https://github.com/context-dot-dev/context-ruby-sdk/commit/4767618765a8f15bde582bf35f78190649681453))
|
|
29
|
+
|
|
3
30
|
## 0.4.0 (2026-03-25)
|
|
4
31
|
|
|
5
32
|
Full Changelog: [v0.3.0...v0.4.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v0.3.0...v0.4.0)
|
data/README.md
CHANGED
|
@@ -32,7 +32,14 @@ module ContextDev
|
|
|
32
32
|
# @return [Boolean, nil]
|
|
33
33
|
optional :shorten_base64_images, ContextDev::Internal::Type::Boolean
|
|
34
34
|
|
|
35
|
-
# @!
|
|
35
|
+
# @!attribute use_main_content_only
|
|
36
|
+
# Extract only the main content of the page, excluding headers, footers, sidebars,
|
|
37
|
+
# and navigation
|
|
38
|
+
#
|
|
39
|
+
# @return [Boolean, nil]
|
|
40
|
+
optional :use_main_content_only, ContextDev::Internal::Type::Boolean
|
|
41
|
+
|
|
42
|
+
# @!method initialize(url:, include_images: nil, include_links: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {})
|
|
36
43
|
# Some parameter documentations has been truncated, see
|
|
37
44
|
# {ContextDev::Models::WebWebScrapeMdParams} for more details.
|
|
38
45
|
#
|
|
@@ -44,6 +51,8 @@ module ContextDev
|
|
|
44
51
|
#
|
|
45
52
|
# @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output
|
|
46
53
|
#
|
|
54
|
+
# @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars,
|
|
55
|
+
#
|
|
47
56
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
|
|
48
57
|
end
|
|
49
58
|
end
|
|
@@ -38,8 +38,7 @@ module ContextDev
|
|
|
38
38
|
)
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
# Scrapes the given URL and returns the raw HTML content of the page.
|
|
42
|
-
# automatic proxy escalation to handle blocked sites.
|
|
41
|
+
# Scrapes the given URL and returns the raw HTML content of the page.
|
|
43
42
|
#
|
|
44
43
|
# @overload web_scrape_html(url:, request_options: {})
|
|
45
44
|
#
|
|
@@ -90,11 +89,10 @@ module ContextDev
|
|
|
90
89
|
# Some parameter documentations has been truncated, see
|
|
91
90
|
# {ContextDev::Models::WebWebScrapeMdParams} for more details.
|
|
92
91
|
#
|
|
93
|
-
# Scrapes the given URL, converts the HTML content to
|
|
94
|
-
#
|
|
95
|
-
# sites.
|
|
92
|
+
# Scrapes the given URL, converts the HTML content to Markdown, and returns the
|
|
93
|
+
# result.
|
|
96
94
|
#
|
|
97
|
-
# @overload web_scrape_md(url:, include_images: nil, include_links: nil, shorten_base64_images: nil, request_options: {})
|
|
95
|
+
# @overload web_scrape_md(url:, include_images: nil, include_links: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {})
|
|
98
96
|
#
|
|
99
97
|
# @param url [String] Full URL to scrape and convert to markdown (must include http:// or https:// pro
|
|
100
98
|
#
|
|
@@ -104,6 +102,8 @@ module ContextDev
|
|
|
104
102
|
#
|
|
105
103
|
# @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output
|
|
106
104
|
#
|
|
105
|
+
# @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars,
|
|
106
|
+
#
|
|
107
107
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
108
108
|
#
|
|
109
109
|
# @return [ContextDev::Models::WebWebScrapeMdResponse]
|
|
@@ -118,7 +118,8 @@ module ContextDev
|
|
|
118
118
|
query: query.transform_keys(
|
|
119
119
|
include_images: "includeImages",
|
|
120
120
|
include_links: "includeLinks",
|
|
121
|
-
shorten_base64_images: "shortenBase64Images"
|
|
121
|
+
shorten_base64_images: "shortenBase64Images",
|
|
122
|
+
use_main_content_only: "useMainContentOnly"
|
|
122
123
|
),
|
|
123
124
|
model: ContextDev::Models::WebWebScrapeMdResponse,
|
|
124
125
|
options: options
|
data/lib/context_dev/version.rb
CHANGED
|
@@ -172,6 +172,26 @@ module ContextDev
|
|
|
172
172
|
:video,
|
|
173
173
|
ContextDev::Models::WebWebScrapeImagesResponse::Image::Element::TaggedSymbol
|
|
174
174
|
)
|
|
175
|
+
CSS =
|
|
176
|
+
T.let(
|
|
177
|
+
:css,
|
|
178
|
+
ContextDev::Models::WebWebScrapeImagesResponse::Image::Element::TaggedSymbol
|
|
179
|
+
)
|
|
180
|
+
OBJECT =
|
|
181
|
+
T.let(
|
|
182
|
+
:object,
|
|
183
|
+
ContextDev::Models::WebWebScrapeImagesResponse::Image::Element::TaggedSymbol
|
|
184
|
+
)
|
|
185
|
+
META =
|
|
186
|
+
T.let(
|
|
187
|
+
:meta,
|
|
188
|
+
ContextDev::Models::WebWebScrapeImagesResponse::Image::Element::TaggedSymbol
|
|
189
|
+
)
|
|
190
|
+
BACKGROUND =
|
|
191
|
+
T.let(
|
|
192
|
+
:background,
|
|
193
|
+
ContextDev::Models::WebWebScrapeImagesResponse::Image::Element::TaggedSymbol
|
|
194
|
+
)
|
|
175
195
|
|
|
176
196
|
sig do
|
|
177
197
|
override.returns(
|
|
@@ -37,12 +37,21 @@ module ContextDev
|
|
|
37
37
|
sig { params(shorten_base64_images: T::Boolean).void }
|
|
38
38
|
attr_writer :shorten_base64_images
|
|
39
39
|
|
|
40
|
+
# Extract only the main content of the page, excluding headers, footers, sidebars,
|
|
41
|
+
# and navigation
|
|
42
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
43
|
+
attr_reader :use_main_content_only
|
|
44
|
+
|
|
45
|
+
sig { params(use_main_content_only: T::Boolean).void }
|
|
46
|
+
attr_writer :use_main_content_only
|
|
47
|
+
|
|
40
48
|
sig do
|
|
41
49
|
params(
|
|
42
50
|
url: String,
|
|
43
51
|
include_images: T::Boolean,
|
|
44
52
|
include_links: T::Boolean,
|
|
45
53
|
shorten_base64_images: T::Boolean,
|
|
54
|
+
use_main_content_only: T::Boolean,
|
|
46
55
|
request_options: ContextDev::RequestOptions::OrHash
|
|
47
56
|
).returns(T.attached_class)
|
|
48
57
|
end
|
|
@@ -56,6 +65,9 @@ module ContextDev
|
|
|
56
65
|
include_links: nil,
|
|
57
66
|
# Shorten base64-encoded image data in the Markdown output
|
|
58
67
|
shorten_base64_images: nil,
|
|
68
|
+
# Extract only the main content of the page, excluding headers, footers, sidebars,
|
|
69
|
+
# and navigation
|
|
70
|
+
use_main_content_only: nil,
|
|
59
71
|
request_options: {}
|
|
60
72
|
)
|
|
61
73
|
end
|
|
@@ -67,6 +79,7 @@ module ContextDev
|
|
|
67
79
|
include_images: T::Boolean,
|
|
68
80
|
include_links: T::Boolean,
|
|
69
81
|
shorten_base64_images: T::Boolean,
|
|
82
|
+
use_main_content_only: T::Boolean,
|
|
70
83
|
request_options: ContextDev::RequestOptions
|
|
71
84
|
}
|
|
72
85
|
)
|
|
@@ -38,8 +38,7 @@ module ContextDev
|
|
|
38
38
|
)
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
# Scrapes the given URL and returns the raw HTML content of the page.
|
|
42
|
-
# automatic proxy escalation to handle blocked sites.
|
|
41
|
+
# Scrapes the given URL and returns the raw HTML content of the page.
|
|
43
42
|
sig do
|
|
44
43
|
params(
|
|
45
44
|
url: String,
|
|
@@ -69,15 +68,15 @@ module ContextDev
|
|
|
69
68
|
)
|
|
70
69
|
end
|
|
71
70
|
|
|
72
|
-
# Scrapes the given URL, converts the HTML content to
|
|
73
|
-
#
|
|
74
|
-
# sites.
|
|
71
|
+
# Scrapes the given URL, converts the HTML content to Markdown, and returns the
|
|
72
|
+
# result.
|
|
75
73
|
sig do
|
|
76
74
|
params(
|
|
77
75
|
url: String,
|
|
78
76
|
include_images: T::Boolean,
|
|
79
77
|
include_links: T::Boolean,
|
|
80
78
|
shorten_base64_images: T::Boolean,
|
|
79
|
+
use_main_content_only: T::Boolean,
|
|
81
80
|
request_options: ContextDev::RequestOptions::OrHash
|
|
82
81
|
).returns(ContextDev::Models::WebWebScrapeMdResponse)
|
|
83
82
|
end
|
|
@@ -91,6 +90,9 @@ module ContextDev
|
|
|
91
90
|
include_links: nil,
|
|
92
91
|
# Shorten base64-encoded image data in the Markdown output
|
|
93
92
|
shorten_base64_images: nil,
|
|
93
|
+
# Extract only the main content of the page, excluding headers, footers, sidebars,
|
|
94
|
+
# and navigation
|
|
95
|
+
use_main_content_only: nil,
|
|
94
96
|
request_options: {}
|
|
95
97
|
)
|
|
96
98
|
end
|
|
@@ -57,7 +57,16 @@ module ContextDev
|
|
|
57
57
|
type: ContextDev::Models::WebWebScrapeImagesResponse::Image::type_
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
type element =
|
|
60
|
+
type element =
|
|
61
|
+
:img
|
|
62
|
+
| :svg
|
|
63
|
+
| :link
|
|
64
|
+
| :source
|
|
65
|
+
| :video
|
|
66
|
+
| :css
|
|
67
|
+
| :object
|
|
68
|
+
| :meta
|
|
69
|
+
| :background
|
|
61
70
|
|
|
62
71
|
module Element
|
|
63
72
|
extend ContextDev::Internal::Type::Enum
|
|
@@ -67,6 +76,10 @@ module ContextDev
|
|
|
67
76
|
LINK: :link
|
|
68
77
|
SOURCE: :source
|
|
69
78
|
VIDEO: :video
|
|
79
|
+
CSS: :css
|
|
80
|
+
OBJECT: :object
|
|
81
|
+
META: :meta
|
|
82
|
+
BACKGROUND: :background
|
|
70
83
|
|
|
71
84
|
def self?.values: -> ::Array[ContextDev::Models::WebWebScrapeImagesResponse::Image::element]
|
|
72
85
|
end
|
|
@@ -5,7 +5,8 @@ module ContextDev
|
|
|
5
5
|
url: String,
|
|
6
6
|
include_images: bool,
|
|
7
7
|
include_links: bool,
|
|
8
|
-
:shorten_base64_images => bool
|
|
8
|
+
:shorten_base64_images => bool,
|
|
9
|
+
use_main_content_only: bool
|
|
9
10
|
}
|
|
10
11
|
& ContextDev::Internal::Type::request_parameters
|
|
11
12
|
|
|
@@ -27,11 +28,16 @@ module ContextDev
|
|
|
27
28
|
|
|
28
29
|
def shorten_base64_images=: (bool) -> bool
|
|
29
30
|
|
|
31
|
+
attr_reader use_main_content_only: bool?
|
|
32
|
+
|
|
33
|
+
def use_main_content_only=: (bool) -> bool
|
|
34
|
+
|
|
30
35
|
def initialize: (
|
|
31
36
|
url: String,
|
|
32
37
|
?include_images: bool,
|
|
33
38
|
?include_links: bool,
|
|
34
39
|
?shorten_base64_images: bool,
|
|
40
|
+
?use_main_content_only: bool,
|
|
35
41
|
?request_options: ContextDev::request_opts
|
|
36
42
|
) -> void
|
|
37
43
|
|
|
@@ -40,6 +46,7 @@ module ContextDev
|
|
|
40
46
|
include_images: bool,
|
|
41
47
|
include_links: bool,
|
|
42
48
|
:shorten_base64_images => bool,
|
|
49
|
+
use_main_content_only: bool,
|
|
43
50
|
request_options: ContextDev::RequestOptions
|
|
44
51
|
}
|
|
45
52
|
end
|
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:
|
|
4
|
+
version: 1.1.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-03-
|
|
11
|
+
date: 2026-03-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|