Skip to content

Commit 376e477

Browse files
committed
Merge branch 'main' into feat-alerts
* main: chore: Update ruff version chore(deps-dev): bump ruff from 0.4.10 to 0.8.5 chore(release): Release 0.7.57 fix: autofilter response type fix: Make autofilter function async
2 parents 05326cd + 7075026 commit 376e477

File tree

6 files changed

+42
-25
lines changed

6 files changed

+42
-25
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.4.4
3+
rev: v0.8.5
44
hooks:
55
- id: ruff
66
name: ruff lint

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 0.7.57 (2025-01-03)
2+
3+
### Fix
4+
5+
- autofilter response type
6+
- Make autofilter function async
7+
18
## 0.7.56 (2025-01-03)
29

310
### Fix

asknews_sdk/api/chat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ async def live_web_search(
605605
)
606606
return WebSearchResponse.model_validate(response.content)
607607

608-
def get_autofilter(
608+
async def get_autofilter(
609609
self,
610610
query: str,
611611
*,
@@ -618,7 +618,7 @@ def get_autofilter(
618618
619619
https://docs.asknews.app/en/reference#get-/v1/chat/autofilter
620620
"""
621-
response = self.client.request(
621+
response = await self.client.request(
622622
method="GET",
623623
endpoint="/v1/chat/autofilter",
624624
headers=http_headers,

asknews_sdk/dto/chat.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class ForecastResponse(BaseModel):
166166
expert_information: Dict
167167

168168

169-
class FilterParamsResponse(BaseModel):
169+
class FilterParams(BaseModel):
170170
query: Annotated[
171171
str,
172172
"Query string that can be any phrase, "
@@ -288,3 +288,12 @@ class FilterParamsResponse(BaseModel):
288288
sentiment: Annotated[
289289
Optional[Literal["negative", "neutral", "positive"]], "Sentiment to filter articles by."
290290
] = None
291+
292+
293+
class FilterParamsMetadata(BaseModel):
294+
title: str
295+
296+
297+
class FilterParamsResponse(BaseModel):
298+
metadata: FilterParamsMetadata
299+
filter_params: FilterParams

poetry.lock

Lines changed: 20 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "asknews"
3-
version = "0.7.56"
3+
version = "0.7.57"
44
description = "Python SDK for AskNews"
55
authors = ["Emergent Methods <contact@emergentmethods.ai>"]
66
packages = [{ include = "asknews_sdk" }]
@@ -19,7 +19,7 @@ crontab = "^1.0.1"
1919

2020
[tool.poetry.group.dev.dependencies]
2121
mypy = "^1.2.0"
22-
ruff = "^0.4.3"
22+
ruff = ">=0.4.3,<0.9.0"
2323
pytest = ">=7.3.1,<9.0.0"
2424
pytest-asyncio = "^0.21.2"
2525
coverage = "^7.2.7"

0 commit comments

Comments
 (0)