From 15ee86ec62882779de442e2728e5e589ebb488d0 Mon Sep 17 00:00:00 2001 From: Snider Date: Fri, 20 Feb 2026 02:05:46 +0000 Subject: [PATCH] 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 --- inference.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inference.go b/inference.go index 56a37f2..d695f3d 100644 --- a/inference.go +++ b/inference.go @@ -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.