Skip to content

Commit 4e63b62

Browse files
author
stlc-bot
committed
fix(openapi): document exclusive news filters (#1265)
Stainless-Generated-From: 1a70e0e
1 parent d002c89 commit 4e63b62

2 files changed

Lines changed: 25 additions & 12 deletions

File tree

‎src/context/dev/resources/news.py‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,19 @@ def search(
6464
"""
6565
Searches live and historical company news for one company, identified in
6666
searchBy by name, domain, ticker (optionally disambiguated by exchange), or
67-
ISIN. Results can be filtered by publisher domain, publisher country, article
68-
language, article type, and published-at date, and include stable story IDs,
69-
source metadata, verified entity relevance, and cursor pagination.
67+
ISIN. Results can be filtered by one of publisher domain, publisher country,
68+
article language, or article type, optionally combined with a published-at date
69+
range, and include stable story IDs, source metadata, verified entity relevance,
70+
and cursor pagination.
7071
7172
Args:
7273
search_by: What to search for.
7374
7475
cursor: Opaque next_cursor from the previous response, or null for the first page.
7576
76-
filter_by: Optional result filters.
77+
filter_by: Optional result filters. Use at most one of sourceDomain, sourceCountry,
78+
articleLanguage, or articleType. A date range may accompany that category;
79+
date.from must not exceed date.to.
7780
7881
limit: Maximum results to return. Defaults to 10.
7982
@@ -150,16 +153,19 @@ async def search(
150153
"""
151154
Searches live and historical company news for one company, identified in
152155
searchBy by name, domain, ticker (optionally disambiguated by exchange), or
153-
ISIN. Results can be filtered by publisher domain, publisher country, article
154-
language, article type, and published-at date, and include stable story IDs,
155-
source metadata, verified entity relevance, and cursor pagination.
156+
ISIN. Results can be filtered by one of publisher domain, publisher country,
157+
article language, or article type, optionally combined with a published-at date
158+
range, and include stable story IDs, source metadata, verified entity relevance,
159+
and cursor pagination.
156160
157161
Args:
158162
search_by: What to search for.
159163
160164
cursor: Opaque next_cursor from the previous response, or null for the first page.
161165
162-
filter_by: Optional result filters.
166+
filter_by: Optional result filters. Use at most one of sourceDomain, sourceCountry,
167+
articleLanguage, or articleType. A date range may accompany that category;
168+
date.from must not exceed date.to.
163169
164170
limit: Maximum results to return. Defaults to 10.
165171

‎src/context/dev/types/news_search_params.py‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ class NewsSearchParams(TypedDict, total=False):
3030
"""Opaque next_cursor from the previous response, or null for the first page."""
3131

3232
filter_by: Annotated[FilterBy, PropertyInfo(alias="filterBy")]
33-
"""Optional result filters."""
33+
"""Optional result filters.
34+
35+
Use at most one of sourceDomain, sourceCountry, articleLanguage, or articleType.
36+
A date range may accompany that category; date.from must not exceed date.to.
37+
"""
3438

3539
limit: int
3640
"""Maximum results to return. Defaults to 10."""
@@ -185,14 +189,17 @@ class SearchBy(TypedDict, total=False):
185189

186190

187191
class FilterByDate(_FilterByDateReservedKeywords, total=False):
188-
"""Published-at window in epoch milliseconds."""
192+
"""Published-at window in epoch milliseconds. from must be before or equal to to."""
189193

190194
to: int
191195
"""Inclusive end of the published-at window, in epoch milliseconds."""
192196

193197

194198
class FilterBy(TypedDict, total=False):
195-
"""Optional result filters."""
199+
"""Optional result filters.
200+
201+
Use at most one of sourceDomain, sourceCountry, articleLanguage, or articleType. A date range may accompany that category; date.from must not exceed date.to.
202+
"""
196203

197204
article_language: Annotated[
198205
List[Literal["ar", "de", "en", "es", "fr", "hi", "it", "ja", "ko", "nl", "pt", "ru", "zh"]],
@@ -206,7 +213,7 @@ class FilterBy(TypedDict, total=False):
206213
"""Article types to include. Up to 3."""
207214

208215
date: FilterByDate
209-
"""Published-at window in epoch milliseconds."""
216+
"""Published-at window in epoch milliseconds. from must be before or equal to to."""
210217

211218
source_country: Annotated[
212219
List[

0 commit comments

Comments
 (0)