Task-oriented dialogue method, storage medium, and computer device

By identifying user intent and generating tool execution plans through the large model in the E-Agent architecture, the accuracy and timeliness issues of task-oriented dialogue in complex and specialized tasks are solved, achieving more efficient and accurate task execution and personalized responses.

WO2026000596A1PCT designated stage Publication Date: 2026-01-02RAJAX NETWORK &TECHNOLOGY (SHANGHAI) CO LTD

Patent Information

Application Number
PCT/CN2024/115183
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-06-25
Filing Date
2024-08-28
Publication Date
2026-01-02

AI Technical Summary

Technical Problem

Existing task-oriented dialogue methods suffer from low success rates, poor accuracy, and poor timeliness when dealing with complex or specialized tasks, making it difficult to meet users' personalized needs.

Method used

Employing an E-Agent architecture, the system identifies user intent through a large model, generates tool execution plans, checks the execution results, and generates response content. This involves the collaborative work of an intent recognition module, a plan formulation module, an execution module, and a content summary module. By leveraging the text understanding and generation capabilities of the large model, the system improves the timeliness and accuracy of intent recognition and text processing.

Benefits of technology

It improves the success rate and accuracy of task-oriented dialogues, can be flexibly applied to various professional fields, reduces the workload of task exhaustion, improves the timeliness and accuracy of task execution, and meets users' personalized needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024115183_02012026_PF_FP_ABST
    Figure CN2024115183_02012026_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of the Internet, and discloses a task-oriented dialogue method, a storage medium, and a computer device. The method comprises: in response to receiving dialogue information initiated by a user, a client sends the dialogue information to a server; in response to receiving the dialogue information, the server determines intent information of the user by means of a large model, generates a tool execution plan on the basis of the intent information, executes the tool execution plan to obtain a plan execution result, checks the plan execution result, generates reply content on the basis of the plan execution result of which the check passes, and sends the reply content to the client; and the client receives and displays the reply content. The described method can effectively improve the success rate and accuracy of task-oriented dialogues in solving complex and specialized tasks, and can also reduce the difficulty of large models in performing task decomposition and task execution, thereby improving the timeliness of the task-oriented dialogues.
Need to check novelty before this filing date? Find Prior Art

Description

Task-oriented dialogue method, storage medium and computer device TECHNICAL FIELD

[0001] The present application relates to the technical field of Internet, in particular to a task-oriented dialogue method, a storage medium and a computer device. BACKGROUND

[0002] Task-oriented dialogue is an interactive dialogue mode aimed at assisting users to efficiently complete specific goals or tasks. In such dialogue, artificial intelligence systems strive to deeply understand the user's intention and provide targeted information, suggestions or perform related operations accordingly, so as to meet the diverse needs of users. At present, task-oriented dialogue is widely used in enterprise automation assistants, customer service support, smart home control and other fields, which can greatly improve work efficiency, optimize user experience and reduce the need for manual intervention.

[0003] Currently, task-oriented dialogue mainly relies on natural language processing technologies such as intent recognition, slot filling and knowledge graph to achieve. However, when dealing with user intent, the above methods often rely on text classification to understand the core needs in the dialogue, or rely on knowledge graph to find solutions. These methods require the system to pre-enumerate all possible problems encountered by users and their corresponding solutions, however, the personalized needs of users are extremely diverse and difficult to enumerate. Therefore, such methods are very difficult to construct sample data. In addition, this enumeration-based method often has a large lag, and the accuracy of solution matching is limited by the pre-set enumeration range, and it is also difficult to meet the changing actual needs of users.

[0004] Based on this, when dealing with some more complex or specialized tasks, users often need to turn to artificial services for help, which not only reduces the timeliness of problem solving, but also increases the investment in human cost.

[0005] SUMMARY

[0006] Therefore, the embodiments of the present application provide a task-oriented dialogue method, a storage medium and a computer device, which mainly aim to solve the technical problems of low success rate, poor accuracy and poor timeliness of existing task-oriented dialogue when solving complex and specialized tasks.

[0007] According to a first aspect of the present application, a task-oriented dialogue method is provided, which comprises:

[0008] The client sends the dialogue information initiated by the user to the server in response to receiving the dialogue information.

[0009] The server determines the intention information of the user by a large model in response to receiving the dialogue information, generates a tool execution plan according to the intention information, executes the tool execution plan to obtain a plan execution result, checks the plan execution result, and generates reply content based on the plan execution result that passes the check, and sends the reply content to the client;

[0010] The client receives and displays the reply content.

[0011] According to a second aspect of the present application, a storage medium having a computer program stored thereon is provided, the program being executed by a processor to implement the task-oriented dialogue method.

[0012] According to a third aspect of the present application, a computer device is provided, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, the processor implementing the task-oriented dialogue method when executing the program.

[0013] By the above technical solution, the task-oriented dialogue method, the storage medium and the computer device provided by the embodiments of the present application, when receiving dialogue information initiated by a user, first determine the intention information of the user by a large model, then generate a tool execution plan according to the intention information, execute the tool plan to obtain a plan execution result, and then check the plan execution result and generate reply content based on the plan execution result, and finally send the reply content to the client for display. The above method can fully utilize the text understanding and generation capabilities of the large model through intention recognition, tool calling, tool execution, text checking and text summarization, and can improve the timeliness and accuracy of intention recognition and text processing in task-oriented dialogue. Compared with the traditional case matching type task-oriented dialogue method, the above method can reduce the workload of task exhaustion and improve the success rate of task solving, so that the task-oriented dialogue can be more flexibly applied to various professional fields and used to solve more complex, specialized and personalized tasks. In addition, the above method can limit the scope of content reply to the scope of tool execution result by decomposing the user's dialogue information into a simpler and clearer tool execution plan, so as to avoid the task decomposed by the large model from being too divergent and deviating from the topic, thereby improving the accuracy of task execution, and at the same time, reducing the difficulty of task decomposition and task execution by the large model, thereby improving the timeliness of task-oriented dialogue. BRIEF DESCRIPTION OF DRAWINGS

[0014] FIG. 1 shows a flowchart of a task-oriented dialogue method according to an embodiment of the present application;

[0015] FIG. 2 shows a flowchart of another task-oriented dialogue method according to an embodiment of the present application;

[0016] FIG. 3 shows a system architecture diagram of a task-oriented dialogue method according to an embodiment of the present application;

[0017] FIG. 4 shows a system architecture diagram of a case generation link according to an embodiment of the present application;

[0018] FIG. 5 shows a system architecture diagram of an information retrieval model according to an embodiment of the present application;

[0019] FIG. 6 shows a trend graph of precision and recall rate changing with threshold according to an embodiment of the present application;

[0020] FIG. 7 shows a structure diagram of a task-oriented dialogue device according to an embodiment of the present application;

[0021] FIG. 8 shows a structure diagram of another task-oriented dialogue device according to an embodiment of the present application. DETAILED DESCRIPTION

[0022] Hereinafter, the present application will be described in detail with reference to the accompanying drawings and in conjunction with embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0023] In view of the limitations of the existing Agent architecture in the implementation of task-oriented dialogue, especially the deficiencies in solving complex or professional field tasks, the present application proposes a task-oriented dialogue method based on E-Agent architecture. The method can find a better balance between speed, accuracy, stability and model training, so as to more effectively meet the actual needs of task-oriented dialogue. The E-Agent architecture includes an intent recognition module, a planning module (Planner), a calling execution module (Caller), a checking and verifying module (Checker) and a content summary module (Summary), which work together to quickly and stably implement task-oriented dialogue and meet the personalized needs of users. The specific implementation of the E-Agent architecture will be described in detail in the following embodiments of the task-oriented dialogue method.

[0024] In one embodiment, as shown in FIG. 1, a task-oriented dialogue method is provided, which is described by taking the application of the method to computer devices such as clients and servers as an example. The above method can include the following steps:

[0025] Step 101, the client sends dialogue information to the server in response to receiving dialogue information initiated by the user.

[0026] Specifically, the user can input any dialogue information through an information input box displayed on the client (such as an application installed on a smart terminal or a webpage, etc.) and send it. After receiving the dialogue information initiated by the user, the client can encapsulate the dialogue information into a standard format and send it to the server through a network protocol. In this embodiment, the information input box is any component that can receive text information, for example, the information input box can be a chat input box, a search input box, etc. The dialogue information can be any text information input by the user, and can also include voice information, video information, picture information, and other forms of information.

[0027] At step 102, in response to receiving the dialogue information, the server determines the user's intent information through a large model, generates a tool execution plan according to the intent information, executes the tool execution plan, obtains a plan execution result, checks the plan execution result, and generates a reply content based on the checked plan execution result. The reply content is sent to the client.

[0028] The large model refers to a large language model (LLM), a multimodal model (LMM), or other advanced artificial intelligence models capable of handling complex tasks and large amounts of data. The large model can be a general-purpose large model or a vertical large model (vertical model) optimized by pre-training on sample data in a specific field. In this embodiment, each module in the E-Agent architecture can be implemented based on the large model. Before implementing the functions of each module through the large model, the server can perform various pre-processing on the large model, such as continue pre-training, supervised fine-tuning (SFT), model quantization, etc., to improve the timeliness, stability and accuracy of the large model task execution. It can be understood that the specific type of large model used in each module of the E-Agent architecture is not limited in this embodiment.

[0029] Specifically, after receiving the dialogue information initiated by the user, the server can input the obtained dialogue information as a parameter into the pre-trained large model, so that the large model can accurately locate the user's intent information based on the dialogue information. In this embodiment, when performing intent recognition, the large model can also obtain context information of the current dialogue, application scenario information, and user information authorized by the user, etc. to enable the large model to more accurately identify the user's intent information. In this embodiment, the parameters input into the large model for intent recognition are not limited, and the process of intent recognition can be implemented through the intent recognition module in the E-Agent architecture.

[0030] Further, after determining the intention information of the user, the server can input the intention information into another large model, so that the large model can select at least one tool through the intention information to generate a tool execution plan. In the embodiment, the tool execution plan can include at least one tool (i.e., a program function interface) related to the intention information, wherein the selection range of the tool can be pre-defined or obtained through a pre-posed vectorization coarse call link. By calling the tool, the corresponding function of the tool can be realized. For example, when the intention information is "query commodity sales", the tool selected by the large model can be the dish data query tool "dish_data_query", wherein the dish data query tool "dish_data_query" is the tool execution plan generated based on the intention information "query commodity sales". It can be understood that when the intention information is relatively simple and clear, the tool execution plan is also relatively simple and clear; when the intention information is relatively complex, more tools are required, and there is a possibility of missing tools. Therefore, the plan execution result of the tool execution plan will be checked in the subsequent process to ensure that there is no missing tool. In the embodiment, the range of the tool selected by the large model and the specific function of the tool are not limited, and the process of generating the tool execution plan can be realized by the planner in the E-Agent architecture.

[0031] Further, after obtaining the tool execution plan, the large model can execute the tool execution plan to obtain a plan execution result. In the embodiment, the execution process of the tool execution plan is the process of calling each tool in the tool execution plan, in which process the large model can obtain tool parameters and call each tool through the tool parameters to obtain the calling result of each tool, and subsequently, the plan execution result can be obtained by integrating the calling result of each tool. In the embodiment, the tool parameters required by the tool are generally user ID, commodity ID, order ID, time range and other relatively conventional information, therefore, the tool parameters can be generally extracted from the user's dialogue information, context information and user information. In the embodiment, the way of extracting the tool parameters by the large model is not limited, and the execution process of the tool execution plan can be realized by the caller in the E-Agent architecture.

