feat: Add flow build cancellation endpoint and functionality (#6813)

* feat: Add flow build cancellation endpoint and support

Implement new functionality to cancel ongoing flow build jobs:
- Add `cancel_flow_build` function in build.py to handle job cancellation
- Create new `/build/{job_id}/cancel` endpoint in chat.py
- Introduce `CancelFlowResponse` schema for cancellation response
- Implement robust error handling and logging for job cancellation process

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Gabriel Luiz Freitas Almeida 2025-02-25 14:17:12 -03:00 • committed by GitHub
commit d02b4573e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 84 additions and 2 deletions

5
uv.lock generated
View file

@ -1,4 +1,5 @@
version = 1
revision = 1
requires-python = ">=3.10, <3.14"
resolution-markers = [
"python_full_version >= '3.13'",
@ -4491,7 +4492,7 @@ requires-dist = [
{ name = "pymongo", specifier = "==4.10.1" },
{ name = "python-pptx", marker = "extra == 'nv-ingest'", specifier = "==0.6.23" },
{ name = "pytube", specifier = "==15.0.0" },
{ name = "pywin32", marker = "sys_platform == 'win32'", specifier = ">=307,<308" },
{ name = "pywin32", marker = "sys_platform == 'win32'", specifier = "==307" },
{ name = "qdrant-client", specifier = "==1.9.2" },
{ name = "qianfan", specifier = "==0.3.5" },
{ name = "ragstack-ai-knowledge-store", specifier = "==0.2.1" },
@ -4513,6 +4514,7 @@ requires-dist = [
{ name = "youtube-transcript-api", specifier = "==0.6.3" },
{ name = "zep-python", specifier = "==2.0.2" },
]
provides-extras = ["deploy", "couchbase", "cassio", "local", "clickhouse-connect", "nv-ingest"]
[package.metadata.requires-dev]
dev = [
@ -4763,6 +4765,7 @@ requires-dist = [
{ name = "uvicorn", specifier = ">=0.30.0,<1.0.0" },
{ name = "validators", specifier = ">=0.34.0" },
]
provides-extras = ["deploy", "local", "all"]
[package.metadata.requires-dev]
dev = [