Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
09a4fa4
fix: Switch to byte streaming to avoid line separators breaking pydan…
robcaulk May 18, 2026
ea16186
fix: repsonse
robcaulk May 18, 2026
27e2e38
chore(release): Release 0.13.46
May 18, 2026
5339feb
fix: If newline chars cross multiple chunks
robcaulk May 18, 2026
3080d53
chore(release): Release 0.13.47
May 18, 2026
9b8d55c
fix: Add crawl_date and content_type to Article response
robcaulk May 20, 2026
90b29db
chore(release): Release 0.13.48
May 20, 2026
04d98a0
fix: Add api_key_id hint to Alert response
wagnercosta May 20, 2026
dddcefa
chore(release): Release 0.13.49
May 20, 2026
43f8d62
fix: Add usage to searchresponse
robcaulk May 24, 2026
51d8f3d
chore(release): Release 0.13.50
May 24, 2026
d6578fd
fix: Add skip_dedup from the scrapedurl item submission
robcaulk May 30, 2026
2bbd73f
chore(release): Release 0.13.51
May 30, 2026
442e87e
fix: Allow reports to define timezone
robcaulk Jun 18, 2026
d02d858
chore(release): Release 0.13.52
Jun 18, 2026
699d53b
fix: Support Python 3.8
robcaulk Jun 18, 2026
95417bc
chore(release): Release 0.13.53
Jun 18, 2026
d67c8ee
fix: Add ability to append date to email subject for alerts
robcaulk Jun 25, 2026
b8e97a9
chore(release): Release 0.13.54
Jun 25, 2026
e14485f
fix: Add claude-sonnet-5 for alert reports
robcaulk Jul 2, 2026
29786b6
fix: Add gpt-5.6 and opus-4.8
robcaulk Jul 21, 2026
0da4469
chore(release): Release 0.13.55
Jul 21, 2026
7e1aaf3
fix: Add wikidata entities to Article DTO
robcaulk Aug 4, 2026
fa6b7c5
chore(release): Release 0.13.56
Aug 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,72 @@
## 0.13.56 (2026-08-04)

### Fix

- Add wikidata entities to Article DTO

## 0.13.55 (2026-07-21)

### Fix

- Add gpt-5.6 and opus-4.8
- Add claude-sonnet-5 for alert reports

## 0.13.54 (2026-06-25)

### Fix

- Add ability to append date to email subject for alerts

## 0.13.53 (2026-06-18)

### Fix

- Support Python 3.8

## 0.13.52 (2026-06-18)

### Fix

- Allow reports to define timezone

## 0.13.51 (2026-05-30)

### Fix

- Add skip_dedup from the scrapedurl item submission

## 0.13.50 (2026-05-24)

### Fix

- Add usage to searchresponse

## 0.13.49 (2026-05-20)

### Fix

- Add api_key_id hint to Alert response

## 0.13.48 (2026-05-20)

### Fix

- Add crawl_date and content_type to Article response

## 0.13.47 (2026-05-18)

### Fix

- If newline chars cross multiple chunks

## 0.13.46 (2026-05-18)

### Fix

- repsonse
- Switch to byte streaming to avoid line separators breaking pydantic validation
- Add byok methods

## 0.13.45 (2026-05-04)

### Fix
Expand Down
12 changes: 8 additions & 4 deletions asknews_sdk/api/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@
"claude-opus-4-6",
"claude-opus-4-5-20251101",
"claude-sonnet-4-6",
"claude-sonnet-5",
"gemini-2.5-flash",
"o3",
"gpt-5.6-sol",
"claude-opus-4-8",
"gpt-5.6-terra",
]


Expand Down Expand Up @@ -171,7 +175,7 @@ def get_chat_completions(
(CreateChatCompletionResponseStream.__content_type__, 1.0),
],
stream=stream,
stream_type="lines",
stream_type="bytes",
)

if stream:
Expand Down Expand Up @@ -770,7 +774,7 @@ def get_deep_news(
(CreateDeepNewsResponseStreamSource.__content_type__, 1.0),
],
stream=stream,
stream_type="lines",
stream_type="bytes",
)

if stream:
Expand Down Expand Up @@ -936,7 +940,7 @@ async def get_chat_completions(
(CreateChatCompletionResponseStream.__content_type__, 1.0),
],
stream=stream,
stream_type="lines",
stream_type="bytes",
)

if stream:
Expand Down Expand Up @@ -1535,7 +1539,7 @@ async def get_deep_news(
(CreateDeepNewsResponseStreamSource.__content_type__, 1.0),
],
stream=stream,
stream_type="lines",
stream_type="bytes",
)

if stream:
Expand Down
25 changes: 22 additions & 3 deletions asknews_sdk/dto/alert.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@
"gemini-2.5-pro",
"gemini-3-pro",
"claude-sonnet-4-6",
"claude-sonnet-5",
"claude-opus-4-6",
"claude-opus-4-5-20251101",
"gemini-2.5-flash",
"o3",
"open-source-best",
"gemini-3-flash",
"gpt-5.6-sol",
"claude-opus-4-8",
"gpt-5.6-terra",
]


