Skip to content

Commit 6419ac0

Browse files
committed
fix: Add countries_blacklist as an option
1 parent 614f0e0 commit 6419ac0

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

asknews_sdk/api/news.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def search_news(
9393
return_graphs: Optional[bool] = False,
9494
return_geo: Optional[bool] = False,
9595
countries: Optional[List[str]] = None,
96+
countries_blacklist: Optional[List[str]] = None,
9697
languages: Optional[List[str]] = None,
9798
continents: Optional[List[str]] = None,
9899
sentiment: Optional[Literal["negative", "neutral", "positive"]] = None,
@@ -193,6 +194,7 @@ def search_news(
193194
"return_graphs": return_graphs,
194195
"return_geo": return_geo,
195196
"countries": countries,
197+
"countries_blacklist": countries_blacklist,
196198
"languages": languages,
197199
"continents": continents,
198200
"sentiment": sentiment,
@@ -395,6 +397,7 @@ async def search_news(
395397
return_graphs: Optional[bool] = False,
396398
return_geo: Optional[bool] = False,
397399
countries: Optional[List[str]] = None,
400+
countries_blacklist: Optional[List[str]] = None,
398401
languages: Optional[List[str]] = None,
399402
continents: Optional[List[str]] = None,
400403
sentiment: Optional[Literal["negative", "neutral", "positive"]] = None,
@@ -495,6 +498,7 @@ async def search_news(
495498
"return_graphs": return_graphs,
496499
"return_geo": return_geo,
497500
"countries": countries,
501+
"countries_blacklist": countries_blacklist,
498502
"languages": languages,
499503
"continents": continents,
500504
"sentiment": sentiment,

asknews_sdk/dto/common.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,19 @@ class FilterParams(BaseModel):
260260
)
261261
countries: Optional[List[str]] = Field(
262262
None,
263-
description="Countries to filter by, this is the two-letter ISO country code"
263+
description="Source countries to filter by (this is only for the publisher location, "
264+
"not the locations mentioned in articles. For "
265+
"Locations mentioned in articles, refer to entity_guarantee)"
266+
", countries must be the two-letter ISO country code"
267+
"For example: United States is 'US', France is 'FR', Sweden is 'SE'.",
268+
)
269+
countries_blacklist: Optional[List[str]] = Field(
270+
None,
271+
description="Source countries to blacklist from search "
272+
"(this is only for the publisher location, "
273+
"not the locations mentioned in articles. For Locations mentioned in articles, "
274+
"refer to reverse_entity_guarantee)"
275+
", countries must be the two-letter ISO country code"
264276
"For example: United States is 'US', France is 'FR', Sweden is 'SE'.",
265277
)
266278
continents: Optional[

0 commit comments

Comments
 (0)