Multi-role dialogue implementation method and device, electronic equipment and readable storage medium

By obtaining and utilizing historical dialogue records, role characteristics and dialogue background information, the speaking role is intelligently determined, which solves the problem that the existing multi-role dialogue system cannot achieve a flexible and efficient dialogue environment, and improves user participation and the intelligence of the dialogue system. .

CN118551007APending Publication Date: 2024-08-27BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202410619786.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-17
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

Existing multi-role dialogue systems cannot achieve a flexible and efficient dialogue environment, limiting the interaction scope and complex situation processing capabilities of the agent, resulting in a decrease in user participation and experience, and the inability to respond to events during the dialogue process in a timely manner.

Method used

By obtaining historical dialogue records, role characteristics and dialogue background information, the dialogue management role agent is used to determine the speaking role, and intelligently determines the appropriate speaking object based on this information, achieving a more flexible and efficient multi-role dialogue.

Benefits of technology

It provides a more realistic and dynamic communication environment, enhances the freedom of speech of users and agents, ensures the continuity and diversity of dialogue, and improves the intelligence and practicality of the dialogue system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118551007A
    Figure CN118551007A
Patent Text Reader

Abstract

The invention discloses a multi-role dialogue implementation method and device, electronic equipment and a readable storage medium, and relates to the technical field of artificial intelligence, a proper speaking object is intelligently determined for speaking according to historical dialogue records, role features, dialogue background information and dialogue environment information, and a real user or a virtual intelligent agent can be used for speaking, so that the user experience is improved. Therefore, the user can enjoy a greater degree of speech freedom, a more real and dynamic environment is provided for communication between the real user and the intelligent agent, and a flexible and efficient dialogue environment is realized. The role comprises a real user or an agent, the agent at least comprises a dialogue management role agent, the dialogue implementation method comprises the steps that dialogue information of a multi-role dialogue is acquired, and the dialogue information at least comprises one or more of historical dialogue records, role features, dialogue background information and dialogue environment information; according to the dialogue information, the dialogue management role agent determines a speaking role in the multi-role dialogue; and displaying the speaking content output by the speaking role.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, device, electronic device and readable storage medium for implementing multi-role dialogue. Background Art

[0002] In recent years, with the continuous development of artificial intelligence technology, large language models have made significant progress in the development of intelligent agent dialogue. These advanced models are already able to understand and generate human language, and play a vital role in various application scenarios. For example, chatbots provide information and entertainment by having natural and fluent conversations with users; virtual assistants can help users complete a series of daily tasks, such as setting alarms, finding information, etc.; applications in the field of customer service can more effectively solve users' questions and needs; in games, agents play the role of NPCs (Non-Player Characters), provide game guidance or assign tasks to players through conversations with players, and can also create game scenarios for players through conversations between NPCs, giving users a better gaming experience.

[0003] In related technologies, taking game scenarios as an example, when implementing dialogues between NPCs, the conversation topic is usually determined based on the independent personality characteristics and related background stories of each NPC character, and an interactive dialogue environment is constructed between the characters to ensure the richness and diversity of the dialogue content. Then, the large language model is called to generate the entire interactive dialogue content at one time to ensure the consistency and coherence of the dialogue, making the dialogue more fluent and natural.

[0004] In the process of implementing the relevant technology, the applicant found that the relevant technology has at least the following problems:

[0005] It is limited to the interaction between two characters and often provides all the results of multi-character dialogues at once, which not only limits the scope of role interaction and weakens the dialogue system's ability to handle complex and diverse situations, but also takes a long time to generate the presentation of all dialogue content, resulting in a lack of visual experience, which will have a certain impact on user participation and experience. Furthermore, this one-time display method makes it impossible for the dialogue system to respond to events that occur during the dialogue process in a timely manner, and users therefore lose the opportunity to participate in multi-character dialogues, affecting the intelligence and practicality of the entire dialogue system, making it difficult to achieve a flexible and efficient dialogue environment. Summary of the invention

[0006] In view of this, the present application provides a multi-role dialogue implementation method, device, electronic device and readable storage medium, the main purpose of which is to solve the current problem that affects the intelligence and practicality of the entire dialogue system and it is difficult to achieve a flexible and efficient dialogue environment.

[0007] According to a first aspect of the present application, a method for implementing a multi-role dialogue is provided, wherein the roles include real human users or intelligent agents, and the intelligent agents include at least one dialogue management role intelligent agent, and the method for implementing a dialogue includes:

[0008] Acquire dialogue information of a multi-role dialogue, wherein the dialogue information includes at least one or more of historical dialogue records, role characteristics, dialogue background information, and dialogue environment information;

[0009] According to the dialogue information, the dialogue management role agent determines the speaking role in the multi-role dialogue;

[0010] Display the speech content output by the speaking role.

[0011] According to a second aspect of the present application, a multi-role dialogue implementation device is provided, wherein the roles include real-life users or intelligent agents, and the intelligent agents include at least one dialogue management role intelligent agent, and the dialogue implementation device includes:

[0012] An acquisition module, used to acquire dialogue information of a multi-role dialogue, wherein the dialogue information includes at least one or more of historical dialogue records, role characteristics, dialogue background information, and dialogue environment information;

[0013] A determination module, configured to determine, by the dialogue management role agent, a speaking role in the multi-role dialogue according to the dialogue information;

[0014] The display module is used to display the speech content output by the speaking role.

[0015] According to a third aspect of the present application, an electronic device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the methods described in the first aspect when executing the computer program.

[0016] According to a fourth aspect of the present application, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the methods described in the first aspect are implemented.

[0017] Through the above technical scheme, the present application provides a multi-role dialogue implementation method, device, electronic device and readable storage medium. The present application obtains dialogue information of a multi-role dialogue including at least one or more of historical dialogue records, role characteristics, dialogue background information, and dialogue environment information. According to the dialogue information, the dialogue management role intelligent agent determines the speaking role in the multi-role dialogue, displays the speech content output by the speaking role, and intelligently determines the appropriate speaking object to speak according to the historical dialogue records, role characteristics, dialogue background information and dialogue environment information. Both real users and virtual intelligent agents can enjoy greater freedom of speech, providing a more realistic and dynamic environment for communication between real users and intelligent agents, ensuring the continuity and diversity of multi-role dialogues, and realizing a flexible and efficient dialogue environment.

[0018] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0020] Figure 1 A schematic diagram of a multi-role dialogue implementation method provided in an embodiment of the present application is shown;

[0021] Figure 2A A schematic diagram of another method for implementing multi-role dialogue provided by an embodiment of the present application is shown;

[0022] Figure 2B A schematic diagram of a process flow of another method for implementing a multi-role dialogue provided in an embodiment of the present application is shown;

[0023] Figure 3 A schematic diagram of the structure of a device for implementing a multi-role dialogue provided by an embodiment of the present application is shown;

[0024] Figure 4 A schematic diagram of the device structure of a computer device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0025] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0026] Before explaining this application in detail, let's first briefly introduce the scenarios involved in this application:

[0027] Large Language Models (LLMs) excel in conversation understanding. The models learn a large amount of text data during training, and they are able to parse user input, extract key information, and generate appropriate responses based on the context. Large language models have trained powerful natural language processing capabilities through self-conversation and other methods, including semantic understanding, sentiment analysis, and question-answering systems. This capability enables intelligent agents to interact smoothly with humans and accurately understand user intentions and needs. All of this makes large language models an important and core module in intelligent agent development.

