From a5ab816c9434022159548ac0d1872160b3c8908d Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Mon, 2 Dec 2024 19:58:03 +0300 Subject: Feat: add character card support --- tools.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'tools.go') diff --git a/tools.go b/tools.go index 44df9f5..5d8960b 100644 --- a/tools.go +++ b/tools.go @@ -10,8 +10,8 @@ import ( var ( // TODO: form that message based on existing funcs - basicSysMsg = `Large Language Model that helps user with any of his requests.` toolCallRE = regexp.MustCompile(`__tool_call__\s*([\s\S]*?)__tool_call__`) + basicSysMsg = `Large Language Model that helps user with any of his requests.` toolSysMsg = `You're a helpful assistant. # Tools You can do functions call if needed. @@ -47,8 +47,20 @@ Tool call is addressed to the tool agent, avoid sending more info than tool call When done right, tool call will be delivered to the tool agent. tool agent will respond with the results of the call. After that you are free to respond to the user. ` - systemMsg = toolSysMsg - sysMap = map[string]string{"basic_sys": basicSysMsg, "tool_sys": toolSysMsg} + basicCard = &models.CharCard{ + SysPrompt: basicSysMsg, + FirstMsg: defaultFirstMsg, + Role: "", + FilePath: "", + } + toolCard = &models.CharCard{ + SysPrompt: toolSysMsg, + FirstMsg: defaultFirstMsg, + Role: "", + FilePath: "", + } + // sysMap = map[string]string{"basic_sys": basicSysMsg, "tool_sys": toolSysMsg} + sysMap = map[string]*models.CharCard{"basic_sys": basicCard, "tool_sys": toolCard} sysLabels = []string{"cancel", "basic_sys", "tool_sys"} ) -- cgit v1.2.3