From fc517c2c69d96501f1adc5a021b39b9eff22e4d7 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Wed, 20 Nov 2024 13:32:32 +0300 Subject: Chore: tools to their own file [wip] --- bot.go | 39 --------------------------------------- 1 file changed, 39 deletions(-) (limited to 'bot.go') diff --git a/bot.go b/bot.go index 4587c08..2037e7e 100644 --- a/bot.go +++ b/bot.go @@ -44,47 +44,8 @@ var ( {Role: assistantRole, Content: defaultFirstMsg}, } interruptResp = false - systemMsg = `You're a helpful assistant. -# Tools -You can do functions call if needed. -Your current tools: - -{ -"name":"get_id", -"args": "username" -} - -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. -` ) -// 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, -} - // ==== func getUserInput(userPrompt string) string { -- cgit v1.2.3