summaryrefslogtreecommitdiff
path: root/windowChats.go
diff options
context:
space:
mode:
Diffstat (limited to 'windowChats.go')
-rw-r--r--windowChats.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/windowChats.go b/windowChats.go
index 39906b7..14e09ac 100644
--- a/windowChats.go
+++ b/windowChats.go
@@ -129,9 +129,30 @@ func addChatsPB(win *gadgets.GenericWindow, pb *chatpb.Chats) *chatpb.ChatsTable
genaiButton.Custom = func(chat *chatpb.Chat) {
log.Info("show *genai.GeminiRequsts for", chat.GetUuid())
chat.PrintChatGeminiTable()
+ pb := makeBooksTable(chat)
+ makeBookWindow(pb)
}
// draw the tabel (send the gui protobuf to the GO plugin)
t.ShowTable()
return t
}
+
+func makeBooksTable(chat *chatpb.Chat) *chatpb.Books {
+ var pb *chatpb.Books
+
+ pb = chatpb.NewBooks()
+
+ for _, entry := range chat.GetEntries() {
+ if entry.GeminiRequest == nil {
+ continue
+ }
+ newb := new(chatpb.Book)
+ newb.Ctime = entry.Ctime
+ newb.Uuid = entry.Uuid
+ newb.From = entry.From
+ newb.GeminiRequest = entry.GeminiRequest
+ pb.Append(newb)
+ }
+ return pb
+}