summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bot.go2
-rw-r--r--llm.go2
-rw-r--r--tools.go6
3 files changed, 6 insertions, 4 deletions
diff --git a/bot.go b/bot.go
index 776a373..35ea0fa 100644
--- a/bot.go
+++ b/bot.go
@@ -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)
}
diff --git a/llm.go b/llm.go
index 14caa5c..05874a1 100644
--- a/llm.go
+++ b/llm.go
@@ -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)
diff --git a/tools.go b/tools.go
index dee0577..acc4697 100644
--- a/tools.go
+++ b/tools.go
@@ -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{},