[0032] Further, after obtaining the plan execution result, the large model can check the completeness of the plan execution result, and determine whether the plan execution result passes the check according to the completeness of the plan execution result. If the plan execution result passes the check, the plan execution result can be input into the next link to generate the reply content; if the plan execution result does not pass the check, the tool needs to be selected again by the plan making module, and the tool execution plan is updated, and then the updated tool execution plan is executed to obtain the updated plan execution result, and then it is determined whether the updated plan execution result is complete. This process can be continuously cycled until the modified plan execution result meets the completeness requirement and / or the number of cycles reaches a certain threshold, and then the plan execution result is output, and finally the reply content is generated through the updated plan execution result. In this embodiment, the large model can determine the completeness of the plan execution result according to the content of the dialogue information. When at least one of the two conditions that the tools related to the dialogue information have been called and / or the plan execution result can solve the problem raised in the dialogue information is met, it is determined that the plan execution result is complete, at this time, the plan execution result can be output and used to generate the reply content. The checking process of the plan execution result can be realized by the checker in the E-Agent architecture.

[0033] Further, after the plan execution result passes the check, the large model can generate the reply content based on the plan execution result that passes the check. The reply content can be generated in combination with the dialogue information input by the user, that is, when generating the reply content, the content related to the dialogue information in the plan execution result can be retained, and the content unrelated to the dialogue information can be removed, so as to obtain the reply content more relevant to the dialogue information. In this embodiment, the large model can also perform other forms of processing on the reply content, such as adding soothing information, adding link information, etc., which are not limited in this embodiment. The generation process of the reply content can be realized by the summary module in the E-Agent architecture.

[0034] In this embodiment, by generating the intention information of the user based on the dialogue information of the user, the task demand of the user can be determined, by generating the tool execution plan based on the intention information, the complex or personalized task demand can be decomposed into a simple tool calling list, so as to reduce the complexity of text information processing, compared with the traditional task decomposition method, the tool execution plan can avoid the task decomposition to be too scattered or lengthy, so as to improve the concentration of information processing and reduce the probability of complex task error. Further, by executing the tool plan and checking the plan execution result, the checking ability and feedback ability of the text information can be improved, and the possibility of information omission can be reduced. Finally, by generating the reply content based on the checked plan execution result, the pertinence and professionalism of the reply content can be improved.

[0035] Step 103, the client receives and displays the reply content.

[0036] Specifically, after generating the reply content, the server can send the reply content to the client, and the client can display the reply content in response to receiving the reply content. For example, the client can display the reply content through various pages such as instant messaging pages, search result pages, etc. In this embodiment, the server can also output other information when outputting the reply content, for example, the server can also output the dialogue information, intention information, tool name, tool calling result, thinking information of the large model, etc. of the user. In this scenario, the server can only send part of the information output by the large model to the client for display, for example, the server can only send the reply content to the client, and then record other information in the log for analysis and processing in the future.

[0037] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to complete the specific implementation process of the embodiment, another task-oriented dialogue method is provided, which can be applied to the E-Agent architecture as shown in FIG. 3 and FIG. 4, and as shown in FIG. 2, the method can include the following steps:

[0038] Step 201, the client sends the dialogue information to the server in response to receiving the dialogue information initiated by the user.

[0039] Step 202, the server acquires the context information in response to receiving the dialogue information, and determines the intention information of the user through the large model based on the dialogue information and the context information.

[0040] In the embodiment, when performing intent recognition, the large model can also obtain application scenario information and user information obtained through user authorization, and the like, so that the large model can more accurately recognize the user's intent information. In the embodiment, the parameters input into the large model for intent recognition are not specifically limited, and the process of intent recognition can be implemented by an intent recognition module in the E-Agent architecture.

[0041] In an optional implementation, step 202 can be implemented in the following manner: the server, in response to receiving the dialogue information, obtains context information of the dialogue information and preset application scenario information, and determines the user's intent information based on the dialogue information and the context information, taking the application scenario information as a constraint condition.

[0042] Specifically, after receiving the dialogue information of the user, the server can first obtain the context information of the dialogue information and the preset application scenario information. The context information can include the user's previous historical dialogue information and session state information, and the application scenario information can be set according to the scene in which the dialogue occurs, the type of service used by the user, or the information processing logic of a specific field. For example, in the merchant assistant scenario, the application scenario information is the application scenario of the merchant service, and in this scenario, all tasks are centered around the core theme of serving the merchant. Further, the server can input the obtained application scenario information as a constraint condition, in combination with the dialogue information and the context information, into a pre-trained large model, so as to accurately understand the natural language in the above information through the large model and infer the core intent of the user.

[0043] In the above implementation, the large model can comprehensively consider the dialogue information, the context information, and the constraint condition of the application scenario to obtain the user's intent information that is more consistent with the current application scenario. For example, in the merchant service scenario, the merchant user usually has the expression habits of colloquialization of content, long dialogue content, and sending dialogue content in multiple sentences. At this time, if the original multi-round dialogue is directly used for tool matching and case searching, there are great challenges in the recall precision of tools and cases. Based on this, the embodiment sets a multi-round rewriting module, which can use the powerful natural language understanding capability of the large model to associate the context and transcribe the core intent of the current round, and finally output the clear and explicit goal.

[0044] In an optional implementation, the server can determine the user's intent information in at least one of the following manners:

[0045] 202-1, the server rewrites the dialogue information and the context information within the topic range constrained by the application scenario information, to obtain at least one piece of intent information of the user.

[0046] Specifically, when performing intent recognition, the server can rewrite the dialogue information and the context information of the user within the topic range constrained by the application scenario information. The rewriting methods can include, but are not limited to, synonym replacement, semantic expansion, word and sentence reorganization, and the like, so as to ensure that the rewritten content meets the constraint conditions of the application scenario. In this embodiment, the large model can output at least one piece of intent information in the form of a list according to different topics of the recognized intent information, so that the large model can accurately select all available tools to formulate a more complete tool execution plan.

[0047] 202-2, when the server determines that the dialogue information and the context information are not within the topic range constrained by the application scenario information, the dialogue information is taken as the intent information of the user.

[0048] Specifically, when the server determines that the dialogue information and the context information are not within the topic range constrained by the application scenario information, the server can no longer rewrite the dialogue information, but directly take the dialogue information as the intent information of the user. At this time, the server can perform subsequent processing according to the dialogue information actually input by the user, such as prompting the user to re-input or guiding the user to output more effective task requirements, and the like.

[0049] 202-3, the server searches at least one case in the intent information experience library based on the dialogue information and the context information through a preset information retrieval model, and sets the case in a prompt template to determine the intent information of the user through the prompt template.

[0050] Specifically, the server can also search for similar cases through the preset information retrieval model and perform intent recognition with the assistance of the similar cases. The information retrieval model can include at least one of a sparse retrieval model, a dense vector retrieval model, and a multi-vector retrieval model. The server can input the dialogue information and the context information as query conditions into the above information retrieval model, search at least one case related to the query conditions in the intent information experience library, and then set the cases in the prompt template of the large model and determine the intent information of the user according to the content of the prompt template. In this embodiment, the intent information experience library can pre-store intent recognition cases in multiple scenarios, wherein the input of the intent recognition case is multi-turn dialogue information connected by the context information and the dialogue information, and the output is single-turn intent information corresponding to the multi-turn dialogue information.

[0051] In an optional implementation, when determining the intent information of the user, the dialogue information and the context information of the user can also be rewritten in at least one of the following ways:

[0052] 202-1-1, the server retains information related to application scenario information in the dialogue information and context information, and generates at least one intent information according to the topic of the retained content.

[0053] Specifically, the server can identify information in the dialogue information and context information that is closely related to the application scenario information. These information can be terms, concepts or processes in a specific field, etc. By retaining these information and rewriting according to the topic of the retained content, it can be ensured that the generated intent information is concise and clear. For example, the dialogue information and context information are as follows: merchant: "Did I have a good comment yesterday?"; Assistant: "After checking, you had a good comment yesterday: 'The dish is very tasty, praise.'"; Merchant: "Can I pin it? I want more consumers to see this message." After rewriting, the following two pieces of intent information can be retained: "How to pin the good comment yesterday?", "How to let more people see the good comment yesterday?". Through the above rewriting, the core intent of the merchant user can be effectively clarified.

[0054] The above implementation can make the generated intent information more accurate and easy to process by extracting the core intent related to the application scenario information from the complex dialogue information and context. At the same time, the above method can also help to improve the understanding ability of the system for a specific field, so as to better meet the needs of the user.

[0055] 202-1-2, the server retains time information and numerical information in the dialogue information and context information in the user's intent information.

[0056] Specifically, the server can extract time information and numerical information from the dialogue information and context information. Among them, the time information and numerical information can be used to clarify the core intent of the user, and can be used as a tool parameter for subsequent extraction. The server can ensure the integrity and accuracy of the intent by retaining these information in the rewritten intent information. For example, when the merchant user asks "Help me analyze the good comments in the last week", the server can retain the time information "last week" in the intent information.

[0057] 202-1-3, the server replaces the reference information in the dialogue information and context information with name information and retains it in the user's intent information.

[0058] Specifically, the server can process the reference information in the dialogue information and the context information, where the reference information refers to pronouns, noun phrases and the like used by the user in the dialogue, which can be combined with the context information to determine the object referred to. Based on this, the server can replace the reference information with explicit name information by analyzing the context information, and retain it in the rewritten intent information. For example, if the merchant user asks "how to contact him?", the server can identify that "him" refers to the delivery personnel of an order, and then replace "him" with the delivery personnel of the order and retain it in the intent information.

[0059] The above implementation can make the rewritten intent information more clearly express the actual needs of the user by replacing the reference information with explicit name information. The above rewriting method can help eliminate ambiguity and uncertainty caused by reference information, thereby improving the accuracy and reliability of system response.

[0060] 202-1-4, when the server identifies that the context information contains a difference topic different from the dialogue information, the content related to the difference topic is deleted in the intent information.

[0061] Specifically, the server can identify the difference topic in the context information that is different from the dialogue information of the current round. Wherein, the difference topic refers to the theme or topic changed by the user in the same conversation, and the information related to the difference topic may interfere with the system's understanding of the core intent. Based on this, the content related to these difference topics can be deleted in the rewritten intent information. For example, if the merchant user first asks a question about a product, and then asks a question about an order, the server will identify the difference between the two topics, and then delete the content related to the above product when generating the intent information.

[0062] The above implementation can make the rewritten intent information more focused on the current core intent by deleting the content related to the difference topic, and this rewriting method helps to reduce the processing amount of unnecessary information by the system, improve the response speed and accuracy. At the same time, since the content related to the difference topic is deleted, the rewritten intent information is easier to process and analyze subsequently.

[0063] In an optional implementation, the intent recognition process can be implemented by setting a prompt template in the large model of the intent recognition module, for example, the prompt template of the large model can be set as follows:

[0064] Combine historical dialogue and application scenarios to restate the current problem of the merchant as a merchant, making the expression clearer and easier to understand;

[0065] 1. Think about whether the historical dialogue and application scenario are related. If not, do not rewrite the current problem of the merchant;

[0066] 2. In idle chat scenarios such as greetings, criticisms, and exclamations, the current problem of the merchant is not rewritten;

[0067] 3. After rephrasing, the time and order number conditions related to the problem cannot be omitted;

[0068] 4. The result of rephrasing prohibits self-imagined conditions.