[0028] In recent years, large language models have made significant progress in the development of intelligent agent dialogue. These advanced models are already able to understand and generate human language and play a vital role in various application scenarios. For example, chatbots provide information and entertainment by having natural and fluent conversations with users; virtual assistants can help users complete a series of daily tasks, such as setting alarms and finding information; and applications in the field of customer service can more effectively solve users' questions and needs.

[0029] Although the human-computer interaction in the above scenarios is usually in the form of one-to-one dialogue, it is more challenging to achieve similar dialogue capabilities in some spontaneous multi-role dialogues between multiple agents. In the complex environment of multi-agent interaction, such as the situation in which multiple agents in the game conduct autonomous dialogues, this scenario involves many technical difficulties. First, the interaction between agents needs to be real-time and efficient, which requires the language model to be able to quickly understand and generate language that adapts to the situation; second, each agent has its own unique personality and behavior pattern, so the model needs to have the ability to understand and simulate individual differences; third, information processing in a multi-role dialogue environment is more complex, and the language model must be able to effectively extract, integrate and respond to multi-source information. All of the above factors make the application of large language models in multi-agent spontaneous multi-role dialogue scenarios face higher technical and theoretical requirements.

[0030] At present, there are two ways to achieve interaction between agents. One technical solution is the interactive dialogue generation method between two agents. The main implementation method is to build an interactive dialogue environment between two agents. First, the conversation topic is determined according to the independent personality characteristics of each agent and the relevant background story, ensuring the richness and diversity of the conversation content; then, the large language model is called to generate the entire interactive conversation content at one time. This method can ensure the consistency and coherence of the conversation and make the conversation more fluent and natural. Another technical solution is that the core of the design and implementation method of the multi-agent dialogue system is to manually preset the chat topic and use the large language model to generate the chat content one by one. Specifically, after each chat content is generated, the multi-role dialogue management role agent will analyze the status of each agent and combine the previous rounds of conversation content to determine the next speaker. This method is conducive to maintaining the orderliness of the conversation, avoiding conflicts between agents, and improving the effectiveness and quality of the conversation.

[0031] However, the applicant recognizes that there is usually an important limitation in the existing technical solutions, that is, they are often limited to the interaction between two agents, and cannot achieve effective coordination and communication of multiple agents. This not only limits the scope of interaction of the agents, but also weakens the system's ability to handle complex and diverse situations. At the same time, these existing technical solutions often provide all multi-role dialogue results at one time. This method may cause the large language model to generate the presentation of all dialogue content, which takes a long time and lacks the perception, which will have a certain impact on the user's participation and experience. More importantly, due to this one-time display method, the system cannot respond to events that occur during the dialogue in a timely manner, and the user loses the opportunity to participate in multi-role dialogues. In addition, the existing technical solutions often lack the ability to independently select topics based on the characteristics of the agent itself and the background of the story, which leads to a great limitation on the interactivity and flexibility of the agent. Similarly, these technical solutions are also unable to allow the agent to automatically join and exit the dialogue according to actual needs, which undoubtedly increases the cost of manual intervention and also affects the intelligence and practicality of the entire dialogue system.

[0032] Therefore, a new technical solution is urgently needed to overcome the above problems, improve the multi-directional interaction capabilities of intelligent agents, and give intelligent agents greater autonomy in choice, so as to achieve a more flexible and efficient multi-role dialogue environment.

[0033] The present application embodiment provides a method for implementing a multi-role dialogue, such as Figure 1 As shown, the method includes:

[0034] 101. Get the dialogue information of multi-role dialogue.

[0035] The present application can be applied to a dialogue system, which can be installed in a game scene so that users in the scene can participate in a dialogue created by the dialogue system in the scene that includes multiple intelligent agents, understand the content of the game scene or take on tasks in the game, etc., providing users with a more realistic and dynamic dialogue environment.

[0036] In the embodiment of the present application, in the process of multi-role dialogue, the dialogue system will comprehensively consider various information to select the most suitable speaker for the next round. Specifically, since the historical dialogue record will record the context information of the dialogue and reflect the theme content of the dialogue, the historical dialogue record will be considered as part of the consideration; further, the dialogue background information is the content that directly reflects the theme of the dialogue, which will record which background story or which event triggered the current dialogue, so the dialogue background will also be considered as part of the consideration; in addition, the dialogue environment information records the environment of the current dialogue, such as whether the dialogue is currently in a store, in a station, etc. The dialogue environment is also the key to affecting the progress of the dialogue, and it also needs to be considered when selecting the speaking role. In summary, in the embodiment of the present application, the dialogue system will obtain the dialogue information of the multi-role dialogue, and the dialogue information includes at least one or more of the historical dialogue records, role characteristics, dialogue background information, and dialogue environment information, so that the dialogue information can be processed based on the large language model in the future, and the speaking role can be determined in the multi-role dialogue.

[0037] Among them, it should be noted that the roles in the multi-role dialogue include real users or intelligent agents. The intelligent agent is a software or hardware system that can autonomously observe the environment and take actions based on the observed information in order to obtain maximum benefits. It can sense the state of the environment and perform a series of operations to change the state of the environment. The intelligent agent usually has the ability to learn and can adjust its behavior according to environmental changes to achieve a predetermined goal. In the game scenario, the intelligent agent can be an NPC; in the customer service scenario, the intelligent agent can be an intelligent customer service, etc. This application does not specifically limit the role of the intelligent agent. In the embodiment of this application, the intelligent agent is an NPC as an example for discussion.

[0038] 102. Based on the dialogue information, the dialogue management role agent determines the speaking role in the multi-role dialogue.

[0039] In the embodiment of the present application, the agent includes at least one dialogue management role agent, which is the administrator in the multi-role dialogue and is used to select the speaking role to speak and handle the dialogue affairs in the multi-role dialogue. After obtaining the dialogue information, the dialogue system will provide the dialogue information to the dialogue management role agent, which will process the dialogue information based on the large language model and determine the speaking role in the multi-role dialogue. Among them, the speaking role can be either an NPC or a real person user, and this application does not make specific restrictions.

[0040] In actual application, the dialogue system can notify the speaking role in a multi-role dialogue in the form of "the next speaking role is: XX" to speak, or it can also send a speech reminder to the speaking role so that the speaking role knows that he is currently selected as the speaking role and speaks. It should be noted that if the NPC is selected as the speaking role, the NPC can call the large language model to process the dialogue information based on the large language model. The large language model will comprehensively judge whether the NPC needs to speak and what to say if it needs to speak.

[0041] 103. Display the speech content output by the speaking role.

[0042] In an embodiment of the present application, when the speech content of the speaking role is received, the dialogue system will display the speech content in the multi-role dialogue, so that each role in the multi-role dialogue can see the speech of the speaking role this time, and comprehensively consider the speech of the speaking role this time to determine whether to speak next and what the speech content is.

[0043] The method provided in the embodiment of the present application obtains dialogue information of a multi-role dialogue including at least one or more of historical dialogue records, role characteristics, dialogue background information, and dialogue environment information. Based on the dialogue information, the dialogue management role agent determines the speaking role in the multi-role dialogue, displays the speech content output by the speaking role, and intelligently determines the appropriate speaking object to speak based on the historical dialogue records, role characteristics, dialogue background information and dialogue environment information. Both real users and virtual agents can enjoy greater freedom of speech, providing a more realistic and dynamic environment for communication between real users and agents, ensuring the continuity and diversity of multi-role dialogues, and realizing a flexible and efficient dialogue environment.

