mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-05 13:52:40 +02:00
refactor(chat): implement turn cancellation and status management in new chat routes for improved user experience and error handling
This commit is contained in:
parent
4056bd1d69
commit
af66fbf106
12 changed files with 671 additions and 81 deletions
|
|
@ -335,6 +335,24 @@ class ResumeRequest(BaseModel):
|
|||
local_filesystem_mounts: list[LocalFilesystemMountPayload] | None = None
|
||||
|
||||
|
||||
class CancelActiveTurnResponse(BaseModel):
|
||||
"""Response for canceling an active turn on a chat thread."""
|
||||
|
||||
status: Literal["cancelling", "idle"]
|
||||
error_code: Literal["TURN_CANCELLING", "NO_ACTIVE_TURN"]
|
||||
retry_after_ms: int | None = None
|
||||
retry_after_at: int | None = None
|
||||
|
||||
|
||||
class TurnStatusResponse(BaseModel):
|
||||
"""Current turn execution status for a thread."""
|
||||
|
||||
status: Literal["idle", "busy", "cancelling"]
|
||||
active_turn_id: str | None = None
|
||||
retry_after_ms: int | None = None
|
||||
retry_after_at: int | None = None
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Public Chat Snapshot Schemas
|
||||
# =============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue