Skip to content

Commit 5e91016

Browse files
committed
fix: Add websource option for alert tracking
1 parent 02d0027 commit 5e91016

File tree

3 files changed

+40
-5
lines changed

3 files changed

+40
-5
lines changed

asknews_sdk/api/chat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ def get_deep_news(
481481
self,
482482
messages: List[Dict[str, str]],
483483
model: Literal[
484+
"gpt-5",
484485
"claude-3-7-sonnet-latest",
485486
"deepseek",
486487
"deepseek-basic",
@@ -1017,6 +1018,7 @@ async def get_deep_news(
10171018
self,
10181019
messages: List[Dict[str, str]],
10191020
model: Literal[
1021+
"gpt-5",
10201022
"claude-3-7-sonnet-latest",
10211023
"deepseek",
10221024
"deepseek-basic",

asknews_sdk/dto/alert.py

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
CheckAlertModel = Literal[
1414
"meta-llama/Meta-Llama-3.1-8B-Instruct",
1515
"gpt-4o-mini",
16+
# "gpt-5-mini",
17+
# "gpt-5-nano",
1618
"gpt-4o",
1719
"o3-mini",
1820
"meta-llama/Meta-Llama-3.3-70B-Instruct",
@@ -22,17 +24,47 @@
2224
]
2325

2426
ReportModel = Literal[
27+
# "gpt-5",
2528
"gpt-4o",
26-
"gpt-4o-mini",
29+
"gpt-4.1-2025-04-14",
30+
"gpt-4.1-mini-2025-04-14" "gpt-4o-mini",
2731
"o3-mini",
2832
"claude-3-5-sonnet-latest",
33+
"claude-sonnet-4-20250514",
2934
"meta-llama/Meta-Llama-3.1-405B-Instruct",
3035
"meta-llama/Meta-Llama-3.3-70B-Instruct",
31-
"gpt-4.1-2025-04-14",
32-
"gpt-4.1-mini-2025-04-14",
3336
]
3437

3538

39+
class WebSourceParams(BaseModel):
40+
queries: List[str] = Field(
41+
...,
42+
description="The queries to use for the web search. This is a list of strings.",
43+
)
44+
domains: Optional[List[str]] = Field(
45+
None, description="The domains to restrict the web search to."
46+
)
47+
strict: bool = Field(
48+
True,
49+
description=(
50+
"If true, the web search will only return results that have "
51+
"a known publication date and are within the lookback period."
52+
),
53+
)
54+
lookback: int = Field(
55+
24,
56+
description=(
57+
"The number of hours back to accept for the web search. "
58+
"If not provided, no lookback will be applied."
59+
),
60+
)
61+
62+
63+
class WebSource(BaseModel):
64+
identifier: Literal["web"]
65+
params: WebSourceParams
66+
67+
3668
class AskNewsSource(BaseModel):
3769
identifier: Literal["asknews"]
3870
params: Optional[FilterParams] = Field(None, description="The filter params to use")
@@ -57,7 +89,8 @@ class BlueskySource(BaseModel):
5789

5890

5991
Source = Annotated[
60-
Union[AskNewsSource, TelegramSource, BlueskySource], Field(discriminator="identifier")
92+
Union[AskNewsSource, TelegramSource, BlueskySource, WebSource],
93+
Field(discriminator="identifier"),
6194
]
6295

6396

asknews_sdk/dto/chat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class WebSearchResult(BaseModel):
152152
class WebSearchResponse(BaseModel):
153153
as_string: str
154154
as_dicts: List[WebSearchResult]
155-
offset: Optional[int] = None
155+
offset: Optional[int | str] = None
156156

157157

158158
class ForecastResponse(BaseModel):

0 commit comments

Comments
 (0)