Commit 69cee06a authored by alex yao's avatar alex yao

fix: 修复调用记忆变量异常

parent 02e9a20e
...@@ -183,10 +183,12 @@ public class AgentApplicationTools { ...@@ -183,10 +183,12 @@ public class AgentApplicationTools {
List<Tool> deductionTools = new ArrayList<>(); List<Tool> deductionTools = new ArrayList<>();
FunctionCallResult functionCallResult = llmService.functionCall(query, tools.toArray(new Tool[0])); FunctionCallResult functionCallResult = llmService.functionCall(query, tools.toArray(new Tool[0]));
if (functionCallResult != null && functionCallResult.isNeed()) { if (functionCallResult != null && functionCallResult.isNeed()) {
LargeModelFunctionEnum functionEnum = LargeModelFunctionEnum.valueOf(functionCallResult.getFunctionCall().getName()); for (Tool tool : tools) {
String llmConfig = functionEnum.getFunction().getLLMConfig().get(0); if (tool.getFunction().getName().equals(functionCallResult.getFunctionCall().getName())) {
Tool tool = JsonUtils.deSerialize(llmConfig, Tool.class); deductionTools.add(tool);
deductionTools.add(tool); break;
}
}
} }
checkPluginUseEntity.setDeductionTools(deductionTools); checkPluginUseEntity.setDeductionTools(deductionTools);
checkPluginUseEntity.setFunctionCallResult(functionCallResult); checkPluginUseEntity.setFunctionCallResult(functionCallResult);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment