61 lines
978 B
Go
61 lines
978 B
Go
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)
|
|
}
|