[0069] nResult: Express the merchant's problem as a merchant, and multiple intents need to be decomposed into a list of multiple independent problems.

[0070] Case 1: Merchant: Did I have a good review yesterday? Assistant: After checking, you had a good review yesterday: "The dish is very tasty, praise". Merchant: Can I pin it? I want more consumers to see this message. Thought: The merchant's pin object is the good review in the previous text, and the question has a time condition: yesterday. Result: "How to pin yesterday's good review?", "How to let more people see yesterday's good review?".

[0071] In an optional implementation, the intent information can be generated by a pre-trained large model, wherein the pre-training method of the large model can be realized by the following way: the server continues to pre-train the large model in the general field based on the sample data set in the pre-set field, wherein the sample data set is set with random noise and does not contain sample user information, then the large model after the continuation pre-training is parameter fine-tuned based on the intent recognition case in the pre-set field, finally, the large model after the fine-tuning is used to generate the intent recognition information of the pre-set problem in the pre-set field, and based on the positive and negative feedback information of the intent recognition information, the parameters of the large model are iteratively updated through the reinforcement learning algorithm to obtain the pre-trained large model.

[0072] Specifically, when performing model training, the server can load a general domain large model as a base model, and then use a preset domain sample dataset to continue pretrain the base model. The dataset can include task dialogue data in a specific domain, and random noise can also be added to the sample data to enhance the robustness of the model while ensuring that the dataset does not contain any sample user information to protect user privacy. After completing the continue pretrain, the server can perform parameter fine-tuning (SFT) on the model based on the intent recognition cases of the preset domain. The intent recognition cases can include multi-turn dialogue information and corresponding intent recognition results in the preset domain, which can be used to guide the model to recognize user intent in a specific domain. During fine-tuning, the large model can adjust its internal parameters according to the input and expected output of the cases to optimize the performance of the large model in the specific domain. Subsequently, the server can generate intent recognition information for a preset question in the preset domain using the fine-tuned model. These intent recognition information can be used to interact with the user and iteratively optimize based on user feedback. Specifically, the server can collect positive and negative feedback information from the user on the intent recognition information, and iteratively update the parameters of the model through a reinforcement learning algorithm (RLHF). The reinforcement learning algorithm can adjust the behavior strategy of the model according to the user's feedback to enable the model to more accurately recognize the user's intent. Finally, techniques such as deep pseudo-reinforcement learning (DPO) can be used to further improve the performance of the model, resulting in a pre-trained large model. The pre-trained model not only has the ability to accurately recognize user intent in a specific domain, but also can continuously learn and optimize during interaction with the user.

[0073] In step 203, the server selects at least one tool based on the intent information and generates a tool execution plan.

[0074] Specifically, after determining the intention information of the user, the server can input the intention information into the large model, so that the large model can select at least one tool through the intention information, thereby obtaining a tool execution plan. In this embodiment, the tool execution plan can include at least one tool (i.e., a program function interface) related to the intention information, wherein the selection range of the tool can be pre-defined or obtained through a pre-positioned vectorization coarse calling link. By calling the tool, the corresponding function of the tool can be implemented. For example, when the intention information is "querying commodity sales", the tool selected by the large model can be the dish data query tool "dish_data_query", wherein the dish data query tool "dish_data_query" is the tool execution plan generated based on the intention information "querying commodity sales". It can be understood that when the intention information is relatively simple and clear, the tool execution plan is also relatively simple and clear; when the intention information is relatively complex, more tools are required, and there is a possibility of missing tools. Therefore, the execution result of the tool execution plan will be checked in the subsequent process to ensure that there is no missing tool. In this embodiment, the range of the tool selected by the large model and the specific function of the tool are not limited, and the process of generating the tool execution plan can be implemented through the planner module (Planner) in the E-Agent architecture.

[0075] In an optional embodiment, step 203 can be implemented by the following method: the server obtains the context information, and according to the context information, searches for a plurality of candidate tools related to the intention information in the tool library, generates a candidate tool list, then selects at least one tool from the candidate tool list based on the intention information, and arranges and combines the selected tools to obtain a tool execution plan.

[0076] Specifically, the server can search for a plurality of candidate tools related to the context information in the pre-constructed tool library according to the context information, and this process can be completed before the selection of the tool by the Planner module and implemented as a coarse calling link. This process can be completed by matching the context information with the description, function or label of the tool in the tool library, thereby obtaining a candidate tool list. Further, the server can select at least one tool from the candidate tool list based on the specific content of the intention information by using a pre-set algorithm or rule. These tools can be arranged and combined according to the logical relationship and dependency relationship in the task completion process to form a tool execution plan of one or more tools. It should be noted that the above-mentioned generation method of the tool execution plan is not only suitable for the merchant service scene, but also has strong universality and scalability, and can be widely applied to other scenes that need to use tools to assist in completing tasks.

[0077] Compared with the way of directly disassembling tasks in the XAgent architecture, the above-mentioned implementation can avoid the problems of too divergent task disassembly and long task list. Meanwhile, compared with the way of generating a complete plan at one time in the ReWOO architecture, the above-mentioned implementation can improve the accuracy of tool selection by precisely matching the intent information and the candidate tools, thereby improving the feasibility and efficiency of the entire plan execution. In addition, by adding the vectorized coarse calling link of tools in the prelink, the set of tools most relevant to the intent information can be located more quickly, thereby improving the efficiency and accuracy of tool selection.

[0078] In an optional implementation, the server can select the tools in the following at least one way:

[0079] 203-1. The server performs keyword matching in the candidate tool list based on the intent information, and screens at least one tool.

[0080] Specifically, the server can perform keyword matching in the pre-constructed candidate tool list based on the intent information and the description, label and other information of the tools, and quickly screen at least one tool related to the intent information. The keywords used for matching can be derived from the user's intent information, or other key elements extracted after processing (such as word segmentation, stop word removal, etc.).

[0081] The above-mentioned implementation can quickly locate the tools directly related to the user's intent by using the keyword matching algorithm, thereby improving the efficiency and accuracy of tool selection. At the same time, the above-mentioned method does not require complex natural language processing, and can reduce the complexity of the system and the requirement for computing resources.

[0082] 203-2. The server judges that the intent information of the current round is the same as that of the previous round, and selects a tool different from the tool of the previous round as the tool of the current round.

[0083] Specifically, the server can record the historical intent information of the user. When it is judged that the intent information of the current round is the same as that of the previous round (or several previous rounds), the server can avoid repeatedly selecting the same tool, but add a new tool to the tool used in the previous round as the selection of the current round, or replace the tool used in the previous round as the selection of the current round. This tool selection strategy helps to provide diversified tool support in continuous tasks and enhances the user experience.

[0084] 203-3. The server selects a tool that is mutually exclusive with the selected tool as a tool disabled in the current round.

[0085] Specifically, the server can maintain a tool mutual exclusion rule library, which can include mutual exclusion relationships between tools. When the server selects a tool, it can check whether the selected tool has a mutual exclusion relationship with the selected tool. If there is a mutual exclusion relationship, the server will disable the tool as the current round tool to ensure that no conflicting tool is selected.

[0086] 203-4, when the server fails to select a tool based on the intent information, the knowledge retrieval tool is selected as the tool of the current round.

[0087] Specifically, when the server fails to select a suitable tool based on the intent information, the server can adopt an alternative strategy, i.e. selecting a knowledge retrieval tool as the tool of the current round. The knowledge retrieval tool has strong information search and integration capabilities in a specific field, which can help the server search for information or resources related to the intent information in a more professional knowledge base, thereby providing support for subsequent task execution.

[0088] 203-5, the server searches for at least one case in the execution plan experience library based on the intent information through a preset information retrieval model, and selects at least one tool from the candidate tool list based on the case.

[0089] The information retrieval model can include at least one of a sparse retrieval model, a dense vector retrieval model, and a multi-vector retrieval model.

[0090] Specifically, the server can search for historical cases similar to the intent information in the execution plan experience library based on the user's intent information using a preset information retrieval model (such as a sparse retrieval model, a dense vector retrieval model, or a multi-vector retrieval model). These historical cases contain experience and tool combination information for successfully completing similar tasks. By analyzing these cases, the server can select at least one tool similar to the tools used in the cases from the candidate tool list.

[0091] In an optional implementation, the server can select a tool based on the searched case in at least one of the following ways:

[0092] 203-5-1, the server sets the tool in the case as the selected tool when the matching degree of the case and the intent information is greater than a preset threshold.

[0093] 203-5-2, the server sets the case in the prompt template when the matching degree of the case and the intent information is less than or equal to a preset threshold, so as to select at least one tool from the candidate tool list through the prompt template.

[0094] Specifically, after searching out the cases related to the intent information from the pre-constructed execution plan experience library by using the preset information retrieval model, the server can calculate the matching degree between each case and the intent information, and compare the calculated matching degree with the preset threshold. If the matching degree of the searched case and the intent information is greater than the preset threshold, the tool used in the case can be used as the selected tool. At this time, the case with high matching degree often means that the tool used is highly related to the current intent information and can well meet the user's demand. On the contrary, if the matching degree of the selected case and the intent information is less than or equal to the preset threshold, the searched case can be set in the prompt template of the large model, so that the large model selects at least one tool from the candidate tool list according to the description and related information of the case in the prompt template. This tool selection method allows the user to make further judgment and selection based on the partially matched case, thereby improving the flexibility and accuracy of tool selection.

[0095] The above embodiment can effectively improve the accuracy and efficiency of tool selection by selecting tools based on the matching degree between cases and intent information.

[0096] In an optional embodiment, the server can arrange and combine the selected tools to obtain a tool execution plan in the following manner: the server sequentially arranges and / or parallelly arranges the tools based on the dependency relationship between the tool parameters of each tool, and then connects the sequentially arranged and / or parallelly arranged tools through a preset operator to obtain the tool execution plan.

[0097] Specifically, the server can select at least one tool in the tool library based on the user's intention information. For example, in the field of merchant services, the tools that the server can select include but are not limited to knowledge retrieval tools, business diagnosis, querying merchant XX basic information, querying merchant XX operating data, and setting XX function write operation interface, and a total of more than one hundred kinds of tools. After selecting the appropriate tools, the server can analyze the dependency relationship between the tool parameters of each tool. These dependency relationships can be based on data flow continuity, operation sequence requirements, or data processing logic requirements, etc. The server can arrange the selected tools in sequence and / or in parallel according to these dependency relationships. Among them, the tools arranged in sequence need to be executed in a specific order to ensure the accuracy of the data and the continuity of the operation; while the tools arranged in parallel can be executed in parallel to improve processing efficiency. After completing the tool arrangement, the server can use pre-set operators such as parentheses, commas, etc. to connect the tools arranged in sequence and / or in parallel. Among them, the operators not only define the execution order of the tools, but also ensure the logical correctness of the entire tool execution plan. Through the connection of the operators, the server can finally generate a tool execution plan such as "[(T1, T2), (T3)]", where T1 and T2 represent tools that need to be executed in sequence, and T3 represents a tool that can be executed in parallel with T1 and T2.

[0098] In an optional embodiment, the tool execution plan can be implemented by setting a prompt template in the large model of the plan making module, for example, the prompt template of the large model can be set as follows:

[0099] You are an intelligent robot of a food delivery platform, named Merchant Assistant. You have the highest authority in the merchant's APP and communicate with merchants in the APP. Your core goal is to understand and solve the problems of merchants and improve their customer satisfaction. Currently, your responsibility is to select multiple tools that need to be called according to the merchant's problems.

