diff options
Diffstat (limited to 'make_chat.go')
| -rw-r--r-- | make_chat.go | 57 |
1 files changed, 41 insertions, 16 deletions
diff --git a/make_chat.go b/make_chat.go index 26c4ea3..b6736c4 100644 --- a/make_chat.go +++ b/make_chat.go @@ -5,23 +5,31 @@ import "go.wit.com/log" func TestChat() { conversation := NewChats() - chat := new(Chat) - chat.Content = "this was fun" + /* + 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 + 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{"a", "b"} + t.Rows = append(t.Rows, r) - r = new(Row) - r.Fields = []string{"1", "", "2", "3"} - t.Rows = append(t.Rows, r) + r = new(Row) + r.Fields = []string{"1", "", "2", "3"} + t.Rows = append(t.Rows, r) + + conversation.Append(chat) + */ + + t := conversation.AddTable() + t.AddRow([]string{"apple", "pear"}) - conversation.Append(chat) + conversation.AddGeminiComment("funny") + conversation.AddUserComment("yes") conversation.AddGeminiComment("I like astronomy") @@ -30,7 +38,13 @@ func TestChat() { log.Println(dump) } -func (c *Chats) AddTable() { +func (t *Table) AddRow(f []string) { + r := new(Row) + r.Fields = f + t.Rows = append(t.Rows, r) +} + +func (c *Chats) AddTable() *Table { chat := new(Chat) t := new(Table) @@ -38,7 +52,7 @@ func (c *Chats) AddTable() { // t.Rows = append(t.Rows, []string{"a", "b"}) r := new(Row) - r.Fields = []string{"a", "b"} + r.Fields = []string{"j", "r", "a", "b"} t.Rows = append(t.Rows, r) r = new(Row) @@ -48,12 +62,23 @@ func (c *Chats) AddTable() { chat.Table = t c.Append(chat) + + return t } func (c *Chats) AddGeminiComment(s string) { chat := new(Chat) - chat.Gemini = true + chat.From = Who_GEMINI + chat.Content = s + + c.Append(chat) +} + +func (c *Chats) AddUserComment(s string) { + chat := new(Chat) + + chat.From = Who_USER chat.Content = s c.Append(chat) |
