diff options
Diffstat (limited to 'windowBook.go')
| -rw-r--r-- | windowBook.go | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/windowBook.go b/windowBook.go index 32ca20f..0e810d8 100644 --- a/windowBook.go +++ b/windowBook.go @@ -66,9 +66,23 @@ func addBooksPB(win *gadgets.GenericWindow, pb *chatpb.Books) *chatpb.BooksTable } // add a general show button - bf := t.AddButtonFunc("cur version", func(chat *chatpb.Book) string { return "show" }) - bf.Custom = func(r *chatpb.Book) { - log.Info("todo: show a chat window here", r.GetUuid()) + bf := t.AddButtonFunc("cur version", func(chat *chatpb.Book) string { return "submit" }) + bf.Custom = func(book *chatpb.Book) { + log.Info("convert pb to genai GO API HERE", book.GetUuid()) + if book.GetGeminiRequest() == nil { + return + } + aichat, err := convertToGenai(book.GetGeminiRequest()) + if err != nil { + log.Info("convertToGenai() returned with error", err) + return + } + err = submitChat(aichat) + if err != nil { + log.Info("submitChat() returned with error", err) + return + } + log.Info("submitChat() appears to have worked?") } // show the age of the chat |