[0100] Objective: Must correctly analyze the merchant's intention and select useful tools from the provided tool list according to this intention. The following API tools can be used:

[0101] unclear_intention: represents unclear or meaningless mood words; unrelated_biz: represents that the business intention is unrelated to the takeout scene; Question: user question; Thought: please carefully read the user and your chat record, analyze the user's question, and select the most suitable tool list for the business question; Action: the most suitable tool list to solve the problem, cannot be empty, multiple tools are separated by English commas, and the selected tools must be within {tool_names}; Observation: feedback given after calling the tool.

[0102] Notes:

[0103] * Must use the tool first, if other tools cannot be matched and used, use "knowledge_retrieval_tool";

[0104] * Note that when the user repeatedly consults a question, it may be that the last tool call was wrong, please replace the tool as appropriate;

[0105] * Tools are mutually exclusive, such as open and close. Do not call them at the same time.

[0106] * If the business question is a meaningless mood word or incomplete input, you must use "unclear_intention";

[0107] * Do not guess the business intention, do not select tools that are not provided, do not choose no tools, do not directly answer, do not wait for the business's new question;

[0108] Case 1: Question: How to bind XX (Note: XX is used to refer to a certain instant messaging application software). Thought: XX and the takeout scene are not directly related, but as an online takeout platform, it may be related to XX communication tools, try to use "knowledge_retrieval_tool" to retrieve knowledge to answer. Action: knowledge_retrieval_tool.

[0109] In an optional implementation, the tool execution plan can be generated by a pre-trained large model. The pre-training method of the large model can be realized by the following way: the server continues to pre-train the large model in the general field based on the sample data set of the pre-set field, and then fine-tunes the parameters of the large model after the continuation pre-training based on the tool call case of the pre-set field, and finally converts the parameter weights of the fine-tuned large model from floating point numbers to integers of a pre-set number of digits, to obtain the pre-trained large model.

[0110] Specifically, when performing model training, the server can load a general domain large model as a base model, and then perform continue pretraining on the base model using a preset domain sample dataset. The dataset can include tool call data in a specific domain. Through the above training process, the model can better adapt to the data distribution and language patterns of the specific domain. After the continue pretraining is completed, the server can further perform parameter fine-tuning (SFT) on the large model after the continue pretraining based on tool call cases in the preset domain. The tool call cases can include mapping relationships between user questions and tools, thereby guiding the model to learn how to accurately identify the tools to be called from the user questions. Through model fine-tuning, the large model can better understand the intent of the user questions and accurately map to the corresponding tools. After fine-tuning, the server can convert the parameter weights of the large model from floating-point numbers to integers of a preset number of bits (int4 quantization). This step can maintain the performance of the model to some extent, while greatly reducing the complexity of the model and the computational resource consumption during runtime. Finally, the large model processed through the above steps can be used to generate a tool execution plan. When a user presents a demand, the model can accurately generate a corresponding tool execution plan according to the input question of the user.

[0111] In step 204, the server extracts tool parameters from the context information and calls the tools in the tool execution plan based on the tool parameters to obtain a plan execution result.

[0112] Specifically, after obtaining the tool execution plan, the large model can execute the tool execution plan to obtain a plan execution result. In this embodiment, the execution process of the tool execution plan is a process of calling each tool in the tool execution plan. In this process, the large model can obtain tool parameters and call each tool through the tool parameters to obtain the calling results of each tool. Subsequently, the plan execution result can be obtained by integrating the calling results of each tool. In this embodiment, the tool parameters required by the tool are generally user ID, commodity ID, order ID, time range, and other relatively common information. Therefore, the tool parameters can generally be extracted from the user's dialogue information, context information, and user information. In this embodiment, the manner in which the large model extracts the tool parameters is not specifically limited. The execution process of the tool execution plan can be implemented by a calling execution module (Caller) in the E-Agent architecture.

[0113] In an optional implementation, step 204 can be implemented in the following manner: the server obtains the context information, extracts tool parameters required by tools in the tool execution plan from the dialogue information and the context information, and then serially calls and / or parallelly calls the tools in the order of arrangement and combination of the tools in the tool execution plan based on the tool parameters, to obtain the plan execution result.

[0114] Specifically, the server can extract tool parameters of tools in the tool execution plan from the context information, where the tool parameters can include, for example, time parameters, commodity IDs, order IDs, and various types of data. By extracting the tool parameters, it can be ensured that the tools in the tool execution plan can be executed correctly and efficiently. After the tool parameters are determined, the server can call the tools according to the arrangement and combination order of the tools defined in the tool execution plan. In many fields, such as the field of merchant services, there is no explicit dependency relationship between most tools, at this time, the server can preferentially adopt the parallel calling manner to maximize the reduction of the overall execution delay of the tools. At the same time, in the case where there is an explicit dependency relationship between the tools, the server can also serially call according to the dependency order to ensure the correct execution of the tools.

[0115] The above implementation can greatly reduce the overall execution delay of the tools by parallelly calling the tools in the tool execution plan, thereby improving the response speed and work efficiency of task execution. In addition, by automatically extracting tool parameters based on dialogue information and context information, it can be ensured that each tool is accurately called, thereby reducing the risk of operation errors and improving the automation and intelligence level of the system.

[0116] In an optional implementation, the server can also obtain tool parameters in at least one of the following manners:

[0117] 204-1, when the server identifies that there is a missing tool parameter, the execution order of the tool with the missing tool parameter is postponed, and the missing tool parameter is extracted from the execution result of the executed tool.

[0118] Specifically, when the server executes the tool execution plan and finds that the input parameter relied on by a tool is missing in the current context, the fault-tolerant mechanism can be triggered, that is, the server can postpone the execution order of the tool, so that the front-end tool has the opportunity to generate or provide the missing parameter during the execution process. After the front-end tool is executed, the server can check again whether new parameter information is obtained. If the missing parameter is obtained, the server can continue to execute the tool in the original plan; otherwise, the server can consider other strategies, such as asking the user to obtain the tool parameter or performing partial execution according to the existing information, and the like.

[0119] The above embodiment can significantly improve the robustness of tool execution plan and the success rate of tool execution by combining the parameter automatic extraction strategy and the parameter extraction fault-tolerant mechanism, and the above method can effectively reduce unnecessary user interaction, improve the efficiency and success rate of tool execution.

[0120] 204-2, the server initiates inquiry information based on the missing tool parameters, and extracts the missing tool parameters from the reply information of the user to the inquiry information.

[0121] Specifically, when the server identifies that there is a missing tool parameter, in addition to triggering the fault-tolerant mechanism, the server can also initiate inquiry information to the user based on the missing parameter and display it to the user through the user interface. The user can provide the missing parameter by replying to the inquiry information. The server can extract the missing parameter from the reply of the user and continue to execute the tool in the original plan.

[0122] The above embodiment can ensure that the plan can be continuously and stably executed by actively asking the user for parameters during the execution of the plan. This dynamic parameter acquisition method can not only improve the efficiency of tool execution, but also improve the success rate of plan execution, avoid the failure of plan execution in the middle of the way, and avoid resource waste.

[0123] In an optional embodiment, the server can process the tool parameters in at least one of the following ways:

[0124] 204-3, the server extracts the time parameter from the tool parameter, and modifies the relative time in the time parameter to absolute time.

[0125] Specifically, among the time parameters extracted by the server, there may be user expressions in relative time, such as "past three days" or "last week", etc. In order to enhance the accuracy of time conversion, the server introduces a date-specific tool. This tool can convert the user's expression of relative time into precise absolute time. For example, "past three days" is converted to a specific date range "start: 20240510, end: 20240512". After completing the conversion of the time parameter, the server can use the updated tool parameter for subsequent tool calls.

[0126] 204-4, the server extracts the order parameter from the tool parameter, and modifies the user expression in the order parameter to the standard expression of the preset field.

[0127] Specifically, the server can extract order-related parameters from the tool parameters, so that the user expression can be converted into a standard expression in the preset field. For example, the server can convert the user expression "XX order" into the standard expression "order serial number XX". In this way, no matter how the user expresses the order information, the server can map it to a unified standard expression to ensure the correct calling of the tool.

[0128] The above embodiment can achieve effective matching between user expression and tool calling by standardizing the order parameters. This not only improves the accuracy of tool calling, but also reduces the risk of misoperation caused by differences in user expression.

[0129] In an optional embodiment, the tools in the tool execution plan can include at least one of a knowledge base search tool, an information query tool, a function setting tool, and an information analysis tool. In this embodiment, by pre-building a knowledge base and a knowledge base search tool, the reply content can be limited to a preset field, thereby reducing the risk of reply content errors. In addition, by combining information query tools, function setting tools, information analysis tools, and other types of tools, various types of functions such as information query, information analysis, and function setting can be implemented to enrich the functionality of task-oriented dialogue. It can be understood that the specific functions implemented by each tool and the scope of the application field are not limited.

[0130] In an optional embodiment, the process of calling the tools in the tool execution plan based on the tool parameters to obtain the plan execution result can be implemented in the following manner: the server calls the tools arranged in sequence in the tool execution plan in series and calls the tools arranged in parallel in parallel based on the tool parameters to obtain the plan execution result.

[0131] Specifically, the server can call the tools arranged in sequence in series and call the tools arranged in parallel in parallel according to the execution order and dependency relationship of the tools. During the calling process, the server can also monitor the execution status of the tools in real time and intervene and adjust as necessary. Finally, the server can collect the execution results of all the tools and generate a comprehensive plan execution result.

[0132] Step 205, the server checks the plan execution result based on the dialogue information and the context information.

[0133] Specifically, after obtaining the plan execution result, the large model can check the completeness of the plan execution result, and determine whether the plan execution result passes the check according to the completeness of the plan execution result. If the plan execution result passes the check, the plan execution result can be input into the next link to generate the reply content; if the plan execution result does not pass the check, the tool needs to be reselected by the plan making module, and the tool execution plan is updated, and then the updated tool execution plan is executed to obtain an updated plan execution result, and then it is determined whether the updated plan execution result is complete. This process can be continuously looped until the modified plan execution result meets the completeness requirement and / or the number of loops reaches a certain threshold, and then the plan execution result is output, and finally the reply content is generated through the updated plan execution result. In this embodiment, the large model can determine the completeness of the plan execution result according to the content of the dialogue information. When it is determined that at least one of the two conditions that all the tools related to the dialogue information have been called and / or the plan execution result can solve the problem raised in the dialogue information is met, it is determined that the plan execution result is complete, and at this time, the plan execution result can be output for generating the reply content. The checking process of the plan execution result can be realized by the checker in the E-Agent architecture.

[0134] In an optional embodiment, step 205 can be implemented in the following way:

[0135] 205-1, the server obtains the context information, and checks the tools in the tool execution plan and the plan execution result based on the dialogue information and the context information.

[0136] 205-2, when the server determines that there is no missing tool in the tool execution plan, and / or the plan execution result is complete, it is determined that the plan execution result passes the check.

[0137] Specifically, when checking the plan execution result, the server can first obtain the context information related to the dialogue information, and then check the completeness of the tools in the tool execution plan and the plan execution result itself according to the obtained context information and dialogue information. The checking process mainly involves two aspects: one is to confirm whether all necessary tools are included in the tool execution plan without omission; the other is to evaluate whether the plan execution result is complete and can meet the requirement of generating the reply content. As long as at least one of the above two conditions is met, it is determined that the plan execution result passes the check.

