Skip to content

Commit e2290f4

Browse files
author
stlc-bot
committed
fix(openapi): keep legacy batch inputs in the spec as deprecated (#2225)
feat(access-policies): limit which websites API requests can reach (#2213) feat(brand): support log-free brand and styleguide requests (#2231) fix(brand): keep metadata-only usage logs for ZDR brand requests (#2234) feat(monitors): add search target to watch the web for new developments (#2215) Stainless-Generated-From: fcd507f9d0293a17ce9fb57ef65666f8516a9da6
1 parent c31170c commit e2290f4

47 files changed

Lines changed: 2332 additions & 261 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎lib/context_dev/models/monitor_create_params.rb‎

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ class MonitorCreateParams < ContextDev::Internal::Type::BaseModel
1414
required :name, String
1515

1616
# @!attribute target
17-
# What to watch: a page, a sitemap, or data extracted from a site.
17+
# What to watch: a page, a sitemap, data extracted from a site, or web search
18+
# results.
1819
#
19-
# @return [ContextDev::Models::MonitorCreateParams::Target::Page, ContextDev::Models::MonitorCreateParams::Target::Sitemap, ContextDev::Models::MonitorCreateParams::Target::Extract]
20+
# @return [ContextDev::Models::MonitorCreateParams::Target::Page, ContextDev::Models::MonitorCreateParams::Target::Sitemap, ContextDev::Models::MonitorCreateParams::Target::Extract, ContextDev::Models::MonitorCreateParams::Target::Search]
2021
required :target, union: -> { ContextDev::MonitorCreateParams::Target }
2122

2223
# @!attribute change_detection
23-
# How changes are judged. Defaults to `semantic` for extract targets and page
24-
# targets with `instructions`, otherwise `exact`.
24+
# How changes are judged. Defaults to `semantic` for extract and search targets
25+
# and page targets with `instructions`, otherwise `exact`.
2526
#
2627
# @return [ContextDev::Models::MonitorCreateParams::ChangeDetection::Exact, ContextDev::Models::MonitorCreateParams::ChangeDetection::Semantic, nil]
2728
optional :change_detection, union: -> { ContextDev::MonitorCreateParams::ChangeDetection }
@@ -64,9 +65,9 @@ class MonitorCreateParams < ContextDev::Internal::Type::BaseModel
6465
#
6566
# @param name [String] Display name for the monitor.
6667
#
67-
# @param target [ContextDev::Models::MonitorCreateParams::Target::Page, ContextDev::Models::MonitorCreateParams::Target::Sitemap, ContextDev::Models::MonitorCreateParams::Target::Extract] What to watch: a page, a sitemap, or data extracted from a site.
68+
# @param target [ContextDev::Models::MonitorCreateParams::Target::Page, ContextDev::Models::MonitorCreateParams::Target::Sitemap, ContextDev::Models::MonitorCreateParams::Target::Extract, ContextDev::Models::MonitorCreateParams::Target::Search] What to watch: a page, a sitemap, data extracted from a site, or web search resu
6869
#
69-
# @param change_detection [ContextDev::Models::MonitorCreateParams::ChangeDetection::Exact, ContextDev::Models::MonitorCreateParams::ChangeDetection::Semantic] How changes are judged. Defaults to `semantic` for extract targets and page targ
70+
# @param change_detection [ContextDev::Models::MonitorCreateParams::ChangeDetection::Exact, ContextDev::Models::MonitorCreateParams::ChangeDetection::Semantic] How changes are judged. Defaults to `semantic` for extract and search targets an
7071
#
7172
# @param mode [Symbol, ContextDev::Models::MonitorCreateParams::Mode] Always `web`. Optional.
7273
#
@@ -80,7 +81,8 @@ class MonitorCreateParams < ContextDev::Internal::Type::BaseModel
8081
#
8182
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
8283

83-
# What to watch: a page, a sitemap, or data extracted from a site.
84+
# What to watch: a page, a sitemap, data extracted from a site, or web search
85+
# results.
8486
module Target
8587
extend ContextDev::Internal::Type::Union
8688

@@ -95,6 +97,9 @@ module Target
9597
# Track relevant pages selected by `schema` and `instructions`; refresh the page set periodically.
9698
variant :extract, -> { ContextDev::MonitorCreateParams::Target::Extract }
9799

100+
# Search the web on every run and report results not seen before, listed in the change’s `matched_urls` and `evidence`. Semantic detection reports only results describing a new development that matches `instructions`; exact detection reports every new result.
101+
variant :search, -> { ContextDev::MonitorCreateParams::Target::Search }
102+
98103
class Page < ContextDev::Internal::Type::BaseModel
99104
# @!attribute type
100105
# Use `page` to watch one web page.
@@ -437,35 +442,72 @@ class Extract < ContextDev::Internal::Type::BaseModel
437442
# @param type [Symbol, :extract] Use `extract` to watch structured data across selected pages.
438443
end
439444

445+
class Search < ContextDev::Internal::Type::BaseModel
446+
# @!attribute query
447+
# Web search query to run on every check. Supports operators such as `site:`,
448+
# `-site:`, and quoted phrases.
449+
#
450+
# @return [String]
451+
required :query, String
452+
453+
# @!attribute type
454+
# Use `search` to watch the whole web for new results about a topic.
455+
#
456+
# @return [Symbol, :search]
457+
required :type, const: :search
458+
459+
# @!attribute instructions
460+
# Plain-language description of which new results matter. Defaults to the query.
461+
#
462+
# @return [String, nil]
463+
optional :instructions, String
464+
465+
# @!method initialize(query:, instructions: nil, type: :search)
466+
# Some parameter documentations has been truncated, see
467+
# {ContextDev::Models::MonitorCreateParams::Target::Search} for more details.
468+
#
469+
# Search the web on every run and report results not seen before, listed in the
470+
# change’s `matched_urls` and `evidence`. Semantic detection reports only results
471+
# describing a new development that matches `instructions`; exact detection
472+
# reports every new result.
473+
#
474+
# @param query [String] Web search query to run on every check. Supports operators such as `site:`, `-si
475+
#
476+
# @param instructions [String] Plain-language description of which new results matter. Defaults to the query.
477+
#
478+
# @param type [Symbol, :search] Use `search` to watch the whole web for new results about a topic.
479+
end
480+
440481
# @!method self.variants
441-
# @return [Array(ContextDev::Models::MonitorCreateParams::Target::Page, ContextDev::Models::MonitorCreateParams::Target::Sitemap, ContextDev::Models::MonitorCreateParams::Target::Extract)]
482+
# @return [Array(ContextDev::Models::MonitorCreateParams::Target::Page, ContextDev::Models::MonitorCreateParams::Target::Sitemap, ContextDev::Models::MonitorCreateParams::Target::Extract, ContextDev::Models::MonitorCreateParams::Target::Search)]
442483
end
443484

444-
# How changes are judged. Defaults to `semantic` for extract targets and page
445-
# targets with `instructions`, otherwise `exact`.
485+
# How changes are judged. Defaults to `semantic` for extract and search targets
486+
# and page targets with `instructions`, otherwise `exact`.
446487
module ChangeDetection
447488
extend ContextDev::Internal::Type::Union
448489

449490
discriminator :type
450491

451-
# Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.
492+
# Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals. For search targets, this means every new result.
452493
variant :exact, -> { ContextDev::MonitorCreateParams::ChangeDetection::Exact }
453494

454495
# Detect meaningful content changes using the target’s instructions and optional schema.
455496
variant :semantic, -> { ContextDev::MonitorCreateParams::ChangeDetection::Semantic }
456497

457498
class Exact < ContextDev::Internal::Type::BaseModel
458499
# @!attribute type
459-
# Use `exact` to compare visible text or sitemap URLs.
500+
# Use `exact` to compare visible text, sitemap URLs, or search results.
460501
#
461502
# @return [Symbol, :exact]
462503
required :type, const: :exact
463504

464505
# @!method initialize(type: :exact)
465506
# Detect exact changes. For page targets, this means visible text diffs. For
466-
# sitemap targets, this means URL additions and removals.
507+
# sitemap targets, this means URL additions and removals. For search targets, this
508+
# means every new result.
467509
#
468-
# @param type [Symbol, :exact] Use `exact` to compare visible text or sitemap URLs.
510+
# @param type [Symbol, :exact] Use `exact` to compare visible text, sitemap URLs, or search results.
469511
end
470512

471513
class Semantic < ContextDev::Internal::Type::BaseModel

0 commit comments

Comments
 (0)