[0044] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, the embodiment of the present application provides another multi-role dialogue implementation method, such as Figure 2A As shown, the method includes:

[0045] 201. Receive a multi-role dialogue request, and obtain multiple role identifiers and dialogue identifiers indicated by the multi-role dialogue request.

[0046] The present application can be applied to a dialogue system, which can be installed in a game scene so that real users in the scene can participate in the dialogue including multiple agents created by the dialogue system in the scene, understand the content of the game scene or take on tasks in the game, etc., to provide users with a more realistic and dynamic dialogue environment. Among them, the dialogue system proposes a generally applicable interface design for the application of multiple agents based on a large language model in a group chat scene, which is also the dialogue service interface in the embodiment of the present application. The dialogue service interface greatly reduces the operation complexity and usage threshold of the caller. For the game development team, it is no longer necessary to develop the code for controlling the group chat process and logic by themselves. This cumbersome and non-core task can be automatically completed by calling the dialogue service interface, thereby reducing the workload of the caller, allowing them to focus more on their own business needs, and the caller does not need to undertake the task of independently deploying a large language model. Since the dialogue service interface has built-in methods for using large language models, the caller can directly use this function without the need for additional settings or installation processes.

[0047] In the embodiment of the present application, when there is a need for a conversation, the caller can initiate a multi-role conversation request in the conversation system. Since the present application grants permissions to the agent, the agent decides whether to join the conversation. Therefore, in response to the multi-role conversation request, the conversation system obtains multiple role identifiers and conversation identifiers indicated by the multi-role conversation request, so as to determine which roles to send invitations to join the multi-role conversation according to the multiple role identifiers and to determine which multi-role conversation to invite everyone to chat according to the conversation identifiers.

[0048] The multi-role dialogue request can be initiated by the caller, or it can be automatically initiated by the dialogue system. In order to enable the caller to initiate a multi-role dialogue request, the dialogue system can provide a dialogue service interface to the outside world. The caller can call the dialogue service interface when there is a dialogue demand, and provide multiple role identifiers and dialogue identifiers to the dialogue system based on the dialogue service interface. In this way, when multiple role identifiers and dialogue identifiers are received based on the dialogue service interface, the dialogue system can determine that a multi-role dialogue request has been received. In the actual application process, when there are two or more NPCs or player groups within a certain area, wherein the player group contains at least one NPC, the caller can call this dialogue service interface to interact between characters. In this process, the caller needs to pass the ID (Identification Card) of the NPC in the area, the player's ID and other role identifiers, as well as the surrounding environmental information to this dialogue service interface. In addition, you also need to enter a conversation identifier, which is a unique identifier representing a multi-role conversation session. The conversation identifier can be a session id. If this is the first time that the multi-role conversation is initiated, the session id should be set to a newly generated value; conversely, if this multi-role conversation is a continuation of a previous round of conversation, its session id should remain the identifier created by the previous round of conversation. This design helps the conversation system better track and manage the progress of multi-role conversations.

[0049] When the dialogue system automatically initiates a multi-role dialogue request, the dialogue system can continuously count the number of roles in the current scene, and when the number of roles reaches the specified number, query the events occurring in the current scene, obtain the dialogue identifier based on the subject of the event, use the role identifiers of the multiple roles in the current scene as multiple role identifiers, and determine that the multi-role dialogue request has been received. In other words, when the number of agents and users in the current scene reaches a certain number, such as 5, 6, etc., the dialogue system can also actively initiate a multi-role dialogue; specifically, when initiating a multi-role dialogue, the dialogue system can query the events occurring in the current scene, determine in which multi-role dialogue to conduct the dialogue based on the subject of the event, and use the role identifiers of the multiple roles in the current scene as multiple role identifiers, so that a multi-role dialogue joining request can be issued to the roles according to these role identifiers. For example, if it is currently detected that the user is picking up shells, the dialogue identifier related to picking up shells can be determined, and the surrounding NPC identifiers can be obtained as multiple role identifiers, so that the NPCs indicated by these role identifiers can be invited to join the multi-role dialogue. It should be noted that the multiple character identifiers may include the identifier of an NPC or the user identifier of a real user in the current scene. This application does not specifically limit the number of character identifiers obtained and whether the character indicated by the character identifier is a real user.

[0050] 202. Determine a multi-role dialogue and a dialogue management role agent of the multi-role dialogue according to the dialogue identifier, and use the roles indicated by the multiple role identifiers as multiple candidate agents.

[0051] In an embodiment of the present application, after obtaining the dialogue identifier and multiple role identifiers, the dialogue system will determine the multi-role dialogue and subsequently add everyone to the multi-role dialogue for chatting; further, in order to be able to select a speaking role to speak and handle dialogue affairs in the multi-role dialogue in the subsequent process, the dialogue system also determines the dialogue management role agent in the multi-role dialogue, and uses the roles indicated by multiple role identifiers as multiple candidate agents.

[0052] Among them, a multi-role dialogue is a group that is about to have a dialogue. If the candidate intelligent agent and the user agree to join the dialogue, they will be pulled into the multi-role dialogue by the dialogue system for dialogue. When determining a multi-role dialogue, the dialogue system will first search the storage system for the dialogue identifier to see if it exists. The storage system can specifically be a Redis storage system. That is, in the actual application process, once the dialogue system receives the sessionid representing the multi-role dialogue session based on the dialogue service interface, it will first search the Redis storage system for the session id to see if it exists.

[0053] If the search determines that the dialogue identifier exists, it means that this multi-role dialogue is actually based on one or more rounds of multi-role dialogues in the past. At this time, it is necessary to extract and load the historical dialogue records of the previous multi-role dialogue from the Redis storage system. The historical dialogue records include the memory content of the historical dialogues, so as to better restore and continue the current multi-role dialogue process. Therefore, the dialogue system will treat the group indicated by the dialogue identifier as a multi-role dialogue, extract the historical dialogue records of the multi-role dialogue from the storage system, and use the management role agent indicated by the historical dialogue records as the dialogue management role agent.

[0054] If the search determines that the dialogue identifier does not exist, it means that this is a brand new multi-role dialogue session. In this case, it is necessary to create a new management role agent on this basis to be responsible for handling subsequent related matters and maintaining the coherence and consistency of the dialogue. Therefore, the dialogue system will create a new dialogue group as a multi-role dialogue, and create a new management role agent in the multi-role dialogue as a dialogue management role agent.

[0055] Furthermore, the candidate agents can be agents in the current environment, such as NPCs. Each agent is equipped with a large language model or has the function of calling a large language model. In this way, the agent can decide whether to join a multi-role dialogue by calling the large language model. Subsequently, it can also decide whether to speak, the content of the speech, whether to exit the multi-role dialogue, etc. by calling the large language model.

[0056] 203. Create a multi-role dialogue joining request, and send the multi-role dialogue joining request to each candidate agent based on the dialogue management role agent.

[0057] In an embodiment of the present application, after multiple candidate agents are determined, the dialogue system will create a multi-role dialogue joining request, and send the multi-role dialogue joining request to each candidate agent based on the dialogue management role agent, so that the candidate agent that receives the multi-role dialogue joining request can decide whether to join the multi-role dialogue for the conversation.

[0058] Among them, in order to enable the candidate agent to comprehensively consider various factors to determine whether it wants to join the multi-role dialogue, the dialogue system will query the storage system for historical dialogue records of the multi-role dialogue. In the case where the query determines that there are historical dialogue records of the multi-role dialogue, the dialogue system will obtain the historical multi-role dialogue background information in the historical dialogue record as the dialogue background information, obtain the identity information of the members who have participated in the multi-role dialogue in the historical dialogue record as the dialogue environment information, generate a multi-role dialogue joining request carrying the dialogue background information and dialogue environment information, and call the dialogue management role agent to send a multi-role dialogue joining request to each candidate agent, that is, the administrator will inform each candidate agent of the historical topic of the current multi-role dialogue and the identity of the role currently participating in the multi-role dialogue, and consult the candidate agent whether it is willing to participate in the multi-role dialogue.

[0059] When the query determines that there is no historical conversation record for the multi-role conversation, the conversation system will identify the current multi-role conversation background information of the multi-role conversation as the conversation background information, count the identity information of the user currently requesting to join the multi-role conversation as the conversation environment information, generate a multi-role conversation joining request carrying the conversation background information and the conversation environment information, and call the conversation management role agent to send a multi-role conversation joining request to each candidate agent. That is, the administrator will inform the multi-role conversation of the current chat topic and the identities of the roles participating in the multi-role conversation, and consult the candidate agents whether they are willing to participate in the multi-role conversation.

[0060] 204. Receive feedback information from each candidate agent, and determine at least one target agent from among the multiple candidate agents based on the feedback information.

[0061] In the embodiment of the present application, after sending a request to join a multi-role dialogue to the candidate agent, each candidate agent will call the large language model to determine whether to join the multi-role dialogue, and inform the dialogue system of the result. Therefore, the dialogue system will receive feedback information from each candidate agent. Among them, the feedback information will indicate whether you want to join the multi-role dialogue, and the feedback information is generated and transmitted by each candidate agent after receiving the request to join the multi-role dialogue. Among them, for each candidate agent, when generating feedback information, the candidate agent will obtain the dialogue background information and dialogue environment information in the request to join the multi-role dialogue, obtain its own role characteristics, and process the dialogue background information, dialogue environment information and its own role characteristics based on the large language model to obtain the processing result. When the processing result indicates joining the multi-role dialogue, feedback information is generated to determine joining the multi-role dialogue, and when the processing result indicates not to join the multi-role dialogue, feedback information is generated to give up joining the multi-role dialogue.

[0062] It should be noted that only candidate agents that agree to join the multi-role dialogue will be further considered by the management role agent, which can not only ensure the authenticity and diversity of the multi-role dialogue, but also take into account the role characteristics and decision-making freedom of the candidate agents. Therefore, the dialogue system will determine at least one target agent from multiple candidate agents based on the feedback information, where the at least one target agent is also the candidate agent determined by the feedback information to join the multi-role dialogue.

[0063] 205. Add at least one target agent as a multi-role dialogue member to the multi-role dialogue.

[0064] In an embodiment of the present application, after determining at least one target agent, the dialogue system can add the at least one target agent as a multi-role dialogue member to the multi-role dialogue to start the dialogue.

[0065] In the actual application process, real users may also want to join the multi-role dialogue. Therefore, for real users, the caller will obtain the dialogue background information of the multi-role dialogue, generate a reminder to join the multi-role dialogue based on the dialogue background information, determine multiple real users in the current scene, and send a reminder to join the multi-role dialogue to each of the multiple real users. In the actual application process, taking the game as an example, the caller can provide the user with a multi-role dialogue icon on the game interface, so that the real user can express his willingness to join the multi-role dialogue by clicking the multi-role dialogue icon. The caller will only pass the user ID of at least one real user who has decided to join the multi-role dialogue to the dialogue system through the dialogue service interface. Therefore, the dialogue system has indicated that they agree to participate in the multi-role dialogue based on the user ID transmitted by the dialogue service interface. The dialogue system can directly determine at least one real user based on these user IDs, and add at least one real user to the multi-role dialogue to enable the real user to participate in the multi-role dialogue. It should be noted that this application does not limit the number of real users in the multi-role dialogue. Even if the multi-role dialogue does not include real users and only intelligent agents, the multi-role dialogue can also run normally.

[0066] In addition, during the actual application process, if the caller does not pass the user ID of the real user who has agreed to join the multi-role conversation to the conversation system, the conversation system can also obtain the conversation background information of the multi-role conversation on its own, generate a multi-role conversation joining reminder based on the conversation background information, determine multiple real users in the current scene, send a multi-role conversation joining reminder to each of the multiple real users, and upon receiving a joining response based on the multi-role conversation joining reminder feedback, use at least one real user among the multiple real users who has fed back a joining response as at least one real user to join the multi-role conversation. This application does not specifically limit the method of determining at least one user to join the multi-role conversation.

[0067] 206. Obtain the role characteristics of each role in the multi-role dialogue, process the role characteristics, dialogue background information and dialogue environment information of each role based on the large language model according to the dialogue management role agent, and determine the speaking role in the multi-role dialogue.

[0068] In an embodiment of the present application, in the process of multi-role dialogue, the dialogue system will comprehensively consider the dialogue background information, dialogue environment information and role characteristics of each role in the multi-role dialogue to select the most suitable speaker for the next round. In the actual application process, in the game, the dialogue management role agent will specifically comprehensively consider past dialogue records, personality characteristics, background stories and current environment information of each NPC to select the most suitable speaker for the next round. Specifically, the dialogue system will process the role characteristics, dialogue background information and dialogue environment information of each role based on the large language model, and determine the speaking role in the multi-role dialogue. Among them, it should be noted that the speaking role can be either an NPC or a real user, and this application does not make specific restrictions.

[0069] In actual application, the dialogue system can notify the speaking role in a multi-role dialogue in the form of "the next speaking role is: XX" to speak, or it can also send a speech reminder to the speaking role so that the speaking role knows that it is currently selected as the speaking role and speaks. It should be noted that if the NPC is selected as the speaking role, the NPC can call the large language model, and process the role characteristics, dialogue background information, dialogue environment information and its own role characteristics of each role based on the large language model. The large language model combines this information to determine whether the NPC needs to speak and what it should say if it needs to speak.

[0070] 207. Notify the speaking role to speak. When the speech content of the speaking role is received, execute the following step 208; when the speaking role receives a speech-giving-up instruction, execute the following step 209.

[0071] In the embodiment of the present application, after the speaking role is determined, the dialogue system will notify the speaking role to speak. Among them, the speaking role selected by the dialogue management role agent has the right to decide whether to speak. In the case where the speaking role is an agent, the agent will obtain the dialogue background information, dialogue background information and its own role characteristics, process the dialogue background information, dialogue background information and its own role characteristics based on the large language model, obtain the processing result, and generate the speech content according to the processing result, wherein, if the processing result indicates to give up speaking, the agent generates a speech abandonment instruction and transmits the speech abandonment instruction, so that the dialogue system obtains the speech abandonment instruction, knows that the current speaking role has given up speaking, and performs the subsequent process. Taking the game scene as an example, in the case where the speaking role is an NPC, the dialogue system in the embodiment of the present application will let it consider its own personality traits, background stories and past dialogue records by calling the NPC related interface, so as to determine whether it should speak. If it decides to speak, the NPC will use the large language model to generate specific speech content based on its actual situation, and pass this content to the dialogue management role agent. If the NPC decides not to speak, it will also notify the dialogue management role agent, and the dialogue management role agent will then look for other suitable candidates. In a multi-role dialogue, if all characters do not speak, all members of this dialogue will remain silent.

[0072] On the contrary, when the speaking character is a real person user, the dialogue system will display the content input area to the real person user, and obtain the content input by the real person user into the content input area as the speech content. If the real person user is not detected to input content in the content input area within the preset time, it is determined that the real person user's abandonment of speech instruction is received. Continuing to take the game scene as an example, if the selected speaker is a real person player, the dialogue system will return a special mark and the player's ID based on the dialogue service interface, and the game will pop up an input box to the player, and the player will decide whether to speak. If the player does not respond for a long time, the game will default to the player giving up the opportunity to speak, and the game will call the multi-role dialogue interface again to enable the dialogue system to reselect the speaking character and start the next round of speaking. If the player does generate speech content, the game will pass these contents to the dialogue management character intelligent body when calling the dialogue service interface next time, so that the speech content is displayed in the multi-role dialogue. In addition, these speech contents will also be recorded in the storage system as a new section of dialogue history, so that the speaking role can be found again according to the recorded speech content later. This method not only gives NPCs and real players greater freedom of speech, but also ensures the continuity and diversity of the multi-role dialogue process.

[0073] Therefore, for the dialogue system, when receiving the speech content of the speaking role, it means that the speaking role has spoken, and the dialogue system needs to send the speech content of the speaking role to the multi-role dialogue so that each role in the multi-role dialogue can see the speech content of this time, that is, execute the following step 208. When receiving the speech abandonment instruction of the speaking role, it means that the speaking role has abandoned the speech this time, and a new speaking role needs to be found, so the following step 209 is executed.

[0074] 208. When receiving the speech content of the speaking role, display the speech content in the multi-role dialogue.

[0075] In an embodiment of the present application, when the speech content of the speaking role is received, it means that the speaking role has spoken, and the dialogue system needs to send the speech content of the speaking role to the multi-role dialogue so that each role in the multi-role dialogue can see the speech content. Therefore, the dialogue system will display the speech content in the multi-role dialogue.

[0076] After the speaking role completes his speech, the multi-role dialogue will continue. In order to record the content of this speech and take it into consideration in the subsequent selection of the speaking role, the dialogue system will store the speech content as a speech record in the historical dialogue records of the multi-role dialogue in the storage system, and process the dialogue background information, historical dialogue records and role features of each role in the multi-role dialogue based on the large language model, and re-determine the speaking role in the multi-role dialogue.

[0077] It should be noted that real users can freely express their opinions at unspecified time points. These randomly generated comments will be transmitted together when the dialogue service interface is called next time, and will be stored in the storage system as a new historical dialogue record, which will in turn affect the dialogue management role agent's decision on future speaking roles, and will also affect the development direction of the entire multi-role dialogue discussion topic. That is, when the first speech content input by the real user is received while waiting for the speaking role to make a speech, the first speech content is stored as a speech record in the historical dialogue record of the multi-role dialogue in the storage system, and the speaking role continues to wait for the speech.

[0078] 209. When receiving a speaking role's instruction to give up speaking, the conversation background information and role features of other roles except the speaking role in the multi-role conversation are processed based on the large language model, and the speaking role is re-determined among other multi-role conversation members.

[0079] In an embodiment of the present application, when a speaking role receives an instruction to give up speaking, it means that the speaking role has given up speaking this time and needs to find a new speaking role. Therefore, the dialogue system will process the dialogue background information and the role characteristics of other roles in the multi-role dialogue except the speaking role based on the large language model, and redetermine the speaking role in the multi-role dialogue.

[0080] In addition, similarly to the content described in step 208 above, since real users can freely express their opinions at non-specified time points, these randomly generated comments will be transmitted together when the dialogue service interface is called next time, and will be stored in the storage system as a new historical dialogue record, thereby affecting the dialogue management role agent's decision on future speaking roles, and will also affect the development direction of the entire multi-role dialogue discussion topic. Therefore, when a second speech content is received from a real user after the speech content is displayed, the dialogue system will store the speech content and the second speech content as a speech record in the historical dialogue record respectively, and process the dialogue background information, historical dialogue records and role characteristics of each role in the multi-role dialogue based on the large language model to redefine the speaking role in the multi-role dialogue.

[0081] In another optional implementation scheme, after the speech content of the current speaking character is displayed, in order to more efficiently manage and maintain the normal operation of the multi-role dialogue, the dialogue system will start multiple threads to synchronously query each agent in the multi-role dialogue whether there is a need to exit the multi-role dialogue. Taking the game as an example, the dialogue system will start multiple threads to synchronously query each NPC whether it wants to exit the current multi-role dialogue environment. Among them, each NPC will feed back its final decision to the dialogue management role agent so that the dialogue management role agent can update the member list of the multi-role dialogue. That is, when the query determines that the target agent has a need to exit the multi-role dialogue, the target agent is removed from the multi-role dialogue and the dialogue environment information is updated, wherein the target agent can be any agent in the multi-role dialogue.

[0082] In another optional implementation, in the case of real users, if the dialogue system receives an exit multi-role dialogue instruction from at least one real user in the multi-role dialogue, the at least one real user is removed from the multi-role dialogue and the dialogue environment information is updated. Taking the game as an example, if the real user actively clicks the exit multi-role dialogue button in the game, it is considered that the multi-role dialogue has been officially left, and the player's ID will no longer be passed when the dialogue service interface is called in the next round of the game.

[0083] In another optional implementation scheme, the dialogue system will continue to read the dialogue environment information of the multi-role dialogue, and when it is determined that the dialogue environment information includes a member and the member is an intelligent agent, or when it is determined that the dialogue environment information does not include any intelligent agent, the multi-role dialogue will be dissolved, and the dialogue identifier of the multi-role dialogue will be determined, and the historical dialogue record associated with the dialogue identifier will be deleted in the storage system. That is to say, continuing to take the game as an example, when the number of NPCs in the multi-role dialogue is reduced to only one and there are no real players, or when there are no NPCs in the entire multi-role dialogue, the dialogue system believes that this multi-role dialogue can no longer continue and needs to be dissolved. At this time, it is necessary to delete all relevant information in the Redis storage system associated with the multi-role dialogue session id to completely terminate the multi-role dialogue activity, which will effectively prevent resource waste and unnecessary data redundancy.

[0084] In addition, it should be noted that the dialogue system will generate multi-role dialogue status information of the multi-role dialogue in the process of maintaining the multi-role dialogue, obtain the management role agent information of the dialogue management role agent, and associate the multi-role dialogue status information, management role agent information and dialogue identification and store them in the storage system. Furthermore, each time the dialogue system calls the dialogue service interface, in addition to returning the speech content of the speaking role, it also comes with the multi-role dialogue status information of the current multi-role dialogue, such as the multi-role dialogue member ID list, whether the multi-role dialogue is dissolved, etc., to facilitate the subsequent processing of the session by the game. At the end of each interface call, the information of the multi-role dialogue is updated and stored in the Redis storage system so that it can be called again next time.