[0138] In the embodiment, the reply content is limited in the scope of the tool execution result, and the tool execution result is obtained by calling the tool, and the selection of the tool is limited in the scope, which leads to that after all the tools related to the dialogue information and the context information are called, the generated plan execution result may still not meet the requirement of generating the reply content. In this case, if it is checked that all the necessary tools are included in the tool execution plan, it is considered that the large model has reached the boundary of problem solving, and even if the problem raised by the user is not solved at this time, it is still considered that the plan execution result passes the check, so as to avoid that the large model randomly expands other content and exceeds the topic boundary of the preset field, so that the reply content is wrong and deviated. In some other cases, if it is checked that there are tools that are not called, but the plan execution result itself can meet the requirement of generating the reply content, it is also considered that the plan execution result passes the check. In this way, the consumption of computing resources can be reduced, the system delay can be reduced, and the timeliness of problem solving can be improved. Based on this, as long as one of the above two conditions is met, it is considered that the plan execution result passes the check.

[0139] The above embodiment checks the tool execution plan from the completeness of tool calling and the completeness of tool calling result, which can ensure the integrity of the plan execution result, so as to avoid the problems of reply error or information missing caused by tool omission or incomplete execution result. The above method not only improves the user experience, but also enhances the reliability and stability of the system. In addition, the above method can identify and correct in the early stage of the problem, so as to reduce the probability of reply content error.

[0140] In an optional embodiment, step 205 further comprises the following steps:

[0141] 205-3, when the server judges that there is a missing tool in the tool execution plan and / or the plan execution result is incomplete, the server can perform the following process in a loop until the modified plan execution result passes the check and / or the number of plan execution result checks reaches a preset threshold: the server generates feedback information based on the checking result of the tool execution plan and the plan execution result, and modifies the tool execution plan based on the feedback information and the intent information, and then executes the modified tool execution plan to obtain the modified plan execution result.

[0142] Specifically, the server can determine that the plan execution result check fails when it is determined that the tool execution plan does not contain all necessary tools or that the plan execution result is incomplete. At this time, the checker can generate a text format information containing the thinking and feedback signal (i.e., feedback information) and feed back the information to the planner module. After receiving the feedback information, the planner module can reselect or adjust the tools (generally in an incremental manner) based on the information and the user's intention information, and generate a modified tool execution plan. The modified plan will then be handed over to the caller module for execution, and a new plan execution result will be generated. Then, the new plan execution result will be sent to the checker module for checking again. This process will be repeated until the checker module passes the check, i.e., the information is complete and sufficient to generate a reply content, or the preset check number threshold is reached.

[0143] In the embodiment, if it is checked that the tool execution plan does not contain all necessary tools, it is considered that the large model has not reached the boundary of problem solving, and at this time, whether the plan execution result can solve the problem raised by the user or not, the plan execution result check is considered to fail, so as to improve the comprehensiveness of the plan execution result. In some other cases, if it is checked that the plan execution result cannot meet the requirement of generating a reply content, the plan execution result check is also considered to fail, and the problem solving approach is searched again through the tool to ensure the effectiveness of problem solving. Based on this, as long as one of the above two conditions is met, it is considered that the plan execution result check fails. It can be understood that the specific conditions for whether the plan execution result passes or not can be designed according to the actual form of the product, and the embodiment does not make specific limitation here.

[0144] The above embodiment can realize automatic completion of information by intelligently adjusting tool selection and execution plan according to the feedback information of the checker and the intention of the user, so that the system can maintain high accuracy and response speed when facing complex and variable dialogue scenarios. At the same time, by setting the threshold upper limit of the check number, the system can control the number of cycles to a certain extent, avoid infinite loop caused by special circumstances, thereby enhancing the robustness of the system, and also improving the response timeliness of the system.

[0145] In an optional embodiment, the method of modifying the tool execution plan based on the feedback information and the intention information in step 205-3 can be implemented in the following way: the server selects at least one tool based on the feedback information and the intention information, and adds the selected tool to the tool execution plan to obtain a modified tool execution plan.

[0146] Specifically, when the server determines that there are missing tools in the tool execution plan and / or the plan execution result is incomplete, feedback information provided by the checker module and user intent information can be obtained, and at least one tool is selected from the predefined tool set by the Planner module and added to the existing tool execution plan to generate a modified tool execution plan. Among them, the large model can select at least one tool based on the function of the tool itself and the need of the application scenario to make up for the deficiency of the current tool execution plan or perfect the current plan execution result. Subsequently, the Planner module can submit the modified tool execution plan to the caller module for execution, and then the checker module judges to obtain a more complete and accurate plan execution result.

[0147] In this embodiment, the selected tool can be added to the original tool execution plan in an incremental manner, or the incorrect tool selected in the original tool execution plan can be replaced, or the tool already selected (such as a knowledge base search tool) can be repeatedly called to generate a new calling result. In addition, the feedback information provided by the checker module can include the checking result of the tool in the tool execution plan and / or the checking result of the plan execution result, so that the Planner module can determine the missing or incorrect tool in the tool execution plan based on the feedback information and supplement new tools, thereby improving the efficiency and accuracy of tool selection.

[0148] The above embodiments can intelligently select and add new tools to the tool execution plan based on the feedback information of the checker module and the user's intent information, so that the system can flexibly adjust and optimize the tool execution plan for different situations to ensure the completeness and accuracy of the information. When facing complex and variable dialogue scenarios, the system can maintain high accuracy and response speed, thereby reducing the need for manual intervention, reducing the maintenance cost of the system, and improving the overall performance and user experience of the system.

[0149] In an optional embodiment, the plan execution result can be checked with the aid of a prompt template set in the large model of the verification checking module. For example, the prompt template of the large model can be set as follows:

[0150] Task: You will receive the merchant's question, context information, and the tools and results already called by the small assistant, and correctly determine whether the small assistant has done its best. Always remember the small assistant's tool list (you can only refer to these tools for judgment): {tool_hum_names}.

[0151] Task points:

[0152] 1. Understand the question: You need to carefully understand the merchant's question in order to assess whether the small assistant's understanding is accurate.

[0153] 2. Small assistant capability boundary: You must pay attention to the small assistant's capability boundary. If the solution cannot be obtained through existing tools, it is considered that the small assistant has done its best.

[0154] 3. Tool retry is prohibited: If a tool call fails, there is no need to retry.

[0155] Question: User's question; Observation: Tool called and tool result; Thought: You must use dialectical thinking to think around the user's question to determine whether the small assistant has done its best and whether there are relevant tools that have not been called; Check: Yes or No; Whether the small assistant has done its best within the capability range; Final Answer: When Check is No, select the correct tool in the tool list; When Check is Yes, reply "none" can be.

[0156] In the above implementation, by setting the check steps, precautions, and related cases of the plan execution result in the prompt template of the large model, the check result of the plan execution result can be made more comprehensive, accurate, and without omission.

[0157] Step 206, the server integrates the plan execution result that passes the check based on the dialogue information and the context information, obtains the reply content, and sends the reply content to the client.

[0158] Specifically, after the plan execution result passes the check, the large model can generate the reply content based on the plan execution result that passes the check. The reply content can be generated in combination with the user input dialogue information, that is, when generating the reply content, the content in the plan execution result related to the dialogue information can be retained, and the content unrelated to the dialogue information can be removed, to obtain the reply content more relevant to the dialogue information. In this embodiment, the large model can also perform other forms of processing on the reply content, such as adding soothing information, adding link information, etc., which are not limited in this embodiment. The generation process of the reply content can be realized by the content summary module (Summary) in the E-Agent architecture.

[0159] In an optional implementation, step 206 can be implemented in the following way: the server obtains the context information, and integrates the content in the plan execution result related to the dialogue information based on the dialogue information and the context information to obtain the reply content.

[0160] Specifically, when performing content integration, the server can first obtain the current dialogue information and context information, and then organize the results returned by the multiple tools and the content of the document blocks according to a certain logical order, for the dialogue information sent by the user in the current round, to ensure the coherence and accuracy of the information. In addition, the server can also exclude noise information that is not related to the dialogue information in the current round, to prevent the noise information from interfering with the quality of the final answer. Finally, the server can convert the integrated information into natural language, thereby generating reply content for the user's question.

[0161] The above embodiment can provide comprehensive, coherent and accurate replies for the user by integrating the results returned by the multiple tools and the content of the document blocks for the dialogue information of the user, thereby effectively improving the accuracy and pertinence of the reply content. In addition, since the server can answer within the scope defined by the tool call results based on the given dialogue information, no other information is introduced, thereby ensuring the professionalism of the reply content.

[0162] In an optional embodiment, the reply content can be generated in at least one of the following ways:

[0163] 206-1, the server deletes the content in the plan execution result that is not related to the dialogue information, and integrates the content retained in the plan execution result to obtain the reply content.

[0164] Specifically, when performing content integration, the server can analyze the content in the plan execution result by natural language processing technology to identify the content that is not related to the dialogue information and delete it. Then, the server can logically integrate the remaining relevant content to form coherent and accurate natural language reply content. The above processing method can ensure that the reply content can focus on the core needs of the user and avoid introducing unnecessary noise.

[0165] The above embodiment can effectively improve the pertinence and accuracy of the reply content by deleting irrelevant content and integrating the remaining information to form the reply content, thereby reducing the risk of misleading the user caused by noise interference. At the same time, the above processing method can also improve the conciseness and readability of the reply content, so that the user can quickly read the required information.

[0166] 206-2, the server obtains at least one link information based on the dialogue information, and adds the link information to the reply content.

[0167] Specifically, when integrating the content, when the server identifies that reference information or detailed information can be further added in the dialogue information, the server can obtain relevant link information (such as picture link, document link, webpage link, etc.) according to the dialogue information, and add the link information into the reply content. In the embodiment, the link information can be a document link in the knowledge base, or a link of an external website.

[0168] The above embodiment can provide more reference information and detailed information for the user by adding the link information into the reply content, so as to help the user to understand the solution of the related problem more comprehensively and quickly, thereby improving the experience of the user and the timeliness of the problem solving.

[0169] 206-3, when the server identifies that the dialogue information contains negative emotions, the server generates appeasing information based on the dialogue information, and adds the appeasing information into the reply content.

[0170] Specifically, when integrating the content, when the server identifies that the dialogue information contains negative emotions (such as complaints, dissatisfaction, etc.), the server can also generate appeasing information based on the dialogue information, such as apology information, explanation information or suggestion information, etc., and add the appeasing information into the reply content.

[0171] The above embodiment can alleviate the negative emotions of the user as much as possible in the reply content by adding the appeasing information in the reply content according to the dialogue information initiated by the user, thereby improving the experience of the user.

[0172] 206-4, when the server identifies that the dialogue information contains artificial service demand information, the server generates guiding information based on the dialogue information, and adds the guiding information into the reply content.

[0173] Specifically, when integrating the content, when the server identifies that the dialogue information contains artificial service demand information (such as the user requiring to transfer to artificial service, etc.), the server can generate guiding information based on the dialogue content, such as providing the contact information of the customer service, describing the service content that the task type dialogue can provide for the user, etc., and add the guiding information into the reply content to guide the user to quickly solve the problem.

[0174] The above embodiment can provide more effective solutions for the user by adding the guiding information into the reply content, thereby reducing the waiting time and communication cost of the user. At the same time, the above method can also improve the response speed and problem solving ability of the server, thereby enhancing the experience of the user.

[0175] 206-5, when the server identifies that the dialogue information is inconsistent with the preset field, the server generates a refusal information based on the dialogue information, and takes the refusal information as the reply content.

