File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments