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

fix: 对话异常

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