Skip to content

Commit 6d99f45

Browse files
feat(api): api update
1 parent bf9dfe3 commit 6d99f45

8 files changed

Lines changed: 50 additions & 52 deletions

File tree

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 37
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-67d0edd5da21ac5e53c3d1f82d60e5f71a160938ed0e8f2e567b042978792405.yml
3-
openapi_spec_hash: d52bec73da0d689ecce7b95235fc6846
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-960cb623c7ec84bf4dc0f5945cbc19eec9cca48271071f400d96066eaa55dbd6.yml
3+
openapi_spec_hash: 84fd39e3f4dc964bf0c32d4e95da1b34
44
config_hash: 2bea1743c84d63bd61f8501a6ea63065

‎api.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ Types:
140140

141141
```python
142142
from context.dev.types import (
143+
ErrorCount,
144+
Error,
143145
BatchRetrieveResponse,
144146
BatchListResponse,
145147
BatchCancelResponse,

‎src/context/dev/types/__init__.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from __future__ import annotations
44

5+
from .error import Error as Error
6+
from .error_count import ErrorCount as ErrorCount
57
from .webhook_delivery import WebhookDelivery as WebhookDelivery
68
from .batch_list_params import BatchListParams as BatchListParams
79
from .web_search_params import WebSearchParams as WebSearchParams

‎src/context/dev/types/batch_cancel_response.py‎

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,11 @@
33
from typing import List, Optional
44
from typing_extensions import Literal
55

6+
from .error import Error
67
from .._models import BaseModel
8+
from .error_count import ErrorCount
79

8-
__all__ = [
9-
"BatchCancelResponse",
10-
"Credits",
11-
"Error",
12-
"Input",
13-
"Progress",
14-
"Results",
15-
"ResultsFile",
16-
"Timing",
17-
"KeyMetadata",
18-
]
10+
__all__ = ["BatchCancelResponse", "Credits", "Input", "Progress", "Results", "ResultsFile", "Timing", "KeyMetadata"]
1911

2012

2113
class Credits(BaseModel):
@@ -28,16 +20,6 @@ class Credits(BaseModel):
2820
"""Credits reserved when the batch was accepted."""
2921

3022

31-
class Error(BaseModel):
32-
"""Batch-level error. Null unless `status` is `failed`."""
33-
34-
code: str
35-
"""Batch error code."""
36-
37-
message: str
38-
"""Batch error message."""
39-
40-
4123
class Input(BaseModel):
4224
"""Submission counts."""
4325

@@ -124,9 +106,9 @@ class BatchCancelResponse(BaseModel):
124106
"""Reserved and used credits."""
125107

126108
error: Optional[Error] = None
127-
"""Batch-level error. Null unless `status` is `failed`."""
109+
"""Why the batch failed."""
128110

129-
errors: List[Error]
111+
errors: List[ErrorCount]
130112
"""Page failures grouped by error code."""
131113

132114
input: Input

‎src/context/dev/types/batch_list_response.py‎

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
from typing import List, Optional
44
from typing_extensions import Literal
55

6+
from .error import Error
67
from .._models import BaseModel
8+
from .error_count import ErrorCount
79

810
__all__ = [
911
"BatchListResponse",
1012
"Data",
1113
"DataCredits",
12-
"DataError",
1314
"DataInput",
1415
"DataProgress",
1516
"DataResults",
@@ -29,16 +30,6 @@ class DataCredits(BaseModel):
2930
"""Credits reserved when the batch was accepted."""
3031

3132

32-
class DataError(BaseModel):
33-
"""Batch-level error. Null unless `status` is `failed`."""
34-
35-
code: str
36-
"""Batch error code."""
37-
38-
message: str
39-
"""Batch error message."""
40-
41-
4233
class DataInput(BaseModel):
4334
"""Submission counts."""
4435

@@ -116,10 +107,10 @@ class Data(BaseModel):
116107
credits: DataCredits
117108
"""Reserved and used credits."""
118109

119-
error: Optional[DataError] = None
120-
"""Batch-level error. Null unless `status` is `failed`."""
110+
error: Optional[Error] = None
111+
"""Why the batch failed."""
121112

122-
errors: List[DataError]
113+
errors: List[ErrorCount]
123114
"""Page failures grouped by error code."""
124115

125116
input: DataInput

‎src/context/dev/types/batch_retrieve_response.py‎

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
from typing import List, Optional
44
from typing_extensions import Literal
55

6+
from .error import Error
67
from .._models import BaseModel
8+
from .error_count import ErrorCount
79

810
__all__ = [
911
"BatchRetrieveResponse",
1012
"Credits",
11-
"Error",
1213
"Input",
1314
"InvalidURL",
1415
"Progress",
@@ -29,16 +30,6 @@ class Credits(BaseModel):
2930
"""Credits reserved when the batch was accepted."""
3031

3132

32-
class Error(BaseModel):
33-
"""Batch-level error. Null unless `status` is `failed`."""
34-
35-
code: str
36-
"""Batch error code."""
37-
38-
message: str
39-
"""Batch error message."""
40-
41-
4233
class Input(BaseModel):
4334
"""Submission counts."""
4435

@@ -133,9 +124,9 @@ class BatchRetrieveResponse(BaseModel):
133124
"""Reserved and used credits."""
134125

135126
error: Optional[Error] = None
136-
"""Batch-level error. Null unless `status` is `failed`."""
127+
"""Why the batch failed."""
137128

138-
errors: List[Error]
129+
errors: List[ErrorCount]
139130
"""Page failures grouped by error code."""
140131

141132
input: Input

‎src/context/dev/types/error.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .._models import BaseModel
4+
5+
__all__ = ["Error"]
6+
7+
8+
class Error(BaseModel):
9+
"""Why the batch failed."""
10+
11+
code: str
12+
"""Batch error code."""
13+
14+
message: str
15+
"""Batch error message."""
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .._models import BaseModel
4+
5+
__all__ = ["ErrorCount"]
6+
7+
8+
class ErrorCount(BaseModel):
9+
"""Page failures sharing one error code."""
10+
11+
code: str
12+
"""Error code for these failures."""
13+
14+
count: int
15+
"""Pages that failed with this code."""

0 commit comments

Comments
 (0)