[0176] Specifically, when performing content integration, when the server identifies that the dialogue information does not match the preset field (for example, in the field of merchant services, the user raises a question irrelevant to the merchant service content), the server can generate a recognition information based on the dialogue content, and send the recognition information as the reply content to the user. The recognition information refers to information expressing that the user's question cannot be processed, which can be generated based on the dialogue information initiated by the user in the current round.

[0177] The above embodiment can avoid answering questions that do not match the preset field by adding recognition information in the reply content, thereby reducing user confusion and misunderstanding.

[0178] 206-6, the server integrates the content related to the dialogue information in the plan execution result under the constraints of the preset number of words and language style, to obtain structured reply content.

[0179] Specifically, when performing content integration, the server can integrate and segment the content related to the dialogue information in the plan execution result under the constraints of the preset number of words and language style, to obtain structured reply content. The structured reply content can include a text divided into paragraphs according to topics, conclusions, and other parts, and arranged according to certain logical structure and language style.

[0180] The above embodiment can provide clear and easy-to-read reply content for the user by generating structured reply content according to certain word requirements and language style, thereby helping the user quickly understand the solution.

[0181] 206-7, the server searches at least one case in the reply content experience library based on the intent information through a preset information retrieval model, and sets the case in a prompt template to determine the reply content through the prompt template.

[0182] Specifically, the server can search at least one case related to the current intent in the reply content experience library through a preset information retrieval model (such as at least one of a sparse retrieval model, a dense vector retrieval model, or a multi-vector retrieval model) according to the intent information corresponding to the dialogue information, and then set the searched case in a prompt template of a large model to determine the final reply content through the prompt template.

[0183] The above embodiment can provide more personalized and targeted reply content for the user by searching for similar cases based on intent information and determining the reply content based on the searched cases. At the same time, the above method can make full use of information in historical data and experience library, to improve the accuracy and reliability of the reply content.

[0184] In an optional implementation, the response content can be generated with the help of a prompt template set in the large model of the content summary module. For example, the prompt template of the large model can be set with the following content:

[0185] Task objective:

[0186] 1. You should politely decline to answer questions from merchants that are not related to the food delivery industry.

[0187] 2. When dealing with questions from merchants, you need to combine the information you already know with the merchant's emotions, and then provide a humane and concise summary answer based on this information.

[0188] 3. For questions from merchants, you need to combine the question with the history of conversations to make a judgment.

[0189] 4. Guide inquiries: When merchants try to contact account managers or customer service, you need to actively guide them to ask you questions directly and do your best to handle and resolve their problems.

[0190] 5. The output content should be divided into layers and paragraphs to facilitate quick reading for merchants.

[0191] ninput:<history_dialogue> : The history of conversations between merchants and the assistant; <tools>: tools and results of the current invocation; <Links You Can Quote>: list of links you can quote; <query>: merchant's current input;

[0192] output: Thought: First from <query>determine whether the merchant has negative sentiment, and then refer to the <history_dialogue>, <tools>, the content of <Links You Can Quote>; make a summary reply;

[0193] Final Answer: When the merchant has negative emotions, first make a soothing; then give a reply to the merchant.

[0194] Note:

[0195] * When referring to Order No. XX, it refers to the order serial number XX.

[0196] * When <tools>When the Action and Observation in your code are not empty, your Thought must be reasonable and concise.

[0197] *Only content relevant to the merchant's current question will be selected from the Observation results for answering;

[0198] *The "Knowledge" section may contain links and images, which will be provided in the form of "<link-1>", "<image-1>", etc. This is also important information; please use the original format ("<link-1>", "<image-1>") directly in your answer. Do not fabricate links. <link> Answer using knowledge, pictures, etc.

[0199] *Final Answers should be concise and clear. Please strictly select appropriate content from the given Observations that is relevant to the merchant's question to answer the question. Do not answer based on your own knowledge, and do not provide suggestions or practices that go beyond the "Observations".

[0200] Case Study:

[0201] ninput:<history_dialogue> :null; <tools>:Action:knowledge_retrieval_tool, Observation: The customer service phone number for the food delivery platform is 10105757. <Links You Can Quote>: []

[0202] <query>: Artificial

[0203] noutput: Thought: The merchant has no negative emotions, so answer according to the merchant's questions. The merchant wants to find artificial customer service. My responsibility is to guide them to ask me questions, so I provide the phone number while guiding the merchant to ask me questions. Final Answer: The takeout customer service phone number is 10105757. If you have any questions on the takeout platform, please feel free to ask me. I will do my best to help you answer.

[0204] In an optional implementation, the reply content can be generated by a pre-trained large model. The pre-training method of the large model can be implemented in the following manner: the server generates multiple types of information reply cases based on multiple pre-set dialog scenarios in a pre-set field, and then fine-tunes the parameters of a pre-set large model based on the multiple types of information reply cases to obtain a pre-trained large model. The pre-set large model can be a large model in a general field, or a large model obtained by further pre-training based on a sample data set in the pre-set field.

[0205] Specifically, when training the model, the server can construct multiple types of information reply cases according to multiple pre-set dialog scenarios in a pre-set field. The constructed cases can cover different user intents, question types, and reply styles to ensure that the large model can adapt to various complex dialog environments. Then, the server can fine-tune the parameters of a pre-set large model using these constructed information reply cases. In this embodiment, the base model of the large model can be a large model in a general field, or a vertical domain model obtained by further pre-training based on a sample data set in the pre-set field. During the parameter fine-tuning process, the server can also use an optimization algorithm to adjust the parameters of the model to minimize the error between the predicted reply and the real case, thereby improving the reply accuracy of the model in the pre-set field.

[0206] Step 207, the client receives and displays the reply content.

[0207] Specifically, after generating the reply content, the server can send the reply content to the client. In response to receiving the reply content, the client can display the reply content. For example, the client can display the reply content on an instant messaging page, a search result page, or other pages. In this embodiment, the server can also output other information when outputting the reply content. For example, the server can also output the user's dialog information, intent information, tool name, tool call result, large model thinking information, and the like. In this scenario, the server can only send part of the information output by the large model to the client for display. For example, the server can only send the reply content to the client, and then record other information in the log for future analysis and processing.

[0208] In an optional embodiment, the client can send feedback information of the reply content to the server. The feedback information can include positive feedback information and negative feedback information. In this embodiment, the positive feedback information and the negative feedback information can be generated by triggering the feedback control and / or the user's evaluation of the reply content. After receiving the feedback information sent by the client, the server can perform corresponding operations on the cases in the experience library based on the feedback information, such as adding new cases, adding experience points to the cases, reducing the experience points of the cases, deleting existing cases, etc., so as to improve the accuracy and effectiveness of the cases in the experience library.

[0209] In step 208, the server generates at least one type of case, and stores the case in the corresponding experience library according to the type of the case.

[0210] In this embodiment, the cases stored by the server can include at least one type of case among the intent recognition case, the tool calling case and the information reply case. The intent recognition case can be stored in the intent information experience library, the tool calling case can be stored in the execution plan experience library, and the information reply case can be stored in the reply content experience library. The above various types of cases can be added, modified and deleted at various stages such as before training of the large model, during training and during use, so as to ensure that the cases in the experience library can cover as many dialog scenarios as possible in the preset field and can solve real problems faced by the user in the preset field, so as to improve the speed and quality of problem solving.

[0211] In this embodiment, the cases in the experience library can include two types, namely result direct use type and example type. The result direct use type means that when the question raised by the user hits a certain type of case, the case can be directly used, at this time, it is not necessary to call the large model to regenerate the tool execution plan, the reply content, etc., which can effectively reduce the computing resources; the example type means that it can be put into the context of the large model prompt template as few-shot (a small number of examples) to guide the large model to generate the intent information, the tool execution plan, the reply content, etc. according to the content in the prompt template and the examples set in the prompt module. In this embodiment, each link of the E-Agent, including the intent recognition module, the plan making module and the content summarizing module, has a respective independent experience library, and the above experience libraries all store corresponding cases, which can be used to guide the large model in each link to generate the corresponding intent information, the tool execution plan, the reply content, etc., so as to improve the generation speed and quality of the tool execution plan or the reply content.

[0212] In the present embodiment, the cases in the experience library can be stored in a K-V structure. Among them, V refers to the specific content of the direct-use case or the example case corresponding to the link where the case is located, and K refers to the single-round core intent information output in the intent extraction link. Exceptionally, the experience K of the intent extraction link needs special processing, which can be spliced from the dialogue information of the user in the last at least one round.

