Skip to content

Commit c6a2656

Browse files
committed
merge main into feat/refactor
2 parents 5ca40ee + ed0ddab commit c6a2656

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## 0.6.10 (2024-06-02)
2+
3+
### Fix
4+
5+
- default to fastest return_type 'string'
6+
7+
## 0.6.9 (2024-05-31)
8+
9+
### Fix
10+
11+
- update the graph relationships
12+
113
## 0.6.8 (2024-05-23)
214

315
### Fix

asknews_sdk/api/news.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ class NewsAPI(BaseAPI):
1313
"""
1414

1515
def get_article(
16-
self,
17-
article_id: Union[str, UUID],
18-
*,
19-
http_headers: Optional[Dict] = None
16+
self, article_id: Union[str, UUID], *, http_headers: Optional[Dict] = None
2017
) -> ArticleResponse:
2118
"""
2219
Get a news article by its UUID.
@@ -45,7 +42,7 @@ def search_news(
4542
n_articles: int = 10,
4643
start_timestamp: Optional[int] = None,
4744
end_timestamp: Optional[int] = None,
48-
return_type: Literal["string", "dicts", "both"] = "dicts",
45+
return_type: Literal["string", "dicts", "both"] = "string",
4946
historical: bool = False,
5047
method: Literal["nl", "kw", "both"] = "nl",
5148
similarity_score_threshold: float = 0.5,
@@ -222,10 +219,7 @@ class AsyncNewsAPI(BaseAPI):
222219
"""
223220

224221
async def get_article(
225-
self,
226-
article_id: Union[str, UUID],
227-
*,
228-
http_headers: Optional[Dict] = None
222+
self, article_id: Union[str, UUID], *, http_headers: Optional[Dict] = None
229223
):
230224
"""
231225
Get a news article by its UUID.
@@ -254,7 +248,7 @@ async def search_news(
254248
n_articles: int = 10,
255249
start_timestamp: Optional[int] = None,
256250
end_timestamp: Optional[int] = None,
257-
return_type: Literal["string", "dicts", "both"] = "dicts",
251+
return_type: Literal["string", "dicts", "both"] = "string",
258252
historical: bool = False,
259253
method: Literal["nl", "kw", "both"] = "nl",
260254
similarity_score_threshold: float = 0.5,

asknews_sdk/dto/stories.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class IntraClusterStatistics(BaseModel):
5656

5757

5858
class GraphRelationships(BaseModel):
59-
nodes: list[dict[Literal["id", "type"], str]]
59+
nodes: list[dict[Literal["id", "type", "detailed_type"], str]]
6060
edges: list[dict[Literal["from", "to", "label"], str]]
6161

6262

@@ -125,7 +125,7 @@ class StoryResponse(BaseSchema):
125125
n_articles: Annotated[List[int], Field(title="N Articles")]
126126
n_updates: Annotated[int, Field(title="N Updates")]
127127
people: Annotated[List[str], Field(title="People")]
128-
reddit_sentiment: Annotated[List[int], Field(title="Reddit Sentiment")]
128+
reddit_sentiment: Annotated[List[int | float], Field(title="Reddit Sentiment")]
129129
reddit_sentiment_timestamps: Annotated[List[int], Field(title="Reddit Sentiment Timestamps")]
130130
rolling_sentiment: Annotated[List[float], Field(title="Rolling Sentiment")]
131131
sentiment: Annotated[List[int], Field(title="Sentiment")]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "asknews"
3-
version = "0.6.8"
3+
version = "0.6.10"
44
description = "Python SDK for AskNews"
55
authors = ["Emergent Methods <[email protected]>"]
66
packages = [{ include = "asknews_sdk" }]

0 commit comments

Comments
 (0)