Agent interaction methods, electronic device and computer-readable storage medium
By providing alternative scenarios and roles for multi-agent systems through multi-agent datasets, and controlling multiple agents to perform tasks, this solves the limitations of single-agent systems in complex scenarios and the inefficiency of multi-agent systems, thereby improving task execution efficiency and operational flexibility.
Patent Information
- Application Number
- PCT/CN2025/078845
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-06
- Filing Date
- 2025-02-24
- Publication Date
- 2025-12-11
AI Technical Summary
Single-agent systems have limitations in complex interactive scenarios, and multi-agent systems, based on closed-source large model APIs, have a single optimization method, resulting in low efficiency in interactive tasks.
By providing multiple alternative scenarios and roles through a multi-agent dataset, the multi-agent can be controlled to perform tasks based on scenario and role information, avoiding reliance on prompts and improving operational flexibility and freedom of choice.
It improves the efficiency of multi-agent interaction tasks, solves the problem of inefficiency caused by relying solely on prompts, and provides greater operational flexibility and freedom of choice.
Smart Images

Figure CN2025078845_11122025_PF_FP_ABST
Abstract
Description
Agent interaction method, electronic device and computer readable storage medium TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence technology and large language model technology, in particular to an agent interaction method, an electronic device and a computer readable storage medium. BACKGROUND
[0002] At present, the application of large language model (LLM) agents has been very common. In complex interactive scenarios, single-agent systems often cannot effectively cope with changing environments and interactions with other agents. For example, in complex interactive scenarios such as Stanford Town Simulation, software company scenario construction, and multi-party debate, single-agent systems often encounter difficulties. Therefore, multi-agent systems are proposed to solve these limitations and gradually gain widespread application.
[0003] In related technologies, most multi-agents are implemented based on closed-source large model application programming interfaces (APIs). Since the internal structure and parameters of the closed-source large model API are not disclosed, prompt information is usually used to optimize system performance. Therefore, there is a technical problem of low efficiency of multi-agents in executing interactive tasks.
[0004] At present, no effective solution has been proposed to solve the above problems. SUMMARY
[0005] Embodiments of the present application provide an agent interaction method, an electronic device and a computer readable storage medium to at least solve the technical problem of low efficiency of multi-agents in executing interactive tasks due to the pure dependence on prompt information to optimize agent performance in related technologies.
[0006] According to an aspect of an embodiment of the present application, an agent interaction method is provided, comprising: obtaining scene information and role information from a multi-agent data set, wherein the multi-agent data set is used to provide a plurality of alternative scenes and a plurality of alternative roles under each alternative scene, the scene information is used to select a corresponding scene for a to-be-executed multi-agent interactive task from the plurality of alternative scenes, and the role information is used to select a role participating in the multi-agent interactive task; based on the scene information and the role information, controlling a plurality of agents to execute the multi-agent interactive task.
[0007] According to another aspect of the embodiments of the present application, a method for agent interaction is also provided, including: obtaining chat scene information and chat role information from a multi-agent data set, wherein the multi-agent data set is used to provide a plurality of alternative scenes and a plurality of alternative roles in each alternative scene, the chat scene information is used to select a corresponding chat scene for a multi-agent chat task to be executed from the plurality of alternative scenes, and the chat role information is used to select a chat role participating in the multi-agent chat task; and controlling a plurality of chat agents to execute the multi-agent chat task based on the chat scene information and the chat role information.
[0008] According to another aspect of the embodiments of the present application, a method for agent interaction is also provided, including: obtaining a multi-agent interaction request through a first application programming interface, wherein request data carried in the multi-agent interaction request includes scene information and role information obtained from a multi-agent data set, the multi-agent data set is used to provide a plurality of alternative scenes and a plurality of alternative roles in each alternative scene, the scene information is used to select a corresponding scene for a multi-agent interaction task to be executed from the plurality of alternative scenes, and the role information is used to select a role participating in the multi-agent interaction task; and returning a multi-agent interaction response through a second application programming interface, wherein response data carried in the multi-agent interaction response includes an interaction execution result, wherein the interaction execution result is obtained after a plurality of agents are controlled to execute the multi-agent interaction task based on the scene information and the role information.
[0009] According to another aspect of the embodiments of the present application, a method for agent interaction is also provided, including: obtaining a multi-agent interaction request through a first application programming interface, wherein request data carried in the multi-agent interaction request includes scene information and role information obtained from a multi-agent data set, the multi-agent data set is used to provide a plurality of alternative scenes and a plurality of alternative roles in each alternative scene, the scene information is used to select a corresponding scene for a multi-agent interaction task to be executed from the plurality of alternative scenes, and the role information is used to select a role participating in the multi-agent interaction task; and returning a multi-agent interaction response through a second application programming interface, wherein response data carried in the multi-agent interaction response includes an interaction execution result, wherein the interaction execution result is obtained after a plurality of agents are controlled to execute the multi-agent interaction task based on the scene information and the role information.
[0010] According to another aspect of the embodiments of the present application, an electronic device is also provided, including: a memory storing an executable program; and a processor configured to run the program, wherein the program, when running, performs any one of the above-mentioned methods for agent interaction.
[0011] According to another aspect of the embodiments of the present application, a computer readable storage medium is also provided, which includes a stored executable program, wherein the executable program controls the device where the computer readable storage medium is located to perform any of the above-mentioned agent interaction methods when the executable program is executed.
[0012] According to another aspect of the embodiments of the present application, a computer program product is also provided, which includes a computer program, and the computer program implements any of the above-mentioned agent interaction methods when executed by a processor.
[0013] In the embodiments of the present application, the multi-agent dataset provides multiple alternative scenes and multiple alternative roles in each alternative scene, based on which, the corresponding scene for the to-be-executed multi-agent interaction task can be selected from the alternative scenes in the multi-agent dataset, the role participating in the multi-agent interaction task can be selected from the multiple alternative roles corresponding to the selected scene, and then the multi-agent is controlled to execute the multi-agent interaction task according to the selected scene and the selected role. Since the multi-agent dataset pre-provides multiple alternative scenes and multiple alternative roles in each scene, the selection of the appropriate scene and role can be made according to the specific to-be-executed multi-agent interaction task, instead of relying on the prompt information alone, which provides the user with extremely high operation flexibility and selection freedom, and after the scene and the role are selected, the multi-agent can be controlled to execute the multi-agent interaction task according to the selected scene and the selected role, which improves the efficiency of the multi-agent in executing the interaction task, and thus solves the technical problem in the related art that the performance of the agent is optimized by relying on the prompt information alone, resulting in low efficiency of the multi-agent in executing the interaction task. BRIEF DESCRIPTION OF DRAWINGS
[0014] The accompanying drawings, which are included to provide a further understanding of the present application, form a part of the present application and illustrate the illustrative embodiments of the present application and the explanation of the present application, and do not constitute improper limitations on the present application. In the drawings:
[0015] FIG. 1 is a hardware structure block diagram of a computer terminal (or mobile device) configured to implement an agent interaction method according to Embodiment 1 of the present application;
[0016] FIG. 2 is a flowchart of an agent interaction method according to Embodiment 1 of the present application;
[0017] FIG. 3 is a schematic diagram of a multi-agent interaction according to Embodiment 1 of the present application;
[0018] FIG. 4 is a flowchart of another agent interaction method according to Embodiment 2 of the present application;
[0019] FIG. 5 is a flowchart of still another agent interaction method according to Embodiment 3 of the present application;
[0020] Fig. 6 is a flow chart of yet another intelligent body interaction method according to Embodiment 4 of the present application;
[0021] Fig. 7 is a structural schematic diagram of an intelligent body interaction apparatus according to Embodiment 5 of the present application;
[0022] Fig. 8 is a structural schematic diagram of another intelligent body interaction apparatus according to Embodiment 5 of the present application;
[0023] Fig. 9 is a structural schematic diagram of still another intelligent body interaction apparatus according to Embodiment 5 of the present application;
[0024] Fig. 10 is a structural schematic diagram of yet another intelligent body interaction apparatus according to Embodiment 5 of the present application;
[0025] Fig. 11 is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the personnel in the technical field better understand the scheme of the present application, the technical scheme in the embodiments of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by the person of ordinary skill in the art without making creative labor should belong to the scope of protection of the present application.
[0027] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0028] First, some nouns or terms appearing in the description of the embodiments of the present application are applicable to the following explanations:
[0029] Intelligent body system: a computer system based on artificial intelligence (AI) technology, in which an AI intelligent body, relying on a large model as a hub, combines tool calls to a knowledge base, and is set to complete complex tasks;
[0030] Large Language Model (LLM): refers to a neural network model with tens of billions or even trillions of parameters, which can be used to perform natural language processing tasks such as language generation, question answering, and text classification, etc. It is usually trained using a large amount of text data and can perform well on a variety of different tasks.
[0031] Generative AI: refers to AI technology that can generate natural language text, images, audio or video data, etc. Unlike traditional classification, regression, etc. tasks, generative AI requires the model to have creativity and imagination, and can generate completely new and unseen content based on the input conditions. Common generative AI includes natural language generation models, image generation models, etc.
[0032] Tool API integration: refers to a way of integrating AI models into API interfaces, which are used by developers or users. Through the API interface, developers or users can use the functions provided by the AI model, such as language translation, image recognition, speech synthesis, etc. to add more rich functions to the application.
[0033] Artificial General Intelligence (AGI): refers to an artificial intelligence system that has the same broad intelligence as humans, and can continuously learn and adapt to various environments and tasks. Unlike current weak artificial intelligence (such as voice assistants, image recognition, etc.) and strong artificial intelligence (such as self-improving robots, creative artists, etc.), AGI has the potential to surpass current human intelligence.
[0034] ModelScope-Agent: ModelScope-Agent is a customizable intelligent assistant system based on open-source large language models. It aims to enable LLMs to efficiently perform tasks in real-world scenarios by combining tool usage modules and memory management mechanisms. ModelScope-Agent has the following features and components. The core components of ModelScope-Agent include LLM controller, tool usage module, and memory module. The LLM controller is responsible for model core inference. The tool usage module covers tool usage data collection, tool retrieval, tool registration, memory control, and other aspects to ensure that LLMs can perform tasks by calling APIs. The memory module stores and manages context information such as dialogue history and API call results. LLMs serve as the brain in the ModelScope-Agent architecture, responsible for strategic planning and task decomposition of the entire agent system. After receiving user instructions, LLMs will plan tasks, select and call corresponding tools or APIs for information retrieval, and integrate all information obtained in previous steps to generate a reply that meets user needs. Open-source LLMs serve as core components, and ModelScope-Agent supports model training on multiple open-source LLMs in the ModelScope community and open-sources the supporting Chinese and English tool instruction dataset MSAgent-Bench to enhance the planning and scheduling capabilities of open-source large models as the core of the agent.
[0035] ModelScope-Agent has customizability: ModelScope-Agent provides a general and customizable Agent framework that makes it easy for users to create their own intelligent agents. Based on open-source large language models as the core, it provides a user-friendly system library with customizable and comprehensive framework, covering data collection, tool retrieval, tool registration, storage management, customized model training, and practical applications.
[0036] The working principle of ModelScope-Agent: Break down the target into smaller tasks and complete them one by one. For example, when a user requests to perform a complex task, ModelScope-Agent will show the entire task planning process, retrieve relevant tools, then use open-source LLMs for planning and scheduling, generate content, and call the corresponding model to complete the task. ModelScope-Agent architecture provides a powerful, flexible, and customizable intelligent assistant system for users, which can play a role in various practical application scenarios.
[0037] At present, although the application of LLM agent has been relatively common, due to the difficulty of single-agent system in considering different factors at the same time in complex interactive scenarios, it often encounters difficulties, so there is a technical problem that single-agent system cannot cope with complex scenarios.
[0038] Therefore, the related art further proposes a multi-agent system. In a complex interactive scenario, the multi-agent system can better consider various different factors and better cope with various uncertainties, but the existing multi-agent system is usually based on a closed-source large model API, the internal structure of the model is not disclosed, and often needs to adjust the prompt information to optimize the model performance, but this can only adjust and optimize the model within a limited range, cannot perform deep optimization, and still has the technical problem of low interaction efficiency between multi-agents.
[0039] Based on the above analysis, the perception scheme of the related art has the following defects.
[0040] Defect 1: Single-agent system has limitations in complex interactive scenarios.
[0041] Defect 2: The multi-agent system model based on a closed-source large model API has a single optimization mode, resulting in low efficiency of multi-agents in performing interactive tasks.
[0042] In view of the above defects, no effective solution has been proposed before the present application.
[0043] Embodiment 1
[0044] According to the embodiments of the present application, an embodiment of an agent interaction method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0045] The method provided in the embodiment one of the present application can be executed in a mobile terminal, a computer terminal or similar computing device. FIG. 1 is a hardware structure block diagram of a computer terminal (or mobile device) configured to implement the agent interaction method according to the embodiment 1 of the present application. As shown in FIG. 1, the computer terminal 10 (or mobile device 10) can include one or more processors 102 (the processor 102 can include but not limited to a microcontroller unit (MCU) or a programmable logic device (FPGA) and the like processing device), a memory 104 configured to store data, and a transmission device 106 configured to have a communication function. In addition, it can also include a display, an input / output (I / O) interface, a universal serial bus (USB) port (which can be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. Those skilled in the art can understand that the structure shown in FIG. 1 is only schematic, which does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 can also include more or less components than those shown in FIG. 1, or have a different configuration from that shown in FIG. 1.
[0046] It should be noted that the one or more processors 102 and / or other data processing circuits described above can be generally referred to as "data processing circuits" herein. The data processing circuit can be embodied in whole or in part as software, hardware, firmware or any other combination. In addition, the data processing circuit can be a single independent processing module, or any one of the other elements combined into the computer terminal 10 (or mobile device) in whole or in part. As referred to in the embodiments of the present application, the data processing circuit serves as a processor to control (for example, the selection of the variable resistance terminal path connected with the interface).
[0047] The memory 104 can be configured to store software programs of application software and modules, such as program instructions / data storage means corresponding to the agent interaction method in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implements the agent interaction method described above. The memory 104 can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 104 can further include memories remotely arranged with respect to the processor 102, which can be connected to the computer terminal 10 through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0048] The transmission device 106 is configured to receive or send data via a network. Specific examples of the network can include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (NIC), which can be connected to other network devices through a base station so as to be able to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is configured to communicate with the Internet in a wireless manner.
[0049] The display can be, for example, a touch screen type liquid crystal display (LCD), which can enable a user to interact with the user interface of the computer terminal 10 (or mobile device).
[0050] Under the above operating environment, the present application provides an agent interaction method as shown in FIG. 2. FIG. 2 is a flowchart of an agent interaction method according to Embodiment 1 of the present application. As shown in FIG. 2, the method can include the following steps:
[0051] Step S21, obtaining scene information and role information from a multi-agent data set, wherein the multi-agent data set is used to provide a plurality of alternative scenes and a plurality of alternative roles under each alternative scene, the scene information is used to select a corresponding scene from the plurality of alternative scenes for a to-be-executed multi-agent interaction task, and the role information is used to select a role participating in the multi-agent interaction task;
[0052] Step S22, controlling a plurality of agents to execute a multi-agent interaction task based on the scene information and the role information.
[0053] In an embodiment of the present application, the multi-agent dataset can be a Chinese multi-agent dataset, which can be used to provide multiple alternative scenarios and multiple alternative roles in each alternative scenario. The alternative scenario is used to indicate different situations or environments that the multi-agent may involve when having a conversation or interaction. These scenarios can involve various situations in daily life or situations in a movie or TV series, and the like, which are not specifically limited here. The alternative role is used to indicate different identities that can be played in different scenarios. These roles can be specific tasks or abstract identities or roles, which are not specifically limited here. The multi-agent interaction task can be a multi-agent chat conversation task. The agent is set to indicate a virtual role driven by a large model.
[0054] For example, after determining the multi-agent interaction task to be performed, a scenario corresponding to the multi-agent interaction task can be selected from multiple alternative scenarios included in the multi-agent dataset, and then a role participating in the multi-agent interaction task can be selected from multiple alternative roles corresponding to the selected scenario. After selecting the scenario and the role corresponding to the multi-agent interaction task to be performed, the multi-agent can be controlled to perform the multi-agent interaction task according to the selected scenario and the role.
[0055] Optionally, after selecting the scenario and the role corresponding to the multi-agent interaction task, the multi-agent can be assigned a corresponding role to enable the multi-agent to perform role-playing, and then discuss the interaction topic in the multi-agent interaction task in the selected scenario.
[0056] For example, assuming that the multi-agent interaction task is a chat task for a certain plot in a movie or TV series, for example, a chat interaction for "Little Li, I heard you had an accident, please respond". Based on this, a scenario corresponding to the task can be selected from the multi-agent dataset according to the multi-agent interaction task, for example, a scenario in which Little Li freely chats with multiple roles in a group chat. After determining the scenario corresponding to the multi-agent interaction task, multiple roles participating in the multi-agent interaction task can be selected from the scenario. For example, the multiple roles can be Xiao Wang, Xiao Zhang, Xiao He, and the like, which can be selected according to the roles corresponding to the plot in the movie or TV series, which is an example and does not specifically limit the selected roles.
[0057] FIG. 3 is a schematic diagram of multi-agent interaction according to Embodiment 1 of the present application. As shown in FIG. 3, after selecting the scene corresponding to the multi-agent interaction task and the role, the role (Xiaowang) who starts the topic and the role (Xiaoli) discussed in the topic can be set according to the role information from the multiple roles in the multi-agent interaction task. Then, by clicking the start interaction control, the multi-agent chat interaction can be started. The content of the chat interaction is shown on the left side of FIG. 3. It should be noted that FIG. 3 is only an example and does not limit the chat content of the multi-agent.
[0058] In the above steps S21 to S22 of the present application, the multi-agent data set is provided with multiple alternative scenes and multiple alternative roles in each alternative scene. Based on this, the corresponding scene for the multi-agent interaction task to be performed can be selected from the alternative scenes in the multi-agent data set, and the roles participating in the multi-agent interaction task can be selected from the multiple alternative roles corresponding to the selected scene. Then, according to the selected scene and the selected role, the multi-agent is controlled to perform the multi-agent interaction task. Since the multi-agent data set pre-provides multiple alternative scenes and multiple alternative roles in each scene, the selection of the appropriate scene and role is no longer simply dependent on the prompt information. Instead, according to the specific multi-agent interaction task to be performed, the appropriate scene and role are selected, providing the user with high operational flexibility and selection freedom. Moreover, after selecting the scene and the role, the multi-agent can be controlled to perform the multi-agent interaction task according to the selected scene and the selected role, improving the efficiency of the multi-agent in performing the interaction task, and thus solving the technical problem in the related art that the performance of the multi-agent is simply optimized by relying on the prompt information, resulting in low efficiency of the multi-agent in performing the interaction task.
[0059] The above multi-agent interaction method provided by the embodiments of the present application can be applied in, but is not limited to, application scenarios involving multi-agent interaction in the fields of e-commerce services, education services, legal services, medical services, conference services, social network services, financial product services, logistics services, and navigation services, such as the scenarios involving multi-agent interaction in e-commerce services, the scenarios involving multi-agent interaction in education services, the scenarios involving multi-agent interaction in legal services, and the like, which are not limited herein.
[0060] In an optional embodiment, in step S22, the multi-agent is controlled to perform the multi-agent interaction task based on the scene information and the role information, including the following method steps:
[0061] Step S221, determining the target scene corresponding to the multi-agent interaction task based on the scene information;
[0062] Step S222, determining the multiple target roles participating in the multi-agent interaction task according to the role information in the target scene;
[0063] Step S223, control at least part of the plurality of agents to simulate a plurality of target roles to perform the multi-agent interaction task.
[0064] In the embodiments of the present application, the target scene is used to indicate a scene matched with the multi-agent interaction task. The target role is used to indicate a plurality of roles participating in the multi-agent interaction task in the target scene.
[0065] In this embodiment, after the multi-agent interaction task to be performed is determined, the target scene corresponding to the multi-agent interaction task to be performed can be selected from a plurality of alternative scenes according to the scene information corresponding to the multi-agent interaction task.
[0066] After the target scene corresponding to the multi-agent interaction task is determined, a plurality of target roles participating in the multi-agent interaction task can be determined according to the role information corresponding to the multi-agent interaction task in the target scene.
[0067] After the target scene and the target role are determined, at least part of the plurality of agents can be controlled to simulate a plurality of target roles to perform the multi-agent interaction task. The at least part of the plurality of agents can be determined according to the selected plurality of target roles.
[0068] For example, assuming that the target scene is a scene of experiencing playing the role of xx in a group chat and chatting with a plurality of women, based on which a plurality of target roles participating in the chatting task can be selected in the target scene. For example, the plurality of target roles can be A, B, C, and D roles. After the plurality of target roles participating in the chatting task are selected, at least part of the plurality of agents can be controlled to play the selected target roles, and then perform the multi-agent interaction task.
[0069] In the steps S221 to S223 of the present application, the target scene and the target role corresponding to the multi-agent interaction task can be determined according to the scene information and the role information corresponding to the multi-agent interaction task to be performed, and then at least part of the plurality of agents can be controlled to simulate a plurality of target roles to perform the multi-agent interaction task, which is convenient for user operation and greatly improves the execution efficiency of the multi-agent interaction task.
[0070] In an alternative embodiment, in step S223, controlling at least part of the plurality of agents to simulate a plurality of target roles to perform the multi-agent interaction task includes the following method steps:
[0071] Step S2231, obtaining an interaction topic corresponding to the multi-agent interaction task;
[0072] Step S2232, performing role allocation on the plurality of target roles to obtain an allocation result;
[0073] At step S2233, based on the interactive topic and the allocation result, the at least part of the agents are controlled to simulate the plurality of target roles to perform the multi-agent interactive task.
[0074] In the embodiments of the present application, the interactive topic can be a topic to be discussed in the multi-agent interactive task. For example, it can be a topic developed for a certain plot in a film or television series, or a hot topic, etc., which is not limited here. The role allocation is used to at least indicate the roles of starting the topic and the roles discussed in the topic among the plurality of target roles.
[0075] For example, after obtaining the interactive topic corresponding to the multi-agent interactive task, the role allocation can be performed on the plurality of target roles for the interactive topic to determine the roles of starting the topic and the roles discussed in the topic among the plurality of target roles, and other roles, which are not described here.
[0076] Optionally, after the role allocation is performed on the plurality of target roles, based on the interactive topic and the allocation result, the at least part of the agents are controlled to simulate the plurality of target roles to perform the multi-agent interactive task. For example, the at least part of the agents are controlled to simulate the plurality of target roles to develop the interactive topic discussion.
[0077] In the above steps S2231 to S2233, after obtaining the interactive topic corresponding to the agent interactive task, the role allocation can be performed on the plurality of target roles to determine the roles of starting the topic and the roles discussed in the interactive topic, so as to effectively guide the direction of the role conversation, ensure that each role participates in the topic discussion, and promote the progress of the topic discussion.
[0078] In an optional embodiment, in step S2233, based on the interactive topic and the allocation result, the at least part of the agents are controlled to simulate the plurality of target roles to perform the multi-agent interactive task, including the following method steps:
[0079] At step S22331, based on the interactive topic and the allocation result, a first target role and a second target role are determined from the plurality of target roles, respectively, wherein the first target role is a predetermined role in the target scene, the second target role is used to interact with the first target role around the interactive topic, and a specified role in the second target role is used to start the multi-agent interactive task around the interactive topic;
[0080] At step S22332, at least part of the agents are selected from the plurality of agents to simulate the first target role and the second target role, respectively;
[0081] In step S22333, the target agent in the plurality of agents is used to control the at least part of the agents to perform the multi-agent interactive task, wherein the target agent is configured to specify the agent performing the interactive operation in each round of interaction included in the multi-agent interactive task.
[0082] In an embodiment of the present application, the first target role is a predetermined role in the target scene, wherein the predetermined role can be a role to be discussed in the interactive topic, and the second target role is used to interact with the first target role around the interactive topic, that is, the second target role can be a role to have a conversation with the first target role. The specified role in the second target role can be a role to start the discussion of the topic in the multi-agent interactive task.
[0083] The target agent is an agent to specify the interactive operation in each round of interaction included in the multi-agent interactive task, and the target agent can be specified in advance. For example, the target agent is specified in advance in the plurality of agents, so that the target agent is independent of the agent performing the interactive operation in the plurality of agents. Alternatively, the target agent can be understood as a control agent, and can also be referred to as a selected chat person, that is, the target agent can select and specify the agent currently performing the interaction, and control the specified agent to perform the interactive operation, that is, control the specified agent to speak.
[0084] For example, after the first target role and the second target role are determined according to the interactive topic and the allocation result, at least part of the agents can be selected from the plurality of agents to simulate the first target role and the second target role respectively, to perform role playing, so as to perform the multi-agent interactive task. In the process of performing the multi-agent interactive task, the target agent can be used to control the agent to specify the interactive operation in each round of interaction included in the multi-agent interactive task.
[0085] In the above steps S22331 to S22333 of the present application, the first target role and the second target role can be determined from the plurality of target roles according to the interactive topic and the allocation result, and at least part of the agents can be selected from the plurality of agents to simulate the first target role and the second target role respectively, and then the target agent is used to control the at least part of the agents to perform the multi-agent interactive task. By using the target agent to specify the agent performing the interactive operation in each round of interaction included in the multi-agent interactive task, the multi-agent interactive task can be managed, and the execution efficiency of the multi-agent interactive task can be effectively improved.
[0086] In an alternative embodiment, in step S22333, the target agent in the plurality of agents is used to control the at least part of the agents to perform the multi-agent interactive task, including the following method steps:
[0087] In step S223331, the target agent sequentially specifies, from the at least partial agents, agents performing interaction operations in each round of interaction included in the multi-agent interaction task, to obtain an interaction operation execution sequence corresponding to the at least partial agents;
[0088] In step S223332, the target agent controls the at least partial agents to perform the multi-agent interaction task based on the interaction operation execution sequence.
[0089] In the embodiments of the present application, the interaction operation execution sequence is used to indicate a discussion order of the at least partial agents in performing the multi-agent interaction task.
[0090] For example, assuming that the at least partial agents are A, B, C, and D, and the target agent sequentially specifies agents performing interaction operations in each round of interaction in the multi-agent interaction task, the obtained interaction operation execution sequence corresponding to the at least partial agents is B, D, C, and A. Based on this, the target agent controls the at least partial agents to perform the multi-agent interaction task according to the interaction operation execution sequence. For example, in the multi-agent interaction task, the agent B is controlled to perform the interaction operation first, then the agent D, then the agent C, and finally the agent D, and so on.
[0091] Optionally, after the target agent determines the interaction operation execution sequence corresponding to the at least partial agents in the multi-agent interaction task, the target agent can control the corresponding agents to perform the corresponding interaction operations according to the execution sequence.
[0092] In the above steps S223331 to S223332 of the present application, the target agent can specify agents performing interaction operations in each round of interaction included in the multi-agent interaction task to obtain an interaction operation execution sequence corresponding to the at least partial agents, and then perform the multi-agent interaction task according to the interaction operation sequence, so that the at least partial agents can perform the multi-agent interaction task in an orderly manner, ensuring that each agent performs the interaction operation in the correct order, thereby improving the execution efficiency of the multi-agent interaction task.
[0093] In an optional embodiment, the agent interaction method further includes the following method steps:
[0094] In step S23, a plurality of virtual spaces are created, wherein the plurality of virtual spaces are respectively used to set different scene plots and set different roles for the scene plots;
[0095] In step S24, different scene information and different role information are respectively configured for the plurality of virtual spaces, to generate a multi-agent data set.
[0096] In the embodiment of the present application, the virtual space can be a chat room. The scene information can be a topic or theme to be discussed, and the role information can also be a role object contained in the topic to be discussed.
[0097] In this embodiment, the model is provided with a creative space that can be used directly, and the creative space has multiple virtual spaces by default. The user can configure different scene information and different role information for the multiple virtual spaces according to the multi-agent interaction task to be performed, that is, configure a chat theme and chat characters participating in the chat theme for the multiple virtual spaces.
[0098] For example, different scene information and different role information can be configured for the virtual space by modifying the story_holder.py file in the virtual space of the model. For example, after determining the scene information and role information to be configured for the virtual space, the scene information in the story_holder.py file in the virtual space can be modified to the scene information to be configured, and the role information in the story_holder.py file in the virtual space can be modified to the role information to be configured, to realize the configuration of the scene information and the role information of the virtual space. After configuring different scene information and different role information for the multiple virtual spaces according to this method, a multi-agent data set can be generated according to the multiple virtual spaces after the configuration.
[0099] In the above steps S23 to S24 of the present application, the scene information and the role information in the story_holder.py file of the virtual space can be modified to realize the configuration of the scene information and the role information of the virtual space. The configuration method is relatively simple and convenient to adjust and modify to meet different needs.
[0100] In an optional embodiment, the agent interaction method further includes the following method steps:
[0101] In step S25, a preset mixin class is used to pass the interaction content between the multiple agents, wherein the preset mixin class is used to encapsulate the communication logic between the multiple agents, and the interaction content is the communication content generated in the process of executing the multi-agent interaction task by the multiple agents.
[0102] In the embodiment of the present application, the preset mixin class (AgentEnvMixin) is a class specially designed to process and simplify the logic of communication with the environment in the multi-agent system. It is usually used as a mixin class and provided for agent (agents) or environment (environment) objects. The environment object is set to manage environment information and promote dynamic interaction between agents through an efficient publish / subscribe mechanism.
[0103] Optionally, in the multi-agent system, the preset mixin class has multiple advantages. Specifically, abstract communication logic: the preset mixin class encapsulates the communication details between multi-agents, decouples from the specific environment interaction logic, allows developers to focus on the decision logic of the agent, and does not have to worry about the underlying communication mechanism; enhanced scalability: by using the mixin pattern, the preset mixin class can be flexibly added to any agent or environment class without changing the existing class structure, thereby enhancing the scalability of the system; simplify multi-agent collaboration: the preset mixin class provides a standardized method for interaction between agents and acquisition of environment state, which helps to simplify the complexity of multi-agent collaboration, making it more direct and efficient to develop multi-agent interaction; parallel processing support: combined with a parallel execution framework such as Ray, the preset mixin class can easily implement parallel processing and asynchronous execution of agents to adapt to high-performance computing requirements and optimize execution efficiency; message passing encapsulation: in the preset mixin class, message passing and processing are usually implemented by calling, and the message queue is correctly managed, messages are filtered and routed, and messages are correctly delivered to avoid mutual blocking at the execution layer; unified interface, the preset mixin class usually provides a unified interface for agents to seamlessly access environment state, history records, and agent state, and the unified interface helps to maintain code clarity and module independence.
[0104] In the above step S25 of the present application, the communication logic between multi-agents is processed by the preset mixin class, which can ensure that the interaction logic of the multi-agent system can be independently operated with the single-agent system without any modification to the existing single-agent module code, thereby ensuring low invasiveness of the original system architecture.
[0105] In an optional embodiment, the agent interaction method further includes the following method steps:
[0106] Step S26, the state information of the plurality of agents is maintained by using the pre-created agent registry center, wherein the state information is used to describe the role information simulated by the plurality of agents, the historical interaction information of the plurality of agents, and the current behavior information of the plurality of agents.
[0107] In the embodiment of the present application, the agent registry center (Agent Registry Center, ARC for short) is used to maintain the state information of the plurality of agents and provide corresponding capability enhancement services. The role information simulated by each agent is used to indicate the role to be played by the corresponding agent, the historical interaction information of each agent can be the historical dialogue record of the corresponding agent, and the current behavior information of each agent is used to indicate the behavior currently executed by the corresponding agent.
[0108] Optionally, the agent registry is further configured to update the state information of the plurality of agents, and the agent registry can keep all the historical state information of the plurality of agents.
[0109] In an optional embodiment, the method further comprises the following steps:
[0110] In step S27, the communication mode and the delivery mode of the interaction content between the plurality of agents are determined by using the pre-created task center.
[0111] In the embodiments of the present application, in order to support diversified agent interaction, an extensible task center is created, which supports broadcast and specific target message delivery mechanism and allows various forms of communication between the plurality of agents. The communication mode between the plurality of agents can include unordered exchange, cyclically executed user-defined logic, etc., which are not limited here.
[0112] Optionally, the task center further provides the delivery mode of the interaction content, wherein the delivery mode of the interaction content includes a send_to mode and a send_from mode, and the delivery mode of the interaction content allows direct message delivery between the agents.
[0113] In step S27 of the above embodiments of the present application, the communication mode and the delivery mode of the interaction content between the plurality of agents are determined by using the task center, which greatly improves the development flexibility and accelerates the rapid iteration of simple application processes.
[0114] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.
[0115] In addition, it should be noted that for the above-mentioned method embodiments, in order to simply describe, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0116] Those skilled in the art can clearly understand that the method according to the above-mentioned embodiments can be realized by means of software and necessary general hardware platforms, and of course can also be realized by hardware, through the description of the above embodiments. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk) and includes a plurality of instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device) to execute the methods described in the various embodiments of the present application.
[0117] Embodiment 2
[0118] In the running environment as in Embodiment 1, the present application provides an intelligent agent interaction method as shown in FIG. 4, which is a flowchart of another intelligent agent interaction method according to Embodiment 2 of the present application. As shown in FIG. 4, the method includes:
[0119] Step S41, obtaining chat scene information and chat role information from a multi-agent data set, wherein the multi-agent data set is used to provide a plurality of alternative scenes and a plurality of alternative roles under each alternative scene, the chat scene information is used to select a corresponding chat scene for a to-be-executed multi-agent chat task from the plurality of alternative scenes, and the chat role information is used to select a chat role participating in the multi-agent chat task;
[0120] Step S42, controlling a plurality of chat agents to execute the multi-agent chat task based on the chat scene information and the chat role information.
[0121] In the embodiments of the present application, the alternative scene is used to indicate different situations or environments that the multi-agent may involve when conducting a chat conversation or interaction. These scenes can involve various situations in daily life or situations in movies and TV series, etc., which are not specifically limited here. The alternative role is used to indicate different or identities that can be played in different scenes. These roles can be specific tasks, or abstract identities or roles, which are not specifically limited here.
[0122] For example, after determining the to-be-executed multi-agent chat task, a scene corresponding to the multi-agent chat task can be selected from a plurality of alternative scenes included in the multi-agent data set, and then a role participating in the multi-agent chat task can be selected from a plurality of alternative roles corresponding to the selected scene. After selecting the scene and the role corresponding to the to-be-executed multi-agent chat task, the multi-agent can be controlled to execute the multi-agent chat task according to the selected scene and the role.
[0123] Optionally, after determining the scenario and the role corresponding to the multi-agent chat task to be executed, the multi-agent can be controlled to execute the multi-agent chat task, that is, the multi-agent is controlled to perform role-playing to simulate the selected role and discuss the chat topic in the selected chat scenario for the multi-agent chat task to be executed. The specific implementation of controlling the multi-agent to execute the multi-agent chat task based on the chat scenario information and the chat role information can refer to the description of the foregoing step S22, and will not be described here.
[0124] In the steps S41-S42 of the present application, the multi-agent dataset is provided with multiple alternative scenarios and multiple alternative roles in each alternative scenario. Based on this, the corresponding chat scenario for the multi-agent chat task to be executed can be selected from the alternative scenarios in the multi-agent dataset, and the chat role participating in the multi-agent interaction task can be selected from the multiple alternative roles corresponding to the selected chat scenario. Then, the multi-agent is controlled to execute the multi-agent interaction task according to the selected chat scenario and the selected chat role. Since the multi-agent dataset is pre-provided with multiple alternative scenarios and multiple alternative roles in each scenario, the selection of the appropriate chat scenario and chat role is no longer simply dependent on the prompt information. Instead, the appropriate chat scenario and chat role are selected according to the specific multi-agent chat task to be executed, providing the user with high operational flexibility and selection freedom. Moreover, after the scenario and the role are selected, the multi-agent can be controlled to execute the multi-agent chat task according to the selected scenario and role, improving the efficiency of the multi-agent in executing the chat task, and thus solving the technical problem in the related art that the performance of the multi-agent is simply optimized by relying on the prompt information, resulting in low efficiency of the multi-agent in executing the chat task.
[0125] In an optional embodiment, the step S42 of controlling the multi-agent to execute the multi-agent chat task based on the chat scenario information and the chat role information includes the following method steps:
[0126] Step S421, determining the target chat scenario corresponding to the multi-agent chat task based on the chat scenario information;
[0127] Step S422, determining the multiple target chat roles participating in the multi-agent chat task according to the chat role information in the target chat scenario;
[0128] Step S423, controlling at least part of the multi-agent to simulate the multiple target chat roles to execute the multi-agent chat task.
[0129] In the embodiment of the present application, the target chat scenario is used to indicate the chat scenario matched with the multi-agent chat task. The target chat role is used to indicate the multiple chat roles participating in the multi-agent chat task in the target chat scenario.
[0130] In this embodiment, after determining the multi-agent chat task to be executed, the target chat scene corresponding to the multi-agent chat task to be executed can be selected from a plurality of candidate scenes according to the chat scene information corresponding to the multi-agent chat task.
[0131] After determining the target chat scene corresponding to the multi-agent chat task, the plurality of target chat roles participating in the multi-agent chat task can be determined according to the role information corresponding to the multi-agent chat task in the target chat scene.
[0132] After determining the target chat scene and the target chat roles, at least part of the plurality of agents can be controlled to simulate the plurality of target chat roles to execute the multi-agent chat task. The at least part of the plurality of agents can be determined according to the selected plurality of target chat roles.
[0133] For example, the specific manner of controlling at least part of the plurality of chat agents to simulate the plurality of target chat roles to execute the multi-agent chat task can refer to the description of the foregoing step S223, and will not be described here.
[0134] In the steps S421 to S423 of the present application, the target chat scene and the target chat roles corresponding to the multi-agent chat task can be determined according to the chat scene information and the chat role information corresponding to the multi-agent chat task to be executed, and then at least part of the plurality of agents can be controlled to simulate the plurality of target chat roles to execute the multi-agent chat task, which is convenient for user operation and greatly improves the execution efficiency of the multi-agent chat task.
[0135] The multi-agent interaction method provided in the embodiments of the present application can be applied in, but is not limited to, application scenarios involving multi-agent interaction in the fields of e-commerce services, education services, legal services, medical services, conference services, social network services, financial product services, logistics services, and navigation services, such as scenarios involving multi-agent interaction in e-commerce services, scenarios involving multi-agent interaction in education services, scenarios involving multi-agent interaction in legal services, and the like, which are not limited herein.
[0136] Embodiment 3
[0137] In the running environment as in embodiment 1, the present application provides an agent interaction method as shown in FIG. 5. FIG. 5 is a flowchart of another agent interaction method according to embodiment 3 of the present application, as shown in FIG. 5, the method comprises:
[0138] At step S51, the multi-agent interaction request is acquired through the first application programming interface, wherein the request data carried in the multi-agent interaction request includes the scene information and the role information acquired from the multi-agent data set, the multi-agent data set is used to provide multiple candidate scenes and multiple candidate roles in each candidate scene, the scene information is used to select a corresponding scene for the to-be-executed multi-agent interaction task from the multiple candidate scenes, and the role information is used to select a role participating in the multi-agent interaction task.
[0139] At step S52, the multi-agent interaction response is returned through the second application programming interface, wherein the response data carried in the multi-agent interaction response includes the interaction execution result, and the interaction execution result is obtained after the multiple agents execute the multi-agent interaction task based on the scene information and the role information.
[0140] The first application programming interface and the second application programming interface can be the same application programming interface or different application programming interfaces. In an optional embodiment, the interface parameters in the first application programming interface and the second application programming interface can include but are not limited to an interface global identifier, an interface signature key, an interface timestamp, an interface request identifier, a system call credential identifier, and the like. The first application programming interface can use GET (get) or POST (publish) as an interface request mode to acquire the file processing request. The second application programming interface can use the JSON (JavaScript Object Notation) format to feed back the file processing response.
[0141] The multi-agent interaction request can be understood as a request message used to request execution of a multi-agent interaction task, wherein the multi-agent interaction task can be a multi-agent chat conversation task.
[0142] The multi-agent interaction response can be understood as a response message generated in response to the multi-agent interaction request.
[0143] The remaining descriptions can refer to the descriptions in Embodiment 1, and will not be described in detail here.
[0144] In the steps S51-S52 of the above method, the multi-agent interaction request is obtained through the first application programming interface, wherein the request data carried in the multi-agent interaction request includes scene information and role information obtained from the multi-agent data set, the multi-agent data set is used to provide multiple alternative scenes and multiple alternative roles in each alternative scene, the scene information is used to select a corresponding scene for the to-be-executed multi-agent interaction task from the multiple alternative scenes, and the role information is used to select a role participating in the multi-agent interaction task; and the multi-agent interaction response is returned through the second application programming interface, wherein the response data carried in the multi-agent interaction response includes an interaction execution result, and the interaction execution result is obtained after the multiple agents perform the multi-agent interaction task based on the scene information and the role information. That is, the multi-agent interaction task can be completed through the multi-agent interaction request and the multi-agent interaction response, the execution process of the multi-agent interaction task is simplified, the execution efficiency of the multi-agent interaction task is improved, and thus the technical problem of low execution efficiency of the multi-agent interaction task is solved.
[0145] The multi-agent interaction method provided in the embodiment of the application can be applied in, but is not limited to, application scenarios involving multi-agent interaction in fields such as e-commerce services, education services, legal services, medical services, conference services, social network services, financial product services, logistics services, and navigation services, for example, scenarios involving multi-agent interaction in e-commerce services, scenarios involving multi-agent interaction in education services, scenarios involving multi-agent interaction in legal services, and the like, which are not limited herein.
[0146] It should be noted that the preferred embodiments of the present embodiment can refer to the related description in Embodiment 1, which will not be repeated here.
[0147] Embodiment 4
[0148] In the running environment as in Embodiment 1, the application provides an agent interaction method as shown in FIG. 6. FIG. 6 is a flowchart of another agent interaction method according to Embodiment 4 of the application. As shown in FIG. 6, the method includes:
[0149] In step S61, a current input multi-agent interaction dialogue request is obtained, wherein the information carried in the multi-agent interaction dialogue request includes scene information and role information obtained from a multi-agent data set, the multi-agent data set is used to provide multiple alternative scenes and multiple alternative roles in each alternative scene, the scene information is used to select a corresponding scene for the to-be-executed multi-agent interaction task from the multiple alternative scenes, and the role information is used to select a role participating in the multi-agent interaction task;
[0150] Step S62, in response to the multi-agent interactive dialogue request, a multi-agent interactive dialogue reply is returned, wherein the information carried in the multi-agent interactive dialogue reply includes: an interactive execution result, the interactive execution result being obtained after the multiple agents are controlled to execute the multi-agent interactive task based on the scene information and the role information;
[0151] Step S63, the interactive execution result is displayed in the graphical user interface.
[0152] The multi-agent interactive dialogue request can be understood as a dialogue request initiated when the multi-agent interaction is performed.
[0153] The multi-agent interactive dialogue reply is used to indicate a response result generated according to the multi-agent dialogue request.
[0154] The remaining description can be referred to the description in Embodiment 1, which will not be described in detail here.
[0155] In the above steps S61 to S63 of the present application, the current input multi-agent interactive dialogue request is obtained, wherein the information carried in the multi-agent interactive dialogue request includes: scene information and role information obtained from a multi-agent data set, the multi-agent data set being used to provide multiple alternative scenes and multiple alternative roles in each alternative scene, the scene information being used to select a corresponding scene for a to-be-executed multi-agent interactive task from the multiple alternative scenes, and the role information being used to select a role participating in the multi-agent interactive task; in response to the multi-agent interactive dialogue request, a multi-agent interactive dialogue reply is returned, wherein the information carried in the multi-agent interactive dialogue reply includes: an interactive execution result, the interactive execution result being obtained after the multiple agents are controlled to execute the multi-agent interactive task based on the scene information and the role information; and the interactive execution result is displayed in the graphical user interface. Wherein, by using the alternative scenes and alternative roles provided by the multi-agent data set, a suitable scene and role can be quickly selected for the to-be-executed multi-agent interactive task, thereby improving the execution efficiency of the multi-agent interactive task, and by displaying the interactive execution result in the graphical user interface, the user can intuitively understand the execution of the multi-agent interactive task, thereby improving the user experience.
[0156] In an optional embodiment, a graphical user interface is provided by a terminal device, and the multi-agent interactive method further includes the following method steps:
[0157] Step S64, in response to a first touch operation on the graphical user interface, a corresponding target scene for the multi-agent interactive task is selected from the multiple alternative scenes, and the scene information is obtained;
[0158] In step S65, in response to the second touch operation on the graphical user interface, the first target role and the second target role are set based on the multiple candidate roles in the target scene, to obtain the role information, wherein the first target role is a predetermined role in the target scene, the second target role is used to interact with the first target role around the interactive topic, and the specified role in the second target role is used to start the multi-agent interactive task around the interactive topic.
[0159] In the embodiments of the present application, the graphical user interface has a touch control, and when the first touch operation on the touch control space is responded to, the corresponding target scene is selected from the multiple candidate scenes for the multi-agent interactive task, to obtain the scene information. When the second touch operation on the touch control is responded to, the first target role and the second target role can be set based on the multiple candidate roles in the target scene, and then the role information corresponding to the multi-agent interactive task is obtained.
[0160] In the above steps S64 to S65 of the present application, through the first touch operation and the second touch operation on the graphical user interface, the user can quickly select the target scene and the target role corresponding to the multi-agent interactive task, simplify the operation process, improve the operation efficiency and experience of the user, and the user can select from multiple candidate scenes and roles according to actual situation and demand, meet the personalized demand of the user, and enhance the user's participation and interactivity.
[0161] The above multi-agent interactive method provided by the embodiments of the present application can be applied in, but not limited to, application scenarios involving multi-agent interaction in the fields of e-commerce services, education services, legal services, medical services, conference services, social network services, financial product services, logistics services and navigation services, such as: scenarios involving multi-agent interaction in e-commerce services, scenarios involving multi-agent interaction in education services, scenarios involving multi-agent interaction in legal services, etc., which are not limited here.
[0162] Embodiment 5
[0163] According to the embodiments of the present application, an agent interaction device configured to implement the above-mentioned agent interaction method is also provided. FIG. 7 is a structural schematic diagram of an agent interaction device according to Embodiment 5 of the present application. As shown in FIG. 7, the agent interaction device 700 includes:
[0164] The first acquisition module 701 is configured to acquire scene information and role information from a multi-agent data set, wherein the multi-agent data set is used to provide multiple candidate scenes and multiple candidate roles in each candidate scene, the scene information is used to select a corresponding scene from the multiple candidate scenes for a to-be-executed multi-agent interactive task, and the role information is used to select a role participating in the multi-agent interactive task;
[0165] The first control module 702 is configured to control the plurality of agents to perform the multi-agent interaction task based on the scene information and the role information.
[0166] Optionally, the first control module 702 is further configured to determine a target scene corresponding to the multi-agent interaction task based on the scene information, determine a plurality of target roles participating in the multi-agent interaction task according to the role information in the target scene, and control at least part of the agents to simulate the plurality of target roles to perform the multi-agent interaction task.
[0167] Optionally, the first control module 702 is further configured to obtain an interaction topic corresponding to the multi-agent interaction task, perform role allocation on the plurality of target roles to obtain an allocation result, and control at least part of the agents to simulate the plurality of target roles to perform the multi-agent interaction task based on the interaction topic and the allocation result.
[0168] Optionally, the first control module 702 is further configured to determine a first target role and a second target role from the plurality of target roles based on the interaction topic and the allocation result, respectively, wherein the first target role is a predetermined role in the target scene, the second target role is used to interact with the first target role around the interaction topic, and a specified role in the second target role is used to start the multi-agent interaction task around the interaction topic, select at least part of the agents from the plurality of agents to simulate the first target role and the second target role, respectively, and control at least part of the agents to perform the multi-agent interaction task by using a target agent in the plurality of agents, wherein the target agent is configured to be an agent that is specified to perform an interaction operation in each round of interaction included in the multi-agent interaction task.
[0169] Optionally, the first control module 702 is further configured to sequentially specify, by using the target agent, an agent that performs an interaction operation in each round of interaction included in the multi-agent interaction task from at least part of the agents to obtain an interaction operation execution sequence corresponding to at least part of the agents, and control at least part of the agents to perform the multi-agent interaction task based on the interaction operation execution sequence by using the target agent.
[0170] Optionally, the agent interaction apparatus 700 further includes a creation module configured to create a plurality of virtual spaces, wherein the plurality of virtual spaces are respectively used to set different scene plots and set different roles for the scene plots, and a generation module configured to respectively configure different scene information and different role information for the plurality of virtual spaces to generate a multi-agent data set.
[0171] Optionally, the agent interaction apparatus 700 further comprises a transmission module configured to transmit the interaction content between the plurality of agents by using a preset mixin class, wherein the preset mixin class is used to encapsulate the communication logic between the plurality of agents, and the interaction content is the communication content generated in the process of executing the multi-agent interaction task by the plurality of agents.
[0172] Optionally, the agent interaction apparatus 700 further comprises a maintenance module configured to maintain the state information of the plurality of agents by using a pre-created agent registry center, wherein the state information is used to describe the role information simulated by the plurality of agents, the historical interaction information of the plurality of agents, and the current behavior information of the plurality of agents.
[0173] Optionally, the agent interaction apparatus 700 further comprises a determination module configured to determine the communication manner between the plurality of agents and the transmission manner of the interaction content by using a pre-created task center.
[0174] With the embodiments of the present application, the multi-agent data set provides a plurality of alternative scenes and a plurality of alternative roles in each alternative scene, based on which, the corresponding scene for the to-be-executed multi-agent interaction task can be selected from the alternative scenes in the multi-agent data set, the role participating in the multi-agent interaction task is selected from the plurality of alternative roles corresponding to the selected scene, and then the multi-agent is controlled to execute the multi-agent interaction task according to the selected scene and the selected role. Since the multi-agent data set pre-provides a plurality of alternative scenes and a plurality of alternative roles in each scene, the operation flexibility and selection freedom of the user can be provided by selecting appropriate scenes and roles according to the specific to-be-executed multi-agent interaction task, rather than simply relying on prompt information, and after the scene and the role are selected, the multi-agent can be controlled to execute the multi-agent interaction task according to the selected scene and the selected role, which improves the efficiency of the multi-agent in executing the interaction task, and further solves the technical problem in the related art that the efficiency of the multi-agent in executing the interaction task is low due to the simple reliance on the prompt information to optimize the performance of the agent.
[0175] It should be noted that the first acquisition module 701 and the first control module 702 correspond to steps S21 to S22 in Embodiment 1, and the two modules have the same instances and application scenarios as the corresponding steps, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules as part of the apparatus can run in the computer terminal 10 provided in Embodiment 1.
[0176] According to the embodiments of the present application, another apparatus embodiment configured to implement the above-mentioned agent interaction method is further provided. FIG. 8 is a structural schematic diagram of another agent interaction apparatus according to Embodiment 5 of the present application, as shown in FIG. 8, the apparatus 800 comprises:
[0177] The second obtaining module 801 is configured to obtain chat scene information and chat role information from the multi-agent data set, wherein the multi-agent data set is used to provide a plurality of candidate scenes and a plurality of candidate roles in each candidate scene, the chat scene information is used to select a corresponding chat scene for a multi-agent chat task to be performed from the plurality of candidate scenes, and the chat role information is used to select a chat role participating in the multi-agent chat task;
[0178] The second control module 802 is configured to control a plurality of chat agents to perform the multi-agent chat task based on the chat scene information and the chat role information.
[0179] According to the embodiments of the present application, the multi-agent data set provides a plurality of candidate scenes and a plurality of candidate roles in each candidate scene, based on which, a corresponding chat scene can be selected for a multi-agent chat task to be performed from the candidate scenes in the multi-agent data set, a chat role participating in the multi-agent interaction task can be selected from the plurality of candidate roles corresponding to the selected chat scene, and then the multi-agent is controlled to perform the multi-agent interaction task according to the selected chat scene and the selected chat role. Since the multi-agent data set provides a plurality of candidate scenes and a plurality of candidate roles in each scene in advance, the operation flexibility and selection freedom of the user can be greatly improved, and the multi-agent can be controlled to perform the multi-agent chat task according to the selected scene and role, thereby improving the efficiency of the multi-agent in performing the chat task, and solving the technical problem in the related art that the efficiency of the multi-agent in performing the chat task is low due to the pure dependence on the prompt information to optimize the performance of the agent.
[0180] It should be noted that the second obtaining module 801 and the second control module 802 correspond to steps S41 to S42 in Embodiment 1, and the two modules have the same instances and application scenarios as the corresponding steps, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules can be run in the computer terminal 10 provided in Embodiment 1 as part of the device.
[0181] According to the embodiments of the present application, another device embodiment configured to implement the above-mentioned agent interaction method is also provided. FIG. 9 is a structural schematic diagram of another agent interaction device according to Embodiment 5 of the present application. As shown in FIG. 9, the device 900 includes:
[0182] The third obtaining module 901 is configured to obtain a multi-agent interaction request through a first application programming interface, wherein the request data carried in the multi-agent interaction request includes scene information and role information obtained from a multi-agent data set, the multi-agent data set is used to provide a plurality of alternative scenes and a plurality of alternative roles in each alternative scene, the scene information is used to select a corresponding scene from the plurality of alternative scenes for a to-be-executed multi-agent interaction task, and the role information is used to select a role participating in the multi-agent interaction task.
[0183] The first returning module 902 is configured to return a multi-agent interaction response through a second application programming interface, wherein the response data carried in the multi-agent interaction response includes an interaction execution result, and the interaction execution result is obtained after the plurality of agents perform the multi-agent interaction task based on the scene information and the role information.
[0184] According to the embodiments of the present application, the multi-agent interaction request is obtained through the first application programming interface, wherein the request data carried in the multi-agent interaction request includes the scene information and the role information obtained from the multi-agent data set, the multi-agent data set is used to provide the plurality of alternative scenes and the plurality of alternative roles in each alternative scene, the scene information is used to select the corresponding scene from the plurality of alternative scenes for the to-be-executed multi-agent interaction task, and the role information is used to select the role participating in the multi-agent interaction task. Then, the multi-agent interaction response is returned through the second application programming interface, wherein the response data carried in the multi-agent interaction response includes the interaction execution result, and the interaction execution result is obtained after the plurality of agents perform the multi-agent interaction task based on the scene information and the role information. That is, the multi-agent interaction task can be completed through the multi-agent interaction request and the multi-agent interaction response, the execution process of the multi-agent interaction task is simplified, the execution efficiency of the multi-agent interaction task is improved, and thus the technical problem of low execution efficiency of the multi-agent interaction task is solved.
[0185] It should be noted that the third obtaining module 901 and the first returning module 902 correspond to steps S51 to S52 in Embodiment 1, and the two modules have the same instances and application scenarios as the corresponding steps, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules can run in the computer terminal 10 provided in Embodiment 1 as a part of the device.
[0186] According to the embodiments of the present application, another device embodiment configured to implement the above-mentioned agent interaction method is also provided. FIG. 10 is a structural schematic diagram of another agent interaction device according to Embodiment 5 of the present application. As shown in FIG. 10, the device 1000 includes:
[0187] The fourth obtaining module 1001 is configured to obtain a current input multi-agent interactive dialogue request, wherein information carried in the multi-agent interactive dialogue request includes scene information and role information obtained from a multi-agent data set, the multi-agent data set is used to provide a plurality of alternative scenes and a plurality of alternative roles in each alternative scene, the scene information is used to select a corresponding scene for a multi-agent interactive task to be executed from the plurality of alternative scenes, and the role information is used to select a role participating in the multi-agent interactive task;
[0188] The second returning module 1002 is configured to return a multi-agent interactive dialogue reply in response to the multi-agent interactive dialogue request, wherein information carried in the multi-agent interactive dialogue reply includes an interactive execution result obtained after the plurality of agents execute the multi-agent interactive task based on the scene information and the role information;
[0189] The display module 1003 is configured to display the interactive execution result in a graphical user interface.
[0190] According to the embodiments, the current input multi-agent interactive dialogue request is obtained, wherein information carried in the multi-agent interactive dialogue request includes scene information and role information obtained from a multi-agent data set, the multi-agent data set is used to provide a plurality of alternative scenes and a plurality of alternative roles in each alternative scene, the scene information is used to select a corresponding scene for a multi-agent interactive task to be executed from the plurality of alternative scenes, and the role information is used to select a role participating in the multi-agent interactive task; a multi-agent interactive dialogue reply is returned in response to the multi-agent interactive dialogue request, wherein information carried in the multi-agent interactive dialogue reply includes an interactive execution result obtained after the plurality of agents execute the multi-agent interactive task based on the scene information and the role information; and the interactive execution result is displayed in a graphical user interface. The alternative scenes and alternative roles provided by the multi-agent data set can be used to more quickly select appropriate scenes and roles for the multi-agent interactive task to be executed, thereby improving the execution efficiency of the multi-agent interactive task, and the interactive execution result is displayed in the graphical user interface, so that the user can intuitively understand the execution of the multi-agent interactive task, thereby improving the user experience.
[0191] It should be noted that the fourth obtaining module 1001, the second returning module 1002 and the display module 1003 correspond to steps S61 to S63 in Embodiment 1, and the three modules have the same instances and application scenarios as the corresponding steps, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules can run in the computer terminal 10 provided in Embodiment 1 as a part of the device.
[0192] Embodiment 6
[0193] Embodiments of the present application can provide an electronic device, which can be any one of the electronic devices in the group of electronic devices. Alternatively, in the embodiments, the electronic device can also be replaced by a terminal device such as a mobile terminal.
[0194] Alternatively, in the embodiments, the electronic device can be at least one of the network devices in the computer network.
[0195] In the embodiments, the electronic device can execute program codes of the following steps in the agent interaction method: obtaining scene information and role information from a multi-agent data set, wherein the multi-agent data set is used to provide a plurality of alternative scenes and a plurality of alternative roles under each alternative scene, the scene information is used to select a corresponding scene from the plurality of alternative scenes for a to-be-executed multi-agent interaction task, and the role information is used to select a role participating in the multi-agent interaction task; and controlling a plurality of agents to execute the multi-agent interaction task based on the scene information and the role information.
[0196] Alternatively, FIG. 11 is a structural block diagram of an electronic device according to an embodiment of the present application. As shown in FIG. 11, the electronic device A can include one or more (only one is shown in FIG. 11) processors 1102, a memory 1104, a storage controller, and a peripheral interface connected with a radio frequency module, an audio module, and a display.
[0197] The memory can be configured to store software programs and modules, such as program instructions / modules of the agent interaction method and device in the embodiments of the present application. The processor executes various function applications and data processing by running the software programs and modules stored in the memory, that is, implements the above-mentioned multi-agent interaction method. The memory can include a high-speed random access memory, and can further include a non-volatile memory such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory can further include a memory remotely arranged with respect to the processor, which can be connected to the electronic device A through a network. Examples of the network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0198] The processor can call information and application programs stored in the memory through the transmission device to execute the following steps: obtaining scene information and role information from a multi-agent data set, wherein the multi-agent data set is used to provide a plurality of alternative scenes and a plurality of alternative roles under each alternative scene, the scene information is used to select a corresponding scene from the plurality of alternative scenes for a to-be-executed multi-agent interaction task, and the role information is used to select a role participating in the multi-agent interaction task; and controlling a plurality of agents to execute the multi-agent interaction task based on the scene information and the role information.
[0199] Optionally, the processor can further execute program codes of the following steps: determining a target scene corresponding to the multi-agent interaction task based on the scene information; determining a plurality of target roles participating in the multi-agent interaction task according to the role information in the target scene; and controlling at least part of the agents to simulate the plurality of target roles to perform the multi-agent interaction task.
[0200] Optionally, the processor can further execute program codes of the following steps: obtaining an interaction topic corresponding to the multi-agent interaction task; performing role allocation on the plurality of target roles to obtain an allocation result; and controlling at least part of the agents to simulate the plurality of target roles based on the interaction topic and the allocation result to perform the multi-agent interaction task.
[0201] Optionally, the processor can further execute program codes of the following steps: determining a first target role and a second target role from the plurality of target roles based on the interaction topic and the allocation result, respectively, wherein the first target role is a predetermined role in the target scene, and the second target role is used to interact with the first target role around the interaction topic, and a specified role in the second target role is used to start the multi-agent interaction task around the interaction topic; selecting at least part of the agents from the plurality of agents to simulate the first target role and the second target role, respectively; and using a target agent in the plurality of agents to control at least part of the agents to perform the multi-agent interaction task, wherein the target agent is set as an agent that is specified to perform an interaction operation in each round of interaction included in the multi-agent interaction task.
[0202] Optionally, the processor can further execute program codes of the following steps: using the target agent to sequentially specify, from at least part of the agents, an agent that performs an interaction operation in each round of interaction included in the multi-agent interaction task to obtain an interaction operation execution sequence corresponding to at least part of the agents; and controlling at least part of the agents to perform the multi-agent interaction task based on the interaction operation execution sequence by the target agent.
[0203] Optionally, the processor can further execute program codes of the following steps: creating a plurality of virtual spaces, wherein the plurality of virtual spaces are respectively used to set different scene plots and set different roles for the scene plots; and configuring different scene information and different role information for the plurality of virtual spaces, respectively, to generate a multi-agent data set.
[0204] Optionally, the processor can further execute program codes of the following steps: using a preset mixin class to pass interaction content between the plurality of agents, wherein the preset mixin class is used to encapsulate communication logic between the plurality of agents, and the interaction content is communication content generated in the process of performing the multi-agent interaction task by the plurality of agents.
[0205] Optionally, the processor can further execute program codes of the following steps: maintaining state information of the plurality of agents by using a pre-created agent registry center, wherein the state information is used to describe role information simulated by the plurality of agents, historical interaction information of the plurality of agents, and current behavior information of the plurality of agents.
[0206] Optionally, the processor can further execute program codes of the following steps: determining a communication manner and a delivery manner of interaction content between the plurality of agents by using a pre-created task center.
[0207] According to the embodiments of the present application, the multi-agent dataset provides a plurality of alternative scenarios and a plurality of alternative roles in each alternative scenario, based on which, a corresponding scenario can be selected from the alternative scenarios in the multi-agent dataset for a to-be-executed multi-agent interactive task, a role participating in the multi-agent interactive task can be selected from the plurality of alternative roles corresponding to the selected scenario, and then the multi-agent can be controlled to execute the multi-agent interactive task according to the selected scenario and the selected role. Since the multi-agent dataset pre-provides a plurality of alternative scenarios and a plurality of alternative roles in each scenario, the multi-agent no longer simply relies on prompt information, but selects appropriate scenarios and roles according to the specific to-be-executed multi-agent interactive task, thereby providing the user with extremely high operation flexibility and selection freedom. After the scenario and the role are selected, the multi-agent can be controlled to execute the multi-agent interactive task according to the selected scenario and the selected role, thereby improving the efficiency of the multi-agent in executing the interactive task, and further solving the technical problem in the related art that simply relying on prompt information to optimize the performance of the agent leads to low efficiency of the multi-agent in executing the interactive task.
[0208] Those skilled in the art can understand that the structure shown in FIG. 11 is only schematic, and the electronic device can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a mobile Internet device (Mobile Internet Devices, abbreviated as MID), a PAD, and the like. FIG. 11 does not limit the structure of the above-mentioned electronic device. For example, the electronic device A can further include more or fewer components (such as a network interface, a display device, etc.) than those shown in FIG. 11, or have a different configuration from that shown in FIG. 11.
[0209] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware of the terminal device by a program, and the program can be stored in a computer readable storage medium, which can include a flash disk, a read-only memory (Read-Only Memory, abbreviated as ROM), a random access memory (Random Access Memory, abbreviated as RAM), a magnetic disk or an optical disk, etc.
[0210] Embodiment 7
[0211] The embodiment of the present application further provides a storage medium. Optionally, in the embodiment, the storage medium is configured to store program code executed by the intelligent agent interaction method provided in the embodiment 1.
[0212] Optionally, in the embodiment, the storage medium can be located in any one of computer terminals in a computer terminal group in a computer network, or in any one of mobile terminals in a mobile terminal group.
[0213] Optionally, in the embodiment, the storage medium is configured to store program code configured to perform the following steps: obtaining scene information and role information from a multi-agent data set, wherein the multi-agent data set is used to provide a plurality of alternative scenes and a plurality of alternative roles in each alternative scene, the scene information is used to select a corresponding scene from the plurality of alternative scenes for a to-be-executed multi-agent interaction task, and the role information is used to select a role participating in the multi-agent interaction task; and controlling a plurality of intelligent agents to execute the multi-agent interaction task based on the scene information and the role information.
[0214] The embodiment of the present application further provides a computer program product, which comprises a computer program, and the computer program is used to implement the intelligent agent interaction method when executed by a processor.
[0215] Optionally, in the embodiment, the computer program product is used to execute the following steps when executed by the processor: obtaining scene information and role information from a multi-agent data set, wherein the multi-agent data set is used to provide a plurality of alternative scenes and a plurality of alternative roles in each alternative scene, the scene information is used to select a corresponding scene from the plurality of alternative scenes for a to-be-executed multi-agent interaction task, and the role information is used to select a role participating in the multi-agent interaction task; and controlling a plurality of intelligent agents to execute the multi-agent interaction task based on the scene information and the role information.
[0216] The serial numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0217] In the above embodiments of the present application, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0218] In several embodiments provided in the present application, it should be understood that the disclosed technology can be implemented by other ways. Among them, the above-described device embodiments are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed units can be indirect coupling or communication connection through some interfaces, units or modules, and can be electrical or other forms.
[0219] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0220] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0221] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0222] The above is only the preferred embodiment of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.
Claims
1. An agent interaction method, comprising: obtaining scene information and character information from a multi-agent dataset, wherein the multi-agent dataset is used to provide a plurality of candidate scenes and a plurality of candidate characters in each candidate scene, the scene information is used to select a corresponding scene for a multi-agent interaction task to be performed from the plurality of candidate scenes, and the character information is used to select characters participating in the multi-agent interaction task; controlling a plurality of agents to perform the multi-agent interaction task based on the scene information and the character information.
2. The agent interaction method of claim 1, wherein, Controlling the plurality of agents to perform the multi-agent interaction task based on the scene information and the character information comprises: determining a target scene corresponding to the multi-agent interaction task based on the scene information; determining a plurality of target characters participating in the multi-agent interaction task according to the character information in the target scene; controlling at least part of the plurality of agents to simulate the plurality of target characters to perform the multi-agent interaction task.
3. The agent interaction method of claim 2, wherein, Controlling at least part of the plurality of agents to simulate the plurality of target characters to perform the multi-agent interaction task comprises: obtaining an interaction topic corresponding to the multi-agent interaction task; performing character allocation on the plurality of target characters to obtain an allocation result; controlling the at least part of the plurality of agents to simulate the plurality of target characters to perform the multi-agent interaction task based on the interaction topic and the allocation result.
4. The agent interaction method of claim 3, wherein, Controlling the at least part of the plurality of agents to simulate the plurality of target characters to perform the multi-agent interaction task based on the interaction topic and the allocation result comprises: determining a first target character and a second target character from the plurality of target characters based on the interaction topic and the allocation result, respectively, wherein the first target character is a predetermined character in the target scene, the second target character is used to interact with the first target character around the interaction topic, and a specified character in the second target character is used to start the multi-agent interaction task around the interaction topic; selecting the at least part of the plurality of agents to simulate the first target character and the second target character, respectively; controlling the at least part of the plurality of agents to perform the multi-agent interaction task by using a target agent in the plurality of agents, wherein the target agent is set to be an agent that specifies an interaction operation in each round of interaction included in the multi-agent interaction task.
5. The agent interaction method of claim 4, wherein, Controlling the at least part of the plurality of agents to perform the multi-agent interaction task by using the target agent in the plurality of agents comprises: specifying, by using the target agent, agents in the at least part of the plurality of agents that perform interaction operations in each round of interaction included in the multi-agent interaction task in turn to obtain an interaction operation execution sequence corresponding to the at least part of the plurality of agents; controlling the at least part of the plurality of agents to perform the multi-agent interaction task based on the interaction operation execution sequence by using the target agent.
6. The agent interaction method of claim 1, wherein, The agent interaction method further comprises: creating a plurality of virtual spaces, wherein the plurality of virtual spaces are respectively used to set different scene plots and different characters for the scene plots; configuring different scene information and different character information for the plurality of virtual spaces respectively, and generating the multi-agent dataset.
7. The agent interaction method of claim 1, wherein, The agent interaction method further includes: adopting a preset mixin class to pass interaction content between the plurality of agents, wherein the preset mixin class is used to encapsulate communication logic between the plurality of agents, and the interaction content is communication content generated in the process of the plurality of agents executing the multi-agent interaction task.
8. The agent interaction method of claim 1, wherein, The agent interaction method further includes: adopting a pre-created agent registry center to maintain state information of the plurality of agents, wherein the state information is used to describe character information simulated by the plurality of agents, historical interaction information of the plurality of agents, and current behavior information of the plurality of agents.
9. The agent interaction method of claim 7, wherein, The agent interaction method further includes: adopting a pre-created task center to determine a communication mode adopted between the plurality of agents and a passing mode of the interaction content.
10. An agent interaction method, comprising: obtaining chat scene information and chat character information from a multi-agent dataset, wherein the multi-agent dataset is used to provide a plurality of alternative scenes and a plurality of alternative characters in each alternative scene, the chat scene information is used to select a corresponding chat scene from the plurality of alternative scenes for a multi-agent chat task to be executed, and the chat character information is used to select chat characters participating in the multi-agent chat task; controlling a plurality of chat agents to execute the multi-agent chat task based on the chat scene information and the chat character information.
11. The agent interaction method of claim 10, wherein, Controlling the plurality of chat agents to execute the multi-agent chat task based on the chat scene information and the chat character information includes: determining a target chat scene corresponding to the multi-agent chat task based on the chat scene information; determining a plurality of target chat characters participating in the multi-agent chat task in the target chat scene according to the chat character information; controlling at least part of the plurality of chat agents to simulate the plurality of target chat characters to execute the multi-agent chat task.
12. An agent interaction method, comprising: obtaining a multi-agent interaction request through a first application programming interface, wherein request data carried in the multi-agent interaction request includes scene information and character information obtained from a multi-agent dataset, the multi-agent dataset is used to provide a plurality of alternative scenes and a plurality of alternative characters in each alternative scene, the scene information is used to select a corresponding scene from the plurality of alternative scenes for a multi-agent interaction task to be executed, and the character information is used to select characters participating in the multi-agent interaction task; return, through a second application programming interface, a multi-agent interaction response, wherein response data carried in the multi-agent interaction response comprises an interaction execution result, wherein the interaction execution result is obtained after a plurality of agents execute the multi-agent interaction task based on the scenario information and the role information.
13. A method for agent interaction, comprising: obtaining a current input multi-agent interaction dialogue request, wherein information carried in the multi-agent interaction dialogue request comprises scenario information and role information obtained from a multi-agent data set, the multi-agent data set being used to provide a plurality of alternative scenarios and a plurality of alternative roles in each alternative scenario, the scenario information being used to select a corresponding scenario for a multi-agent interaction task to be executed from the plurality of alternative scenarios, and the role information being used to select a role participating in the multi-agent interaction task; in response to the multi-agent interaction dialogue request, returning a multi-agent interaction dialogue reply, wherein information carried in the multi-agent interaction dialogue reply comprises an interaction execution result obtained after a plurality of agents execute the multi-agent interaction task based on the scenario information and the role information; displaying the interaction execution result in a graphical user interface.
14. The agent interaction method of claim 13, wherein, The method further comprises: in response to a first touch operation on the graphical user interface, selecting a corresponding target scenario for the multi-agent interaction task from the plurality of alternative scenarios to obtain the scenario information; in response to a second touch operation on the graphical user interface, setting a first target role and a second target role based on a plurality of alternative roles in the target scenario to obtain the role information, wherein the first target role is a predetermined role in the target scenario, the second target role is used to interact with the first target role around an interaction topic, and a specified role in the second target role is used to start the multi-agent interaction task around the interaction topic.
15. An electronic device, comprising: a memory storing an executable program; a processor configured to run the program, wherein the program, when executed, performs the method for agent interaction of any one of claims 1 to 14.
16. A computer readable storage medium comprising a stored executable program, wherein, The computer-readable storage medium is configured to perform the method for agent interaction of any one of claims 1 to 14 when the executable program is executed.
17. A computer program product, comprising a computer program which, when executed by a processor, implements the method for agent interaction of any one of claims 1 to 14.
Citation Information
Patent Citations
Service-oriented intelligent platform
CN101316242A
Universal and configurable multi-agent interaction framework
CN117350325A
Data generation method, electronic equipment and storage medium
CN117556026A
Multi-role intelligent dialogue method and device, electronic equipment and storage medium
CN117743560A
Intelligent agent interaction method, electronic equipment and computer readable storage medium
CN118585109A