We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82409e2 commit 305bdc7Copy full SHA for 305bdc7
1 file changed
src/together/resources/batch.py
@@ -85,7 +85,6 @@ def cancel_batch(self, batch_job_id: str) -> BatchJob:
85
stream=False,
86
)
87
88
- assert isinstance(response, TogetherResponse)
89
return BatchJob(**response.data)
90
91
@@ -149,3 +148,18 @@ async def list_batches(self) -> List[BatchJob]:
149
148
assert isinstance(response, TogetherResponse)
150
jobs = response.data or []
151
return [BatchJob(**job) for job in jobs]
+
152
+ async def cancel_batch(self, batch_job_id: str) -> BatchJob:
153
+ requestor = api_requestor.APIRequestor(
154
+ client=self._client,
155
+ )
156
157
+ response, _, _ = await requestor.arequest(
158
+ options=TogetherRequest(
159
+ method="POST",
160
+ url=f"batches/{batch_job_id}/cancel",
161
+ ),
162
+ stream=False,
163
164
165
+ return BatchJob(**response.data)
0 commit comments