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

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

parent 02e9a20e
......@@ -183,10 +183,12 @@ public class AgentApplicationTools {
List<Tool> deductionTools = new ArrayList<>();
FunctionCallResult functionCallResult = llmService.functionCall(query, tools.toArray(new Tool[0]));
if (functionCallResult != null && functionCallResult.isNeed()) {
LargeModelFunctionEnum functionEnum = LargeModelFunctionEnum.valueOf(functionCallResult.getFunctionCall().getName());
String llmConfig = functionEnum.getFunction().getLLMConfig().get(0);
Tool tool = JsonUtils.deSerialize(llmConfig, Tool.class);
deductionTools.add(tool);
for (Tool tool : tools) {
if (tool.getFunction().getName().equals(functionCallResult.getFunctionCall().getName())) {
deductionTools.add(tool);
break;
}
}
}
checkPluginUseEntity.setDeductionTools(deductionTools);
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