diff options
author | Grail Finder <wohilas@gmail.com> | 2025-02-16 13:43:42 +0300 |
---|---|---|
committer | Grail Finder <wohilas@gmail.com> | 2025-02-16 13:43:42 +0300 |
commit | 3ae71d81c426d5526827da1df3d930b991d0d62f (patch) | |
tree | 9aa3b96ea3bfd5a7223e425b3f9bbd2bd894a129 /tables.go | |
parent | 58d632ed196ba8704cd79a0c9db773beb78ebee6 (diff) |
Fix: card edit
Diffstat (limited to 'tables.go')
-rw-r--r-- | tables.go | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -112,15 +112,23 @@ func makeChatTable(chatMap map[string]models.Chat) *tview.Table { if err := notifyUser("error", "no such card: "+agentName); err != nil { logger.Warn("failed ot notify", "error", err) } + return + } + if chatBody.Messages[0].Role != "system" || chatBody.Messages[1].Role != agentName { + if err := notifyUser("error", "unexpected chat structure; card: "+agentName); err != nil { + logger.Warn("failed ot notify", "error", err) + } + return } + // change sys_prompt + first msg + cc.SysPrompt = chatBody.Messages[0].Content + cc.FirstMsg = chatBody.Messages[1].Content if err := pngmeta.WriteToPng(cc.ToSpec(cfg.UserRole), cc.FilePath, cc.FilePath); err != nil { logger.Error("failed to write charcard", "error", err) } - // pages.RemovePage(historyPage) return default: - // pages.RemovePage(historyPage) return } }) |