Skip to content

Commit 10ea7d9

Browse files
committed
update sdk
1 parent 66dd077 commit 10ea7d9

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

jigsawstack/sentiment.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ class SentimentParams(TypedDict):
1212
"""
1313

1414

15+
class SentimentSentenceResult(TypedDict):
16+
score: float
17+
emotion: str
18+
text: str
19+
sentiment: str
20+
21+
1522
class SentimentResult(TypedDict):
1623
emotion: str
1724
"""
@@ -25,6 +32,7 @@ class SentimentResult(TypedDict):
2532
"""
2633
The score of the sentiment.
2734
"""
35+
sentences: List[SentimentSentenceResult]
2836

2937

3038
class SentimentResponse(TypedDict):

jigsawstack/web.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ class AIScrapeParams(TypedDict):
7070
goto_options: NotRequired[object]
7171
wait_for: NotRequired[object]
7272
cookies: NotRequired[object]
73+
page_position: NotRequired[int]
74+
root_element_selector: NotRequired[str]
7375

7476

7577
class ScrapeParams(TypedDict):
@@ -97,6 +99,18 @@ class ScrapeResponse(TypedDict):
9799
data: Any
98100

99101

102+
class AIScrapeResponse(TypedDict):
103+
success: bool
104+
"""
105+
Indicates whether the translation was successful.
106+
"""
107+
data: List[object]
108+
context: object
109+
page_position_length: int
110+
page_position: int
111+
selectors: object
112+
113+
100114
class Web(ClientConfig):
101115

102116
config: RequestConfig
@@ -114,7 +128,7 @@ def __init__(
114128
disable_request_logging=disable_request_logging,
115129
)
116130

117-
def ai_scrape(self, params: AIScrapeParams) -> ScrapeResponse:
131+
def ai_scrape(self, params: AIScrapeParams) -> AIScrapeResponse:
118132
path = "/ai/scrape"
119133
resp = Request(
120134
config=self.config,

0 commit comments

Comments
 (0)