summaryrefslogtreecommitdiff
path: root/tools.go
blob: 82f07b31f75b1a075da0241430764160dc42f9a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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,
}