diff options
| author | Jeff Carr <[email protected]> | 2025-08-30 18:07:41 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-08-30 18:07:41 -0500 |
| commit | fbbed0475bc680afb754bbe9ba471c584d884a8f (patch) | |
| tree | 8aeac923b5aeaa193744ff4e774065ce9545e707 /main.go | |
| parent | 512ebf5be67f468eaeeb223911c6f6707cea3015 (diff) | |
parse stuff
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 43 |
1 files changed, 33 insertions, 10 deletions
@@ -8,6 +8,8 @@ package main import ( "embed" "os" + "path/filepath" + "strings" "github.com/google/uuid" "go.wit.com/dev/alexflint/arg" @@ -65,21 +67,42 @@ func main() { _ = aiClient if argv.JsonFile != "" { - jstruct, err := parseJSON(argv.JsonFile) - if err != nil { - badExit(err) - } - log.Info("parseJSON() ok. model =", jstruct.Model) + /* + jstruct, err := parseJSON(argv.JsonFile) + if err != nil { + badExit(err) + } + log.Info("parseJSON() ok. model =", jstruct.Model) - // Marshal this JSON file into a protobuf - genaiContent, err := convertToGenai(jstruct) + // Marshal this JSON file into a protobuf + genaiContent, err := convertToGenai(jstruct) + if err != nil { + badExit(err) + } + log.Info("Successfully converted JSON to genai.Content") + // Here you would now use the 'genaiContent' to send to the API + _ = genaiContent // Prevent unused variable error for now + */ + + // now try to Marshal() into a protobuf + pb, err := parsePB(argv.JsonFile) if err != nil { badExit(err) } - log.Info("Successfully converted JSON to genai.Content") - // Here you would now use the 'genaiContent' to send to the API - _ = genaiContent // Prevent unused variable error for now + log.Info("GeminiContent pb.Marshal() worked len =", len(pb.Contents)) + _, filename := filepath.Split(argv.JsonFile) + parts := strings.Split(filename, ".") + if len(parts) == 5 { + uuid := parts[1] + log.Info(uuid, parts) + // newEntry := new(chatpb.ChatEntry) + // newEntry.GeminiRequest = pb + if chat := me.chats.FindByUuid(uuid); chat != nil { + log.Info("FOUND CHAT", uuid) + } + } else { + } okExit("") } |
