summaryrefslogtreecommitdiff
path: root/windowBook.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-03 01:19:37 -0500
committerJeff Carr <[email protected]>2025-09-03 01:19:37 -0500
commitf5b513fa05ddbaaa2149cf0527ae1206e653266b (patch)
tree5e3776433b90c16e6cf30acb4468af712c5712da /windowBook.go
parent785591ab4cb3026ff069271b6f322a2e6f13eec8 (diff)
buttons for different stuffv0.0.6
Diffstat (limited to 'windowBook.go')
-rw-r--r--windowBook.go20
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