Skip to content

🔧 [Lang API] Track what if the chat chunk is the final one #161

Description

@roma-glushko

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions