MCPcopy Index your code
hub / github.com/LumaAI-API/Luma-API / ConstructChatCompletionStreamReponse

Function ConstructChatCompletionStreamReponse

common/openai_tools.go:86–102  ·  view source on GitHub ↗
(model, answerID string, answer string)

Source from the content-addressed store, hash-verified

84}
85
86func ConstructChatCompletionStreamReponse(model, answerID string, answer string) openai.ChatCompletionStreamResponse {
87 resp := openai.ChatCompletionStreamResponse{
88 ID: answerID,
89 Object: "chat.completion.chunk",
90 Created: time.Now().Unix(),
91 Model: model,
92 Choices: []openai.ChatCompletionStreamChoice{
93 {
94 Index: 0,
95 Delta: openai.ChatCompletionStreamChoiceDelta{
96 Content: answer,
97 },
98 },
99 },
100 }
101 return resp
102}
103
104func SendChatData(w http.ResponseWriter, model string, chatID, data string) {
105 dataRune := []rune(data)

Callers 1

SendChatDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected