MCPcopy Create free account
hub / github.com/aurora-develop/aurora / writeChatCompletionStreamDone

Function writeChatCompletionStreamDone

initialize/handlers.go:37–45  ·  view source on GitHub ↗
(c *gin.Context, stopSent bool, model string, conversationID string)

Source from the content-addressed store, hash-verified

35}
36
37func writeChatCompletionStreamDone(c *gin.Context, stopSent bool, model string, conversationID string) {
38 if !stopSent {
39 finalLine := officialtypes.StopChunkWithConversation("stop", model, conversationID)
40 c.Writer.WriteString("data: " + finalLine.String() + "\n\n")
41 c.Writer.Flush()
42 }
43 c.Writer.WriteString("data: [DONE]\n\n")
44 c.Writer.Flush()
45}
46
47func NewHandle(proxy *proxys.IProxy, token *tokens.AccessToken) *Handler {
48 return &Handler{proxy: proxy, token: token, sessions: NewSessionManager()}

Calls 2

StringMethod · 0.80
FlushMethod · 0.80