[0213] Further, in each link of the task-oriented dialogue implementation, if a case in the experience library is matched, it means that the current scene is a familiar and experienced scene, and at this time, the experience data (i.e., the case) can be used. In the present embodiment, the process of case recall can be considered as a retrieval matching task, the core of which is how to efficiently and accurately determine whether the current scene accurately matches the case in the database, which has the characteristics of high performance and high matching accuracy. Based on this, the present embodiment adopts a Hybrid Retrieval (search model integration) method to combine sparse retrieval (BM25), dense vector retrieval (BGE) and multi-vector retrieval (Multi-Vector) three retrieval models to perform information retrieval and case recall. The architecture of the information retrieval model is shown in FIG. 5, and the retrieval effect of the information retrieval model is shown in FIG. 6. As shown in FIG. 6, when the threshold value is greater than 0.79, the accuracy of hit@1 (an evaluation index in the information retrieval task, which refers to whether the first result (top-1 result) returned by the system hits the user's target or demand under a given user request) can be stabilized at more than 82%, at the same time, the recall rate can be stabilized at 93%, and the performance requirement of controlling the time consumption within 500 ms can be met.

[0214] Further, in terms of case generation, as shown in FIG. 4, cases in the experience library are mainly generated and optimized through two ways, i.e., expert-oriented (i.e., full-process feedback in FIG. 4) and user-oriented (i.e., result-oriented feedback in FIG. 4). Among them, in the aspect of expert-oriented, full-process guidance can be performed in the process of reply content generation, and improvement and learning can be performed in real time to deposit experience schemes; in the aspect of real user-oriented, online user result-oriented feedback can be used to affect the experience value of the scheme in real time.

[0215] In an optional implementation, the case can be generated by at least one of the following ways:

[0216] 208-1, receiving the intent information, the work execution plan and the reply content generated when the user interacts with the large model, and performing feedback operation on the intent information, the work execution plan and the reply content based on the first positive and negative feedback information of the user to the intent information, the work execution plan and the reply content, to obtain at least one case.

[0217] Specifically, users in the preset field (i.e., experts) can generate and optimize cases by asking questions and interacting with the task-oriented dialogue model based on the E-Agent architecture, and experts can observe the intermediate process and final reply of the Agent in real time during this process. Specifically, during the interaction process, if the reply or intermediate process of the Agent has errors, the expert can point out the problem and provide improvement suggestions in real time. Then, the server can generate corresponding feedback information through a large model or manual intervention according to the feedback of the expert. Further, the expert can initiate a retry request for the incorrect information, and during the retry, the server can add the feedback information of the previous round to the Prompt requested by the large model and initiate a call again, and then repeat this process until the expert is satisfied. Finally, the server can extract sample type and direct use type experience from the large model input, output and feedback information at each link and store it in the experience library.

[0218] The above implementation can accurately identify and improve the problems of the model in the reply content generation process through the whole-process guidance and real-time feedback of users in the preset field, to ensure that the generated cases have high quality and accuracy. At the same time, by continuously accumulating expert experience, the system can continuously optimize the model performance and improve the adaptability of the model in similar scenarios. In addition, by extracting and storing sample type and direct use type experience, the system can quickly respond to new scenarios and new problems, and improve the content reply quality of task-oriented dialogue.

[0219] 208-2, receiving second positive and negative feedback information of the user on the reply content, and based on the second positive and negative feedback information, performing feedback operations on the intention information, work execution plan and reply content generated in the reply content generation process to obtain at least one case.

[0220] Specifically, the server can also receive real-time positive and negative feedback information of online users on the reply content. Specifically, during the interaction process between the online user and the large model, the server can receive real-time positive and negative feedback information of the online user on the reply content. Among them, the user can generate positive and negative feedback information of the reply content through multiple ways such as clicking, liking, sending comments, etc., so that the server can perform positive and negative feedback operations on the corresponding cases according to the feedback information made by the user, such as increasing or decreasing cases, or increasing or decreasing the experience points of the cases. This way of real-time feedback based on users can quickly capture user needs and continuously optimize the case library.

[0221] The above embodiment can quickly identify user needs by receiving and processing real-time positive and negative feedback information of the user, and optimize and update the case library accordingly. This approach can significantly reduce the negative impact of incorrect experiences on user experience, while improving user satisfaction. In addition, by collecting positive and negative feedback information of the user on the reply content, the server can automatically identify and store valuable user experiences, thereby further enriching and perfecting the case library to improve the service quality of task-based conversations.

[0222] In an optional embodiment, referring to the process of generating and optimizing cases in a process-oriented feedback manner in FIG. 4, step 208-1 can be implemented by at least one of the following ways:

[0223] 208-1-1, when the server receives positive feedback information of the user on the intent information, the work execution plan and the reply content, the server performs positive feedback operation on the case corresponding to the intent information, the work execution plan and the reply content of the positive feedback information, wherein the positive feedback operation includes increasing the experience score of the case, and / or adding a new case.

[0224] Specifically, when the server receives positive feedback information of the user on the intent information, the work execution plan and the reply content, the server can first identify and locate the case corresponding to the positive feedback information. Then, the system can perform positive feedback operation on the case, including but not limited to increasing the experience score of the case to improve the priority of the case in subsequent similar problems. At the same time, the server can also merge or integrate similar or related positive feedback cases according to the specific content of the positive feedback information to generate new cases.

[0225] The above embodiment can quickly identify and strengthen user-satisfying cases by collecting positive feedback operations of the user on the cases, thereby improving the quality and usability of the case library. At the same time, the newly generated cases can further enrich the content of the case library to improve the adaptability and flexibility of the system.

[0226] 208-1-2, when the server receives negative feedback information of the user on the intent information, the work execution plan and the reply content, the server performs error correction processing on the intent information, the work execution plan and the reply content corresponding to the negative feedback information, generates error correction information, and sets the error correction information in the prompt template to regenerate the intent information, the work execution plan and the reply content through the prompt template.

[0227] Specifically, when the server receives negative feedback information from the user on the intent information, the work execution plan, and the reply content, it can first analyze the specific reasons and content of the negative feedback and locate the error case. Then, it can perform error correction processing on the error case and generate error correction information. These error correction information can include specific descriptions of the error information, correct processing methods, or suggested improvement directions, etc. Then, the server can set the error correction information in the prompt template of the large model, which can be used to guide the subsequent case generation. Finally, the large model can regenerate the intent information, the work execution plan, and the reply content according to the prompt template to ensure that the new content can avoid previous errors and improve user satisfaction.

[0228] In an optional implementation, the method of regenerating the intent information, the work execution plan, and the reply content through the prompt template in step 208-1-2 can be implemented in the following way: when the server identifies that the case corresponding to the intent information, the work execution plan, and the reply content generated through the case is incorrect, it replaces the incorrect case when regenerating the intent information, the work execution plan, and the reply content, and performs a negative feedback operation on the incorrect case, wherein the negative feedback operation includes reducing the experience score of the case and / or deleting the case.

[0229] Specifically, when the server identifies that the intent information, the work execution plan, and the reply content generated through the case have errors, it can first identify the error case and determine which link in generating the intent information, the work execution plan, and the reply content the case has errors. Then, the server can replace the incorrect case and perform intent recognition, work execution plan formulation, and reply content generation based on other correct or more appropriate cases. During the regeneration process, the server can also perform a negative feedback operation on the error case. These negative feedback operations include but are not limited to reducing the experience score of the case to reduce its priority in future similar situations; in specific situations, if the error of the case is serious or similar errors occur multiple times, the server can also choose to delete the case to avoid the case affecting the performance of the system.

[0230] In an optional implementation, referring to the process of generating and optimizing cases in a result-oriented feedback manner in FIG. 4, step 208-2 can be implemented in at least one of the following ways:

[0231] 208-2-1, when the server receives positive feedback information from the user on the reply content, it performs a positive feedback operation on the case corresponding to the intent information, the work execution plan, and the reply content generated through the case, wherein the positive feedback operation includes increasing the experience score of the case.

[0232] Specifically, when the server receives positive feedback information from the user on the reply content, it can locate the case corresponding to the reply content, i.e., locate the case corresponding to the intent information, the work execution plan and the reply content generated by the case. Then, the server can perform a positive feedback operation on these cases, mainly including increasing the experience score of the case. Among them, increasing the experience score of the case can improve the priority of the case in the future similar scene, so that the system is more inclined to use the case with higher experience score to generate the reply content.

[0233] 208-2-2, when the server receives positive feedback information from the user on the reply content, the intent information, the work execution plan and the reply content not generated by the case are added as a new case.

[0234] Specifically, when the server receives positive feedback information from the user on the reply content, if the reply content, the tool execution plan and the reply content are not generated by the case, but are regenerated by the large model based on the intent information, the server can add the newly generated intent information, the work execution plan and the reply content as a completely new case to the case library. In this way, the system can continuously learn and accumulate new knowledge and experience to cope with more diverse and complex user needs.

[0235] 208-2-3, when the server receives negative feedback information from the user on the reply content, the case corresponding to the intent information, the work execution plan and the reply content generated by the case is subjected to a negative feedback operation, wherein the negative feedback operation includes reducing the experience score of the case and / or deleting the case.

[0236] Specifically, when the server receives negative feedback information from the user on the reply content, it can locate the corresponding case and then perform a negative feedback operation on these cases, mainly including reducing the experience score of the case. In addition, in some cases, these cases can also be deleted. Among them, reducing the experience score of the case can reduce the probability of these cases being selected in the future, while deleting the case directly removes the potential errors or low-quality cases, thereby helping to improve the overall performance and accuracy of the system.

[0237] 208-2-4, when the server receives negative feedback information from the user on the reply content, the intent information, the work execution plan and the reply content not generated by the case are deleted.

[0238] Specifically, when the server receives negative feedback information from the user on the reply content, if the intent information, the tool execution plan and the reply content corresponding to the reply content are not generated by the case, the server can directly delete these intent information, the work execution plan and the reply content, thereby helping to maintain the cleanliness and efficiency of the case library and avoiding storing invalid or low-quality content.

[0239] The above-mentioned embodiments can improve the performance of the system and the user experience by dynamically optimizing and adjusting the cases in the experience library according to real-time feedback of the user. First, the above-mentioned method can more accurately identify and use high-quality cases to generate a reply by increasing the experience points of the cases through positive feedback operations, thereby improving the accuracy and reliability of the reply. At the same time, negative feedback operations can reduce or delete low-quality cases to reduce the probability of incorrect replies. Moreover, by adding new cases and deleting invalid cases, the system can continuously learn and accumulate new knowledge and experience to cope with more diverse and complex user needs, making the system more adaptable and flexible, thereby better meeting the individual needs of users. In addition, by optimizing the case library, the system can generate more accurate and useful replies, thereby improving the user experience. At the same time, the feedback of the user can be fully utilized to enhance the interactivity between the user and the system.

[0240] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data 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. In addition, the labels corresponding to the steps in the above-mentioned embodiments only serve to identify and do not limit the execution order of the steps. The execution order of the steps in each embodiment can be set according to the actual situation.

[0241] Further, as a specific implementation of the method shown in FIGS. 1 to 6, the embodiment of the present application provides a task-oriented dialogue device, as shown in FIG. 7, which comprises:

[0242] The dialogue information sending module 31 can be used to send the dialogue information in response to receiving the dialogue information initiated by the user.

[0243] The reply content receiving module 32 can be used to receive and display the reply content, wherein the generation process of the reply content comprises: determining the intention information of the user based on the dialogue information through a large model, generating a tool execution plan according to the intention information, executing the tool execution plan, obtaining a plan execution result, checking the plan execution result, and generating the reply content based on the plan execution result that passes the check.

[0244] Further, as a specific implementation of the method shown in FIGS. 1 to 6, the embodiment of the present application provides a task-oriented dialogue device, as shown in FIG. 8, which comprises:

[0245] The intention recognition module 41 can be used to determine the intention information of the user through a large model in response to receiving the dialogue information initiated by the user.

[0246] The planning module 42 is configured to generate a tool execution plan according to the intention information;

[0247] The calling execution module 43 is configured to execute the tool execution plan to obtain a plan execution result;

[0248] The checking module 44 is configured to check the plan execution result;

[0249] The content summarizing module 45 is configured to generate reply content based on the checked plan execution result.

[0250] It should be noted that other corresponding descriptions of the functions of the task-oriented dialogue device provided in the embodiments of the present application can refer to the corresponding descriptions in the methods of FIGS. 1 to 6, and will not be described here.

[0251] The embodiments of the present application also provide a computer device, which can be a personal computer, a server, a network device, etc. The computer device includes a bus, a processor, a memory, and a communication interface, and can also include an input / output interface and a display device. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The database of the computer device is configured to store location information. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement the steps in the method embodiments.

[0252] Those skilled in the art can understand that the structure of the computer device described above is only part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components, or combine certain components, or have a different component arrangement.

[0253] In one embodiment, a computer readable storage medium is provided, which can be non-volatile or volatile, and has a computer program stored thereon. The computer program is executed by the processor to implement the steps in the above method embodiments.

[0254] In one embodiment, a computer program product is provided, which includes a computer program. The computer program is executed by the processor to implement the steps in the above method embodiments.

[0255] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0256] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.

[0257] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.< / query> < / tools> < / tools> < / tools> < / query> < / query> < / tools>

Claims

1. A task-oriented dialog method, characterized by, The method comprises: The client sends the conversation information initiated by the user to the server in response to receiving the conversation information; The server determines the intention information of the user through a large model in response to receiving the conversation information, generates a tool execution plan according to the intention information, executes the tool execution plan to obtain a plan execution result, checks the plan execution result, and generates a reply content based on the plan execution result that passes the check, and sends the reply content to the client; The client receives and displays the reply content.

2. The method of claim 1, wherein, The server determines the intention information of the user through a large model in response to receiving the conversation information, comprising: The server acquires context information of the conversation information and preset application scenario information in response to receiving the conversation information; The server determines the intention information of the user based on the conversation information and the context information with the application scenario information as a constraint condition.

