Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/context.dev-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: |-
github.repository == 'stainless-sdks/context.dev-ruby' &&
(github.event_name == 'push' || github.event.pull_request.head.repo.fork) &&
(github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
(github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.0.0"
".": "1.1.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 20
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-ea89aeedfdd75f71542bcbb53880ecbc07f2656945d9ac8dce55d7bdabc5f8cc.yml
openapi_spec_hash: c4dd62c3a3dc8c59a050fb6a76ab5f1b
config_hash: 91976f3284e20f47fdb0256e128536cd
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-2ddb6d73ec8831eee4cb4352b85843a1f6f444e48d8be837cfcd118eddd2a63e.yml
openapi_spec_hash: 1163122fba27e56fa5879bc98d32ee14
config_hash: 38268bb88fc4dcbb8f2f94dd138b5910
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 1.1.0 (2026-03-28)

Full Changelog: [v1.0.0...v1.1.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.0.0...v1.1.0)

### Features

* **api:** api update ([9ae9b10](https://github.com/context-dot-dev/context-ruby-sdk/commit/9ae9b108ce2737b42574a6f781103410a546f704))
* **api:** api update ([58ed755](https://github.com/context-dot-dev/context-ruby-sdk/commit/58ed7551637936ea3c007e28af3358eb96a339ca))


### Bug Fixes

* **internal:** correct multipart form field name encoding ([221d059](https://github.com/context-dot-dev/context-ruby-sdk/commit/221d0598148243acddae6c9679c949c07e1dcd7a))


### Chores

* **ci:** support opting out of skipping builds on metadata-only commits ([aad82ac](https://github.com/context-dot-dev/context-ruby-sdk/commit/aad82ac90dd1c55ca4db05e63b70b46abded53e3))

## 1.0.0 (2026-03-25)

Full Changelog: [v0.4.0...v1.0.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v0.4.0...v1.0.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
context.dev (1.0.0)
context.dev (1.1.0)
cgi
connection_pool

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "context.dev", "~> 1.0.0"
gem "context.dev", "~> 1.1.0"
```

<!-- x-release-please-end -->
Expand Down
3 changes: 1 addition & 2 deletions lib/context_dev/internal/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,7 @@ def encode_query_params(query)
y << "Content-Disposition: form-data"

unless key.nil?
name = ERB::Util.url_encode(key.to_s)
y << "; name=\"#{name}\""
y << "; name=\"#{key}\""
end

case val
Expand Down
4 changes: 4 additions & 0 deletions lib/context_dev/models/web_web_scrape_images_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ module Element
LINK = :link
SOURCE = :source
VIDEO = :video
CSS = :css
OBJECT = :object
META = :meta
BACKGROUND = :background

# @!method self.values
# @return [Array<Symbol>]
Expand Down
11 changes: 10 additions & 1 deletion lib/context_dev/models/web_web_scrape_md_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel
# @return [Boolean, nil]
optional :shorten_base64_images, ContextDev::Internal::Type::Boolean

# @!method initialize(url:, include_images: nil, include_links: nil, shorten_base64_images: nil, request_options: {})
# @!attribute use_main_content_only
# Extract only the main content of the page, excluding headers, footers, sidebars,
# and navigation
#
# @return [Boolean, nil]
optional :use_main_content_only, ContextDev::Internal::Type::Boolean

# @!method initialize(url:, include_images: nil, include_links: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {ContextDev::Models::WebWebScrapeMdParams} for more details.
#
Expand All @@ -44,6 +51,8 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel
#
# @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output
#
# @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars,
#
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
7 changes: 5 additions & 2 deletions lib/context_dev/resources/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def web_scrape_images(params)
# Scrapes the given URL, converts the HTML content to Markdown, and returns the
# result.
#
# @overload web_scrape_md(url:, include_images: nil, include_links: nil, shorten_base64_images: nil, request_options: {})
# @overload web_scrape_md(url:, include_images: nil, include_links: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {})
#
# @param url [String] Full URL to scrape and convert to markdown (must include http:// or https:// pro
#
Expand All @@ -102,6 +102,8 @@ def web_scrape_images(params)
#
# @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output
#
# @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars,
#
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
#
# @return [ContextDev::Models::WebWebScrapeMdResponse]
Expand All @@ -116,7 +118,8 @@ def web_scrape_md(params)
query: query.transform_keys(
include_images: "includeImages",
include_links: "includeLinks",
shorten_base64_images: "shortenBase64Images"
shorten_base64_images: "shortenBase64Images",
use_main_content_only: "useMainContentOnly"
),
model: ContextDev::Models::WebWebScrapeMdResponse,
options: options
Expand Down
2 changes: 1 addition & 1 deletion lib/context_dev/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module ContextDev
VERSION = "1.0.0"
VERSION = "1.1.0"
end
20 changes: 20 additions & 0 deletions rbi/context_dev/models/web_web_scrape_images_response.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,26 @@ module ContextDev
:video,
ContextDev::Models::WebWebScrapeImagesResponse::Image::Element::TaggedSymbol
)
CSS =
T.let(
:css,
ContextDev::Models::WebWebScrapeImagesResponse::Image::Element::TaggedSymbol
)
OBJECT =
T.let(
:object,
ContextDev::Models::WebWebScrapeImagesResponse::Image::Element::TaggedSymbol
)
META =
T.let(
:meta,
ContextDev::Models::WebWebScrapeImagesResponse::Image::Element::TaggedSymbol
)
BACKGROUND =
T.let(
:background,
ContextDev::Models::WebWebScrapeImagesResponse::Image::Element::TaggedSymbol
)

sig do
override.returns(
Expand Down
13 changes: 13 additions & 0 deletions rbi/context_dev/models/web_web_scrape_md_params.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,21 @@ module ContextDev
sig { params(shorten_base64_images: T::Boolean).void }
attr_writer :shorten_base64_images

# Extract only the main content of the page, excluding headers, footers, sidebars,
# and navigation
sig { returns(T.nilable(T::Boolean)) }
attr_reader :use_main_content_only

sig { params(use_main_content_only: T::Boolean).void }
attr_writer :use_main_content_only

sig do
params(
url: String,
include_images: T::Boolean,
include_links: T::Boolean,
shorten_base64_images: T::Boolean,
use_main_content_only: T::Boolean,
request_options: ContextDev::RequestOptions::OrHash
).returns(T.attached_class)
end
Expand All @@ -56,6 +65,9 @@ module ContextDev
include_links: nil,
# Shorten base64-encoded image data in the Markdown output
shorten_base64_images: nil,
# Extract only the main content of the page, excluding headers, footers, sidebars,
# and navigation
use_main_content_only: nil,
request_options: {}
)
end
Expand All @@ -67,6 +79,7 @@ module ContextDev
include_images: T::Boolean,
include_links: T::Boolean,
shorten_base64_images: T::Boolean,
use_main_content_only: T::Boolean,
request_options: ContextDev::RequestOptions
}
)
Expand Down
4 changes: 4 additions & 0 deletions rbi/context_dev/resources/web.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ module ContextDev
include_images: T::Boolean,
include_links: T::Boolean,
shorten_base64_images: T::Boolean,
use_main_content_only: T::Boolean,
request_options: ContextDev::RequestOptions::OrHash
).returns(ContextDev::Models::WebWebScrapeMdResponse)
end
Expand All @@ -89,6 +90,9 @@ module ContextDev
include_links: nil,
# Shorten base64-encoded image data in the Markdown output
shorten_base64_images: nil,
# Extract only the main content of the page, excluding headers, footers, sidebars,
# and navigation
use_main_content_only: nil,
request_options: {}
)
end
Expand Down
15 changes: 14 additions & 1 deletion sig/context_dev/models/web_web_scrape_images_response.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,16 @@ module ContextDev
type: ContextDev::Models::WebWebScrapeImagesResponse::Image::type_
}

type element = :img | :svg | :link | :source | :video
type element =
:img
| :svg
| :link
| :source
| :video
| :css
| :object
| :meta
| :background

module Element
extend ContextDev::Internal::Type::Enum
Expand All @@ -67,6 +76,10 @@ module ContextDev
LINK: :link
SOURCE: :source
VIDEO: :video
CSS: :css
OBJECT: :object
META: :meta
BACKGROUND: :background

def self?.values: -> ::Array[ContextDev::Models::WebWebScrapeImagesResponse::Image::element]
end
Expand Down
9 changes: 8 additions & 1 deletion sig/context_dev/models/web_web_scrape_md_params.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ module ContextDev
url: String,
include_images: bool,
include_links: bool,
:shorten_base64_images => bool
:shorten_base64_images => bool,
use_main_content_only: bool
}
& ContextDev::Internal::Type::request_parameters

Expand All @@ -27,11 +28,16 @@ module ContextDev

def shorten_base64_images=: (bool) -> bool

attr_reader use_main_content_only: bool?

def use_main_content_only=: (bool) -> bool

def initialize: (
url: String,
?include_images: bool,
?include_links: bool,
?shorten_base64_images: bool,
?use_main_content_only: bool,
?request_options: ContextDev::request_opts
) -> void

Expand All @@ -40,6 +46,7 @@ module ContextDev
include_images: bool,
include_links: bool,
:shorten_base64_images => bool,
use_main_content_only: bool,
request_options: ContextDev::RequestOptions
}
end
Expand Down
1 change: 1 addition & 0 deletions sig/context_dev/resources/web.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module ContextDev
?include_images: bool,
?include_links: bool,
?shorten_base64_images: bool,
?use_main_content_only: bool,
?request_options: ContextDev::request_opts
) -> ContextDev::Models::WebWebScrapeMdResponse

Expand Down
Loading