diff options
author | Grail Finder <wohilas@gmail.com> | 2025-08-08 14:26:01 +0300 |
---|---|---|
committer | Grail Finder <wohilas@gmail.com> | 2025-08-08 14:26:01 +0300 |
commit | 6955a5bc3a89e982f0b05d1e8e6f109e3b79d9ca (patch) | |
tree | efc6375fb276562f786851220794ecc0ac63decc | |
parent | 3b7784e0a44e7f8ca5c14db590ebdfe1736e87e5 (diff) |
-rw-r--r-- | bot.go | 2 | ||||
-rw-r--r-- | llm.go | 2 | ||||
-rw-r--r-- | tools.go | 6 |
3 files changed, 6 insertions, 4 deletions
@@ -448,6 +448,8 @@ func findCall(msg, toolCall string, tv *tview.TextView) { } resp := f(fc.Args) toolMsg := fmt.Sprintf("tool response: %+v", string(resp)) + fmt.Fprintf(tv, "%s[-:-:b](%d) <%s>: [-:-:-]\n%s\n", + "\n", len(chatBody.Messages), cfg.ToolRole, toolMsg) chatRound(toolMsg, cfg.ToolRole, tv, false, false) } @@ -173,7 +173,7 @@ func (op OpenAIer) FormMsg(msg, role string, resume bool) (io.Reader, error) { ChatBody: chatBody, Tools: nil, } - if cfg.ToolUse && !resume { + if cfg.ToolUse && !resume && role != cfg.ToolRole { req.Tools = baseTools // set tools to use } data, err := json.Marshal(req) @@ -149,7 +149,7 @@ var baseTools = []models.Tool{ Type: "function", Function: models.ToolFunc{ Name: "memorise", - Description: "save topic-data in key-value cache", + Description: "Save topic-data in key-value cache. Use when asked to remember something/keep in mind.", Parameters: models.ToolFuncParams{ Type: "object", Required: []string{"topic", "data"}, @@ -171,7 +171,7 @@ var baseTools = []models.Tool{ Type: "function", Function: models.ToolFunc{ Name: "recall", - Description: "recall topic-data from key-value cache", + Description: "Recall topic-data from key-value cache. Use when precise info about the topic is needed.", Parameters: models.ToolFuncParams{ Type: "object", Required: []string{"topic"}, @@ -189,7 +189,7 @@ var baseTools = []models.Tool{ Type: "function", Function: models.ToolFunc{ Name: "recall_topics", - Description: "recall all topics from key-value cache", + Description: "Recall all topics from key-value cache. Use when need to know what topics are currently stored in memory.", Parameters: models.ToolFuncParams{ Type: "object", Required: []string{}, |