| 4420 | const invocationResult = await ToolManager.invokeFunctionTools(streamingProcessor.toolCalls); | 4420 | const invocationResult = await ToolManager.invokeFunctionTools(streamingProcessor.toolCalls); |
| 4421 | if (invocationResult.hadToolCalls) { | 4421 | if (invocationResult.hadToolCalls) { |
| 4422 | const lastMessage = chat[chat.length - 1]; | 4422 | const lastMessage = chat[chat.length - 1]; |
| 4423 | const shouldDeleteMessage = ['', '...'].includes(lastMessage?.mes) && ['', '...'].includes(streamingProcessor.result); | 4423 | const shouldDeleteMessage = ['', '...'].includes(lastMessage?.mes) && ['', '...'].includes(streamingProcessor?.result); |
| 4424 | shouldDeleteMessage && await deleteLastMessage(); | 4424 | shouldDeleteMessage && await deleteLastMessage(); |
| 4425 | if (!invocationResult.invocations.length && shouldDeleteMessage) { | 4425 | if (!invocationResult.invocations.length && shouldDeleteMessage) { |
| 4426 | ToolManager.showToolCallError(invocationResult.errors); | 4426 | ToolManager.showToolCallError(invocationResult.errors); |