According to the technical scheme, the method comprises the steps that input
risk control detection is conducted on input questions of a user, if risks exist, a default
risk control answer template is inquired, and all characters of the
risk control answer template are sequentially returned in a streaming mode; if the risk does not exist, the problem is transmitted to a
large model to generate streaming output; generating a to-be-detected text based on streaming output, performing
content security detection on the to-be-detected text, determining a
content security detection result, and if the detection result is no risk, continuing to generate and output a
large model; and if the detection result is that the risk exists, stopping the generation of the
large model, replacing the currently buffered content with the preset prompt information, and then outputting the preset prompt information. According to the scheme of the invention, through risk control detection of input and output stages in a large model dialogue, the detection efficiency is improved, and the problems of long user
waiting time and poor experience in full-buffer detection during large model streaming output, frequent detection interface calling and low generation speed in streaming output real-time detection are solved.