diff options
| author | Jeff Carr <[email protected]> | 2025-08-22 02:38:49 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-08-22 02:38:49 -0500 |
| commit | 21ca3300d4e8bccb6e324ec7c3fa62aa2f1cea35 (patch) | |
| tree | 40d9956dcb4daa8db85f9d7d9ac8633df1a12aa4 | |
| parent | 185677e464c9e2842c75500156ba9b38c40acbf8 (diff) | |
changed protobuf
| -rw-r--r-- | chat.proto | 14 | ||||
| -rw-r--r-- | example.go | 11 | ||||
| -rw-r--r-- | helpers.go | 12 |
3 files changed, 17 insertions, 20 deletions
@@ -40,22 +40,16 @@ message ChatEntry { // `autogenpb:nomute string content = 3; Table table = 4; repeated ToolCall ToolCalls = 5; - string ContentFile = 6; // `autogenpb:unique` `autogenpb:sort` + string ContentFile = 6; string uuid = 7; // `autogenpb:unique` `autogenpb:sort` repeated CodeSnippet Snippets = 8; } message Chat { // `autogenpb:nomutex` - Who from = 1; + string uuid = 1; // `autogenpb:unique` `autogenpb:sort` google.protobuf.Timestamp ctime = 2; - string content = 3; - Table table = 4; - repeated ToolCall ToolCalls = 5; - string ContentFile = 6; // `autogenpb:unique` `autogenpb:sort` - string uuid = 7; // `autogenpb:unique` `autogenpb:sort` - repeated CodeSnippet Snippets = 8; - string ChatName = 9; - repeated ChatEntry Entries = 10; + string ChatName = 3; + repeated ChatEntry Entries = 4; } message Chats { // `autogenpb:marshal` `autogenpb:mutex` @@ -10,11 +10,14 @@ func ExampleChat() *Chats { t := conversation.AddTable() t.AddRow([]string{"apple", "pear"}) - gchat := conversation.AddGeminiComment("funny") + conversation.AddGeminiComment("funny") - snip := new(CodeSnippet) - snip.Filename = "log/snip1.txt" - gchat.Snippets = append(gchat.Snippets, snip) + /* + gchat := conversation.AddGeminiComment("funny") + snip := new(CodeSnippet) + snip.Filename = "log/snip1.txt" + gchat.Snippets = append(gchat.Snippets, snip) + */ conversation.AddUserComment("yes") @@ -12,8 +12,8 @@ import ( timestamppb "google.golang.org/protobuf/types/known/timestamppb" ) -func (c *Chats) AddGeminiComment(s string) *Chat { - chat := new(Chat) +func (c *Chats) AddGeminiComment(s string) *ChatEntry { + chat := new(ChatEntry) chat.From = Who_GEMINI chat.Content = s @@ -24,8 +24,8 @@ func (c *Chats) AddGeminiComment(s string) *Chat { return chat } -func (c *Chats) AddUserComment(s string) *Chat { - chat := new(Chat) +func (c *Chats) AddUserComment(s string) *ChatEntry { + chat := new(ChatEntry) chat.From = Who_USER chat.Content = s @@ -172,12 +172,12 @@ func (c *Chat) VerifyUuid() bool { return false } -func (x *Chats) AppendNew(y *Chat) { +func (x *Chats) AppendNew(y *ChatEntry) { x.Lock() defer x.Unlock() var chat *Chat - chat = proto.Clone(y).(*Chat) + chat = proto.Clone(y).(*ChatEntry) x.Chats = append(x.Chats, chat) } |
