1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
package chatpb
import "go.wit.com/log"
func TestChat() {
conversation := NewChats()
chat := new(Chat)
chat.Content = "this was fun"
t := new(Table)
t.Columns = 4
// t.Rows = append(t.Rows, []string{"a", "b"})
chat.Table = t
r := new(Row)
r.Fields = []string{"a", "b"}
t.Rows = append(t.Rows, r)
r = new(Row)
r.Fields = []string{"1", "", "2", "3"}
t.Rows = append(t.Rows, r)
conversation.Append(chat)
conversation.AddGeminiComment("I like astronomy")
dump := conversation.FormatTEXT()
log.Println(dump)
}
func (c *Chats) AddTable() {
chat := new(Chat)
t := new(Table)
t.Columns = 4
// t.Rows = append(t.Rows, []string{"a", "b"})
r := new(Row)
r.Fields = []string{"a", "b"}
t.Rows = append(t.Rows, r)
r = new(Row)
r.Fields = []string{"1", "", "2", "3"}
t.Rows = append(t.Rows, r)
chat.Table = t
c.Append(chat)
}
func (c *Chats) AddGeminiComment(s string) {
chat := new(Chat)
chat.Gemini = true
chat.Content = s
c.Append(chat)
}
|