diff options
| author | Jeff Carr <[email protected]> | 2025-09-02 01:21:48 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-02 01:21:48 -0500 |
| commit | aebfe325d63a947d936c069a8cffd3b2d631aeae (patch) | |
| tree | 2a19e7287ca08d84b5d375b7b753498364497471 /addChat.go | |
| parent | 49ad81bc279a8b1669f68e5d02c95d2a66a5cb4b (diff) | |
functions to double check the sanity of JSON Marshal
Diffstat (limited to 'addChat.go')
| -rw-r--r-- | addChat.go | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -6,7 +6,6 @@ import ( "time" "go.wit.com/log" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" ) // returns true if the pb was added @@ -15,14 +14,23 @@ func (c *Chat) AddGeminiRequest(fname string, age time.Time, pb *GeminiRequest) for _, e := range c.GetEntries() { if e.GetContentFile() == fname { log.Info("fname already here", fname) + if iContent, iParts, ok := e.VerifyGeminiRequest(pb); ok { + log.Info("pb is already here with same size", iContent, iParts) + return false + } else { + log.Info("pb is already here but things don't match", iContent, iParts) + } return false } } - e := new(ChatEntry) - e.Ctime = timestamppb.New(age) - e.From = Who_USER - e.ContentFile = fname - e.GeminiRequest = pb - c.AppendEntry(e) + log.Info("not sure if c.Entries == pb for real. need to read Content & Parts") + /* + e := new(ChatEntry) + e.Ctime = timestamppb.New(age) + e.From = Who_USER + e.ContentFile = fname + e.GeminiRequest = pb + c.AppendEntry(e) + */ return true } |