[0085] In summary, the logic of the technical solution of this application is as follows: Figure 2BAs shown, when the dialogue system determines that there is a need for dialogue at present, it determines the roles that can participate in the dialogue in the surrounding area, and judges whether these roles are bound to dialogue identifiers and whether there is a dialogue management role agent in the multi-role dialogue indicated by the dialogue identifier. If there is no indication of a multi-role dialogue and a dialogue management role agent, a new multi-role dialogue and a new dialogue management role agent are created; otherwise, a multi-role dialogue joining request is sent to the role to ask whether it joins the multi-role dialogue. If the role decides to join the multi-role dialogue, the dialogue system will obtain dialogue information, which includes one or more of the historical dialogue records, role characteristics, dialogue background information, and dialogue environment information, and determine the next speaking role to speak according to the dialogue information, and notify the speaking role to speak. It should be noted that in the above process, the content of any real user's free speech can be accepted. After notifying the speaking role to speak, the speaking role can decide whether to speak. If the speaking role decides not to speak, the dialogue system will reselect the next speaking role and ask it whether it wants to speak; if the speaking role decides to speak, the dialogue system will obtain the speech content of the speaking role and return a dialogue content in the multi-role dialogue. In addition, while maintaining the normal operation of a multi-role dialogue, the dialogue system will start multiple threads to synchronously query each character whether they want to exit the current multi-role dialogue environment. If a character decides to exit and the multi-role dialogue includes a member and the member is an arbitrary intelligent agent, or it is read and determined that the multi-role dialogue does not include any intelligent agent, the dialogue system ends the multi-role dialogue and records and summarizes the content of the dialogue in the storage system.

[0086] The embodiment of the present application provides a multi-agent dialogue interface service with higher flexibility, aiming to more accurately simulate and reproduce the chat situation of multiple people in real life. The feature of the dialogue system proposed in the embodiment of the present application is that it can return a message at a time, which provides the possibility for users (players) to insert dialogues and participate in multi-role dialogues. This not only improves the interactivity and participation of users, but also provides a more real and dynamic environment for communication between multi-agents. In addition, unlike the traditional manual intervention method, the agent in the dialogue system of the embodiment of the present application can generate chat topics autonomously without manual pre-setting or intervention during operation, which means that the agent can switch chat topics at will according to actual needs, increasing the diversity and randomness of chat content. Finally, in order to better meet the needs of users and agents, the dialogue system introduces the function of "free joining or leaving", whether it is an agent or a user, can choose to join or exit the multi-role dialogue according to their own wishes, so that the multi-role dialogue can be guaranteed to always remain in an active and vibrant state.

[0087] The method provided in the embodiment of the present application intelligently determines the appropriate speaking object to speak based on historical conversation records, role characteristics, conversation background information and conversation environment information. Both real users and virtual agents can enjoy greater freedom of speech, providing a more realistic and dynamic environment for communication between real users and agents, ensuring the continuity and diversity of multi-role conversations, and realizing a flexible and efficient conversation environment.

[0088] Further, as Figure 1 The specific implementation of the method, the embodiment of the present application provides a multi-role dialogue implementation device, such as Figure 3 As shown, the roles include real users or intelligent agents, and the intelligent agents include at least one dialogue management role intelligent agent. The dialogue implementation device includes: an acquisition module 301, a determination module 302, and a display module 303.

[0089] The acquisition module 301 is used to acquire the dialogue information of the multi-role dialogue, wherein the dialogue information includes at least one or more of the historical dialogue records, role characteristics, dialogue background information, and dialogue environment information;

[0090] The determination module 302 is used to determine the speaking role in the multi-role dialogue by the dialogue management role agent according to the dialogue information;

[0091] The display module 303 is used to display the speech content output by the speaking role.

[0092] In a specific application scenario, the device also includes:

[0093] A sending module, configured to respond to a multi-role dialogue request, determine a multi-role dialogue and a plurality of candidate agents, and send a multi-role dialogue joining request to each of the plurality of candidate agents, wherein the multi-role dialogue joining request carries the dialogue background information and the dialogue environment information;

[0094] The determination module 302 is further configured to receive feedback information from each candidate agent, and determine at least one target agent from among the plurality of candidate agents based on the feedback information, wherein the at least one target agent is a candidate agent determined to join the multi-role dialogue as indicated by the feedback information;

[0095] An adding module is used to add the at least one target agent as a multi-role dialogue member to the multi-role dialogue.

[0096] In a specific application scenario, the sending module is used to, when receiving the multi-role dialogue request, obtain multiple role identifiers and dialogue identifiers indicated by the multi-role dialogue request; determine the multi-role dialogue and the dialogue management role agent of the multi-role dialogue according to the dialogue identifier, and use the roles indicated by the multiple role identifiers as the multiple candidate agents; create the multi-role dialogue joining request, and send the multi-role dialogue joining request to each candidate agent based on the dialogue management role agent.

[0097] In a specific application scenario, the sending module is used to determine that the multi-role dialogue request has been received when the multiple role identifiers and the dialogue identifier are received based on the dialogue service interface; or, continuously count the number of roles in the current scene, and when the number of roles reaches a specified number, query the event occurring in the current scene, obtain the dialogue identifier based on the subject of the event, use the role identifiers of the multiple roles in the current scene as the multiple role identifiers, and determine that the multi-role dialogue request has been received.

[0098] In a specific application scenario, the sending module is used to retrieve whether the dialogue identifier exists in the storage system; when the retrieval determines that the dialogue identifier exists, the group indicated by the dialogue identifier is used as the multi-role dialogue, and the historical dialogue records of the multi-role dialogue are extracted from the storage system, and the management role agent indicated by the historical dialogue records is used as the dialogue management role agent; when the retrieval determines that the dialogue identifier does not exist, a new dialogue group is created as the multi-role dialogue, and a new management role agent is created in the multi-role dialogue as the dialogue management role agent.

[0099] In a specific application scenario, the sending module is used to query the storage system whether there is a historical dialogue record for the multi-role dialogue; when the query determines that the historical dialogue record exists for the multi-role dialogue, the historical multi-role dialogue background information is obtained from the historical dialogue record as the dialogue background information, the identity information of the members who have participated in the multi-role dialogue is obtained from the historical dialogue record as the dialogue environment information, a request to join the multi-role dialogue carrying the dialogue background information and the dialogue environment information is generated, and the dialogue management role intelligent agent is called to send the multi-role dialogue joining request to each of the candidate intelligent agents; when the query determines that the historical dialogue record does not exist for the multi-role dialogue, the current multi-role dialogue background information of the multi-role dialogue is identified as the dialogue background information, the identity information of the user currently requesting to join the multi-role dialogue is counted as the dialogue environment information, the request to join the multi-role dialogue carrying the dialogue background information and the dialogue environment information is generated, and the dialogue management role intelligent agent is called to send the multi-role dialogue joining request to each of the candidate intelligent agents.

[0100] In a specific application scenario, the feedback information is generated and transmitted by each candidate agent after receiving the request to join the multi-role dialogue, wherein for each candidate agent, when generating the feedback information, the candidate agent obtains the dialogue background information and the dialogue environment information in the request to join the multi-role dialogue, obtains its own role characteristics, processes the dialogue background information, the dialogue environment information and its own role characteristics based on the large language model to obtain a processing result, and generates the feedback information to confirm joining the multi-role dialogue when the processing result indicates not to join the multi-role dialogue, and generates the feedback information to give up joining the multi-role dialogue when the processing result indicates not to join the multi-role dialogue.

[0101] In a specific application scenario, the determination module 302 is also used to obtain the conversation background information, generate a multi-role conversation joining reminder based on the conversation background information; determine multiple users in the current scene, and send the multi-role conversation joining reminder to each of the multiple users; and upon receiving a joining response based on the multi-role conversation joining reminder feedback, add at least one user among the multiple users who has fed back the joining response to the multi-role conversation.

[0102] In a specific application scenario, the determination module 302 is used to obtain the role characteristics of each role in the multi-role dialogue; the role characteristics of each role, the dialogue background information and the dialogue environment information are processed based on the large language model by the dialogue management role agent to determine the speaking role in the multi-role dialogue.

