summaryrefslogtreecommitdiff
path: root/json.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-08-30 16:54:54 -0500
committerJeff Carr <[email protected]>2025-08-30 16:54:54 -0500
commit512ebf5be67f468eaeeb223911c6f6707cea3015 (patch)
treef2c14fd9a7d3cf736c538032af5eba7cebd7aab8 /json.go
parent6888512b3bb422e83d98edcf3e7b18b89f3f504f (diff)
attempt to marshal JSON file to protobuf
Diffstat (limited to 'json.go')
-rw-r--r--json.go5
1 files changed, 5 insertions, 0 deletions
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