fix: add json struct tags to Message for API serialization

Message is used as a type alias by go-ml. Without json tags,
HTTP backends that serialize messages to JSON (e.g. OpenAI API)
would produce incorrect field names.

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Snider 2026-02-20 02:05:46 +00:00
parent c61ec9f5c7
commit 15ee86ec62

View file

@ -79,8 +79,8 @@ type Token struct {
// Message represents a chat message for multi-turn conversation.
type Message struct {
Role string // "system", "user", "assistant"
Content string
Role string `json:"role"` // "system", "user", "assistant"
Content string `json:"content"`
}
// ClassifyResult holds the output for a single prompt in a batch classification.