Dialogue status display method, device, equipment and readable storage medium
Through the streaming interface to interact with the large model and detect the end of sentence characters, the problem of large models taking a long time to process complex conversations is solved, immediacy and transparency are achieved, and the user experience is improved.
Patent Information
- Application Number
- CN202411585181.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-11-07
AI Technical Summary
In the automatic dialogue system, the custom server based on the large model takes a long time to process complex dialogues, causing users to wait too long, reducing the interactive experience and causing anxiety.
It interacts with the large model through a streaming interface, returns response dialogue fragments in real time, and combines sentence end character detection strategies to gradually cache and send complete sentences, while providing status prompts to ensure immediacy and transparency.
It enables the instant sending of complete conversation sentences to users, reduces user anxiety, enhances the transparency and credibility of the conversation system, and improves user satisfaction and interactive experience.
Smart Images

Figure CN119621205B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method, apparatus, device, and readable storage medium for displaying a conversation status. Background Art
[0002] In the scenario of an automatic dialogue system, the original server preset by the system in the traditional method usually automatically matches the set response results based on the client's input dialogue and sends them to the client. This method is difficult to cope with changing user needs and complex dialogue scenarios. For this reason, the automatic dialogue system introduces custom servers and large models to customize the response logic that meets the needs of specific scenarios.
[0003] In application scenarios where custom servers implement conversational responses using large models, processing complex conversations based on these models takes a long time. Users must wait for a long time before receiving a response after sending an input. This long wait not only degrades the user's interactive experience, but the uncertainty associated with waiting can easily lead to user anxiety. Therefore, how to ensure the immediacy of conversations while alleviating user anxiety and improving the user experience has become an urgent problem to be solved. Summary of the Invention
[0004] In view of this, in order to solve the above technical problems, the present application provides a conversation status display method, device, equipment and readable storage medium.
[0005] Specifically, this application is implemented through the following technical solutions:
[0006] According to a first aspect of an embodiment of the present application, a method for displaying a dialog status is provided, which is applied to a custom server of a dialog system, wherein the dialog system further includes a client and an original server preset by the system; the method comprises:
[0007] Receive the client input dialogue forwarded by the original server, and send the input dialogue to the preset large model through a streaming interface;
[0008] receiving response dialogue segments sequentially returned by the large model in response to the input dialogue;
[0009] In the process of sequentially caching the response dialogue segments, if a sentence ending character is detected in the cached response dialogue segments, the cached characters preceding the sentence ending character are segmented and determined as information to be sent;
[0010] The information to be sent is forwarded to the client through the original server, and when there are other characters after the sentence end character, the status input interface preset in the dialogue system is called to send a first control information to the client; the first control information is used to instruct the client to update the dialogue interface to display a first status prompt that there is a response dialogue to be returned.
[0011] Optionally, the method further includes:
[0012] In the process of sending the input dialogue to the preset large model through the streaming interface, the status input interface is called to send second control information to the client; the second control information is used to instruct the client to update the dialogue interface to display a second status prompt that the input dialogue is being processed.
[0013] Optionally, the method further includes:
[0014] During the sequential caching process, if the total length of characters included in the cached response dialogue segments reaches the set character length, detecting whether there is a sentence ending character in the cached response dialogue segments in the reverse order of the cached response dialogue segments;
[0015] When the first sentence-ending character is detected, detection is stopped and all buffered characters before the first sentence-ending character are segmented and determined as information to be sent.
[0016] Optionally, detecting whether there is a sentence ending character in the cached response dialogue segment according to the cache reverse order of the cached response dialogue segment includes:
[0017] According to the cache reverse order, check whether the last character is the sentence end character;
[0018] If not, the detection is performed character by character in reverse order starting from the last character until the sentence ending character is detected for the first time or all the cached response dialogue segments are detected.
[0019] Optionally, when detecting whether a sentence-ending character exists in the cached response dialogue segments according to the cache reverse order of the cached response dialogue segments, the method further includes:
[0020] In the case that the sentence-ending character is not detected, the response dialogue segments received after the buffered response dialogue segment are detected in sequence until the sentence-ending character is detected.
[0021] Optionally, the method further includes:
[0022] During the sequential caching process, detecting whether a sentence-ending character exists in the most recently cached response dialogue segment;
[0023] When a sentence-ending character is detected, the buffered characters preceding the sentence-ending character are segmented and determined as information to be sent.
[0024] Optionally, the method further includes:
[0025] When the number of times a sentence end character is detected reaches a set number, the detection of the sentence end character is stopped, and when the large model stops returning the response dialogue segment, all buffered characters after the last detected sentence end character are segmented and determined as information to be sent;
[0026] The set number of times is the limit on the number of response dialogues for input dialogues in the dialogue system minus one.
[0027] Optionally, the determination condition for the large model to stop returning the response dialogue segment includes at least one of the following:
[0028] After a first set period of time, no response dialogue segment is received from the large model;
[0029] Or, detecting that the status identifier of the streaming interface indicates that the interface is disconnected;
[0030] Or, an interface disconnection notification message is received from the large model.
[0031] Optionally, the display time of the first status prompt on the dialogue interface is limited to a second set time length; the method further includes:
[0032] receiving response information for the first control information returned by the client through the preset status interface, and starting timing;
[0033] When the timing duration reaches the second set duration, if the information to be sent is not sent to the original server within the timing period, the status input interface is re-called to send the first control information.
[0034] According to a second aspect of an embodiment of the present application, a dialog status display device is provided, which is applied to a custom server of a dialog system, wherein the dialog system also includes a client and an original server preset by the system; the device includes:
[0035] An input dialogue receiving and sending module, configured to receive the client input dialogue forwarded by the original server, and send the input dialogue to a preset large model through a streaming interface;
[0036] a response dialogue segment receiving module, configured to receive the response dialogue segments sequentially returned by the large model in response to the input dialogue;
[0037] a detection and information-to-be-sent determination module, configured to, during the process of sequentially caching the response dialogue segments, if a sentence-ending character is detected in the cached response dialogue segments, segment the cached characters preceding the sentence-ending character and determine them as information to be sent;
[0038] The response sending and status prompt module is used to forward the information to be sent to the client through the original server, and when there are other characters after the end character of the sentence, call the status input interface preset in the dialogue system to send a first control information to the client; the first control information is used to instruct the client to update the dialogue interface to display a first status prompt that there is a response dialogue to be returned.
[0039] Optionally, the device further comprises:
[0040] In the process of sending the input dialogue to the preset large model through the streaming interface, the status input interface is called to send second control information to the client; the second control information is used to instruct the client to update the dialogue interface to display a second status prompt that the input dialogue is being processed.
[0041] Optionally, the device further comprises:
[0042] a detection module configured to detect whether a sentence-ending character exists in the cached response dialogue segments in the reverse order of the cached response dialogue segments if the total length of characters included in the cached response dialogue segments reaches a set character length during the sequential caching process;
[0043] The segmentation module is used to stop detection and segment all buffered characters before the first sentence-ending character as information to be sent when the first sentence-ending character is detected.
[0044] Optionally, the detection module is specifically configured to:
[0045] According to the cache reverse order, check whether the last character is the sentence end character;
[0046] If not, the detection is performed character by character in reverse order starting from the last character until the sentence ending character is detected for the first time or all the cached response dialogue segments are detected.
[0047] Optionally, when detecting whether a sentence-ending character exists in the cached response dialogue segments according to the cache reverse order of the cached response dialogue segments, the apparatus further comprises:
[0048] In the case that the sentence-ending character is not detected, the response dialogue segments received after the buffered response dialogue segment are detected in sequence until the sentence-ending character is detected.
[0049] Optionally, the device further comprises:
[0050] During the sequential caching process, detecting whether a sentence-ending character exists in the most recently cached response dialogue segment;
[0051] When a sentence-ending character is detected, the buffered characters preceding the sentence-ending character are segmented and determined as information to be sent.
[0052] Optionally, the device further comprises:
[0053] When the number of times a sentence end character is detected reaches a set number, the detection of the sentence end character is stopped, and when the large model stops returning the response dialogue segment, all buffered characters after the last detected sentence end character are segmented and determined as information to be sent;
[0054] The set number of times is the limit on the number of response dialogues for input dialogues in the dialogue system minus one.
[0055] Optionally, the determination condition for the large model to stop returning the response dialogue segment includes at least one of the following:
[0056] After a first set period of time, no response dialogue segment is received from the large model;
[0057] Or, detecting that the status identifier of the streaming interface indicates that the interface is disconnected;
[0058] Or, an interface disconnection notification message is received from the large model.
[0059] Optionally, the display time of the first status prompt on the dialogue interface is limited to a second set time length; the device further includes:
[0060] receiving response information for the first control information returned by the client through the preset status interface, and starting timing;
[0061] When the timing duration reaches the second set duration, if the information to be sent is not sent to the original server within the timing period, the status input interface is re-called to send the first control information.
[0062] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising: a memory and a processor; the memory is used to store a computer program; and the processor is used to execute the above-mentioned conversation status display method by calling the computer program.
[0063] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the above-mentioned dialog status display method is implemented.
[0064] The technical solutions provided by the embodiments of the present application may have the following beneficial effects:
[0065] In the technical solution provided by the above-mentioned present application, through real-time interaction with the big model through the streaming interface, the big model is allowed to gradually return the response dialogue fragments in a streaming manner. Combined with the detection strategy of the sentence end characters in the received response dialogue fragments, it can not only send the complete dialogue sentence to the client instantly, ensuring that the user can view part of the response content in time, but also accurately identify whether there are subsequent dialogue fragments to be returned after the complete dialogue sentence sent instantly, and use status prompts to instantly inform the user of the current progress of the big model's response to the dialogue, thereby enhancing the transparency and credibility of the dialogue system, effectively alleviating the user's uncertainty and anxiety, increasing the immediacy of interaction and improving user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0067] Figure 1 This is a schematic diagram of a dialogue system architecture that introduces a custom server, as shown in an exemplary embodiment of the related art;
[0068] Figure 2A This is a schematic diagram of a dialogue system architecture that introduces a custom server and a large model, as shown in an exemplary embodiment of the present application;
[0069] Figure 2B This is a flow chart of a method for displaying a conversation status according to an exemplary embodiment of the present application;
[0070] Figure 2C This is a flow chart showing a large model returning a response dialogue segment through a streaming interface, as shown in an exemplary embodiment of the present application;
[0071] Figure 2D This is a flow chart showing an exemplary embodiment of the present application, in which a custom server receives response dialogue segments, sequentially stores them, and performs sentence end character detection;
[0072] Figure 3A This is a schematic diagram illustrating a method of detecting a sentence ending character based on a response dialogue segment according to an exemplary embodiment of the present application;
[0073] Figure 3B1 is a schematic diagram showing a sentence end character detection method based on characters according to an exemplary embodiment of the present application;
[0074] Figure 4 This is a structural diagram of a conversation status display device shown in an exemplary embodiment of the present application;
[0075] Figure 5 It is a hardware schematic diagram of an electronic device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0076] In automated dialogue systems, traditional pre-set raw servers often only provide fixed-pattern responses. For example, the system often pre-defines the correspondence between input dialogue and responses, resulting in monotonous responses and poor adaptability to different scenarios, making it difficult to cope with changing user needs and complex dialogue scenarios. Therefore, large models, with their powerful processing capabilities and in-depth understanding of natural language, can provide dialogue systems with more flexible and accurate response options. By introducing custom servers and large models into automated dialogue systems, response logic tailored to specific scenario requirements can be customized. The large model then responds to input dialogue from the client, improving the fluency and flexibility of dialogue systems.
[0077] like Figure 1 The diagram illustrates the structure and interaction of a dialogue system that incorporates a custom server and a large model. Based on the dialogue system's support for user-defined servers, the system includes not only the client and the original server pre-set by the system, but also a custom server configured by the user based on dialogue needs. This custom server utilizes the large model to respond to incoming dialogue. After introducing this custom server, the dialogue system uses the original server as a message relay station to maintain the flexibility and scalability of the dialogue system architecture, the reliability and security of message delivery, and system maintainability. Messages from the client are forwarded by the original server to the custom server, and messages from the custom server are then forwarded to the client via the original server.
[0078] However, in application scenarios where a custom server uses a large model to implement conversational responses, processing complex conversations based on this large model takes a long time. Users must wait for a long time before receiving a response after sending a conversation input. This long wait not only degrades the user's interactive experience, but the uncertainty associated with waiting can easily lead to user anxiety. Therefore, for interactive scenarios involving dialogue systems that incorporate a custom server and a large model, how to ensure the immediacy of conversation while alleviating user anxiety and improving the user experience has become a pressing issue.
[0079] In view of this, this application proposes a method for displaying the dialogue input status for a dialogue system. Through the interaction between the customized server and the large model streaming interface, combined with the response dialogue fragment processing logic returned by the large model streaming, it ensures the immediacy of the dialogue while reducing the user's waiting anxiety, and achieving a more natural, smooth and efficient dialogue interaction experience.
[0080] This method is applied to the above-mentioned dialogue system, such as Figure 2A The dialog system architecture diagram shown in the figure supports user-defined servers. That is, users can configure a server address (also called a callback URL or server address) on the original server. This server address serves as a communication bridge between the original server and the user-defined server. When a user sends a message through the client, the original server forwards the message to the user-configured server address. The client refers to the terminal device or software interface with which the user interacts, which can include but is not limited to a mobile phone app, a web browser, etc., and is used to display the dialog system's response information and receive user input. In this embodiment of the present application, the dialog system's customized server interacts with the preset large model through a streaming interface. Among them, the input dialogue from the client will be forwarded to the big model by the custom server through the streaming interface. The big model generates a corresponding response dialogue for the input dialogue, and continuously returns it to the custom server in the form of streaming results through the streaming interface; the custom server is used to process the received streaming results of the response dialogue and construct a message to be sent to the original server preset by the dialogue system, which is forwarded to the client by the original server; after receiving the message to be sent from the original server, the client displays it on the user dialogue interface of the client.
[0081] based on Figure 2A The example dialogue system is shown. This application provides a dialogue status display method, which is executed by the custom server of the above dialogue system. Figure 2B As shown in the flowchart, the method may include at least the following steps:
[0082] S201, receiving a client input dialogue forwarded by the original server, and sending the input dialogue to a preset large model through a streaming interface;
[0083] Input dialogue refers to the text entered by the user on the client's dialogue interface. It can be questions, instructions, or any form of natural language text, and is used to interact with the custom server of the dialogue system.
[0084] Streaming interfaces allow data to be transmitted in streams (i.e., continuous blocks of data). They are suitable for processing large amounts of data or when data is generated rapidly. The data stream returned by a streaming interface is called a streaming result. Data is not returned all at once but is generated and sent gradually over time. The amount of data sent each time depends on the generation speed of the large model and the data block segmentation design of the streaming interface.
[0085] Pre-built large models can include pre-trained machine learning models deployed on custom servers or other devices. They interact with custom servers via streaming interfaces. These large models are capable of handling complex natural language processing tasks, such as text generation, question-answering systems, and sentiment analysis. During training, these pre-built large models can be trained based on user scenarios. For example, if the conversation system is required to accurately answer encyclopedia questions, the large model can be trained by collecting a large amount of encyclopedia knowledge as samples.
[0086] In this step, after the user sends an input dialog through the client's dialog interface, the input dialog can be sent to the original server via an HTTP request, WebSocket connection, or other communication protocol. The original server forwards the received input dialog to the custom server. Alternatively, the original server can perform necessary verification and preprocessing on the input dialog, such as format conversion and security verification, before forwarding the input dialog to the custom server to ensure reliable message delivery between the client and the custom server. Based on the interaction between the custom server and the large model via a streaming interface, after receiving the input dialog forwarded by the original server, the custom server calls the preset streaming interface to pass the message to the large model. After receiving the input dialog, the large model understands the input dialog and generates a response dialog for it, and sends the generated response dialog to the custom server in the form of a stream via the streaming interface.
[0087] For example, Figure 2C The flow chart of the input dialogue sent to the big model is shown as an example. Suppose the user inputs "What's the weather like tomorrow?" (i.e., the input dialogue) through the dialogue interface of the client. The client sends the input dialogue to the original server, and the original server forwards it to the custom server. The custom server enables the streaming interface to send the input dialogue to the big model. After receiving the input dialogue, the big model starts to generate a response dialogue, as shown in the figure, "Tomorrow's weather will be cloudy and turn to light rain, with a temperature of 15℃-20℃. It is recommended to wear a coat to keep warm when traveling. Don't forget to bring an umbrella! Is there anything else I can help you with?" The response dialogue will be divided into multiple data blocks, namely response dialogue segments, and returned to the custom server in the form of a stream through the streaming interface.
[0088] S202, receiving response dialogue segments sequentially returned by the large model in response to the input dialogue;
[0089] Based on a streaming interface that transmits data in continuous chunks, in this embodiment, to efficiently and in real time process input conversations and return responses, the response dialogues generated by the large model for the input conversations are sequentially returned to the custom server in the form of response dialogue segments. Specifically, upon receiving the input conversation, the large model immediately begins processing and generating the response content. Unlike the traditional approach of waiting for the entire response to be generated before sending it all at once, the streaming interface enables the large model to immediately send the portion of content (i.e., "tomorrow") to the server via the streaming interface as soon as content becomes available (for example, the word "tomorrow" has been generated). As the large model continues to process and generate subsequent response content (such as "weather" and its subsequent content), the newly generated content is also sent to the server via the streaming interface in real time and sequentially.
[0090] For example, for Figure 2C In the example response dialogue, while the big model is generating the response dialogue, the generated available response dialogue can be sent to the client in response dialogue fragments such as "tomorrow", "the weather", "it is cloudy and turning to light rain," "the temperature is", "15℃-20℃."... The generated available response dialogue fragments are sent through the streaming interface, and the big model continues to generate the subsequent content of the response dialogue. The two are executed in parallel to achieve the immediacy of the dialogue response.
[0091] For the custom server, it receives the response dialogue fragments returned by the streaming interface in real time, and combines the response dialogue fragments in the order of receipt to form the complete response content of the large model for the input dialogue. Figure 2C In the example response dialog, the custom server receives [tomorrow] [weather] [is cloudy with light rain] [temperature is] [15℃-20℃.] [travel] [suggestion] [wear a coat]... in sequence through the streaming interface.
[0092] S203, in the process of sequentially caching the response dialogue segments, if a sentence-ending character is detected in the cached response dialogue segments, segmenting the cached characters before the sentence-ending character and determining them as information to be sent;
[0093] The sequential caching refers to storing the received response dialogues in the order in which they are received, and storing the received response dialogues in the cache area in order for easy access and processing. Figure 2DIn the sequential caching example shown, the custom server receives [tomorrow's weather] [is cloudy with light rain, temperature is] [15℃-20℃.] [travel advice] in sequence through the streaming interface. Correspondingly, the data stored in the temporary storage space can be represented as [tomorrow's weather is cloudy with light rain, temperature is 15℃-20℃. Travel advice].
[0094] Sentence-ending characters include special characters or character combinations used to mark the end of a sentence, such as punctuation marks such as a period, question mark, and exclamation mark. The sentence-ending characters can be dynamically adapted based on the language used by the dialogue system. The dialogue system can maintain a configuration table containing different languages and their corresponding sentence-ending character sets. For example, when the language of the dialogue system is English, the corresponding sentence-ending identifier is an English end punctuation mark, such as a solid dot. In order to make a more accurate judgment, language recognition can be performed on the response dialogue segment to be detected, and the response dialogue segment can be detected using a set sentence-ending character set that matches the recognized language.
[0095] The "to-be-sent message" is a message that is ready to be forwarded by the custom server to the client via the original server. In this embodiment, the to-be-sent message includes at least one complete sentence. The custom server sequentially caches received response dialogue segments. During the caching process, the custom server can sequentially check whether each received response dialogue segment contains a sentence-ending character. Alternatively, after accumulating response dialogue segments of a set character length, the custom server can check whether a sentence-ending character is contained in the segmented segments in reverse order of caching time. If a sentence-ending character is detected, all characters cached before the sentence-ending character, as well as the sentence-ending character itself, are segmented from the cache space. The segmented characters are sequentially assembled into the to-be-sent message.
[0096] Among them, the sequential detection of whether each received response dialogue segment contains a sentence-ending character can be achieved in the following manner: in the sequential caching process, the latest cached response dialogue segment is detected to determine whether a sentence-ending character exists; when a sentence-ending character is detected, the cached characters before the sentence-ending character are segmented and determined as information to be sent.
[0097] That is, when the custom server receives a response dialogue segment, it can cache it sequentially in the cache area and detect whether the currently cached response dialogue segment contains a sentence-ending character: if so, the cached characters before the sentence-ending character and the sentence-ending character are sequentially combined into a string as the information to be sent, and the subsequent cached response dialogue segments are continued to be detected; if not, the next response dialogue segment received is continued to be cached and the sentence-ending character detection is performed.
[0098] by Figure 2DAs an example of the sequential cache shown in the figure, take the first six response dialogue segments as an example, for each response dialogue segment received in sequence [tomorrow] [weather] [is cloudy and turns to light rain,] [temperature is] [15℃-20℃.] [travel], as Figure 2D As shown, when each response dialogue segment is cached into the cache area, it is detected whether the response dialogue segment includes a sentence-ending character. When the fifth response dialogue segment [15°C-20°C. ] is detected, the sentence-ending character, a period, is detected. Then, the cached characters before and including the period in the cache area (i.e., the first five response dialogue segments) are separated from the cache area and combined into a string in the original cache order as the message M1 to be sent shown in the figure. Next, the custom server continues to detect whether the sixth response dialogue segment [Travel] includes a sentence-ending character. The aforementioned process is repeated to continuously determine new messages to be sent until the streaming interface stops returning and all returned response dialogue segments have been detected.
[0099] Regarding the segmentation of the cached characters before the sentence end character to determine them as information to be sent, in order to ensure that when the next sentence end character is detected and the cached characters before the next sentence end character are segmented, the next information to be sent can be correctly segmented to avoid repeatedly including the previously sent message to be sent, this can be specifically implemented by deleting the cache area or setting a cache start flag.
[0100] That is, after the cached characters before the sentence end character are segmented and determined as information to be sent, the cached characters before the sentence end character can be deleted from the sequentially cached buffer area to release buffer space; or, a pointer or start identifier can be maintained in the buffer area to indicate the starting position of the current data to be sent, and the pointer or identifier will move as the data is processed. When the sentence end character is detected in the buffer area, the most recent cache start identifier before the sentence end character (or the preset default cache start position during the first detection) is searched, and the cached characters before (including the sentence end character) the sentence end character and after the cache start identifier are segmented and determined as information to be sent, and the cache pointer or start identifier is moved to the position of the sentence end character to prepare for the detection and processing of the next sentence.
[0101] S204: forward the information to be sent to the client through the original server, and when there are other characters after the sentence end character, call the status input interface preset in the dialogue system to send a first control information to the client; the first control information is used to instruct the client to update the dialogue interface to display a first status prompt that there is a response dialogue to be returned.
[0102] The state input interface is a pre-set interface in the dialogue system, used to send control information to the client under specific conditions to change the client's display state or prompt the user. In this embodiment, when the state input interface is called by the custom server, it sends first control information to the client. This first control information is a signal or message sent by the dialogue system to the client, used to instruct the client to perform a specific interface update operation. The first state prompt is a visual or text prompt on the dialogue interface, used to remind the user that there is a new response dialogue to be sent to the dialogue interface for display. For example, the first state prompt can be a text prompt such as "The other party is typing" or "Please wait, a new response is being generated."
[0103] For each message to be sent determined by the sentence-ending character segmentation in step S203, this step is used to send the message to be sent to the original server, which forwards it to the client. After receiving the message to be sent, the client updates and displays it on the dialogue interface, such as displaying the text content of the message to be sent in the form of a message bubble, so that the user can see the response of the dialogue system in a timely manner.
[0104] At the same time, in order to determine whether there is a new response that needs to be returned to the user, after the current message to be sent is forwarded to the client through the original server, check whether there is a character after the sentence end character of the message to be sent in the cache area: if there is a character, it indicates that there is a new response dialogue to be returned, and the custom server can send a first control message to the client through the above-mentioned status input interface; after receiving the first control message, the client will update its interface according to the instructions of the information and display the corresponding first status prompt. The first status prompt is a visual change, such as displaying a loading animation or text prompt to prompt the user "More content is loading" or "Please wait" and other information.
[0105] Based on the response dialogue segments returned sequentially by the streaming interface in real time by the custom server in step S202, step S203 caches the response dialogue segments in the order in which they are received. Each time a sentence-ending character is detected, all characters preceding the sentence-ending character in the cache, as well as the sentence-ending character, are separated and combined into a string in the cached order as a message to be sent. The message to be sent is then forwarded to the client via the original server. Furthermore, the presence of other characters after the sentence-ending character is detected to determine whether to control the display of the first status prompt on the client interface. That is, step S204 can be triggered by determining a message to be sent. In the process of sequentially caching the response dialogue segments, step S204 is executed accordingly each time a message to be sent is determined.
[0106] by Figure 2CFor example, in the example "Tomorrow's weather will be cloudy with light rain, and the temperature will be 15-20°C. Northwest wind force 4. It is recommended to wear a coat to keep warm. Don't forget to bring an umbrella! How else can I help you?", the custom server receives [tomorrow's] [weather] [is cloudy with light rain,] [temperature] [15-20°C.] [travel] [recommendation] [wear a coat to keep warm.] [don't forget] [bring an umbrella! How else can I help you?] through the streaming API.
[0107] In the sequential caching process, if the method of sequentially detecting whether each received response dialogue segment contains a sentence ending character is adopted, such as Figure 2D As shown, when the fifth conversation segment [15℃-20℃.] is detected, a period is detected, and the cache stores [Tomorrow's weather will be cloudy with light rain, and the temperature will be 15℃-20℃.], determining that the message M1 to be sent is "Tomorrow's weather will be cloudy with light rain, and the temperature will be 15℃-20℃." M1 is then sent to the client via the original server, and the content of M1 is deleted from the cache. The operations of receiving and sequentially caching the response conversation segments based on the custom server are performed simultaneously with the operations of determining and sending M1. For example, during the process of sending M1, the conversation segments [Travel] [Suggestions] are received and sequentially cached in the cache position after the fifth response conversation segment. After M1 is sent, based on the presence of the characters "Travel Suggestions" after the period in M1, the custom server calls the status input interface to send the first control information.
[0108] Similarly, when the eighth conversation segment [Wear a coat to keep warm] is detected, a period is detected, and message M2 to be sent: "It is recommended to wear a coat to keep warm when traveling." is determined to be sent to the client, and the state input interface is called to send the first control information. When the tenth conversation segment [Take an umbrella! Anything else] is detected, an exclamation mark is detected, and message M3 to be sent: "Don't forget to bring an umbrella!" is determined to be sent to the client, and the state input interface is called to send the first control information. When the eleventh conversation segment [How can I help you?] is detected, a question mark is detected, and message M4 to be sent: "Is there anything else I can help you with?" is determined to be sent to the client. Since the streaming interface stops returning and there are no other characters after the question mark, there is no need to call the first state interface.
[0109] In the disclosed embodiment, the custom server utilizes a streaming interface to interact with the large model in real time, and uses sentence-end character detection to automatically splice and segment the response dialogue fragments returned by the large model in real time, forming complete dialogue sentences that are immediately sent to the client. This ensures rapid response to the dialogue, increases the immediacy of interaction, and enables users to obtain and understand information more quickly, reducing the interference of fragmented information and improving the coherence and comprehension of the dialogue. At the same time, when new dialogue content needs to be sent, a status prompt mechanism is provided in conjunction with sentence-end character detection. This status prompt instantly informs the user of the dialogue progress, enhancing the user's perception of the dialogue process and improving the friendliness and interactivity of the system, thereby ensuring the immediacy of the dialogue while reducing the user's uncertainty and anxiety.
[0110] In addition, this application detects and processes the end-of-sentence characters to form complete conversation sentences before sending them. Compared with directly sending streaming segments to the client, this effectively avoids the fragmentation of conversation content and reduces the forwarding and processing burden of the original server and client, reduces redundancy and errors in data transmission and processing, improves processing efficiency, and thus improves the overall performance and stability of the system.
[0111] In the aforementioned embodiment, the response dialogue fragment returned from the large model is effectively processed, and a status prompt is provided after the sentence end character is detected to enhance the user experience. The first status prompt first appears when the custom server first determines the message to be sent from the response dialogue fragment returned by the large model for the input dialogue, and there are other characters other than the message to be sent in the buffer area. During the buffering time range between the user sending the input dialogue through the client and the first receipt of the first response dialogue returned by the custom server, the user may feel anxious about waiting.
[0112] Therefore, in order to further improve the user experience, this embodiment proposes an optimization solution, which provides a clear dialogue processing progress prompt method specifically for the buffering time range, and may include the following steps: in the process of sending the input dialogue to the preset large model through the streaming interface, calling the status input interface to send a second control information to the client; the second control information is used to instruct the client to update the dialogue interface to display a second status prompt that the input dialogue is being processed.
[0113] That is, after the client sends an input dialogue to the custom server, the custom server can immediately trigger the progress prompt mechanism when forwarding the input dialogue to the large model, and send a second control message to the client by calling the preset status input interface, triggering the client's dialogue interface to update and display the second status prompt to inform the user that the dialogue system has received the input dialogue and is processing it, thereby reducing the user's waiting anxiety and improving the interactive friendliness and user satisfaction of the dialogue system.
[0114] For example, after the user enters a conversation on the client's conversation interface and clicks send, the display text on the client's conversation interface used to display the name of the conversation object can be replaced with a text prompt such as "Processing, please wait", "Processing...", etc.
[0115] In the embodiment of the present disclosure, by adding a dialogue processing progress feedback method for the time period between the user sending the input dialogue and the first receipt of the response dialogue, the feedback mechanism of the dialogue system is improved, ensuring that the user can obtain timely and clear progress feedback throughout the dialogue process, thereby enhancing the overall performance of the dialogue system and user experience.
[0116] In some embodiments, regarding the detection of sentence-ending characters during the sequential caching process, in addition to sequentially detecting whether each received response dialogue segment contains a sentence-ending character, in order to balance the timeliness of detecting sentence-ending characters with avoiding the processing burden caused by frequent detection, this embodiment proposes another detection method that triggers detection when the character length of the buffer area reaches a certain threshold. That is, when the total character length of the response dialogue segments stored in the buffer area is greater than or equal to the set character length, the detection of the sentence-ending character is triggered. This detection method can be implemented by the following steps a1-a3:
[0117] a1, during the sequential caching process, if the total length of characters included in the cached response dialogue segments reaches the set character length, detecting whether there is a sentence-ending character in the cached response dialogue segments in the reverse order of caching the cached response dialogue segments;
[0118] Character length can be used to indicate the number of characters. This setting can be adjusted based on actual application scenarios and requirements. A too low threshold can lead to frequent detection, increasing system burden; a too high threshold can delay sentence end detection, impacting the timeliness of conversational interaction and user experience. Therefore, in actual applications, the most appropriate threshold can be found through testing and adjustment. Furthermore, other factors can be considered to optimize the detection strategy, such as dynamically adjusting the threshold based on conversation context and user interaction habits, to further enhance the system's intelligence and adaptability.
[0119] During the sequential caching process, the custom server can maintain a counter to track the total length of characters in the cached response dialogue segments. When a new response dialogue segment is received for caching, the character length of the segment can be added to the counter. When the value of the counter reaches or exceeds the preset set character length, the sentence end character detection is triggered. The response dialogue segment can be used as a unit to check each response dialogue segment one by one in the reverse order of the cache of the response dialogue segment to see if there is a sentence end character, or the character can be checked in reverse order by traversing the cached characters until the first sentence end character is found or all cached characters are traversed.
[0120] The custom server will cache the response dialogue segments received in sequence into the buffer area, see Figure 3A In the schematic diagram shown as an example, it is assumed that the cache area has stored M response dialogue segments (P1-Pm in the figure), and the corresponding total character length is S1 which is less than the set character length S. After the (M+1)th response dialogue segment P(m+1) is cached, the corresponding total character length is S2 which is greater than S. Then, the sentence end character detection of the M+1 response dialogue segments that have been stored can be triggered, and the detection is carried out in order from the M+1th to the 1st.
[0121] a2. When the first sentence-ending character is detected, stop detecting and segment all buffered characters before the first sentence-ending character into information to be sent.
[0122] In the process of detecting from the M+1th response dialogue segment to the 1st response dialogue segment in reverse order, if a sentence-ending character is detected for the first time, such as a sentence-ending character is detected in the M+1th response dialogue segment, all cached characters before the first sentence-ending character, that is, all characters of length S1 corresponding to the first M response dialogue segments, and the sentence-ending character itself and the characters before it in the M+1th response dialogue segment, are separated from the cache area and combined into a message to be sent according to the cache order of the characters.
[0123] a3. If no sentence ending character is detected, the response dialogue segments received after the buffered response dialogue segment are detected in sequence until a sentence ending character is detected.
[0124] That is, if no sentence-ending character is found after reversing through all cached response segments, the system checks each newly received response segment for a sentence-ending character until it detects one. Upon detecting a sentence-ending character, the character itself and the characters cached before it are sent as the information to be sent. The system then recalculates the length of the characters cached in the buffer and updates the counter, preparing for the next round of detection.
[0125] For example, in the process of detecting from the M+1th response dialogue segment to the 1st response dialogue segment in reverse order, if the 1st response dialogue segment is detected and no sentence-ending character is detected in the response dialogue segment, it indicates that the cached M+1 response dialogue segments do not include sentence-ending characters. Then, sentence-ending character detection can be performed on the M+2th, M+3th, etc. response dialogue segments in turn until a sentence-ending character is detected, the message to be sent is determined, and the above a1-a3 is repeated until the large model completes processing of all response dialogue segments for the input dialogue.
[0126] In the embodiment of the present disclosure, a reasonable character length threshold is set to timely evaluate the contents of the buffer area. When the total character length of the accumulated response dialogue segments in the buffer area reaches or exceeds this threshold, a sentence end character detection is performed, thereby ensuring that important information is not missed while reducing the number of unnecessary detections and optimizing system performance.
[0127] In some embodiments, for the aforementioned step a1 of detecting whether there is a sentence-ending character in the cached response dialogue segment according to the cache reverse order of the cached response dialogue segment, this embodiment provides a character-by-character reverse order checking method, which traverses the cached characters until the first sentence-ending character is found or all cached characters are traversed.
[0128] That is, according to the reverse order of the cache, check whether the last character in the cached response dialogue segment is the sentence-ending character; if not, start detecting character by character in reverse order starting from the last character until the sentence-ending character is detected for the first time or all the cached response dialogue segments are detected.
[0129] like Figure 3B The detection method diagram shown in the figure assumes that the cache has stored M response dialogue segments, and the corresponding total character length is S1 (such as S1 characters), which is less than the set character length S (such as S characters). After the (M+1)th response dialogue segment is cached, the corresponding total character length is S2 (such as S2 characters), which is greater than S. Then, the sentence-ending character detection of the M+1 response dialogue segments that have been stored can be triggered. Starting from the last character in the M+1th response dialogue segment, the detection is started in the reverse order of the character cache, that is, starting from the S2th character, traversing one character in reverse order to the 1st character to identify whether the character is the sentence-ending character.
[0130] During the reverse traversal of characters, it is possible to first detect whether the S2th character is the sentence ending character: if so, stop detecting and separate the 1st to S2th characters into the message to be sent; if not, perform reverse traversal detection.
[0131] In the embodiment of the present disclosure, the sentence-ending character in the response dialogue segment returned based on the streaming interface usually exists at the end of the segment. This embodiment detects whether the sentence-ending character exists in the cached response dialogue segment by checking in reverse order character by character, thereby maintaining a high retrieval efficiency. The implementation of the reverse order check character by character is simple and intuitive, avoiding complex logic or additional data structure support, and reducing the risk of errors.
[0132] In some embodiments, based on a user's input dialogue in some dialog systems, the original server may limit the number of response dialogue messages it can send in response to that input dialogue. For example, the server may only return a maximum of five response messages to a user's input dialogue; the sixth response message cannot be sent. To address this dialog requirement, this embodiment provides a method for handling the limited number of response messages, based on the value of the response dialogue limit, in order to return the complete response dialogue generated by the large model to the client.
[0133] That is, with respect to the operation of detecting sentence-ending characters during sequential caching, if the number of times a sentence-ending character is detected reaches a set number, if the streaming interface is still returning response dialogue segments, detection of the sentence-ending character will cease, and the receiving of response dialogue segments returned by the streaming interface and the sequential caching operation will continue. If the large model stops returning response dialogue segments, all cached characters following the sentence-ending character detected when the set number of times (i.e., the last detected character) is reached will be segmented and determined as information to be sent. The set number of times is the limit on the number of response dialogues for input dialogues in the dialogue system minus one.
[0134] For example, the server can only return a maximum of 5 response messages to the user's input dialogue. The number of times is set to 4. When the sentence end character is detected 4 times, the detection of the sentence end character is stopped. After the 4th message to be sent is sent to the client, when the streaming interface stops returning the response dialogue segment, all the cached characters after the 4th detected sentence end character are determined as the 5th message to be sent and sent to the client.
[0135] Whether the large model stops returning the response dialogue segment can be determined by timeout determination, status identification detection, interface disconnection notification, etc. Regarding timeout determination, it can include that after a first set time period, the response dialogue segment returned by the large model is not received. That is, if the response dialogue segment returned by the large model through the streaming interface is still not received after the preset first time threshold, it can be determined that the large model has stopped returning data to handle the waiting situation caused by uncertain factors such as network delay and large model processing time. Regarding status identification detection, it can include detecting that the status identification of the streaming interface indicates that the interface is disconnected. The custom server can continuously monitor the status identification of the streaming interface. When it is detected that the status identification indicates that the interface is disconnected or enters an inactive state, it can be confirmed that the large model has stopped returning the response dialogue segment through the interface. It relies on the status feedback at the interface level and has high accuracy and real-time performance. Regarding interface disconnection notification, it can include receiving an interface disconnection notification message from the large model, that is, relying on the clear communication protocol between the large model and the custom server. When such a notification is received, it is directly confirmed that the large model has actively or passively stopped returning the response dialogue segment, ensuring the accuracy and reliability of information transmission.
[0136] In practice, the above criteria can be dynamically adjusted and optimized based on the specific settings of the streaming interface, the performance characteristics of the large model, and the actual needs of the system. For example, the timeout threshold can be adjusted based on the stability of the network environment, or the sensitivity to interface disconnection notifications can be adjusted based on the load of the large model. This can better adapt to different operating environments and scenarios, improving overall stability and responsiveness.
[0137] In the disclosed embodiment, by intelligently detecting the number of sentence-ending characters and adjusting the processing logic accordingly, it is ensured that even when the number of response messages is limited, the complete response content generated by the large model for the user input dialogue can be returned to the client, effectively avoiding the truncation of the response content due to the number limit and ensuring the integrity of the information received by the user.
[0138] In some embodiments, the display of the first status prompt on the dialogue interface is subject to a time limit, such as a second set duration. In order to ensure the accuracy and effectiveness of the status prompt in this display scenario and improve the interactive efficiency and user experience of the dialogue system, this embodiment provides a status prompt display and retransmission mechanism. After calling a preset status interface to send the first control information to the client, the timing is started based on the response message received from the client. The decision on whether to retransmit the first control information is made based on the relationship between the timing duration and the second set duration. The response information is used to confirm that the first control information has been successfully received and processed. Based on this, the method can further include the following steps b1-b2:
[0139] b1, receiving response information to the first control information returned by the client through the preset status interface, and starting timing;
[0140] Response information returned by the client to the first control information is received through the preset status interface. In response to the receipt of the response information, a timing operation is triggered to monitor the display time of the first status prompt.
[0141] b2. When the timing duration reaches the second set duration, if the information to be sent is not sent to the original server within the timing period, re-call the status input interface to send the first control information.
[0142] When the timing reaches the first set time, the first status display on the dialogue interface of the client is about to stop displaying, and a check is made to see whether the information to be sent has been sent to the original server within this timing period: if not, it indicates that the message sending is delayed or blocked. In order to give the user clear feedback, the custom server re-calls the status input interface to send the first control information to update the prompt status of the dialogue processing progress.
[0143] In the disclosed embodiment, a timing duration judgment and resending mechanism is used to ensure that users receive timely feedback, thereby improving the stability and reliability of the dialogue system.
[0144] Corresponding to the embodiment of the above-mentioned method for displaying the conversation status, see Figure 4 As shown, the present application also provides an embodiment of a conversation status display device, which is applied to a custom server of a conversation system, wherein the conversation system also includes a client and an original server preset by the system; the device includes:
[0145] Input dialogue receiving and sending module 401, configured to receive the client input dialogue forwarded by the original server, and send the input dialogue to the preset large model through a streaming interface;
[0146] A response dialogue segment receiving module 402 is configured to receive response dialogue segments sequentially returned by the large model in response to the input dialogue;
[0147] The detection and to-be-sent information determination module 403 is configured to, during the process of sequentially caching the response dialogue segments, if a sentence-ending character is detected in the cached response dialogue segments, segment the cached characters preceding the sentence-ending character and determine them as to-be-sent information;
[0148] The response sending and status prompt module 404 is used to forward the information to be sent to the client through the original server, and when there are other characters after the end character of the sentence, call the status input interface preset in the dialogue system to send a first control information to the client; the first control information is used to instruct the client to update the dialogue interface to display a first status prompt that there is a response dialogue to be returned.
[0149] Optionally, the device further comprises:
[0150] In the process of sending the input dialogue to the preset large model through the streaming interface, the status input interface is called to send second control information to the client; the second control information is used to instruct the client to update the dialogue interface to display a second status prompt that the input dialogue is being processed.
[0151] Optionally, the device further comprises:
[0152] a detection module configured to detect whether a sentence-ending character exists in the cached response dialogue segments in the reverse order of the cached response dialogue segments if the total length of characters included in the cached response dialogue segments reaches a set character length during the sequential caching process;
[0153] The segmentation module is used to stop detection and segment all buffered characters before the first sentence-ending character as information to be sent when the first sentence-ending character is detected.
[0154] Optionally, the detection module is specifically configured to:
[0155] According to the cache reverse order, check whether the last character is the sentence end character;
[0156] If not, the detection is performed character by character in reverse order starting from the last character until the sentence ending character is detected for the first time or all the cached response dialogue segments are detected.
[0157] Optionally, when detecting whether a sentence-ending character exists in the cached response dialogue segments according to the cache reverse order of the cached response dialogue segments, the apparatus further comprises:
[0158] In the case that the sentence-ending character is not detected, the response dialogue segments received after the buffered response dialogue segment are detected in sequence until the sentence-ending character is detected.
[0159] Optionally, the device further comprises:
[0160] During the sequential caching process, detecting whether a sentence-ending character exists in the most recently cached response dialogue segment;
[0161] When a sentence-ending character is detected, the buffered characters preceding the sentence-ending character are segmented and determined as information to be sent.
[0162] Optionally, the device further comprises:
[0163] When the number of times a sentence end character is detected reaches a set number, the detection of the sentence end character is stopped, and when the large model stops returning the response dialogue segment, all buffered characters after the last detected sentence end character are segmented and determined as information to be sent;
[0164] The set number of times is the limit on the number of response dialogues for input dialogues in the dialogue system minus one.
[0165] Optionally, the determination condition for the large model to stop returning the response dialogue segment includes at least one of the following:
[0166] After a first set period of time, no response dialogue segment is received from the large model;
[0167] Or, detecting that the status identifier of the streaming interface indicates that the interface is disconnected;
[0168] Or, an interface disconnection notification message is received from the large model.
[0169] Optionally, the display time of the first status prompt on the dialogue interface is limited to a second set time length; the device further includes:
[0170] receiving response information for the first control information returned by the client through the preset status interface, and starting timing;
[0171] When the timing duration reaches the second set duration, if the information to be sent is not sent to the original server within the timing period, the status input interface is re-called to send the first control information.
[0172] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0173] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application. A person of ordinary skill in the art can understand and implement the present invention without inventive effort.
[0174] The embodiment of the present application also provides an electronic device, the structural diagram of the electronic device is as follows Figure 5 As shown, the electronic device 500 includes at least one processor 501, a memory 502 and a bus 503, and the at least one processor 501 is electrically connected to the memory 502; the memory 502 is configured to store at least one computer-executable instruction, and the processor 501 is configured to execute the at least one computer-executable instruction, thereby performing the steps of any one of the conversation status display methods provided in any one of the embodiments or any one of the optional implementation modes in the present application.
[0175] Furthermore, the processor 501 may be a Field-Programmable Gate Array (FPGA) or other devices with logic processing capabilities, such as a Microcontroller Unit (MCU) or a Central Processing Unit (CPU).
[0176] An embodiment of the present application further provides another readable storage medium storing a computer program, which is used to implement the steps of any dialogue status display method provided in any embodiment or any optional implementation manner of the present application when executed by a processor.
[0177] The readable storage media provided in the embodiments of the present application include, but are not limited to, any type of disk (including floppy disks, hard disks, optical disks, CD-ROMs, and magneto-optical disks), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic cards, or optical cards. In other words, the readable storage medium includes any medium that can store or transmit information in a readable form by a device (e.g., a computer).
[0178] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for displaying a conversation status, characterized in that: A custom server is applied to a dialogue system, wherein the dialogue system further includes a client and an original server preset by the system; the method includes: Receive the client input dialogue forwarded by the original server, and send the input dialogue to the preset large model through a streaming interface; receiving response dialogue segments sequentially returned by the large model in response to the input dialogue; In the process of sequentially caching the response dialogue segments, if a sentence ending character is detected in the cached response dialogue segments, the cached characters preceding the sentence ending character are segmented and determined as information to be sent; The information to be sent is forwarded to the client through the original server, and when there are other characters after the sentence end character, the status input interface preset in the dialogue system is called to send a first control information to the client; the first control information is used to instruct the client to update the dialogue interface to display a first status prompt that there is a response dialogue to be returned.
2. The method according to claim 1, characterized in that The method further comprises: In the process of sending the input dialogue to the preset large model through the streaming interface, the status input interface is called to send second control information to the client; the second control information is used to instruct the client to update the dialogue interface to display a second status prompt that the input dialogue is being processed.
3. The method according to claim 1, characterized in that The method further comprises: During the sequential caching process, if the total length of characters included in the cached response dialogue segments reaches the set character length, detecting whether there is a sentence ending character in the cached response dialogue segments in the reverse order of caching the cached response dialogue segments; When the first sentence-ending character is detected, detection is stopped and all buffered characters before the first sentence-ending character are segmented and determined as information to be sent.
4. The method according to claim 3, characterized in that The detecting whether a sentence ending character exists in the cached response dialogue segment according to the cache reverse order of the cached response dialogue segment includes: According to the cache reverse order, check whether the last character is the sentence end character; If not, the detection is performed character by character in reverse order starting from the last character until the sentence ending character is detected for the first time or all the cached response dialogue segments are detected.
5. The method according to claim 3, characterized in that The method further comprises: In the case that the sentence-ending character is not detected, the response dialogue segments received after the buffered response dialogue segment are detected in sequence until the sentence-ending character is detected.
6. The method according to claim 1, characterized in that The method further comprises: During the sequential caching process, detecting whether a sentence-ending character exists in the most recently cached response dialogue segment; When a sentence-ending character is detected, the buffered characters preceding the sentence-ending character are segmented and determined as information to be sent.
7. The method according to claim 1, characterized in that The method further comprises: When the number of times a sentence end character is detected reaches a set number, the detection of the sentence end character is stopped, and when the large model stops returning the response dialogue segment, all buffered characters after the last detected sentence end character are segmented and determined as information to be sent; The set number of times is the limit on the number of response dialogues for input dialogues in the dialogue system minus one.
8. The method according to claim 7, characterized in that The determination condition for the large model to stop returning the response dialogue segment includes at least one of the following: After a first set period of time, no response dialogue segment is received from the large model; Or, detecting that the status identifier of the streaming interface indicates that the interface is disconnected; Or, an interface disconnection notification message is received from the large model.
9. The method according to claim 1, characterized in that The display time of the first status prompt on the dialogue interface is limited to a second set time length; the method further includes: receiving response information for the first control information returned by the client through a preset status interface, and starting timing; When the timing duration reaches the second set duration, if the information to be sent is not sent to the original server within the timing period, the status input interface is re-called to send the first control information.
10. A dialogue status display device, characterized in that: A custom server for a dialogue system, wherein the dialogue system also includes a client and an original server preset by the system; the device includes: An input dialogue receiving and sending module, configured to receive the client input dialogue forwarded by the original server, and send the input dialogue to a preset large model through a streaming interface; a response dialogue segment receiving module, configured to receive the response dialogue segments sequentially returned by the large model in response to the input dialogue; a detection and information-to-be-sent determination module, configured to, during the process of sequentially caching the response dialogue segments, if a sentence-ending character is detected in the cached response dialogue segments, segment the cached characters preceding the sentence-ending character and determine them as information to be sent; The response sending and status prompt module is used to forward the information to be sent to the client through the original server, and when there are other characters after the end character of the sentence, call the status input interface preset in the dialogue system to send a first control information to the client; the first control information is used to instruct the client to update the dialogue interface to display a first status prompt that there is a response dialogue to be returned.
11. An electronic device, characterized in that: include: Memory, processor; The memory is used to store computer programs; The processor is configured to call the computer program to implement the method according to any one of claims 1 to 9.
12. A readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Generating method and device, training method and device, computer readable medium and electronic equipment
CN108920560A
Multi-round dialogue generation method, terminal and computer readable storage medium
CN113962213A