Commit 28dd6696 authored by alex yao's avatar alex yao

fix: 对话异常

parent b34e0910
......@@ -128,7 +128,7 @@ public class AiLawServiceImpl implements AiLawService {
List<Tool> tools = AgentApplicationTools.buildFunctionConfig(null, "N", dialoguesId, dialoguesId, unitIds, "N");
CheckPluginUseEntity checkPluginUseEntity = AgentApplicationTools.checkPluginUse(messages, tools, null);
FunctionCallResult functionCallResult = checkPluginUseEntity.getFunctionCallResult();
if (functionCallResult != null) {
if (functionCallResult != null && functionCallResult.isNeed()) {
FunctionCall functionCall = functionCallResult.getFunctionCall();
if ("web_search".equals(functionCall.getName())) {
AbstractFunctionResult<List<WebSearchFunctionResult>> functionResult = webSearchFunction.doFunction(functionCall.getArguments(), dialoguesId, null, null);
......
......@@ -613,7 +613,7 @@ public class LongTextDialoguesServiceImpl implements LongTextDialoguesService {
List<Tool> tools = AgentApplicationTools.buildFunctionConfig(null, "N", dialoguesId, dialoguesId, unitIds, "N");
CheckPluginUseEntity checkPluginUseEntity = AgentApplicationTools.checkPluginUse(messages, tools, null);
FunctionCallResult functionCallResult = checkPluginUseEntity.getFunctionCallResult();
if (functionCallResult != null) {
if (functionCallResult != null && functionCallResult.isNeed()) {
FunctionCall functionCall = functionCallResult.getFunctionCall();
if (functionCallResult.isNeed() && functionCall != null && "web_search".equals(functionCall.getName())) {
AbstractFunctionResult<List<WebSearchFunctionResult>> functionResult = webSearchFunction.doFunction(functionCall.getArguments(), dialoguesId, null, null);
......
......@@ -143,7 +143,7 @@ public class PortalServiceImpl implements PortalService {
List<Tool> tools = AgentApplicationTools.buildFunctionConfig(null, "N", callEntity.getDialoguesId(), callEntity.getDialoguesId(), unitIds, "N");
CheckPluginUseEntity checkPluginUseEntity = AgentApplicationTools.checkPluginUse(messages, tools, null);
FunctionCallResult functionCallResult = checkPluginUseEntity.getFunctionCallResult();
if (functionCallResult != null) {
if (functionCallResult != null && functionCallResult.isNeed()) {
FunctionCall functionCall = functionCallResult.getFunctionCall();
if ("web_search".equals(functionCall.getName())) {
AbstractFunctionResult<List<WebSearchFunctionResult>> functionResult = webSearchFunction.doFunction(functionCall.getArguments(), callEntity.getDialoguesId(), null, null);
......
......@@ -236,7 +236,7 @@ public class AiWritingServiceImpl implements AiWritingService {
List<Tool> tools = AgentApplicationTools.buildFunctionConfig(null, "N", dialoguesId, dialoguesId, unitIds, "N");
CheckPluginUseEntity checkPluginUseEntity = AgentApplicationTools.checkPluginUse(messages, tools, null);
FunctionCallResult functionCallResult = checkPluginUseEntity.getFunctionCallResult();
if (functionCallResult != null) {
if (functionCallResult != null && functionCallResult.isNeed()) {
FunctionCall functionCall = functionCallResult.getFunctionCall();
if (functionCallResult.isNeed() && functionCall != null && "web_search".equals(functionCall.getName())) {
AbstractFunctionResult<List<WebSearchFunctionResult>> functionResult = webSearchFunction.doFunction(functionCall.getArguments(), dialoguesId, null, null);
......
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