diff --git a/astrbot/message/handler.py b/astrbot/message/handler.py index 89383a46..a2072643 100644 --- a/astrbot/message/handler.py +++ b/astrbot/message/handler.py @@ -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() diff --git a/util/agent/func_call.py b/util/agent/func_call.py index 5283ee4d..830496ca 100644 --- a/util/agent/func_call.py +++ b/util/agent/func_call.py @@ -1,6 +1,5 @@ from model.provider.provider import Provider import json -import time import textwrap class FuncCallJsonFormatError(Exception): diff --git a/util/agent/web_searcher.py b/util/agent/web_searcher.py index e519ca69..d9b38431 100644 --- a/util/agent/web_searcher.py +++ b/util/agent/web_searcher.py @@ -1,6 +1,4 @@ -import traceback import random -import json import aiohttp import os