[0103] In a specific application scenario, the speaking role is an intelligent agent or a real person user; when the speaking role is an intelligent agent, the intelligent agent obtains the conversation background information, the conversation background information and its own role characteristics, processes the conversation background information, the conversation background information and its own role characteristics based on a large language model to obtain a processing result, and generates the speech content according to the processing result, wherein if the processing result indicates to give up speaking, the intelligent agent generates an instruction to give up speaking and transmits the instruction to give up speaking; when the speaking role is a real person user, a content input area is displayed to the real person user, and the content input by the real person user into the content input area is obtained as the speech content, wherein if the real person user is not detected to input content in the content input area within a preset time, it is determined that the instruction to give up speaking from the real person user is received.

[0104] In a specific application scenario, the determination module 302 is also used to process the conversation background information and role characteristics of other roles in the multi-role conversation except the speaking role based on the large language model when receiving the speaking role's instruction to give up speaking, and to redetermine the speaking role in the multi-role conversation.

[0105] In a specific application scenario, the determination module 302 is also used to store the speech content as a speech record in the historical conversation record; based on the large language model, the conversation background information, the historical conversation record and the role characteristics of each role in the multi-role conversation are processed to redetermine the speaking role in the multi-role conversation.

[0106] In a specific application scenario, the device also includes:

[0107] The first storage module is used to store the first speech content as a speech record in the historical conversation record when receiving the first speech content input by a real user while waiting for the speaking role to make the speech content, and continue to wait for the speaking role to speak.

[0108] In a specific application scenario, the determination module 302 is also used to store the speech content and the second speech content as a speech record in the historical conversation record respectively when a second speech content is received from a real user after the speech content is displayed; based on the large language model, the conversation background information, the historical conversation record and the role characteristics of each role in the multi-role conversation are processed to redetermine the speaking role in the multi-role conversation.

[0109] In a specific application scenario, the device also includes:

[0110] An updating module is used to start multiple threads to synchronously query each intelligent agent in the multi-role dialogue whether there is a need to exit the multi-role dialogue, and when the query determines that the target intelligent agent has a need to exit the multi-role dialogue, remove the target intelligent agent from the multi-role dialogue and update the dialogue environment information; and / or, when receiving an exit multi-role dialogue instruction from at least one real user in the multi-role dialogue, remove the at least one real user from the multi-role dialogue and update the dialogue environment information;

[0111] The second storage module is used to continuously read the dialogue environment information of the multi-role dialogue, and when it is determined that the dialogue environment information includes a member and the member is an intelligent agent, or when it is determined that the dialogue environment information does not include any intelligent agent, dissolve the multi-role dialogue, and determine the dialogue identifier of the multi-role dialogue, and delete the historical dialogue record associated with the dialogue identifier in the storage system.

[0112] In a specific application scenario, the second storage module is also used to generate multi-role dialogue status information of the multi-role dialogue, obtain the management role agent information of the dialogue management role agent; and associate the multi-role dialogue status information, the management role agent information and the dialogue identifier and store them in the storage system.

[0113] The device provided by the embodiment of the present application obtains dialogue information of a multi-role dialogue including at least one or more of historical dialogue records, role characteristics, dialogue background information, and dialogue environment information. Based on the dialogue information, the dialogue management role agent determines the speaking role in the multi-role dialogue, displays the speech content output by the speaking role, and intelligently determines the appropriate speaking object to speak based on the historical dialogue records, role characteristics, dialogue background information and dialogue environment information. Both real users and virtual agents can enjoy greater freedom of speech, providing a more realistic and dynamic environment for communication between real users and agents, ensuring the continuity and diversity of multi-role dialogues, and realizing a flexible and efficient dialogue environment.

[0114] It should be noted that for other corresponding descriptions of the functional units involved in the multi-role dialogue implementation device provided in the embodiment of the present application, reference can be made to Figure 1 and FIG. 2A to FIG. 2B The corresponding description in will not be repeated here.

[0115] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0116] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0117] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

[0118] In an exemplary embodiment, see Figure 4 , and also provides a computer device, which includes a bus, a processor, a memory and a communication interface, and may also include an input and output interface and a display device, wherein each functional unit can communicate with each other through the bus. The memory stores a computer program, and the processor is used to execute the program stored in the memory and execute the multi-role dialogue implementation method in the above embodiment.

[0119] A computer-readable storage medium stores a computer program, which implements the steps of the multi-role dialogue implementation method when executed by a processor.

[0120] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by hardware, or by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.

[0121] Those skilled in the art will appreciate that the accompanying drawings are merely schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily required for implementing the present application.

[0122] Those skilled in the art will appreciate that the modules in the device in the implementation scenario can be distributed in the device in the implementation scenario according to the implementation scenario description, or can be changed accordingly and located in one or more devices different from the implementation scenario. The modules in the above implementation scenario can be combined into one module, or can be further split into multiple sub-modules.

[0123] The above application serial numbers are for description only and do not represent the advantages or disadvantages of the implementation scenarios.

[0124] The above disclosure only discloses several specific implementation scenarios of the present application. However, the present application is not limited thereto, and any changes that can be conceived by technicians in this field should fall within the scope of protection of the present application.

Claims

1. A method for implementing multi-role dialogue, characterized in that: The roles include real human users or intelligent agents, and the intelligent agents include at least one dialogue management role intelligent agent. The dialogue implementation method includes: Acquire dialogue information of a multi-role dialogue, wherein the dialogue information includes at least one or more of historical dialogue records, role characteristics, dialogue background information, and dialogue environment information; According to the dialogue information, the dialogue management role agent determines the speaking role in the multi-role dialogue; Display the speech content output by the speaking role.

2. The method according to claim 1, characterized in that Before obtaining the dialogue information of the multi-role dialogue, the method further includes: In response to a multi-role dialogue request, determining a multi-role dialogue and a plurality of candidate agents, and sending a multi-role dialogue joining request to each of the plurality of candidate agents, wherein the multi-role dialogue joining request carries the dialogue background information and the dialogue environment information; Receive feedback information from each candidate agent, and determine at least one target agent from among the plurality of candidate agents based on the feedback information, wherein the at least one target agent is a candidate agent determined to join the multi-role dialogue as indicated by the feedback information; The at least one target agent is added to the multi-role dialogue as a member of the multi-role dialogue.

3. The method according to claim 2, characterized in that The method of responding to the multi-role dialogue request, determining the multi-role dialogue and a plurality of candidate agents, and sending a multi-role dialogue joining request to each of the plurality of candidate agents comprises: Receiving the multi-role dialogue request, and acquiring a plurality of role identifiers and dialogue identifiers indicated by the multi-role dialogue request; Determine the multi-role dialogue and the dialogue management role agent of the multi-role dialogue according to the dialogue identifier, and use the roles indicated by the multiple role identifiers as the multiple candidate agents; The multi-role dialogue joining request is created, and the multi-role dialogue joining request is sent to each candidate agent based on the dialogue management role agent.

4. The method according to claim 3, characterized in that Before obtaining the multiple role identifiers and dialogue identifiers indicated by the multi-role dialogue request, the method further includes: In the case where the multiple role identifiers and the dialogue identifier are received based on the dialogue service interface, determining that the multi-role dialogue request is received; or, Continuously counting the number of roles in the current scene, and when the number of roles reaches a specified number, querying the event occurring in the current scene, obtaining the dialogue identifier based on the subject of the event, using the role identifiers of multiple roles in the current scene as the multiple role identifiers, and determining that the multi-role dialogue request is received.