Expand Down Expand Up @@ -61,7 +65,10 @@
"claude-opus-4-5-20251101",
"claude-opus-4-6",
"claude-sonnet-4-6",
"meta-llama/Meta-Llama-3.1-405B-Instruct",
"claude-sonnet-5",
"gpt-5.6-sol",
"claude-opus-4-8",
"gpt-5.6-terra" "meta-llama/Meta-Llama-3.1-405B-Instruct",
"meta-llama/Meta-Llama-3.3-70B-Instruct",
]
AlertReportModelDefault: AlertReportModel = "claude-sonnet-4-6"
Expand Down Expand Up @@ -130,7 +137,7 @@ class DeepNewsSourceParams(DeepNewsParams):
description=(
f"The model to use for DeepNews research. Defaults to {DeepNewsSourceModelDefault}"
),
examples=["claude-sonnet-4-5-20250929"],
examples=["claude-sonnet-4-6"],
)
search_depth: Optional[int] = Field(
default=1,
Expand Down Expand Up @@ -160,7 +167,7 @@ class DeepNewsReportParams(DeepNewsParams):
description=(
f"The model to use for DeepNews research. Defaults to {DeepNewsReportModelDefault}"
),
examples=["claude-sonnet-4-5-20250929"],
examples=["claude-sonnet-4-6"],
)
search_depth: Optional[int] = Field(
default=2,
Expand Down Expand Up @@ -281,6 +288,10 @@ class EmailParams(BaseModel):
asknews_watermark: Optional[bool] = Field(
default=True, description='Append "Generated by AskNews AI" watermark.'
)
subject_date: Optional[bool] = Field(
default=False,
description="Whether to include the date in the subject of the email. Defaults to False.",
)


class GoogleDocsParams(BaseModel):
Expand Down Expand Up @@ -338,6 +349,13 @@ class ReportRequestParams(BaseModel):
default=True,
description='Append "Generated by AskNews AI" watermark.',
)
timezone: Optional[str] = Field(
default="UTC",
description=(
"The timezone to use for any timestamps in the report. Defaults to UTC. "
"Should be a valid tz database name, e.g. 'America/New_York'."
),
)


class LegacyReportRequest(ReportRequestParams):
Expand Down Expand Up @@ -675,3 +693,4 @@ class AlertResponse(BaseSchema):
alert_type: Optional[AlertType] = None
title: Optional[str] = None
seat_id: Optional[UUID] = None
api_key_id: Optional[str] = None
31 changes: 31 additions & 0 deletions asknews_sdk/dto/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ class Entities(BaseModel):
Science: Annotated[Optional[List[str]], Field([], title="Science")]


class WikidataEntity(BaseModel):
title: Annotated[str, Field(title="Title")]
qid: Annotated[str, Field(title="Qid")]
relevance: Annotated[float, Field(title="Relevance")]
description: Annotated[Optional[str], Field(None, title="Description")]
# Original GLiNER/graph surface form before Wikidata disambiguation.
source_mention: Annotated[Optional[str], Field(None, title="Source Mention")]


class Author(BaseModel):
email: Optional[str] = None
name: Optional[str] = None
Expand All @@ -85,6 +94,9 @@ class Article(BaseModel):
domain_url: Annotated[str, Field(title="Domain Url")]
eng_title: Annotated[str, Field(title="Eng Title")]
entities: Annotated[Entities, Field(title="Entities")]
wikidata_entities: Annotated[
Optional[Dict[str, List[WikidataEntity]]], Field(None, title="Wikidata Entities")
] = None
image_url: Annotated[Optional[str], Field(None, title="Image Url")]
keywords: Annotated[List[str], Field(title="Keywords")]
language: Annotated[str, Field(title="Language")]
Expand Down Expand Up @@ -139,6 +151,25 @@ class Article(BaseModel):
full_text: Optional[str] = None
image_description: Optional[str] = None
original_language_summary: Optional[str] = None
crawl_date: Optional[AwareDatetime] = None
content_type: Optional[
Literal[
"news",
"opinion",
"analysis",
"review",
"listicle",
"guide",
"interview",
"profile",
"forum",
"liveblog",
"fact-check",
"press_release",
"obituary",
"data_journalism",
]
] = None


class PingResponse(BaseSchema):
Expand Down
6 changes: 6 additions & 0 deletions asknews_sdk/dto/news.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ class SearchResponseDictItem(Article):
as_string_key: Annotated[str, Field(title="As String Key")]


class Usage(BaseModel):
credits: int


class SearchResponse(BaseSchema):
as_dicts: Annotated[Optional[List[SearchResponseDictItem]], Field(None, title="As Dicts")]
as_string: Annotated[Optional[str], Field(None, title="As String")]
offset: Annotated[Optional[Union[int, str]], Field(None, title="Offset")]
hit_cache: Annotated[Optional[bool], Field(None, title="Hit Cache")]
usage: Optional[Usage] = None


class SourceReportItem(BaseModel):
Expand Down Expand Up @@ -81,6 +86,7 @@ class ScrapeDataItem(BaseModel):
class ScrapedURLItem(BaseModel):
url: Annotated[str, Field(title="URL")]
data: Annotated[Optional[ScrapeDataItem], Field(title="Data")] = None
skip_dedupe: Annotated[bool, Field(title="Skip Dedupe check")] = False
metadata: Annotated[Optional[Dict], Field(title="Metadata")] = None
enrichments: Annotated[Optional[Dict], Field(title="Enrichments")] = None

Expand Down
Loading
Loading