From 512ebf5be67f468eaeeb223911c6f6707cea3015 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 30 Aug 2025 16:54:54 -0500 Subject: attempt to marshal JSON file to protobuf --- json.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'json.go') diff --git a/json.go b/json.go index 129046d..e663fc5 100644 --- a/json.go +++ b/json.go @@ -4,6 +4,7 @@ import ( "encoding/json" "os" + "go.wit.com/lib/protobuf/chatpb" "go.wit.com/log" "google.golang.org/genai" ) @@ -53,6 +54,10 @@ func parseJSON(filename string) (*GeminiRequest, error) { if err != nil { return nil, log.Errorf("failed to read file %s: %w", filename, err) } + pb := new(chatpb.GeminiRequest) + if err := pb.UnmarshalJSON(data); err != nil { + return nil, err + } // Unmarshal the JSON data var req *GeminiRequest -- cgit v1.2.3