3. The method of claim 2, wherein, The server determines the intention information of the user based on the conversation information and the context information with the application scenario information as a constraint condition, comprising: The server rewrites the conversation information and the context information within the topic range constrained by the application scenario information to obtain at least one intention information of the user; and / or, The server retains information related to the application scenario information in the conversation information and the context information, and generates at least one intention information according to the topic of the retained content; and / or, The server retains time information and digital information in the conversation information and the context information in the intention information of the user; and / or, The server replaces the reference information in the conversation information and the context information with name information retained in the intention information of the user; and / or, The server deletes content related to the difference topic in the intention information when it is identified that the context information contains a difference topic different from the conversation information; and / or, The server determines the conversation information as the intention information of the user when it is judged that the conversation information and the context information are not within the topic range constrained by the application scenario information; and / or, The server searches at least one case in an intention information experience library based on the conversation information and the context information through a preset information retrieval model, and sets the case in a prompt template to determine the intention information of the user through the prompt template, wherein the information retrieval model comprises at least one of a sparse retrieval model, a dense vector retrieval model and a multi-vector retrieval model.

4. The method according to any one of claims 1 to 3, characterized in that, The intention information is generated through a pre-trained large model, and a pre-training method of the large model comprises: The server continues to pre-train a large model in a general field based on a sample data set of a preset field, wherein random noise is set in the sample data set, and sample user information is not included; The server performs parameter fine-tuning on the large model after continuing pre-training based on an intention recognition case of the preset field; The server generates the intent recognition information of the preset question in the preset field based on the fine-tuned large model, and iteratively updates the parameters of the large model based on the positive and negative feedback information of the intent recognition information through a reinforcement learning algorithm to obtain a pre-trained large model.

5. The method of claim 1, wherein, The server generates a tool execution plan according to the intent information, including: The server obtains context information and finds a plurality of candidate tools related to the intent information in a tool library according to the context information to generate a candidate tool list; The server selects at least one tool from the candidate tool list based on the intent information and performs permutation and combination on the selected tools to obtain the tool execution plan.

6. The method of claim 5, wherein, The server selects at least one tool from the candidate tool list based on the intent information, including: The server performs keyword matching in the candidate tool list based on the intent information to filter out at least one tool; and / or, The server selects a tool that is different from the tool of the previous round as the tool selected in the current round when it is determined that the intent information of the current round is the same as the intent information of the previous round; and / or, The server selects a tool that is different from the tool of the previous round as the tool selected in the current round when it is determined that the intent information of the current round is the same as the intent information of the previous round; and / or, The server selects a tool that is different from the tool of the previous round as the tool selected in the current round when it is determined that the intent information of the current round is the same as the intent information of the previous round; and / or, The server searches for at least one case in an execution plan experience library based on the intent information through a preset information retrieval model, and selects at least one tool from the candidate tool list based on the case, wherein the information retrieval model includes at least one of a sparse retrieval model, a dense vector retrieval model, and a multi-vector retrieval model; The server selects at least one tool from the candidate tool list based on the case, including: The server selects a tool in the case as the selected tool when the matching degree of the case and the intent information is greater than a preset threshold; and / or, The server sets the case in a prompt template when the matching degree of the case and the intent information is less than or equal to the preset threshold, so as to select at least one tool from the candidate tool list through the prompt template.

7. The method of claim 5, wherein, The server performs permutation and combination on the selected tools to obtain the tool execution plan, including: The server arranges the tools in sequence and / or in parallel based on the dependency relationship between the tool parameters of the selected tools; The server connects the tools arranged in sequence and / or in parallel through a preset operator to obtain the tool execution plan.

8. The method according to any one of claims 5 to 7, characterized in that, The tool execution plan is generated by a pre-trained large model, and the pre-training method of the large model includes: The server continues to pre-train a large model in a general field based on a sample data set of a preset field; The server fine-tunes the parameters of the large model after continuing pre-training based on tool calling cases of the preset field; The server converts the parameter weight of the fine-tuned large model from a floating-point number to an integer of a preset number of bits to obtain the pre-trained large model.

9. The method of claim 1, wherein, The server executes the tool execution plan to obtain a plan execution result, including: The server obtains context information and extracts tool parameters required by the tools in the tool execution plan from the dialogue information and the context information; The server serially calls and / or parallelly calls the tools according to the order of arrangement and combination of the tools in the tool execution plan based on the tool parameters to obtain the plan execution result; The server serially calls and / or parallelly calls the tools according to the order of arrangement and combination of the tools in the tool execution plan based on the tool parameters to obtain the plan execution result, including: The server serially calls and / or parallelly calls the tools according to the order of arrangement and combination of the tools in the tool execution plan based on the tool parameters to obtain the plan execution result.

10. The method of claim 9, wherein, The method further includes: When the server identifies that there is a missing tool parameter, the server reorders the execution of the tool with the missing tool parameter, extracts the missing tool parameter from the execution result of the executed tools; and / or, The server initiates inquiry information based on the missing tool parameter, and extracts the missing tool parameter from the reply information of the user to the inquiry information; and / or, The server extracts a time parameter from the tool parameters and modifies the relative time in the time parameter to absolute time; and / or, The server extracts an order parameter from the tool parameters and modifies the user expression in the order parameter to a standard expression in a preset field; and / or, The tools in the tool execution plan include at least one of a knowledge base search tool, an information query tool, a function setting tool, and an information analysis tool.

11. The method of claim 1, wherein, The server checks the plan execution result, including: The server obtains context information and checks the tools in the tool execution plan and the plan execution result based on the dialogue information and the context information; When the server determines that there is no missing tool in the tool execution plan and / or the plan execution result is complete, the server determines that the plan execution result passes the check; and / or, When the server determines that there is a missing tool in the tool execution plan and / or the plan execution result is incomplete, the server repeatedly performs the following processes until the modified plan execution result passes the check and / or the number of checks of the plan execution result reaches a preset threshold: the server generates feedback information based on the check result of the tool execution plan and the plan execution result, and modifies the tool execution plan based on the feedback information and the intent information, executes the modified tool execution plan to obtain a modified plan execution result; The server modifies the tool execution plan based on the feedback information and the intention information, including: the server selects at least one tool based on the feedback information and the intention information, and adds the selected tool to the tool execution plan to obtain a modified tool execution plan.

12. The method of claim 1, wherein, The server generates reply content based on the plan execution result that passes the check, including: The server obtains context information, and integrates content related to the dialogue information in the plan execution result based on the dialogue information and the context information to obtain the reply content; The server generates reply content based on the dialogue information and the context information, including: The server deletes content in the plan execution result that is not related to the dialogue information, integrates the remaining content in the plan execution result to obtain the reply content; and / or, The server obtains at least one link information based on the dialogue information, and adds the link information to the reply content; and / or, The server generates soothing information based on the dialogue information when it is identified that the dialogue information contains negative emotions, and adds the soothing information to the reply content; and / or, The server generates guidance information based on the dialogue information when it is identified that the dialogue information contains artificial service demand information, and adds the guidance information to the reply content; and / or, The server generates a refusal information based on the dialogue information when it is identified that the dialogue information does not match the preset field, and uses the refusal information as the reply content; and / or, The server integrates content related to the dialogue information in the plan execution result under the constraint conditions of a preset number of words and language style to generate structured reply content; and / or, The server searches for at least one case in a reply content experience library based on the intention information through a preset information retrieval model, and sets the case in a prompt template to determine the reply content through the prompt template, wherein the information retrieval model includes at least one of a sparse retrieval model, a dense vector retrieval model, and a multi-vector retrieval model.

13. The method of claim 1 or 12, wherein, The reply content is generated by a pre-trained large model, and the pre-training method of the large model includes: The server generates multiple types of information reply cases based on multiple preset dialogue scenarios in a preset field; The server performs parameter fine-tuning on a preset large model based on the multiple types of information reply cases to obtain a pre-trained large model, wherein the preset large model is a general-purpose field large model, or a large model obtained by further pre-training based on a preset field sample data set.

14. The method of claim 1, wherein, The method further includes: The server generates at least one type of case, and stores the case in a corresponding experience library according to the type of the case, wherein the case includes at least one of an intent recognition case, a tool calling case, and an information reply case; The generation method of the at least one type of case includes: receiving intent information, a work execution plan, and reply content generated when a user interacts with a large model, performing feedback operation on the intent information, the work execution plan, and the reply content based on first positive and negative feedback information of the user on the intent information, the work execution plan, and the reply content, to obtain the at least one case; and / or, receiving second positive and negative feedback information of the user on the reply content, and performing feedback operation on intent information, a work execution plan, and reply content generated in a reply content generation process based on the second positive and negative feedback information, to obtain the at least one case.

15. The method of claim 14, wherein, The server performs feedback operation on the intent information, the work execution plan, and the reply content based on the first positive and negative feedback information, to obtain at least one case, including: When the server receives positive feedback information of the user on the intent information, the work execution plan, and the reply content, the server performs positive feedback operation on a case corresponding to the intent information, the work execution plan, and the reply content corresponding to the positive feedback information, wherein the positive feedback operation includes increasing experience points of the case, and / or, adding a new case; and / or, When the server receives negative feedback information of the user on the intent information, the work execution plan, and the reply content, the server performs error correction processing on the intent information, the work execution plan, and the reply content corresponding to the negative feedback information, generates error correction information, and sets the error correction information in a prompt template, to regenerate intent information, a work execution plan, and reply content through the prompt template; The server regenerates intent information, a work execution plan, and reply content through the prompt template, including: When the server identifies that a case corresponding to intent information, a work execution plan, and reply content generated through the case is incorrect, the server replaces the incorrect case when regenerating the intent information, the work execution plan, and the reply content, and performs negative feedback operation on the incorrect case, wherein the negative feedback operation includes decreasing experience points of the case and / or deleting the case.

16. The method of claim 14, wherein, The server performs feedback operation on intent information, a work execution plan, and reply content generated in a reply content generation process based on the second positive and negative feedback information, to obtain at least one case, including: When the server receives positive feedback information of the user on the reply content, the server performs positive feedback operation on a case corresponding to intent information, a work execution plan, and reply content generated through the case, wherein the positive feedback operation includes increasing experience points of the case; and / or, When the server receives positive feedback information of the user on the reply content, the server adds intent information, a work execution plan, and reply content not generated through a case as a new case; and / or, The server performs a negative feedback operation on the case corresponding to the intention information, the work execution plan and the reply content generated by the case when receiving negative feedback information of the user on the reply content, wherein the negative feedback operation comprises reducing the experience score of the case and / or deleting the case; and / or, The server deletes the intention information, the work execution plan and the reply content not generated by the case when receiving negative feedback information of the user on the reply content.

17. A task-oriented dialog method, characterized by, The method comprises: In response to receiving conversation information initiated by a user, sending the conversation information; Receiving and displaying reply content, wherein the generation process of the reply content comprises: determining the intention information of the user based on the conversation information through a large model, generating a tool execution plan according to the intention information, executing the tool execution plan to obtain a plan execution result, checking the plan execution result, and generating the reply content based on the plan execution result that passes the check.

18. A task-oriented dialog method, characterized by, The method comprises: In response to receiving conversation information initiated by a user, determining the intention information of the user through a large model; Generating a tool execution plan according to the intention information; Executing the tool execution plan to obtain a plan execution result; Checking the plan execution result; Generating reply content based on the plan execution result that passes the check.

19. A storage medium having stored thereon a computer program, characterized in that The computer program, when executed by a processor, implements the method of any one of claims 1 to 18.

20. A computer device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein, The processor, when executing the computer program, implements the method of any one of claims 1 to 18.

Citation Information

Patent Citations

  • Multi-robot dialogue method and system for software-as-a-service platform

    CN117573834A

  • Information processing method and device based on large language model, storage medium and equipment

    CN118093813A

  • Task-based dialogue method, storage medium and computer equipment

    CN118377886A

  • Conversational systems and methods for robotic task identification using natural language

    US20210110822A1

Cited By

  • Code data migration method and system and electronic equipment

    CN122285077A