Skip to content

Commit 305bdc7

Browse files
committed
Address comments
1 parent 82409e2 commit 305bdc7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/together/resources/batch.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ def cancel_batch(self, batch_job_id: str) -> BatchJob:
8585
stream=False,
8686
)
8787

88-
assert isinstance(response, TogetherResponse)
8988
return BatchJob(**response.data)
9089

9190

@@ -149,3 +148,18 @@ async def list_batches(self) -> List[BatchJob]:
149148
assert isinstance(response, TogetherResponse)
150149
jobs = response.data or []
151150
return [BatchJob(**job) for job in jobs]
151+
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

Comments
 (0)