feat: customized tool-use

This commit is contained in:
Soulter
2024-09-08 08:16:36 -04:00
parent b5cb5eb969
commit 98863ab901
3 changed files with 3 additions and 4 deletions
+3 -1
View File
@@ -214,7 +214,9 @@ class MessageHandler():
return MessageResult("AstrBot Function-calling 异常:未找到请求的函数调用。")
try:
args = json.loads(llm_result.arguments)
function_invoked_ret = await func_obj(**args)
args['ame'] = message
args['context'] = self.context
llm_result = await func_obj(**args)
has_func = True
except BaseException as e:
traceback.print_exc()
-1
View File
@@ -1,6 +1,5 @@
from model.provider.provider import Provider
import json
import time
import textwrap
class FuncCallJsonFormatError(Exception):
-2
View File
@@ -1,6 +1,4 @@
import traceback
import random
import json
import aiohttp
import os