Expose the status of the chunk in the stream: if it's the final chunk that closed the whole stream or not:
|
// TODO: use objectpool here |
|
chatResponse := schemas.ChatResponse{ |
|
ID: completionChunk.ID, |
|
Created: completionChunk.Created, |
|
Provider: providerName, |
|
Cached: false, |
|
ModelName: completionChunk.ModelName, |
|
ModelResponse: schemas.ModelResponse{ |
|
SystemID: map[string]string{ |
|
"system_fingerprint": completionChunk.SystemFingerprint, |
|
}, |
|
Message: schemas.ChatMessage{ |
|
Role: completionChunk.Choices[0].Delta.Role, |
|
Content: completionChunk.Choices[0].Delta.Content, |
|
}, |
|
}, |
|
// TODO: Pass info if this is the final message |
|
} |
|
|
|
responseC <- chatResponse |
Expose the status of the chunk in the stream: if it's the final chunk that closed the whole stream or not:
glide/pkg/providers/openai/chat_stream.go
Lines 114 to 133 in 6960732