5. The method according to claim 3, characterized in that: The step of determining the multi-role dialogue and the dialogue management role agent of the multi-role dialogue according to the dialogue identifier includes: Retrieve whether the conversation identifier exists in the storage system; In the case where the dialogue identifier is determined to exist by retrieval, the group indicated by the dialogue identifier is used as the multi-role dialogue, and the historical dialogue record of the multi-role dialogue is extracted from the storage system, and the management role agent indicated by the historical dialogue record is used as the dialogue management role agent; When it is determined through retrieval that the dialog identifier does not exist, a new dialog group is created as the multi-role dialog, and a new management role agent is created in the multi-role dialog as the dialog management role agent.

6. The method according to claim 3, characterized in that: The creating a multi-role dialogue joining request, sending the multi-role dialogue joining request to each candidate agent based on the dialogue management role agent, comprises: Querying the storage system whether there is a historical conversation record of the multi-role conversation; In the case where the query determines that the multi-role dialogue has the historical dialogue record, historical multi-role dialogue background information is obtained from the historical dialogue record as dialogue background information, identity information of members who have participated in the multi-role dialogue is obtained from the historical dialogue record as dialogue environment information, a multi-role dialogue joining request carrying the dialogue background information and the dialogue environment information is generated, and the dialogue management role agent is called to send the multi-role dialogue joining request to each candidate agent; When the query determines that the historical conversation record does not exist for the multi-role conversation, the current multi-role conversation background information of the multi-role conversation is identified as the conversation background information, the identity information of the user currently requesting to join the multi-role conversation is counted as the conversation environment information, the multi-role conversation joining request carrying the conversation background information and the conversation environment information is generated, and the conversation management role agent is called to send the multi-role conversation joining request to each of the candidate agents.

7. The method according to claim 2, characterized in that The feedback information is generated and transmitted by each candidate agent after receiving the request to join the multi-role dialogue, wherein, for each candidate agent, when generating the feedback information, the candidate agent obtains the dialogue background information and the dialogue environment information in the request to join the multi-role dialogue, obtains its own role characteristics, processes the dialogue background information, the dialogue environment information and its own role characteristics based on the large language model to obtain a processing result, and generates the feedback information to confirm joining the multi-role dialogue when the processing result indicates not to join the multi-role dialogue, and generates the feedback information to give up joining the multi-role dialogue when the processing result indicates not to join the multi-role dialogue.

8. The method according to claim 2, characterized in that: The method further comprises: Acquire the conversation background information, and generate a multi-role conversation joining reminder based on the conversation background information; Determine a plurality of users in the current scene, and send a reminder to join the multi-role dialogue to each of the plurality of users; In the case of receiving a joining response based on the multi-role dialogue joining reminder feedback, at least one user among the multiple users who has fed back the joining response is added to the multi-role dialogue.

9. The method according to claim 1, characterized in that: The step of determining, by the dialogue management role agent, a speaking role in the multi-role dialogue according to the dialogue information includes: Obtaining the role characteristics of each role in the multi-role dialogue; The dialogue management role agent processes the role characteristics of each role, the dialogue background information and the dialogue environment information based on a large language model to determine the speaking role in the multi-role dialogue.

10. The method according to claim 1, characterized in that The speaking role is an intelligent agent or a real person user; In the case where the speaking role is an agent, the agent obtains the dialogue background information, the dialogue background information and its own role characteristics, processes the dialogue background information, the dialogue background information and its own role characteristics based on a large language model to obtain a processing result, and generates the speech content according to the processing result, wherein if the processing result indicates to give up speaking, the agent generates a speech giving up instruction and transmits the speech giving up instruction; In the case where the speaking role is a real person user, a content input area is displayed to the real person user, and the content input into the content input area by the real person user is obtained as the speech content, wherein if the real person user is not detected inputting content in the content input area within a preset time, it is determined that a speech abandonment instruction from the real person user is received.

11. The method according to claim 1, characterized in that After the dialogue management role agent determines the speaking role in the multi-role dialogue according to the dialogue information, the method further includes: When receiving a speaking-giving-up instruction from the speaking role, the dialogue background information and role features of other roles in the multi-role dialogue except the speaking role are processed based on a large language model, and the speaking role in the multi-role dialogue is re-determined.

12. The method according to claim 1, characterized in that After displaying the speech content output by the speaking role, the method further includes: Storing the speech content as a speech record in the historical conversation record; The dialogue background information, the historical dialogue records and the role characteristics of each role in the multi-role dialogue are processed based on the large language model, and the speaking role in the multi-role dialogue is re-determined.

13. The method according to any one of claims 1 or 12, characterized in that: The method further comprises: When receiving a first speech content input by a real person user while waiting for the speaking role to make the speech content, the first speech content is stored as a speech record in the historical conversation record, and the speaking role continues to wait for the speech.

14. The method according to claim 1, characterized in that After displaying the speech content output by the speaking role, the method further includes: When receiving a second speech content input by a real person user after displaying the speech content, storing the speech content and the second speech content as a speech record in the historical conversation record respectively; The dialogue background information, the historical dialogue records and the role characteristics of each role in the multi-role dialogue are processed based on the large language model, and the speaking role in the multi-role dialogue is re-determined.

15. The method according to claim 1, characterized in that The method further comprises: Initiate multiple threads to synchronously query each agent in the multi-role dialogue whether there is a need to exit the multi-role dialogue, and when the query determines that the target agent has a need to exit the multi-role dialogue, remove the target agent from the multi-role dialogue and update the dialogue environment information; and / or, Upon receiving an exit instruction from at least one real user in the multi-role dialogue, removing the at least one real user from the multi-role dialogue and updating the dialogue environment information; and / or, Continuously read the dialogue environment information of the multi-role dialogue, and when it is determined that the dialogue environment information includes a member and the member is an intelligent agent, or when it is determined that the dialogue environment information does not include any intelligent agent, dissolve the multi-role dialogue, and determine the dialogue identifier of the multi-role dialogue, and delete the historical dialogue record associated with the dialogue identifier in the storage system.

16. The method according to claim 15, characterized in that After deleting the historical conversation record associated with the conversation identifier in the storage system, the method further includes: Generate multi-role dialogue state information of the multi-role dialogue, and obtain management role agent information of the dialogue management role agent; The multi-role dialogue state information, the management role agent information and the dialogue identifier are associated and stored in the storage system.

17. A device for realizing multi-role dialogue, characterized in that: The roles include real human users or intelligent agents, and the intelligent agents include at least one dialogue management role intelligent agent. The dialogue implementation device includes: An acquisition module, used to acquire dialogue information of a multi-role dialogue, wherein the dialogue information includes at least one or more of historical dialogue records, role characteristics, dialogue background information, and dialogue environment information; A determination module, configured to determine, by the dialogue management role agent, a speaking role in the multi-role dialogue according to the dialogue information; The display module is used to display the speech content output by the speaking role.

Citation Information

Cited By

  • Visual data generation method and device, equipment, medium and product

    CN119046490A

  • Simulation court implementation method and device based on intelligent agent, equipment and medium

    CN119168059A

  • Role dialogue generation method and device, equipment, storage medium and program product

    CN119808945A

  • Role dialogue generation method and device, equipment, storage medium and program product

    CN119808945B

  • Corpus data generation method and device based on large model and intelligent agent

    CN120851212A