diff options
author | Grail Finder <wohilas@gmail.com> | 2024-11-20 13:32:32 +0300 |
---|---|---|
committer | Grail Finder <wohilas@gmail.com> | 2024-11-20 13:33:04 +0300 |
commit | fc517c2c69d96501f1adc5a021b39b9eff22e4d7 (patch) | |
tree | 669bb1a364359bb8565b7fed7b1828593395958d /tools.go | |
parent | 8ae4d075c4d043eae604af9cad0cf5e571420a61 (diff) |
Chore: tools to their own file [wip]
Diffstat (limited to 'tools.go')
-rw-r--r-- | tools.go | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/tools.go b/tools.go new file mode 100644 index 0000000..82f07b3 --- /dev/null +++ b/tools.go @@ -0,0 +1,59 @@ +package main + +var ( + // TODO: form that message based on existing funcs + systemMsg = `You're a helpful assistant. +# Tools +You can do functions call if needed. +Your current tools: +<tools> +{ +"name":"get_id", +"args": "username" +} +</tools> +To make a function call return a json object within __tool_call__ tags; +Example: +__tool_call__ +{ +"name":"get_id", +"args": "Adam" +} +__tool_call__ +When making function call avoid typing anything else. 'tool' user will respond with the results of the call. +After that you are free to respond to the user. +` +) + +func memorize(topic, info string) { + // +} + +func recall(topic string) string { + // + return "" +} + +func recallTopics() []string { + return []string{} +} + +func fullMemoryLoad() {} + +// predifine funcs +func getUserDetails(id ...string) map[string]any { + // db query + // return DB[id[0]] + return map[string]any{ + "username": "fm11", + "id": 24983, + "reputation": 911, + "balance": 214.73, + } +} + +type fnSig func(...string) map[string]any + +var fnMap = map[string]fnSig{ + "get_id": getUserDetails, +} |