MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / abort_requests

Function abort_requests

fastdeploy/entrypoints/openai/api_server.py:477–492  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

475
476@app.post("/v1/abort_requests")
477async def abort_requests(request: Request):
478 body = await request.json()
479 abort_all = body.get("abort_all", False)
480 req_ids = body.get("req_ids", None)
481
482 # 参数校验
483 if not abort_all and not req_ids:
484 return JSONResponse(status_code=400, content={"error": "must provide abort_all=true or req_ids"})
485
486 control_request = ControlRequest(
487 request_id=f"control-{uuid.uuid4()}",
488 method="abort_requests",
489 args={"abort_all": abort_all, "req_ids": req_ids or []},
490 )
491 control_response = await app.state.engine_client.run_control_method(control_request)
492 return control_response.to_api_json_response()
493
494
495def wrap_streaming_generator(original_generator: AsyncGenerator):

Callers

nothing calls this directly

Calls 4

ControlRequestClass · 0.90
to_api_json_responseMethod · 0.80
getMethod · 0.45
run_control_methodMethod · 0.45

Tested by

no test coverage detected