diff options
author | Grail Finder <wohilas@gmail.com> | 2025-08-08 09:24:47 +0300 |
---|---|---|
committer | Grail Finder <wohilas@gmail.com> | 2025-08-08 09:24:47 +0300 |
commit | 9cb4561c828426502b5a28797b932db6c06e22b1 (patch) | |
tree | b82b102669b5bacfde1379fd9b4945ee3d1f58f3 /tools.go | |
parent | d59b985534474ecd27c3c144e7dd770a2433d184 (diff) |
Enha: openai tools [WIP]
Diffstat (limited to 'tools.go')
-rw-r--r-- | tools.go | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -1,8 +1,8 @@ package main import ( - "gf-lt/models" "fmt" + "gf-lt/models" "regexp" "strings" "time" @@ -141,3 +141,29 @@ var fnMap = map[string]fnSig{ "recall_topics": recallTopics, "memorise": memorise, } + +// openai style def +var baseTools = []models.Tool{ + // memorise + models.Tool{ + Type: "function", + Function: models.ToolFunc{ + Name: "memorise", + Description: "save topic-data in key-value cache", + Parameters: models.ToolFuncParams{ + Type: "object", + Required: []string{"topic", "data"}, + Properties: map[string]models.ToolArgProps{ + "topic": models.ToolArgProps{ + Type: "string", + Description: "topic is the key under which data is saved", + }, + "data": models.ToolArgProps{ + Type: "string", + Description: "data is the value that is saved under the topic-key", + }, + }, + }, + }, + }, +} |