Commit 99c3f494 authored by alex yao's avatar alex yao

fix:修复插件调用失败后,积分回滚

parent 25f14aac
...@@ -35,6 +35,7 @@ import cn.com.poc.thirdparty.resource.demand.ai.function.long_memory.LongMemory; ...@@ -35,6 +35,7 @@ import cn.com.poc.thirdparty.resource.demand.ai.function.long_memory.LongMemory;
import cn.com.poc.thirdparty.resource.demand.ai.function.memory_variable_writer.MemoryVariableWriter; import cn.com.poc.thirdparty.resource.demand.ai.function.memory_variable_writer.MemoryVariableWriter;
import cn.com.poc.thirdparty.service.LLMService; import cn.com.poc.thirdparty.service.LLMService;
import cn.com.yict.framemax.core.context.Context; import cn.com.yict.framemax.core.context.Context;
import cn.com.yict.framemax.core.exception.BusinessException;
import cn.com.yict.framemax.core.i18n.I18nMessageException; import cn.com.yict.framemax.core.i18n.I18nMessageException;
import cn.com.yict.framemax.data.model.PagingInfo; import cn.com.yict.framemax.data.model.PagingInfo;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
...@@ -927,6 +928,9 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ ...@@ -927,6 +928,9 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
// 执行函数返回结果 // 执行函数返回结果
LargeModelFunctionEnum functionEnum = LargeModelFunctionEnum.valueOf(functionCallResult.getFunctionCall().getName()); LargeModelFunctionEnum functionEnum = LargeModelFunctionEnum.valueOf(functionCallResult.getFunctionCall().getName());
String functionResult = functionEnum.getFunction().doFunction(functionCallResult.getFunctionCall().getArguments(), AgentApplicationTools.identifier(dialogueId, agentId)); String functionResult = functionEnum.getFunction().doFunction(functionCallResult.getFunctionCall().getArguments(), AgentApplicationTools.identifier(dialogueId, agentId));
if (StringUtils.isBlank(functionResult)) {
throw new BusinessException("插件执行失败");
}
//构造返回结果 //构造返回结果
result.setFunctionName(functionCallResult.getFunctionCall().getName()); result.setFunctionName(functionCallResult.getFunctionCall().getName());
result.setFunctionArg(functionCallResult.getFunctionCall().getArguments()); result.setFunctionArg(functionCallResult.getFunctionCall().getArguments());
......
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