类 ToolExecutor
java.lang.Object
com.agentsflex.core.model.chat.tool.ToolExecutor
函数调用执行器,支持责任链拦截。
执行顺序:全局拦截器 → 用户拦截器 → 实际函数调用。
-
字段概要
字段 -
构造器概要
构造器构造器说明ToolExecutor(Tool tool, ToolCall toolCall) ToolExecutor(Tool tool, ToolCall toolCall, List<ToolInterceptor> userInterceptors) -
方法概要
修饰符和类型方法说明voidaddInterceptor(ToolInterceptor interceptor) 动态添加拦截器(添加到链尾)voidaddInterceptors(List<ToolInterceptor> interceptors) private ToolChainbuildChain(int index) private List<ToolInterceptor>buildInterceptorChain(List<ToolInterceptor> userInterceptors) execute()执行函数调用,触发拦截链。getTool()
-
字段详细资料
-
tool
-
toolCall
-
interceptors
-
-
构造器详细资料
-
ToolExecutor
-
ToolExecutor
-
-
方法详细资料
-
buildInterceptorChain
-
addInterceptor
动态添加拦截器(添加到链尾) -
addInterceptors
-
execute
执行函数调用,触发拦截链。- 返回:
- 函数返回值
- 抛出:
RuntimeException- 包装原始异常
-
buildChain
-
getTool
-
getToolCall
-
getInterceptors
-