You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 63b8964
Browse filesBrowse the repository at this point in the historyBrowse files
"""What this batch has done to your credit balance."""
15
17
16
-
charged: int
17
-
"""Credits used by successful pages."""
18
+
net: int
19
+
"""`reserved` minus `refunded` — what the batch has cost so far.
18
20
19
-
estimated: int
20
-
"""Credits reserved when the batch was accepted."""
21
-
22
-
23
-
classInput(BaseModel):
24
-
"""Submission counts."""
21
+
Equal to `reserved` until the batch settles.
22
+
"""
25
23
26
-
accepted: int
27
-
"""Pages accepted, or the crawl page limit. Credits are reserved for this count."""
24
+
refunded: int
25
+
"""Credits returned for pages that did not succeed.
28
26
29
-
duplicates: int
30
-
"""Duplicate URL and `itemId` pairs skipped. Always 0 for crawls."""
27
+
Stays 0 until the batch reaches a final status, then settles in one movement.
28
+
"""
31
29
32
-
invalid: int
33
-
"""Pages rejected during validation."""
30
+
reserved: int
31
+
"""Credits debited from your balance the moment the batch was accepted.
34
32
35
-
submitted: int
36
-
"""Pages submitted before validation. For a crawl, the page limit."""
33
+
This is a charge, not a forecast — the whole amount leaves the balance up front.
34
+
"""
37
35
38
36
39
37
classProgress(BaseModel):
40
-
"""Current processing counts. Use `status` to check completion."""
38
+
"""Pages attempted so far. Use `status` to check completion."""
41
39
42
40
failed: int
43
41
"""Pages that could not be scraped."""
44
42
45
43
pending: int
46
-
"""Accepted pages not yet attempted.
44
+
"""Reserved pages not yet attempted.
47
45
48
-
Always 0 once the batch completes; a crawl can finish under its page limit when
49
-
the site has no more reachable pages.
46
+
A cancelled batch keeps reporting the URLs it never reached; a crawl whose
47
+
`input.reserved_is_ceiling` is true reports 0 once final, because its unspent
48
+
budget was never real pages.
50
49
"""
51
50
52
51
succeeded: int
@@ -65,9 +64,8 @@ class ResultsFile(BaseModel):
65
64
66
65
67
66
classResults(BaseModel):
68
-
"""Download links available when the batch finishes.
69
-
70
-
GET /batch/{batch_id}/results serves the same records as paginated JSON.
67
+
"""
68
+
Download links, available once the batch reaches a final status and null before then. GET /batch/{batch_id}/results serves the same records as paginated JSON.
71
69
"""
72
70
73
71
expires_at: str
@@ -102,28 +100,46 @@ class BatchCancelResponse(BaseModel):
102
100
id: str
103
101
"""Batch ID used to retrieve or cancel the job."""
104
102
103
+
crawl: Optional[CrawlControls] =None
104
+
"""
105
+
The crawl controls as submitted, so the limits requested can be compared against
106
+
what the crawl reached.
107
+
"""
108
+
105
109
credits: Credits
106
-
"""Reserved and used credits."""
110
+
"""What this batch has done to your credit balance."""
107
111
108
-
error: Optional[Error] =None
109
-
"""Why the batch failed."""
112
+
failure: Optional[Failure] =None
113
+
"""
114
+
A failure of the batch as a whole, distinct from the per-page failures in
115
+
`page_errors`.
116
+
"""
110
117
111
-
errors: List[ErrorCount]
112
-
"""Page failures grouped by error code."""
118
+
format: Literal["markdown", "html"]
119
+
"""What each page is returned as.
113
120
114
-
input: Input
115
-
"""Submission counts."""
121
+
Matches `input.data.format` on the submit request.
122
+
"""
123
+
124
+
input: Intake
125
+
"""What submission took in, and what it charged for."""
116
126
117
127
mode: Literal["scrape", "crawl"]
118
-
"""How pages are selected."""
128
+
"""How pages were selected. Matches `input.mode` on the submit request."""
129
+
130
+
page_errors: List[PageErrorCount]
131
+
"""Individual page failures grouped by error code, sorted by count.
132
+
133
+
Unrelated to `failure`, which is the batch itself failing.
134
+
"""
119
135
120
136
progress: Progress
121
-
"""Current processing counts. Use `status` to check completion."""
137
+
"""Pages attempted so far. Use `status` to check completion."""
122
138
123
139
results: Optional[Results] =None
124
-
"""Download links available when the batch finishes.
125
-
126
-
GET /batch/{batch_id}/results serves the same records as paginated JSON.
140
+
"""
141
+
Download links, available once the batch reaches a final status and null before
142
+
then. GET /batch/{batch_id}/results serves the same records as paginated JSON.
Copy file name to clipboardExpand all lines: src/context/dev/types/batch_list_response.py
+54-42Lines changed: 54 additions & 42 deletions
Original file line number
Diff line number
Diff line change
@@ -3,15 +3,16 @@
3
3
fromtypingimportList, Optional
4
4
fromtyping_extensionsimportLiteral
5
5
6
-
from .errorimportError
6
+
from .intakeimportIntake
7
+
from .failureimportFailure
7
8
from .._modelsimportBaseModel
8
-
from .error_countimportErrorCount
9
+
from .crawl_controlsimportCrawlControls
10
+
from .page_error_countimportPageErrorCount
9
11
10
12
__all__= [
11
13
"BatchListResponse",
12
14
"Data",
13
15
"DataCredits",
14
-
"DataInput",
15
16
"DataProgress",
16
17
"DataResults",
17
18
"DataResultsFile",
@@ -21,42 +22,39 @@
21
22
22
23
23
24
classDataCredits(BaseModel):
24
-
"""Reserved and used credits."""
25
+
"""What this batch has done to your credit balance."""
25
26
26
-
charged: int
27
-
"""Credits used by successful pages."""
27
+
net: int
28
+
"""`reserved` minus `refunded` — what the batch has cost so far.
28
29
29
-
estimated: int
30
-
"""Credits reserved when the batch was accepted."""
31
-
32
-
33
-
classDataInput(BaseModel):
34
-
"""Submission counts."""
30
+
Equal to `reserved` until the batch settles.
31
+
"""
35
32
36
-
accepted: int
37
-
"""Pages accepted, or the crawl page limit. Credits are reserved for this count."""
33
+
refunded: int
34
+
"""Credits returned for pages that did not succeed.
38
35
39
-
duplicates: int
40
-
"""Duplicate URL and `itemId` pairs skipped. Always 0 for crawls."""
36
+
Stays 0 until the batch reaches a final status, then settles in one movement.
37
+
"""
41
38
42
-
invalid: int
43
-
"""Pages rejected during validation."""
39
+
reserved: int
40
+
"""Credits debited from your balance the moment the batch was accepted.
44
41
45
-
submitted: int
46
-
"""Pages submitted before validation. For a crawl, the page limit."""
42
+
This is a charge, not a forecast — the whole amount leaves the balance up front.
43
+
"""
47
44
48
45
49
46
classDataProgress(BaseModel):
50
-
"""Current processing counts. Use `status` to check completion."""
47
+
"""Pages attempted so far. Use `status` to check completion."""
51
48
52
49
failed: int
53
50
"""Pages that could not be scraped."""
54
51
55
52
pending: int
56
-
"""Accepted pages not yet attempted.
53
+
"""Reserved pages not yet attempted.
57
54
58
-
Always 0 once the batch completes; a crawl can finish under its page limit when
59
-
the site has no more reachable pages.
55
+
A cancelled batch keeps reporting the URLs it never reached; a crawl whose
56
+
`input.reserved_is_ceiling` is true reports 0 once final, because its unspent
57
+
budget was never real pages.
60
58
"""
61
59
62
60
succeeded: int
@@ -75,9 +73,8 @@ class DataResultsFile(BaseModel):
75
73
76
74
77
75
classDataResults(BaseModel):
78
-
"""Download links available when the batch finishes.
79
-
80
-
GET /batch/{batch_id}/results serves the same records as paginated JSON.
76
+
"""
77
+
Download links, available once the batch reaches a final status and null before then. GET /batch/{batch_id}/results serves the same records as paginated JSON.
81
78
"""
82
79
83
80
expires_at: str
@@ -104,28 +101,46 @@ class Data(BaseModel):
104
101
id: str
105
102
"""Batch ID used to retrieve or cancel the job."""
106
103
104
+
crawl: Optional[CrawlControls] =None
105
+
"""
106
+
The crawl controls as submitted, so the limits requested can be compared against
107
+
what the crawl reached.
108
+
"""
109
+
107
110
credits: DataCredits
108
-
"""Reserved and used credits."""
111
+
"""What this batch has done to your credit balance."""
109
112
110
-
error: Optional[Error] =None
111
-
"""Why the batch failed."""
113
+
failure: Optional[Failure] =None
114
+
"""
115
+
A failure of the batch as a whole, distinct from the per-page failures in
116
+
`page_errors`.
117
+
"""
112
118
113
-
errors: List[ErrorCount]
114
-
"""Page failures grouped by error code."""
119
+
format: Literal["markdown", "html"]
120
+
"""What each page is returned as.
115
121
116
-
input: DataInput
117
-
"""Submission counts."""
122
+
Matches `input.data.format` on the submit request.
123
+
"""
124
+
125
+
input: Intake
126
+
"""What submission took in, and what it charged for."""
118
127
119
128
mode: Literal["scrape", "crawl"]
120
-
"""How pages are selected."""
129
+
"""How pages were selected. Matches `input.mode` on the submit request."""
130
+
131
+
page_errors: List[PageErrorCount]
132
+
"""Individual page failures grouped by error code, sorted by count.
133
+
134
+
Unrelated to `failure`, which is the batch itself failing.
135
+
"""
121
136
122
137
progress: DataProgress
123
-
"""Current processing counts. Use `status` to check completion."""
138
+
"""Pages attempted so far. Use `status` to check completion."""
124
139
125
140
results: Optional[DataResults] =None
126
-
"""Download links available when the batch finishes.
127
-
128
-
GET /batch/{batch_id}/results serves the same records as paginated JSON.
141
+
"""
142
+
Download links, available once the batch reaches a final status and null before
143
+
then. GET /batch/{batch_id}/results serves the same records as paginated JSON.
0 commit comments