mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-15 00:07:28 +00:00
OAI: Add finish to completions
OAI spec requires [DONE] to be sent over SSE to signal that a generation is completed. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
3
main.py
3
main.py
@@ -366,6 +366,9 @@ async def generate_completion(request: Request, data: CompletionRequest):
|
||||
)
|
||||
|
||||
yield get_sse_packet(response.model_dump_json())
|
||||
|
||||
# Yield a finish response on successful generation
|
||||
yield get_sse_packet("[DONE]")
|
||||
except CancelledError:
|
||||
logger.error("Completion request cancelled by user.")
|
||||
except Exception as exc:
|
||||
|
||||
Reference in New Issue
Block a user