Task processing method, device and equipment
By defining an initial plan and optimizing the task processing flow, intelligent customer service robots can effectively handle user tasks, solving the problem that existing technologies can only answer questions but cannot process tasks, thus improving task completion rate and the quality of response information.
Patent Information
- Application Number
- CN202411052385.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2026-02-06
AI Technical Summary
Existing intelligent customer service robots can only answer questions raised by users, but cannot effectively handle users' tasks, lacking flexibility and efficiency.
By receiving tasks to be processed, an initial plan is determined based on the task and tool description information, including initial steps and required tools. The initial plan is executed and response information is generated. The task processing flow is optimized using mind trees and tool proxy technology. Candidate plans and tools with higher scores are selected to ensure task completion and output of high-quality responses.
It enables flexible processing of user input tasks, improves task completion rate and response quality, avoids erroneous output of incomplete tasks, and enhances the processing capabilities of intelligent customer service.
Smart Images

Figure CN121480682A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of natural language processing, and in particular to a task processing method, device and equipment. BACKGROUND
[0002] With the rapid development of information technology, the demand for customer service is increasing. In order to meet the demand for efficient and convenient service, intelligent customer service technology emerges as the times require.
[0003] Intelligent customer service technology can be applied to intelligent customer service robots for answering questions raised by users. At present, for the questions raised by users, intelligent customer service robots can use rule engines and machine learning algorithms for processing, and analyze the questions raised by users through pre-set rules and data training models to output answers. SUMMARY
[0004] The embodiments of the present application provide a task processing method, device and equipment, which can process a task input by a user.
[0005] In a first aspect, the embodiments of the present application provide a task processing method, comprising:
[0006] receiving an input task to be processed;
[0007] determining an initial plan for processing the task to be processed based on the task to be processed and tool description information, wherein the initial plan includes an initial step for processing the task to be processed and tools required by the initial plan;
[0008] executing the initial plan based on the initial step and the tools required by the initial plan to obtain an execution result corresponding to the initial plan;
[0009] determining response information of the task to be processed based on the execution result corresponding to the initial plan.
[0010] Through the above steps, the embodiments of the present application can determine the tools required by the initial plan based on the task to be processed and the tool description information, flexibly call the tools of the system to execute the initial plan, and then obtain the response information of the task to be processed, thereby realizing the processing of the task to be processed input by the user and solving the problem that the questions raised by the user can only be answered but cannot be processed.
[0011] In a possible implementation, the determining of the initial plan for processing the task to be processed based on the task to be processed and the tool description information comprises:
[0012] generating a first candidate plan set based on the task to be processed and the tool description information, wherein the first candidate plan set includes at least one candidate plan;
[0013] determining scores of the candidate plans in the first candidate plan set based on the candidate plan evaluation parameters;
[0014] determining the initial plan in the first candidate plan set based on the scores of the candidate plans in the first candidate plan set.
[0015] By the above steps, at least one candidate plan in the first candidate plan set is generated, and then the initial plan is determined in the first candidate plan set based on the scores of the candidate plans, so that the candidate plan with a higher score can be preferentially executed, and the efficiency and quality of the response information generation are improved.
[0016] In a possible implementation, the determining the response information of the to-be-processed task based on the execution result corresponding to the initial plan comprises:
[0017] determining whether the to-be-processed task is completed based on the execution result corresponding to the initial plan;
[0018] in a case where it is determined that the to-be-processed task is completed, determining first response information based on the to-be-processed task and the execution result corresponding to the initial plan;
[0019] in a case where it is determined that the to-be-processed task is not completed, determining second response information based on the to-be-processed task, the tool description information and the execution result corresponding to the initial plan.
[0020] By judging whether the to-be-processed task is completed, the response information of the to-be-processed task is determined based on the judgment result, so that the completion rate of the to-be-processed task can be improved, and the execution result corresponding to the initial plan in a case where the to-be-processed task is not completed is avoided from being output as the response information.
[0021] In a possible implementation, the determining the second response information based on the to-be-processed task, the tool description information and the execution result corresponding to the initial plan comprises:
[0022] performing a first operation, the first operation comprising: determining an i+1th plan for processing the to-be-processed task based on the to-be-processed task, the tool description information and the execution results corresponding to the first i plans respectively; executing the i+1th plan to obtain an execution result corresponding to the i+1th plan; i is initially 1, and i is a positive integer greater than or equal to 1;
[0023] in a case where it is determined that the to-be-processed task is not completed based on the execution results corresponding to the first i+1 plans respectively, updating i to i+1, and repeating the first operation;
[0024] In a case where it is determined that the to-be-processed task is completed based on the execution results of the previous i+1 plans respectively corresponding to the to-be-processed task, the second response information is determined based on the execution results of the previous i+1 plans respectively corresponding to the to-be-processed task.
[0025] By judging whether the to-be-processed task is completed, the response information of the to-be-processed task is determined based on the judgment result, so that the completion rate of the to-be-processed task can be improved, and the execution result of the previous i plans corresponding to the to-be-processed task in a case where the to-be-processed task is not completed is avoided from being output as the response information.
[0026] In a possible implementation, the determining the i+1th plan for processing the to-be-processed task based on the to-be-processed task, the tool description information, and the execution results of the previous i plans respectively corresponding to the to-be-processed task comprises:
[0027] The i+1th candidate plan set is generated based on the to-be-processed task, the tool description information, and the execution results of the previous i plans respectively corresponding to the to-be-processed task, and the i+1th candidate plan set comprises at least one candidate plan;
[0028] The score of each candidate plan in the i+1th candidate plan set is determined based on the candidate plan evaluation parameter.
[0029] The i+1th plan is determined in the i+1th candidate plan set based on the scores of the candidate plans in the i+1th candidate plan set.
[0030] Through the above steps, in a case where the to-be-processed task is not completed, the i+1th candidate plan set is generated based on the previous i plans, and the i+1th plan is selected in the i+1th candidate plan set based on the scores of the candidate plans, so that the candidate plan with a higher score can be preferentially executed, and the efficiency and quality of the response information generation are improved.
[0031] In a possible implementation, the executing the i+1th plan to obtain the execution result corresponding to the i+1th plan comprises:
[0032] The target tool for executing the i+1th plan and the input parameter of the target tool are determined based on the i+1th plan, the tool description information, the to-be-processed task, and the execution results of the previous i plans respectively corresponding to the to-be-processed task.
[0033] The i+1th plan is executed based on the target tool and the input parameter of the target tool to obtain the execution result corresponding to the i+1th plan.
[0034] Through the above steps, the target tool and the input parameter of the target tool can be selected for the i+1th plan, so that the i+1th plan can be effectively executed.
[0035] In a possible implementation, the determining the second response information based on the execution results corresponding to the first i+1 plans comprises:
[0036] performing a second operation, the second operation comprising: determining whether the target plan meets a quality requirement based on the execution result corresponding to the target plan; the target plan initially comprising the first i+1 plans, and the execution result corresponding to the target plan initially comprising the execution results corresponding to the first i+1 plans;
[0037] In a case where the target plan meets the quality requirement, determining the second response information based on the execution result corresponding to the target plan.
[0038] By the above steps, the target plan is subjected to quality evaluation, and the second response information is output in a case where the target plan meets the quality requirement, so that the quality of the response information is improved.
[0039] In a possible implementation, the method further comprises:
[0040] In a case where the target plan does not meet the quality requirement, updating the target plan to obtain an updated target plan;
[0041] repeating the second operation based on the execution result corresponding to the updated target plan.
[0042] By the above steps, the target plan is subjected to quality evaluation, and the target plan is updated in a case where the target plan does not meet the quality requirement, so that the execution result that does not meet the quality requirement is avoided from being output as the response information, and the quality of the response information is improved.
[0043] In a possible implementation, the updating the target plan to obtain the updated target plan comprises:
[0044] determining, in the candidate plan set corresponding to the jth plan, the candidate plan set corresponding to the jth plan, wherein the candidate plan set corresponding to the jth plan comprises an unexecuted candidate plan, and the j is a positive integer less than or equal to i+1;
[0045] determining, from the unexecuted candidate plans, a target candidate plan based on the scores of the unexecuted candidate plans;
[0046] updating the target plan based on the target candidate plan to obtain the updated target plan.
[0047] In the case that the target plan does not meet the quality requirement, the probability of successfully processing the to-be-processed task and the processing stability of the to-be-processed task can be improved by updating the target plan and continuously selecting a suitable candidate plan from the candidate plan set for execution.
[0048] In a possible implementation, the determining of the initial plan for processing the to-be-processed task based on the to-be-processed task and the tool description information comprises:
[0049] The first-level candidate node set in the thought tree is generated based on the to-be-processed task and the tool description information by the thought tree technology, and each candidate node in the first-level candidate node set has a corresponding candidate plan.
[0050] The score of each candidate node in the first-level candidate node set is determined based on the candidate plan evaluation parameter.
[0051] The target node at the first level is determined in the first-level candidate node set based on the score of each candidate node in the first-level candidate node set, and the candidate plan corresponding to the target node at the first level is determined as the initial plan.
[0052] At least one candidate node in the first-level candidate node set is generated by the thought tree technology, and then the target node at the first level is determined in the first-level candidate node set based on the score of each candidate node, and the candidate plan corresponding to the target node at the first level is determined as the initial plan, so that the candidate plan corresponding to the candidate node with a higher score can be preferentially executed, and the efficiency and quality of the response information generation can be improved.
[0053] In a possible implementation, the determining of the response information of the to-be-processed task based on the execution result corresponding to the initial plan comprises:
[0054] Whether the to-be-processed task has been completed is determined based on the execution result corresponding to the initial plan by the tool agent technology.
[0055] In the case that the to-be-processed task has been completed, the first response information is determined based on the to-be-processed task and the execution result corresponding to the initial plan by the discrimination technology.
[0056] In the case that the to-be-processed task has not been completed, the second response information is determined based on the to-be-processed task, the tool description information, and the execution result corresponding to the initial plan by the thought tree technology and the tool agent technology.
[0057] The tool agent technology is used to determine whether the to-be-processed task is completed, and the response information of the to-be-processed task is determined based on the determination result, so that the completion rate of the to-be-processed task can be improved, and the execution result corresponding to the initial plan in the case that the to-be-processed task is not completed is avoided to be output as the response information.
[0058] In a possible implementation, the second response information is determined based on the to-be-processed task, the tool description information and the execution result corresponding to each of the first i plans by the thinking tree technology and the tool agent technology, and the second response information includes:
[0059] The third operation includes: determining an (i+1)th plan for processing the to-be-processed task based on the to-be-processed task, the tool description information and the execution result corresponding to each of the first i plans by the thinking tree technology; and executing the (i+1)th plan by the tool agent technology to obtain an execution result corresponding to the (i+1)th plan; i is initially 1, and i is a positive integer greater than or equal to 1;
[0060] In a case that it is determined by the tool agent technology based on the execution result corresponding to each of the first i+1 plans that the to-be-processed task is not completed, i is updated to i+1, and the third operation is repeatedly executed;
[0061] In a case that it is determined by the tool agent technology based on the execution result corresponding to each of the first i+1 plans that the to-be-processed task is completed, the second response information is determined based on the execution result corresponding to each of the first i+1 plans by the discrimination technology.
[0062] The tool agent technology is used to determine whether the to-be-processed task is completed, and the response information of the to-be-processed task is determined based on the determination result, so that the completion rate of the to-be-processed task can be improved, and the execution result corresponding to the initial plan in the case that the to-be-processed task is not completed is avoided to be output as the response information.
[0063] In a possible implementation, the (i+1)th plan for processing the to-be-processed task is determined based on the to-be-processed task, the tool description information and the execution result corresponding to each of the first i plans by the thinking tree technology, and the (i+1)th plan includes:
[0064] The (i+1)th plan for processing the to-be-processed task is determined based on the to-be-processed task, the tool description information and the execution result corresponding to each of the first i plans by the thinking tree technology, and the (i+1)th plan includes:
[0065] The score of each candidate node in the (i+1)th level candidate node set is determined based on the candidate plan evaluation parameter.
[0066] determining a target node of the i+1th level from the candidate node set of the i+1th level based on the scores of the candidate nodes in the candidate node set of the i+1th level, and determining a candidate plan corresponding to the target node of the i+1th level as the i+1th plan.
[0067] Through the above steps, in the case that the to-be-processed task is not completed, the candidate node set of the i+1th level is generated based on the first i plans by the thinking tree technology, and the target node of the i+1th level is selected from the candidate node set of the i+1th level based on the scores of the candidate nodes, so that the candidate plan corresponding to the candidate node with a higher score can be preferentially executed, and the efficiency and quality of the generated response information are improved.
[0068] In a possible implementation, the executing the i+1th plan by the tool agent technology to obtain an execution result corresponding to the i+1th plan includes:
[0069] determining, by the tool agent technology, a target tool for executing the i+1th plan and an input parameter of the target tool based on the i+1th plan, the tool description information, the to-be-processed task, and the execution results corresponding to the first i plans.
[0070] executing, by the tool agent technology, the i+1th plan based on the target tool and the input parameter of the target tool to obtain the execution result corresponding to the i+1th plan.
[0071] Through the above steps, a suitable target tool and an input parameter of the target tool can be selected for the i+1th plan, so that the i+1th plan can be effectively executed.
[0072] In a possible implementation, the determining the second response information based on the execution results corresponding to the first i+1 plans by the discrimination technology includes:
[0073] performing a fourth operation, where the fourth operation includes: determining, by the discrimination technology, whether the target plan meets a quality requirement based on the to-be-processed task and an execution result corresponding to the target plan; the target plan initially includes the first i+1 plans, and the execution result corresponding to the target plan initially includes the execution results corresponding to the first i+1 plans;
[0074] determining the second response information based on the execution result corresponding to the target plan in a case that the target plan meets the quality requirement.
[0075] Through the above steps, the target plan is quality judged, and the second response information is output in a case where the target plan meets the quality requirement, so that the quality of the response information can be improved.
[0076] In a possible implementation, the method further includes:
[0077] In a case where the target plan does not meet the quality requirement, the target plan is updated through the thinking tree technology to obtain an updated target plan;
[0078] The fourth operation is repeatedly performed based on an execution result corresponding to the updated target plan through the judgment technology.
[0079] Through the above steps, the target plan is quality judged, and the target plan is updated in a case where the target plan does not meet the quality requirement, so that the execution result that does not meet the quality requirement can be avoided from being output as the response information, and the quality of the response information is improved.
[0080] In a second aspect, an embodiment of the present application provides a task processing apparatus, including:
[0081] A receiving unit configured to receive an inputted to-be-processed task;
[0082] A first processing unit configured to determine an initial plan for processing the to-be-processed task based on the to-be-processed task and tool description information, the initial plan including an initial step for processing the to-be-processed task and a tool required by the initial plan;
[0083] An execution unit configured to execute the initial plan based on the initial step and the tool required by the initial plan to obtain an execution result corresponding to the initial plan;
[0084] A second processing unit configured to determine response information of the to-be-processed task based on the execution result corresponding to the initial plan.
[0085] In a possible implementation, the first processing unit is specifically configured to:
[0086] Generate a first candidate plan set based on the to-be-processed task and the tool description information, the first candidate plan set including at least one candidate plan;
[0087] Determine a score of each candidate plan in the first candidate plan set based on a candidate plan evaluation parameter;
[0088] Determine the initial plan in the first candidate plan set based on the score of each candidate plan in the first candidate plan set.
[0089] In a possible implementation, the second processing unit is specifically configured to:
[0090] determine whether the to-be-processed task has been completed based on the execution result corresponding to the initial plan;
[0091] in a case where it is determined that the to-be-processed task has been completed, determine first response information based on the to-be-processed task and the execution result corresponding to the initial plan;
[0092] in a case where it is determined that the to-be-processed task has not been completed, determine second response information based on the to-be-processed task, the tool description information, and the execution result corresponding to the initial plan.
[0093] In a possible implementation, the second processing unit is specifically configured to:
[0094] perform a first operation, the first operation including: determining an i+1th plan for processing the to-be-processed task based on the to-be-processed task, the tool description information, and the execution result corresponding to each of the first i plans; executing the i+1th plan to obtain an execution result corresponding to the i+1th plan; i is initially 1, and i is a positive integer greater than or equal to 1;
[0095] in a case where it is determined that the to-be-processed task has not been completed based on the execution result corresponding to each of the first i+1 plans, updating i to i+1 and repeating the first operation;
[0096] in a case where it is determined that the to-be-processed task has been completed based on the execution result corresponding to each of the first i+1 plans, determining the second response information based on the execution result corresponding to each of the first i+1 plans.
[0097] In a possible implementation, the second processing unit is specifically configured to:
[0098] generating an i+1th candidate plan set based on the to-be-processed task, the tool description information, and the execution result corresponding to each of the first i plans, the i+1th candidate plan set including at least one candidate plan;
[0099] determining a score of each candidate plan in the i+1th candidate plan set based on a candidate plan evaluation parameter;
[0100] determining the i+1th plan in the i+1th candidate plan set based on the score of each candidate plan in the i+1th candidate plan set.
[0101] In a possible implementation, the second processing unit is specifically configured to:
[0102] determine a target tool for executing the i+1th plan and an input parameter of the target tool based on the i+1th plan, the tool description information, the to-be-processed task and the execution results corresponding to the first i plans respectively;
[0103] execute the i+1th plan based on the target tool and the input parameter of the target tool, to obtain an execution result corresponding to the i+1th plan.
[0104] In a possible implementation, the second processing unit is specifically configured to:
[0105] perform a second operation, the second operation including: determining whether the target plan meets a quality requirement based on the to-be-processed task and the execution result corresponding to the target plan; the target plan initially including the first i+1 plans, and the execution result corresponding to the target plan initially including the execution results corresponding to the first i+1 plans respectively;
[0106] in a case where the target plan meets the quality requirement, determining the second response information based on the execution result corresponding to the target plan.
[0107] In a possible implementation, the second processing unit is further configured to:
[0108] in a case where the target plan does not meet the quality requirement, updating the target plan to obtain an updated target plan;
[0109] repeating the second operation based on an execution result corresponding to the updated target plan.
[0110] In a possible implementation, the second processing unit is specifically configured to:
[0111] determining, in a candidate plan set corresponding to a jth plan, a target candidate plan set, there being an unexecuted candidate plan in the candidate plan set corresponding to the jth plan, the j being a positive integer less than or equal to i+1;
[0112] determining, in the unexecuted candidate plans, the target candidate plan based on scores of the unexecuted candidate plans respectively;
[0113] updating the target plan based on the target candidate plan to obtain the updated target plan.
[0114] In a possible implementation, the first processing unit is specifically configured to:
[0115] generate a first-level candidate node set in the thought tree based on the to-be-processed task and the tool description information, each candidate node in the first-level candidate node set having a corresponding candidate plan;
[0116] determine a score of each candidate node in the first-level candidate node set based on a candidate plan evaluation parameter;
[0117] determine a target node in the first-level candidate node set based on the scores of the candidate nodes in the first-level candidate node set, and determine a candidate plan corresponding to the target node in the first-level candidate node set as the initial plan.
[0118] In a possible implementation, the second processing unit is specifically configured to:
[0119] determine, based on the execution result corresponding to the initial plan, whether the to-be-processed task has been completed by using the tool agent technology;
[0120] determine first response information based on the to-be-processed task and the execution result corresponding to the initial plan by using the discrimination technology, in a case where it is determined that the to-be-processed task has been completed;
[0121] determine second response information based on the to-be-processed task, the tool description information, and the execution result corresponding to the initial plan by using the thought tree technology and the tool agent technology, in a case where it is determined that the to-be-processed task has not been completed.
[0122] In a possible implementation, the second processing unit is specifically configured to:
[0123] perform a third operation, the third operation including: determining an i+1th plan for processing the to-be-processed task based on the to-be-processed task, the tool description information, and execution results corresponding to the first i plans by using the thought tree technology; executing the i+1th plan by using the tool agent technology to obtain an execution result corresponding to the i+1th plan; i is initially 1, and i is a positive integer greater than or equal to 1;
[0124] in a case where it is determined that the to-be-processed task has not been completed based on the execution results corresponding to the first i+1 plans by using the tool agent technology, update i to i+1, and repeatedly perform the third operation;
[0125] in a case where it is determined that the to-be-processed task has been completed based on the execution results corresponding to the first i+1 plans by using the tool agent technology, determine the second response information based on the execution results corresponding to the first i+1 plans by using the discrimination technology.
[0126] In a possible implementation, the second processing unit is specifically configured to:
[0127] The thought tree technology is used to generate a candidate node set of an (i+1)th level based on the to-be-processed task, the tool description information and the execution result of each of the first i plans, each candidate node in the candidate node set of the (i+1)th level has a corresponding candidate plan;
[0128] The candidate plan evaluation parameter is used to determine a score of each candidate node in the candidate node set of the (i+1)th level;
[0129] The target node of the (i+1)th level is determined in the candidate node set of the (i+1)th level based on the score of each candidate node in the candidate node set of the (i+1)th level, and the candidate plan corresponding to the target node of the (i+1)th level is determined as the (i+1)th plan.
[0130] In a possible implementation, the second processing unit is specifically configured to:
[0131] The tool agent technology is used to determine a target tool for executing the (i+1)th plan and an input parameter of the target tool based on the (i+1)th plan, the tool description information, the to-be-processed task and the execution result of each of the first i plans.
[0132] The tool agent technology is used to execute the (i+1)th plan based on the target tool and the input parameter of the target tool, to obtain an execution result corresponding to the (i+1)th plan.
[0133] In a possible implementation, the second processing unit is specifically configured to:
[0134] The fourth operation includes: the discrimination technology is used to determine whether the target plan meets a quality requirement based on the to-be-processed task and the execution result corresponding to the target plan; the target plan initially includes the first i+1 plans, and the execution result corresponding to the target plan initially includes the execution result corresponding to each of the first i+1 plans;
[0135] In a case where the target plan meets the quality requirement, the second response information is determined based on the execution result corresponding to the target plan.
[0136] In a possible implementation, the second processing unit is further configured to:
[0137] In a case where the target plan does not meet the quality requirement, the thought tree technology is used to update the target plan to obtain an updated target plan.
[0138] By the discrimination technique, the fourth operation is repeatedly executed based on the updated execution result corresponding to the target plan.
[0139] In a third aspect, an embodiment of the present application provides a task processing device, comprising at least one processor and a memory.
[0140] The memory stores computer execution instructions.
[0141] The at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the task processing method according to any one of the first aspect.
[0142] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium stores computer execution instructions, and the computer execution instructions are used to implement the task processing method according to any one of the first aspect when executed by a controller.
[0143] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising a computer program, and the computer program is used to implement the task processing method according to any one of the first aspect when executed by a controller.
[0144] The task processing method, device and equipment provided by the embodiments of the present application first receive an inputted to-be-processed task, and determine an initial plan for processing the to-be-processed task based on the to-be-processed task and tool description information, wherein the initial plan comprises an initial step for processing the to-be-processed task and tools required by the initial plan, then execute the initial plan based on the initial step and the tools required by the initial plan, to obtain an execution result corresponding to the initial plan, and finally determine response information of the to-be-processed task based on the execution result corresponding to the initial plan. The scheme of the embodiments of the present application can determine the tools required by the initial plan in combination with the tool description information for the to-be-processed task, flexibly call the tools of the system to execute the initial plan, and then obtain the response information of the to-be-processed task, so as to realize the processing of the to-be-processed task inputted by the user, and solve the problem that the current system can only answer the questions raised by the user but cannot process the tasks. BRIEF DESCRIPTION OF DRAWINGS
[0145] In order to more clearly illustrate the technical solutions in the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0146] Figure 1 An applicable application scenario schematic diagram is provided for the embodiments of the present application.
[0147] Figure 2 A flowchart of a task processing method provided for an embodiment of the present application;
[0148] Figure 3 A schematic diagram of determining an initial plan provided for an embodiment of the present application;
[0149] Figure 4 A flowchart of a task processing method provided for an embodiment of the present application;
[0150] Figure 5 A flowchart of determining response information of a task to be processed provided for an embodiment of the present application;
[0151] Figure 6 A flowchart of determining response information provided for an embodiment of the present application Figure 1 ;
[0152] Figure 7 A tool calling flow and a large language model inference schematic diagram provided for an embodiment of the present application;
[0153] Figure 8 A flowchart of determining response information provided for an embodiment of the present application Figure 2 ;
[0154] Figure 9 A schematic diagram of updating a target plan provided for an embodiment of the present application;
[0155] Figure 10 A structural schematic of a task processing apparatus provided for an embodiment of the present application Figure 1 ;
[0156] Figure 11 A structural schematic of a task processing device provided for an embodiment of the present application Figure 2 .
[0157] The specific embodiments of the present application have been shown through the above-described drawings, and will be described in more detail hereinafter. These drawings and the written description are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0158] The exemplary embodiments will be described in detail herein below with reference to the drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments are not meant to represent all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the appended claims.
[0159] It should be noted that in this document, the terms "comprising", "including", or any other variant thereof are intended to cover a non-exclusive inclusion, such that processes, methods, articles, or apparatuses that comprise a list of elements are not limited to those elements, but can also include other elements not expressly listed or inherent to such processes, methods, articles, or apparatuses. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0160] With the rapid development of information technology, the demand for customer service is increasing. Because manual customer service has problems such as low solving efficiency, high labor cost, long training period, and inability to provide 24-hour service, it has been unable to meet the efficient and convenient service needs of modern users. Therefore, intelligent customer service technology has emerged as the times require.
[0161] Intelligent customer service technology is mainly applied to intelligent customer service robots. After the user inputs a question, the intelligent customer service robot can analyze and process the input question and output the corresponding answer. At present, there are mainly two ways for the intelligent customer service robot to analyze and process the input question. One way is to analyze and process the question raised by the user through a pre-set rule and data training model. This way generates answers that are too fixed and have low flexibility, and cannot accurately answer when new types of questions appear. The other way is to use large-scale pre-training language models and document knowledge graph construction technology to retrieve relevant content from documents and generate answers for the question raised by the user. This way is limited by the accuracy of retrieval and the amount of data, and is prone to answering irrelevant questions, and has low flexibility.
[0162] Based on this, the embodiment of the present application provides a task processing method to realize the processing of the task input by the user. The scheme of the embodiment of the present application will be introduced below in combination with the drawings.
[0163] First, the application scenario of the embodiment of the present application will be introduced. Figure 1 The application scenario of the embodiment of the present application will be introduced.
[0164] Figure 1 An application scenario suitable for the embodiment of the present application is shown in FIG. 1. Figure 1 As shown in FIG. 1, the application scenario suitable for the embodiment of the present application includes a client 11 and a server 12. The client 11 and the server 12 can interact with each other.
[0165] The user A can input a to-be-processed task through the client 11, and then the client 11 sends the to-be-processed task input by the user A to the server 12. The server 12 processes the to-be-processed task, obtains the answer information, and outputs the answer information through the client 11.
[0166] It should be noted that the client 11 and the server 12 can be two independent devices, or can belong to two different components in the same device, and the embodiments of the present application do not limit this. For example, the client 11 and the server 12 can belong to two components of an intelligent customer service robot, wherein the client 11 belongs to an input and output component of the intelligent customer service robot, is used to receive a to-be-processed task input by the user A, and output response information, and the server 12 belongs to a processing component of the intelligent customer service robot, is used to analyze and process the to-be-processed task to obtain the response information.
[0167] In Figure 1 Based on the application scenario of the example, the scheme of the embodiments of the present application is introduced as follows. Figure 2 The scheme of the embodiments of the present application is introduced as follows.
[0168] Figure 2 The flowchart of the task processing method provided by the embodiments of the present application is shown in FIG. 1, and the method comprises the following steps. Figure 2 The method comprises the following steps.
[0169] S21, receiving an input to-be-processed task.
[0170] The execution subject of the embodiments of the present application can be a server, a processor, a microprocessor or the like component with data processing function, or can be a device integrated with the server, the processor, the microprocessor or the like component, such as an electronic device. The embodiments of the present application do not limit the execution subject, and any device with data processing function can be used. In the following embodiments, the execution subject is taken as an example of the server.
[0171] The server receives the to-be-processed task, wherein the to-be-processed task can be input by the user in the form of voice, or can be input by the user through a keyboard, a mouse, a client or the like device, and the embodiments of the present application do not limit this.
[0172] The to-be-processed task can belong to different types. For example, the to-be-processed task can be a question input by the user, and the server needs to answer the question; for example, the to-be-processed task can be an operation expected to be performed by the user, and the server needs to perform the corresponding operation based on the to-be-processed task, and the like.
[0173] S22, determining an initial plan for processing the to-be-processed task based on the to-be-processed task and tool description information, wherein the initial plan comprises an initial step for processing the to-be-processed task and a tool required by the initial plan.
[0174] The tool description information refers to information for describing each tool. A plurality of different tools are pre-stored in the system, different tools have different functions and different use modes, and therefore the corresponding tool description information is different.
[0175] The tool description information may include, for example but not limited to, one or more of the information for describing the name, function, usage, input parameter, output parameter, type of the tool, etc. of the tool.
[0176] Taking the tool as a WiFi configuration tool for example, the name of the tool is WiFi configuration tool, the function of the tool is to create a service set identifier (SSID) signal through an access point (AP) device, the input parameter is the name and password of the created WiFi, the usage is to input the configured WiFi name and password through an API interface after the tool is invoked, and the output is information about whether the WiFi creation is successful. These information can all be used as the tool description information of the created engineering tool.
[0177] Taking the tool as a user tool for example, the name of the tool is user tool, the function of the tool is to ask the user when the user information is not clear, the input parameter is a question for asking, the usage is that the client outputs the question for asking to the user after the tool is invoked, and the user outputs the answer to the system as the return information of the user tool after answering the question, and the output parameter is the answer of the user. These information can all be used as the tool description information of the user tool.
[0178] Taking the tool as an expert tool for example, the name of the tool is expert tool, the function of the tool is to ask for help from a manual customer service personnel when the server cannot solve the related problem, the input parameter is a question for asking for help, the usage is to send the question to the manual customer service in the background after the tool is invoked, and the manual customer service returns the solution to the system after solving the problem, and the output parameter is the solution. These information can all be used as the tool description information of the expert tool.
[0179] In the above embodiment, the tool description information is introduced by taking the tool as the WiFi configuration tool, the user tool and the expert tool. It should be noted that other types of tools can also be preset in the system, so that the corresponding tool description information is also included.
[0180] After receiving the to-be-processed task, the server determines an initial plan based on the to-be-processed task and the tool description information, and the initial plan includes an initial step and tools required by the initial plan.
[0181] In a possible implementation, the server can parse the to-be-processed task, determine the initial step required for processing the to-be-processed task, and then determine the tools required for executing the initial step in combination with the tool description information, so as to determine the tools required by the initial plan.
[0182] In a possible implementation, the server can also convert the to-be-processed task and the tool description information into a corresponding prompt, and then input the corresponding prompt into the large language model to output an initial plan for processing the to-be-processed task by the large language model.
[0183] For example, the system preconfigured tools include tool A (WiFi configuration tool) and tool B (user tool) for the to-be-processed task of "help me start networking", and the prompt can be, for example:
[0184] "to-be-processed task: help me start networking;
[0185] Now there are system preconfigured tool A and tool B;
[0186] The tool description information of tool A is: name of the tool-WiFi configuration tool; function-creating SSID signal through AP device; input parameter-creating name and password of WiFi; usage-after calling, input the configured WiFi name, password and the like through API interface; output-information about whether the WiFi creation is successful;
[0187] The tool description information of tool B is: name of the tool-user tool; function-asking the user when the user information is unclear; input parameter-a question for asking; usage-after calling, the client outputs the question for asking to the user, and the user's answer is output to the system as the return information of the user tool; output parameter-answer of the user;
[0188] Please generate an initial plan for the to-be-processed task based on the above information.
[0189] In a possible implementation, the server can also convert the to-be-processed task and the tool description information into a corresponding prompt, and then input the corresponding prompt into the large language model to output an initial plan for processing the to-be-processed task by the large language model.
[0190] The process can be referred to Figure 3 for an example. Figure 3 An illustrative diagram for determining an initial plan provided by an embodiment of the present application is shown in Figure 3 , the to-be-processed task is "help me start networking", and based on the to-be-processed task and the tool description information, a corresponding prompt is obtained (which can be referred to Figure 3An example of the prompt is shown in FIG. 6, and the prompt is input into the large language model. The large language model generates a first candidate plan set and scores of the candidate plans according to the prompt.
[0191] For example, the system preconfigured tools include tool A (a WiFi configuration tool) and tool B (a user tool) for the to-be-processed task of "help me start networking", and the prompt words can be, for example:
[0192] "to-be-processed task: help me start networking;
[0193] Now there are system preconfigured tool A and tool B;
[0194] The tool description information of tool A is: name of the tool-WiFi configuration tool; function-creating SSID signal through AP device; input parameter-creating name and password of WiFi; usage-after calling, input the configured WiFi name and password through API interface; output-information about whether the WiFi creation is successful;
[0195] The tool description information of tool B is: name of the tool-user tool; function-asking the user when the user information is unclear; input parameter-a question for asking; usage-after calling, the client outputs the question for asking to the user, and the answer of the user is output to the system as the return information of the user tool; output parameter-answer of the user;
[0196] Based on the above information, generate a first candidate plan set, and generate scores of the candidate plans in the first candidate plan set from the aspects of feasibility, resource utilization, and efficiency."
[0197] In the embodiments of the present application, the first candidate plan set can be generated by initializing the thinking tree. As shown in FIG. 7, after obtaining the prompt based on the to-be-processed task and the tool description information, the first candidate plan set is obtained through processing of the large language model. The first candidate plan set includes plan A, plan B, and plan C, and the three plans correspond to the three initial nodes of the thinking tree. Further, the large language model can also output the scores of the three plans, as shown in FIG. 8. The score of plan A is 4, the score of plan B is 9, and the score of plan C is 2. Then, the server determines plan B with the highest score as the initial plan. Figure 3 Figure 3
[0198] S23, executing the initial plan based on the initial step and the tools required by the initial plan, to obtain an execution result corresponding to the initial plan.
[0199] After obtaining the initial step and the tool required by the initial plan, the server can call the tool required by the initial plan based on the initial step, execute the initial plan, and obtain the corresponding execution result.
[0200] For example, the server can determine the output parameter of the tool required by the initial plan based on the initial step, the name of the tool, and other information, then call the tool based on the name of the tool and the output parameter, execute the initial plan, and obtain the execution result corresponding to the initial plan.
[0201] For example, the server can convert the tool description information of the tool required by the initial plan and the initial step into a corresponding prompt, then input the corresponding prompt into the large language model, output the called tool name and input parameter by the large language model, execute the initial plan through the API interface, and obtain the execution result of the tool, thereby obtaining the execution result corresponding to the initial plan.
[0202] Taking the task to be processed as "help me start networking", the initial plan as creating a project interface, and the tool required as tool A (WiFi configuration tool) as an example, the prompt word can be, for example:
[0203] "Task to be processed: help me start networking;
[0204] The tool description information of tool A is: the name of the tool-WiFi configuration tool; function-creating SSID signal through AP device; input parameter-creating the name and password of WiFi; usage-after calling, input the configured WiFi name, password, etc. through the API interface; output-information about whether the WiFi creation is successful;
[0205] Initial plan: create a project interface;
[0206] Please output the called tool name and input parameter based on the above information."
[0207] S24, based on the execution result corresponding to the initial plan, determine the response information of the task to be processed.
[0208] After obtaining the execution result corresponding to the initial plan, the server can directly determine the execution result corresponding to the initial plan as the response information of the task to be processed, and output the response information. The server can also determine whether the task to be processed has been completed based on the execution result corresponding to the initial plan, if it is determined that the task to be processed has been completed, convert the execution result corresponding to the initial plan and the task to be processed into a corresponding prompt, then input the corresponding prompt into the large language model, output the quality evaluation result by the large language model, and the quality evaluation result is used to indicate whether the initial plan meets the quality requirements, i.e. whether the execution result corresponding to the initial plan can solve the task to be processed.
[0209] Taking the pending task as "Help me set up the network" and the initial plan as creating a project interface as an example, the prompt message could be something like:
[0210] "Pending task: Help me set up the network at the start;"
[0211] The execution result corresponding to the initial plan is: Project interface successfully created;
[0212] Based on the information above, please output the quality assessment result in the format True / False (choose one).
[0213] Optionally, the quality assessment result can be indicated by the field "True" or "False". "True" indicates that the initial plan meets the quality requirements, meaning that the execution result of the initial plan can resolve the task to be processed; "False" indicates that the initial plan does not meet the quality requirements, meaning that the execution result of the initial plan cannot resolve the task to be processed. Then, combining the quality assessment result and the execution result of the initial plan, the response information for the task to be processed is determined and output.
[0214] The task processing method provided in this application first receives an input task to be processed, and then determines an initial plan for processing the task based on the task and tool description information. The initial plan includes initial steps for processing the task and the tools required by the initial plan. The initial plan is then executed based on the initial steps and the required tools to obtain the corresponding execution result. Finally, the response information for the task is determined based on the execution result. This solution, by combining the tool description information with the task description, can determine the tools required for the initial plan, flexibly invoke system tools to execute the initial plan, and thus obtain the response information for the task. This achieves the processing of user-input tasks, solving the current problem that it can only answer user questions but cannot perform task processing.
[0215] Based on any of the above embodiments, the solutions of the embodiments of this application will be further described below with reference to the accompanying drawings.
[0216] First, combine Figure 4 The overall process framework of the solution in the embodiments of this application is introduced.
[0217] Figure 4 The task processing flowchart provided for the embodiments of this application is as follows: Figure 4 As shown, the system first receives the input task to be processed, and then initializes the agent tool. The process of initializing the agent tool involves obtaining the tool description information of the various pre-set tools in the system.
[0218] Then, the to-be-processed task and the tool description information are input to the thinking tree decision generation module. The thinking tree decision generation module represents the solution process of the to-be-processed task as a tree, each node in the thinking tree represents a part of the solution, and the thinking tree decision generation module implements the processing of the to-be-processed task by maintaining the thinking tree and searching for different solutions on the thinking tree.
[0219] As shown in Figure 4 , the processing process of the thinking tree decision generation module generally includes outputting a plurality of candidate plans, evaluating the plurality of candidate plans, growing the thinking tree, and outputting a to-be-executed plan.
[0220] After the thinking tree decision generation module outputs the to-be-executed plan, the to-be-executed plan is input to a reason and act (ReAct) tool agent module (also referred to as a tool agent module). The processing process of the ReAct tool agent module generally includes thinking about the to-be-executed plan, calling a tool to execute the to-be-executed plan, and outputting an execution result.
[0221] Initially, the thinking tree decision generation module can generate a first-level candidate node set in a thinking tree based on the to-be-processed task and the tool description information by using a thinking tree technique. The first-level candidate node set includes a plurality of candidate nodes, and each node corresponds to a candidate plan. For example Figure 3 The three nodes in Figure 3 belong to the plurality of candidate nodes in the first-level candidate node set in the thinking tree, and the plans corresponding to the three nodes are plan A, plan B, and plan C, respectively.
[0222] After generating the first-level candidate node set, the thinking tree decision generation module determines the scores of the candidate nodes in the first-level candidate node set based on candidate plan evaluation parameters.
[0223] The candidate plan evaluation parameters are used to indicate the criteria for scoring the candidate plans, and accordingly, the candidate plan evaluation parameters can be scores under the scoring criteria dimensions. The criteria for scoring can include, for example, the feasibility, efficiency, and resource utilization of the candidate plans, and the scores under the scoring criteria dimensions can include, for example, the feasibility scores, efficiency scores, and resource utilization scores of the candidate plans, and so on. For each candidate node in the first-level candidate node set, the thinking tree decision generation module can obtain the score of the candidate node based on the scores of the candidate plan corresponding to the candidate node under at least one scoring criteria dimension, wherein the scores under at least one scoring criteria dimension can include at least one of the feasibility scores, the efficiency scores, and the resource utilization scores.
[0224] Then, the thought tree decision generation module determines a target node of the first level in the candidate node set of the first level based on the scores of the candidate nodes in the candidate node set of the first level, and determines a candidate plan corresponding to the target node of the first level as an initial plan.
[0225] After determining the initial plan, the thought tree decision generation module inputs the initial plan to the ReAct tool agent module, and the ReAct tool agent module executes the initial plan through tool agent technology to obtain an execution result corresponding to the initial plan. Specifically, the ReAct tool agent module can determine a tool for executing the initial plan and input parameters of the tool based on the initial plan, tool description information, and the to-be-processed task through tool agent technology. Then, the ReAct tool agent module executes the initial plan based on the tool and the corresponding input parameters through tool agent technology to obtain the execution result corresponding to the initial plan.
[0226] After obtaining the execution result corresponding to the initial plan, the ReAct tool agent module determines whether the to-be-processed task has been completed based on the execution result corresponding to the initial plan through tool agent technology. The judgment of the ReAct tool agent module on the execution result corresponding to the initial plan involves judging the completeness of the execution of the to-be-processed task, such as Figure 4 as shown, that is, judging whether the to-be-processed task is ended (judgment of the ReAct tool agent module). Specifically, the ReAct tool agent module can convert the execution result corresponding to the initial plan and the to-be-processed task into corresponding prompts, and then input the corresponding prompts into a large language model to output a judgment result indicating whether the to-be-processed task has been completed.
[0227] In a case where it is determined that the to-be-processed task has been completed, the ReAct tool agent module sends the to-be-processed task and the execution result corresponding to the initial plan to the judgment module, and the judgment module determines first response information based on the to-be-processed task and the execution result corresponding to the initial plan through judgment technology.
[0228] Specifically, the judgment module can determine whether the initial plan meets quality requirements based on the to-be-processed task and the execution result corresponding to the initial plan through judgment technology, such as Figure 4 as shown, that is, judging whether the user's question is solved (judgment of the judgment module). If yes, the execution result corresponding to the initial plan can be determined as the first response information, such as Figure 4If yes, it can be determined that the final answer can be found. If no, it is first determined whether there is an untraversed node. At present, there is a candidate node in the candidate node set of the first level in the thought tree. If there is a candidate node that has not been traversed in the candidate node set of the first level (i.e., a candidate plan that has not been executed), a thought tree pruning operation can be performed. Then, the quality evaluation result can be sent by the judgment module to the thought tree decision generation module. The thought tree decision generation module reselects a candidate node as an updated target node of the first level according to the scores of the candidate nodes in the candidate node set of the first level by the thought tree technology, and determines the candidate plan corresponding to the updated target node of the first level as an updated initial plan. The above steps are repeated based on the updated initial plan. If there is no candidate node that has not been traversed, it can be determined that the answer cannot be found.
[0229] In the case where it is determined that the to-be-processed task is not completed, the second response information is determined based on the to-be-processed task, the tool description information, and the execution results corresponding to the initial plan by the thought tree technology and the tool agent technology.
[0230] Specifically, a third operation is performed, which includes: the thought tree decision generation module determines an (i+1)th plan for processing the to-be-processed task based on the to-be-processed task, the tool description information, and the execution results corresponding to the first i plans by the thought tree technology, and sends the (i+1)th plan to the ReAct tool agent module; the ReAct tool agent module executes the (i+1)th plan by the tool agent technology to obtain an execution result corresponding to the (i+1)th plan; i is initially 1, and i is a positive integer greater than or equal to 1.
[0231] The process of determining the (i+1)th plan by the thought tree decision generation module includes: first, the thought tree decision generation module generates a candidate node set of the (i+1)th level based on the to-be-processed task, the tool description information, and the execution results corresponding to the first i plans by the thought tree technology. Each candidate node in the candidate node set of the (i+1)th level has a corresponding candidate plan. Then, the thought tree decision generation module determines the scores of the candidate nodes in the candidate node set of the (i+1)th level based on the candidate plan evaluation parameters. Finally, the thought tree decision generation module determines a target node of the (i+1)th level in the candidate node set of the (i+1)th level based on the scores of the candidate nodes in the candidate node set of the (i+1)th level, and determines the candidate plan corresponding to the target node of the (i+1)th level as the (i+1)th plan.
[0232] The ReAct tool agent module executes the process of the i+1th plan through tool agent technology. First, the target tool for executing the i+1th plan and the input parameters of the target tool are determined based on the i+1th plan, tool description information, the to-be-processed task, and the execution results of the first i plans respectively through tool agent technology. Then, the i+1th plan is executed based on the target tool and the input parameters of the target tool through tool agent technology to obtain the execution result corresponding to the i+1th plan.
[0233] After the ReAct tool agent module executes the i+1th plan and obtains the execution result corresponding to the i+1th plan, the ReAct tool agent module determines whether to end the to-be-processed task through tool agent technology, that is, whether the to-be-processed task is completed based on the execution results of the first i+1 plans respectively. As shown in Figure 4 , that is, whether to end the to-be-processed task (ReAct tool agent module discrimination). Specifically, the ReAct tool agent module can convert the execution results of the first i+1 plans respectively and the to-be-processed task into corresponding prompts, and then input the corresponding prompts into the large language model to output a judgment result indicating whether the to-be-processed task has been completed.
[0234] In the case that the ReAct tool agent module determines that the to-be-processed task is not completed based on the execution results of the first i+1 plans respectively through tool agent technology, the ReAct tool agent module sends the execution result corresponding to the i+1th plan to the thought tree decision generation module and updates i to i+1; the third operation is repeated. As shown in Figure 4 , that is, in the case that the to-be-processed task is not completed, the growth of the thought tree needs to be performed by the thought tree decision generation module to generate a candidate node set of the next level, and the above steps are repeated.
[0235] In the case that the ReAct tool agent module determines that the to-be-processed task is completed based on the execution results of the first i+1 plans respectively through tool agent technology, the ReAct tool agent module sends the execution results of the first i+1 plans respectively to the discrimination module; the discrimination module determines the second response information based on the execution results of the first i+1 plans respectively through discrimination technology. As shown in Figure 4 , in the case that the to-be-processed task is completed, whether the user's question is solved is determined by the discrimination module.
[0236] Specifically, the discrimination module performs a fourth operation, and the fourth operation includes: determining whether the target plan meets the quality requirement based on the to-be-processed task and the execution result corresponding to the target plan through discrimination technology; the target plan initially includes the first i+1 plans, and the execution result corresponding to the target plan initially includes the execution results of the first i+1 plans respectively.
[0237] In the case that the target plan meets the quality requirement, the discrimination module determines the second response information based on the execution result corresponding to the target plan. As shown in Figure 4 If the user's question is solved, it can be determined that the final answer can be found.
[0238] In the case that the target plan does not meet the quality requirement, the discrimination module sends the target plan to the thought tree decision generation module; the thought tree decision generation module updates the target plan through the thought tree technology to obtain an updated target plan, and sends the updated target plan to the discrimination module; the discrimination module repeatedly performs the fourth operation based on the execution result corresponding to the updated target plan through the discrimination technology. As shown in Figure 4 , it is first judged whether there is a node that has not been traversed. At present, there are candidate nodes in the candidate node set of i+1 levels in the thought tree, as long as there is a candidate node that has not been traversed (i.e., a candidate plan that has not been executed) in the candidate node set of i+1 levels, the thought tree pruning operation can be performed, and then the discrimination module can send the quality evaluation result to the thought tree decision generation module, the thought tree decision generation module reselects a candidate node according to the scores of the candidate nodes in the candidate node set of i+1 levels, updates the target plan, and repeatedly performs the above steps based on the updated target plan. If there is no candidate node that has not been traversed, it can be determined that the answer cannot be found.
[0239] The thought tree pruning process can refer to the example of Figure 4 , first pruning, i.e., deleting the failed nodes in the thought tree. In the embodiment of the present application, if the discrimination module judges that the target plan (i.e., the first i+1 plan) does not meet the quality requirement after executing the i+1 plan, the node corresponding to the i+1 plan is the failed node in the thought tree. Then, starting from the last level node in the thought tree, a new plan is output. Specifically, it is judged whether the search is completed (i.e., the search of all levels of nodes is completed), if yes, it is determined that the search cannot continue and the answer cannot be found; if not, the k-th level node is searched, it is judged whether there is a node that has not been traversed in the k-th level node in the thought tree, and k is initially M, M is the number of levels included in the thought tree, and M is a positive integer.
[0240] If there is no node that has not been traversed in the k-th level node in the thought tree, k is updated to k-1, and the pruning and searching of the k-th level node are continued; if there is a node that has not been traversed in the k-th level node, the plan corresponding to the node that has not been traversed is output in the k-th level node that has not been traversed.
[0241] Then, the plan corresponding to the untraversed node is input into the thought tree decision generation module to update the thought tree, and the plan output and execution are continued by the thought tree decision generation module and the ReAct tool agent module. For details, refer to the related description above.
[0242] As shown in Figure 4 , the scheme of the embodiment of the application introduces the thought tree technology on the ReAct framework, combines plan backtracking, multi-path exploration, dynamic adjustment and optimization, multi-tool collaborative work, and feedback-based error correction mechanism, and can significantly improve the flexibility, accuracy, and stability of the intelligent customer service system response.
[0243] The following further introduces the scheme of the embodiment of the application under the flow framework of the example. Figure 5
[0244] Figure 5 The flowchart for determining the response information of the to-be-processed task provided by the embodiment of the application is shown in Figure 3 , and includes:
[0245] S51, determining whether the to-be-processed task has been completed based on the execution result corresponding to the initial plan.
[0246] S51 involves judging the completeness of the execution of the to-be-processed task. For example, completing the to-be-processed task requires three steps of A, B, and C, the initial plan only completes the A step, and the execution result of the A step is obtained, then it can be determined that the to-be-processed task is not completed; for example, completing the to-be-processed task only requires one A step, the initial plan completes the A step, and the execution result of the A step is obtained, according to the to-be-processed task and the execution result of the A step, it can be determined that the to-be-processed task has been completed. Then, the large language model outputs the final response information based on the execution result.
[0247] In one possible implementation, the server can convert the execution result corresponding to the initial plan and the to-be-processed task into a corresponding prompt, and then input the corresponding prompt into the large language model to output a judgment result by the large language model, the judgment result indicating whether the to-be-processed task has been completed.
[0248] Taking the to-be-processed task as “help me start networking”, the initial plan as “to start networking, need to create a project first”, and the execution result corresponding to the initial plan as “the creation of the project has been completed” as an example, the prompt input into the large language model may be, for example:
[0249] “to-be-processed task: help me start networking;
[0250] Execution result corresponding to the initial plan: the creation of the project has been completed;
[0251] Please determine whether the to-be-processed task has been completed.
[0252] Then, if the large language model outputs that the to-be-processed task has not been completed, the server can determine that the to-be-processed task has not been completed.
[0253] S52, in a case where it is determined that the to-be-processed task has been completed, determining first response information based on an execution result corresponding to the to-be-processed task and the initial plan.
[0254] In a possible implementation, the execution result corresponding to the initial plan can be directly determined as the first response information.
[0255] In a possible implementation, the execution result corresponding to the initial plan can be quality evaluated based on the to-be-processed task, to determine whether the initial plan meets quality requirements. If the initial plan meets the quality requirements, the execution result corresponding to the initial plan is determined as the first response information. If the initial plan does not meet the quality requirements, a new initial plan can be selected from the first candidate plan set, the new initial plan is executed, and the first response information is determined based on an execution result corresponding to the new initial plan. For example Figure 6 In the example, plans A, B, and C are generated in advance, plan B is determined as the initial plan and executed because plan B has the highest score. If plan B does not meet the quality requirements, the server can determine plan A as a new initial plan, execute plan A, obtain an execution result corresponding to plan A, and determine the first response information based on the execution result corresponding to plan A.
[0256] It should be noted that if the to-be-processed task is determined to be not completed based on the execution result corresponding to the new initial plan, a next plan needs to be generated based on the new initial plan and executed. The process can be referred to the related description of S53 in the following embodiments, which will not be described here. If the to-be-processed task is determined to be completed based on the execution result corresponding to the new initial plan, the execution result corresponding to the new initial plan can be directly determined as the first response information, or the first response information can be determined based on whether the new initial plan meets the quality requirements. The process can be referred to the related description of S52.
[0257] S53, in a case where it is determined that the to-be-processed task has not been completed, determining second response information based on the to-be-processed task, tool description information, and an execution result corresponding to the initial plan.
[0258] In a case where the to-be-processed task has not been completed, a new plan needs to be further generated based on the initial plan. The process will be introduced in combination with Figure 6 the following embodiments.
[0259] Figure 1 The process for determining response information provided by the embodiments of the present applicationFigure 6 As shown in Figure 7 includes:
[0260] S61, performing a first operation, the first operation comprising: determining an (i+1)th plan for processing the to-be-processed task based on the to-be-processed task, the tool description information, and execution results respectively corresponding to the first i plans.
[0261] i is initially 1, and i is a positive integer greater than or equal to 1. The first operation can specifically include the following steps (a)-(c):
[0262] (a) generating an (i+1)th candidate plan set based on the to-be-processed task, the tool description information, and the execution results respectively corresponding to the first i plans, the (i+1)th candidate plan set including at least one candidate plan.
[0263] In a possible implementation, the server can convert the to-be-processed task, the tool description information, and the execution results respectively corresponding to the first i plans into corresponding prompts, and then input the corresponding prompts into the large language model to output the (i+1)th candidate plan set, the (i+1)th candidate plan set including at least one candidate plan.
[0264] (b) determining scores of the candidate plans in the (i+1)th candidate plan set based on candidate plan evaluation parameters.
[0265] The candidate plan evaluation parameters are used to indicate the criteria for scoring the candidate plans, and the criteria for scoring may, for example, include dimensions such as feasibility, efficiency, and resource utilization of the candidate plans, i.e., the candidate plan evaluation parameters may, for example, include feasibility, efficiency, and resource utilization of the candidate plans, and the like.
[0266] In a possible implementation, for any candidate plan in the (i+1)th candidate plan set, the server obtains the score of the candidate plan based on at least one of the scores (e.g., which may include a feasibility score, an efficiency score, and a resource utilization score) of the candidate plan in the dimension of the scoring criteria.
[0267] For example, the feasibility score, the efficiency score, and the resource utilization score of the candidate plan can be averaged to obtain the score of the candidate plan; for example, different weights can be set for the feasibility score, the efficiency score, and the resource utilization score, and the score of the candidate plan can be obtained based on the feasibility score, the efficiency score, and the resource utilization score of the candidate plan and the respective weights of the feasibility score, the efficiency score, and the resource utilization score.
[0268] In a possible implementation, for any candidate plan in the i+1th candidate plan set, the server can convert the candidate plan and the candidate plan evaluation parameter into a corresponding prompt, and then input the corresponding prompt into the large language model, and output a score of the candidate plan by the large language model.
[0269] Taking the to-be-processed task as "help me start networking" and the candidate plan as "consult the user's demand scenario" as an example, the prompt input into the large language model may be, for example:
[0270] "to-be-processed task: help me start networking;
[0271] candidate plan: consult the user's demand scenario;
[0272] Please score the candidate plan from the dimensions of feasibility, efficiency, resource utilization, etc."
[0273] Then, the large language model outputs "the score of the candidate plan is 9 points", and the server can determine that the score of the candidate plan is 9 points.
[0274] (c) based on the scores of the candidate plans in the i+1th candidate plan set, determining the i+1th plan in the i+1th candidate plan set.
[0275] After obtaining the scores of the candidate plans in the i+1th candidate plan set, the server can determine the candidate plan with the highest score as the i+1th plan, or the server can determine the candidate plan with the second highest score as the i+1th plan, and so on.
[0276] S62, executing the i+1th plan to obtain an execution result corresponding to the i+1th plan.
[0277] After determining the i+1th plan, the server needs to select a suitable tool to execute the i+1th plan.
[0278] Executing the i+1th plan can specifically include the following steps (d)-(e):
[0279] (d) determining a target tool for executing the i+1th plan and an input parameter of the target tool based on the i+1th plan, the tool description information, the to-be-processed task, and the execution results corresponding to the first i plans.
[0280] The execution results corresponding to the first i plans belong to historical execution information, and the i+1th plan is a plan executed on the basis of the first i plans.
[0281] In a possible implementation, the server can output the thinking process of the execution of the i+1th plan based on the i+1th plan, the tool description information, the to-be-processed task, and the execution results of the previous i plans.
[0282] Specifically, the server can convert the i+1th plan, the tool description information, the to-be-processed task, and the execution results of the previous i plans into corresponding prompts, and then input the corresponding prompts into the large language model to output the thinking process of the execution of the i+1th plan.
[0283] (d) The process of selecting a suitable tool for the i+1th plan. The execution information corresponding to the i+1th plan indicates how to execute the i+1th plan, and the tools required for different execution manners are different.
[0284] For example, if the i+1th plan is to consult the user's demand scenario, if the thinking process of the execution of the i+1th plan indicates that the demand scenario is determined by asking the user, the required tool includes the user tool; if the thinking process of the execution of the i+1th plan indicates that the demand scenario is determined by seeking help from an artificial customer service, the required tool includes the expert tool, and so on.
[0285] In a possible implementation, the server can convert the thinking process of the execution of the i+1th plan, the i+1th plan, the tool description information, the to-be-processed task, and the execution results of the previous i plans into corresponding prompts, and then input the corresponding prompts into the large language model to output the name of the target tool.
[0286] Then, the server can convert the thinking process of the execution of the i+1th plan, the i+1th plan, the tool description information, the to-be-processed task, the execution results of the previous i plans, and the name of the target tool into corresponding prompts, and then input the corresponding prompts into the large language model to output the input parameters of the target tool, wherein the input parameters of the target tool are used to call the target tool.
[0287] (e) Based on the target tool and the input parameters of the target tool, the i+1th plan is executed to obtain the execution result corresponding to the i+1th plan.
[0288] After the input parameters of the target tool are determined, the target tool can be called through the input parameters of the target tool, the input parameters are processed by the target tool, the i+1th plan is executed, and the execution result corresponding to the i+1th plan is obtained.
[0289] For example, if the i+1th plan is to consult the user's demand scenario, the target tool is the user tool, and the input parameter is the follow-up question "What is your demand scenario?", the server calls the user tool through the output parameter, outputs the follow-up question to the user through the front end, and obtains the execution result corresponding to the i+1th plan based on the user's answer after the user answers.
[0290] The process can be combined with Figure 7 understanding, Figure 7 A tool calling process and large language model inference schematic diagram provided by an embodiment of the present application are shown in FIG. 6. As shown in FIG. 6, the task to be processed is "help me start networking", the plan is "select to create a project interface and first create a project", ReAct thinks "I need to select to create an interface API", then determines the target tool, calls the tool to execute the plan, completes the project creation, and the final answer is "all operations have been completed for you". Figure 7
[0291] As shown in FIG. 7, for a knowledge retrieval tool, the input parameter may, for example, be a knowledge question that needs to be retrieved, and the returned article content is retrieved through the calling of the underlying API interface; for an expert tool, the input parameter is a consultation question, and the output parameter is the reply of the expert; for a user tool, the input parameter is a follow-up question to the user, and the output parameter is the reply of the user; for other tools, there are also corresponding inputs and outputs, such as shown in FIG. 7, the data format of the input and output can be json. Figure 7 Figure 8
[0292] S63, judging whether the task to be processed is completed based on the execution results corresponding to the first i+1 plans, if not, performing S64, and if yes, performing S65.
[0293] After obtaining the i+1th plan, the server can judge whether the task to be processed is completed based on the execution results corresponding to the first i+1 plans. Specifically, the server can convert the execution results corresponding to the first i+1 plans and the task to be processed into corresponding prompts, then input the corresponding prompts into the large language model, and output the judgment result from the large language model, the judgment result indicating whether the task to be processed is completed. The implementation manner of the process can refer to the implementation manner of converting the execution result corresponding to the initial plan and the task to be processed into corresponding prompts, then inputting the corresponding prompts into the large language model, and outputting the judgment result from the large language model in the above-mentioned embodiment, which will not be described herein again.
[0294] S64, updating i to i+1, and performing S61.
[0295] In a case where it is determined based on the execution results corresponding to the first i+1 plans that the to-be-processed task is not completed, the server updates i to i+1 and repeats the first operation.
[0296] In the embodiments of the present application, the first plan is the initial plan. If it is determined based on the execution results corresponding to the initial plan that the to-be-processed task is not completed, the first operation needs to be performed to generate the second plan, and then the second plan is executed. It is determined based on the execution results corresponding to the second plan whether the to-be-processed task is completed, and the same is true for the subsequent plans. If it is determined based on the execution results corresponding to the first i+1 plans that the to-be-processed task is not completed, the first operation needs to be continuously performed to generate the next plan until the to-be-processed task is completed.
[0297] S65, determining the second response information based on the execution results corresponding to the first i+1 plans.
[0298] In a case where it is determined based on the execution results corresponding to the first i+1 plans that the to-be-processed task is completed, the server determines the second response information based on the execution results corresponding to the first i+1 plans. The process will be introduced below. Figure 8
[0299] Figure 2 The process for determining the response information provided in the embodiments of the present application Figure 8 As shown in Figure 9 , it includes:
[0300] S81, determining whether the target plan meets the quality requirement based on the execution results corresponding to the to-be-processed task and the target plan. If not, S82 is executed, and if yes, S83 is executed.
[0301] Initially, the target plan initially includes the first i+1 plans, and the execution results corresponding to the target plan initially include the execution results corresponding to the first i+1 plans.
[0302] The server can convert the execution results corresponding to the to-be-processed task and the target plan into corresponding prompts, and then input the corresponding prompts into the large language model. The large language model outputs a quality judgment result, which is used to indicate whether the target plan meets the quality requirement, i.e., whether the execution results corresponding to the target plan can solve the to-be-processed task.
[0303] Determining whether the target plan meets the quality requirement mainly determines whether the execution results corresponding to the plans in the target plan can match the to-be-processed task, and whether there are questions such as answering a different question.
[0304] In one implementation manner, taking the to-be-processed task as "help me start networking", the prompt word may be, for example:
[0305] The to-be-handled task is: help me start networking.
[0306] The execution result corresponding to the first plan is: the user's demand scenario consultation has been completed.
[0307] The execution result corresponding to the second plan is: the project interface has been successfully created. ...
[0309] The execution result corresponding to the i+1th plan is: on the basis of the user's demand scenario and the created project interface, the start networking task has been completed.
[0310] Based on the above information, output the quality evaluation result in the format of True / False (choose one of the two).
[0311] Where "True" means that the target plan meets the quality requirements, that is, the execution result corresponding to the target plan can solve the to-be-handled task, and "False" means that the target plan does not meet the quality requirements, that is, the execution result corresponding to the target plan cannot solve the to-be-handled task.
[0312] In an implementation manner, the to-be-handled task is "help me start networking", and the prompt words may be, for example:
[0313] The to-be-handled task is: help me start networking.
[0314] The execution result corresponding to the first plan is: the user's demand scenario consultation has been completed.
[0315] The execution result corresponding to the second plan is: the project interface has been successfully created. ...
[0317] The execution result corresponding to the i+1th plan is: on the basis of the user's demand scenario and the created project interface, the start networking task has been completed.
[0318] Based on the above information, output the matching degree score between the target plan and the to-be-handled task.
[0319] The above prompt words are input into a large language model, the large language model can output the matching degree score between the target plan and the to-be-handled task, and then compare it with a preset matching degree threshold, if the matching degree score between the target plan and the to-be-handled task is greater than or equal to the preset matching degree threshold, it is determined that the target plan meets the quality requirements; if the matching degree score between the target plan and the to-be-handled task is less than the preset matching degree threshold, it is determined that the target plan does not meet the quality requirements.
[0320] S82, updating the target plan.
[0321] If the target plan does not meet the quality requirement, it indicates that the quality of the execution result corresponding to the target plan is poor, and the target plan cannot solve the user's problem and cannot better complete the to-be-processed task. In an implementation manner, when the quality evaluation result of the target plan output by the large language model is False, it is determined that the target plan does not meet the quality requirement; in an implementation manner, when the matching degree score between the target plan output by the large language model and the to-be-processed task is less than a preset matching degree threshold, it is determined that the target plan does not meet the quality requirement.
[0322] Therefore, in the case that the target plan does not meet the quality requirement, the server updates the target plan to obtain an updated target plan.
[0323] Specifically, the server determines, in the candidate plan set corresponding to each of the first i+1 plans, a candidate plan set corresponding to the jth plan, and there is an unexecuted candidate plan in the candidate plan set corresponding to the jth plan, j being a positive integer less than or equal to i+1.
[0324] Then, the server determines, in the unexecuted candidate plans, a target candidate plan based on the scores of the unexecuted candidate plans. Optionally, the target candidate plan is the candidate plan with the highest score in the unexecuted candidate plans in the candidate plan set corresponding to the jth plan.
[0325] Finally, the server updates the target plan based on the target candidate plan to obtain an updated target plan. The updated target plan includes at least the first j-1 plans and the target candidate plan, that is, the server determines the target candidate plan as a new jth plan and deletes the original jth plan. The server can determine whether the to-be-processed task has been completed after the execution of the first j-1 plans and the target candidate plan. If yes, the updated target plan includes the first j-1 plans and the target candidate plan; if no, a new candidate plan set needs to be generated based on the to-be-processed task, the tool description information, the first j-1 plans and the target candidate plan corresponding to the execution results, until the to-be-processed task is finally completed, and the updated target plan is obtained. The way of generating a new candidate plan set based on the to-be-processed task, the tool description information, the first j-1 plans and the target candidate plan corresponding to the execution results is similar to the implementation manner of generating the i+1th candidate plan set based on the to-be-processed task, the tool description information and the first i plans corresponding to the execution results in the above embodiment. For specific implementation manners, refer to the related introduction in the above embodiment, which will not be described here.
[0326] After the updated target plan is determined, the second operation can be repeatedly performed based on the execution result corresponding to the updated target plan until the final target plan meets the quality requirement.
[0327] The process may, for example, be combined with Figure 9 understanding. Figure 9 An example of an updated target plan provided by an embodiment of the present application is shown in Figure 9 The prompt shows the generated plans and the corresponding scores, for example, in Figure 9 , plan A is "to perform the initial networking, should first create a project", the score of plan A is 4, plan B is "to perform the initial networking, should first consult the user's demand scenario", the score of plan B is 9, and so on.
[0328] As shown in the thought tree example in Figure 9 , the server first generates a first candidate plan set based on the to-be-processed task and tool description information, the first candidate plan set includes plans A, B and C, and the scores of the plans are shown in Figure 9 . Among them, the first candidate plan set corresponds to the first level in the thought tree, and the first level includes the nodes corresponding to plans A, B and C respectively. Since the score of plan B is the highest, it is determined as the initial plan, and then plan B is executed to obtain the execution result corresponding to plan B.
[0329] Then, based on the execution result corresponding to plan B, it is determined that the to-be-processed task is not completed, so a second candidate plan set is further generated, and the second candidate plan set includes plans D and E. Among them, the second candidate plan set corresponds to the second level in the thought tree, and the second level includes the nodes corresponding to plans D and E respectively. Among them, the score of plan D is 1, and the score of plan E is 10, so the server can determine plan E as the second plan, and execute plan E to obtain the execution result corresponding to plan E.
[0330] Then, based on the execution results corresponding to plans B and E, it is determined that the to-be-processed task is not completed, so a third candidate plan set is further generated, and the third candidate plan set includes plan F. Among them, the third candidate plan set corresponds to the third level in the thought tree, and the third level includes the node corresponding to plan F. Therefore, the server can determine plan F as the third plan, and execute plan F to obtain the execution result corresponding to plan F.
[0331] If it is determined that the to-be-processed plan has been completed after executing plan F, at this time the target plan includes plans B, E and F, it is necessary to determine whether it meets the quality requirements (i.e. whether it can solve the user's problem) based on the execution results of plans B, E and F. If it meets the quality requirements, the answer information can be determined based on the execution results of plans B, E and F. If it does not meet the quality requirements, the target plan needs to be updated.
[0332] As shown in Figure 9As shown, plan F can be pruned from the thinking tree (plan F is the i+1th plan currently executed, and it can be determined that the quality requirement is not met based on the first i+1 plans, at which time plan F can be pruned), and the thinking tree further includes nodes corresponding to plan A, plan B, plan C, plan D, and plan E, respectively, from plan F backtracking to plan E, and from plan E backtracking to plan D. Plan D is a candidate plan corresponding to plan E, and there is an unexecuted candidate plan in the candidate plan set of plan D, so plan D can be determined as a new second plan. At this time, the first plan at least includes plan B and plan D. If it is determined based on the execution results corresponding to plan B and plan D that the to-be-processed task is not completed, the next plan needs to be further generated based on plan D, until the to-be-processed task is completed, for example, in Figure 10 plan G and plan H are further generated based on plan D. The process can be referred to the related description of the above-mentioned embodiments, which will not be described here. If it is determined based on the execution results corresponding to plan B and plan D that the to-be-processed task is completed, the new target plan includes plan B and plan D, and then it is determined whether the new target plan meets the quality requirement, and the response information is determined based on whether the new target plan meets the quality requirement. The process can be referred to the related description of the above-mentioned embodiments, which will not be described here.
[0333] S83, determining the execution result corresponding to the target plan as the second response information.
[0334] In the case where the target plan meets the quality requirement, the server determines the execution result corresponding to the target plan as the second response information.
[0335] In summary, the scheme of the embodiments of the present application can determine the tools required for the initial plan in combination with the tool description information for the to-be-processed task, flexibly call the tools of the system to execute the initial plan, explore a new path in the case where the to-be-processed task is not completed based on the execution result corresponding to the initial plan, generate the next plan, until the target plan is obtained, further, determine whether the target plan meets the quality requirement through quality evaluation, update the target plan in the case where the quality requirement is not met, and output the response information after the target plan meets the quality requirement. Through the exploration of the above-mentioned path and the update of the target plan, the flexibility, accuracy and stability of the response can be improved, and the quality of the response information can be improved.
[0336] Figure 1 Structure diagram of a task processing device provided by an embodiment of the present application Figure 10 As shown in Figure 11 the task processing device 100 includes:
[0337] A receiving unit 101 is configured to receive an input to-be-processed task.
[0338] The first processing unit 102 is configured to determine an initial plan for processing the to-be-processed task based on the to-be-processed task and the tool description information, wherein the initial plan comprises an initial step for processing the to-be-processed task and tools required by the initial plan.
[0339] The execution unit 103 is configured to execute the initial plan based on the initial step and the tools required by the initial plan, to obtain an execution result corresponding to the initial plan.
[0340] The second processing unit 104 is configured to determine response information of the to-be-processed task based on the execution result corresponding to the initial plan.
[0341] In a possible implementation, the first processing unit 102 is specifically configured to:
[0342] generate a first candidate plan set based on the to-be-processed task and the tool description information, wherein the first candidate plan set comprises at least one candidate plan;
[0343] determine a score of each candidate plan in the first candidate plan set based on a candidate plan evaluation parameter;
[0344] determine the initial plan in the first candidate plan set based on the score of each candidate plan in the first candidate plan set.
[0345] In a possible implementation, the second processing unit 104 is specifically configured to:
[0346] determine whether the to-be-processed task has been completed based on the execution result corresponding to the initial plan;
[0347] in a case where it is determined that the to-be-processed task has been completed, determine first response information based on the to-be-processed task and the execution result corresponding to the initial plan;
[0348] in a case where it is determined that the to-be-processed task has not been completed, determine second response information based on the to-be-processed task, the tool description information, and the execution result corresponding to the initial plan.
[0349] In a possible implementation, the second processing unit 104 is specifically configured to:
[0350] perform a first operation, wherein the first operation comprises: determining an i+1th plan for processing the to-be-processed task based on the to-be-processed task, the tool description information, and an execution result corresponding to each of the first i plans; and executing the i+1th plan to obtain an execution result corresponding to the i+1th plan; i is initially 1, and i is a positive integer greater than or equal to 1;
[0351] In a case where it is determined based on the execution results of the previous i+1 plans respectively corresponding to the to-be-processed task that the to-be-processed task is not completed, i is updated to i+1, and the first operation is repeatedly performed.
[0352] In a case where it is determined based on the execution results of the previous i+1 plans respectively corresponding to the to-be-processed task that the to-be-processed task is completed, the second response information is determined based on the execution results of the previous i+1 plans respectively corresponding to the to-be-processed task.
[0353] In a possible implementation, the second processing unit 104 is specifically configured to:
[0354] generate an i+1th candidate plan set based on the to-be-processed task, the tool description information, and the execution results of the previous i plans respectively corresponding to the to-be-processed task, the i+1th candidate plan set including at least one candidate plan;
[0355] determine a score of each candidate plan in the i+1th candidate plan set based on a candidate plan evaluation parameter;
[0356] determine the i+1th plan in the i+1th candidate plan set based on the scores of the candidate plans in the i+1th candidate plan set.
[0357] In a possible implementation, the second processing unit 104 is specifically configured to:
[0358] determine a target tool for executing the i+1th plan and an input parameter of the target tool based on the i+1th plan, the tool description information, the to-be-processed task, and the execution results of the previous i plans respectively corresponding to the to-be-processed task;
[0359] execute the i+1th plan based on the target tool and the input parameter of the target tool to obtain an execution result corresponding to the i+1th plan.
[0360] In a possible implementation, the second processing unit 104 is specifically configured to:
[0361] perform a second operation, the second operation including: determining whether a target plan meets a quality requirement based on the to-be-processed task and an execution result corresponding to the target plan, the target plan initially including the previous i+1 plans, and the execution result corresponding to the target plan initially including the execution results of the previous i+1 plans respectively corresponding to the to-be-processed task;
[0362] In a case where the target plan meets the quality requirement, determine the second response information based on the execution result corresponding to the target plan.
[0363] In a possible implementation, the second processing unit 104 is further configured to:
[0364] updating the target plan to obtain an updated target plan in a case where the target plan does not meet the quality requirement;
[0365] repeating the second operation based on an execution result corresponding to the updated target plan.
[0366] In a possible implementation, the second processing unit 104 is specifically configured to:
[0367] determining, in the candidate plan set corresponding to the jth plan, an unexecuted candidate plan, the j being a positive integer less than or equal to i+1;
[0368] determining a target candidate plan from the unexecuted candidate plans based on the scores of the unexecuted candidate plans;
[0369] updating the target plan based on the target candidate plan to obtain the updated target plan.
[0370] In a possible implementation, the first processing unit 102 is specifically configured to:
[0371] generating a candidate node set of a first level in a thinking tree based on the to-be-processed task and the tool description information by a thinking tree technology, each candidate node in the candidate node set of the first level having a corresponding candidate plan;
[0372] determining a score of each candidate node in the candidate node set of the first level based on a candidate plan evaluation parameter;
[0373] determining a target node of the first level from the candidate node set of the first level based on the scores of the candidate nodes in the candidate node set of the first level, and determining a candidate plan corresponding to the target node of the first level as the initial plan.
[0374] In a possible implementation, the second processing unit 104 is specifically configured to:
[0375] determining whether the to-be-processed task has been completed based on an execution result corresponding to the initial plan by a tool agent technology;
[0376] determining first response information based on the to-be-processed task and the execution result corresponding to the initial plan by a discrimination technology in a case where it is determined that the to-be-processed task has been completed;
[0377] In a case where it is determined that the to-be-processed task is not completed, second response information is determined based on the to-be-processed task, the tool description information, and the execution result corresponding to the initial plan by the thinking tree technology and the tool agent technology.
[0378] In a possible implementation, the second processing unit 104 is specifically configured to:
[0379] perform a third operation, the third operation including: determining an i+1th plan for processing the to-be-processed task based on the to-be-processed task, the tool description information, and the execution result corresponding to each of the first i plans by the thinking tree technology; and executing the i+1th plan to obtain an execution result corresponding to the i+1th plan by the tool agent technology; i is initially 1, and i is a positive integer greater than or equal to 1;
[0380] In a case where it is determined that the to-be-processed task is not completed based on the execution result corresponding to each of the first i+1 plans by the tool agent technology, i is updated to i+1, and the third operation is repeatedly performed;
[0381] In a case where it is determined that the to-be-processed task is completed based on the execution result corresponding to each of the first i+1 plans by the tool agent technology, the second response information is determined based on the execution result corresponding to each of the first i+1 plans by a discrimination technology.
[0382] In a possible implementation, the second processing unit 104 is specifically configured to:
[0383] generate a candidate node set of an i+1th level based on the to-be-processed task, the tool description information, and the execution result corresponding to each of the first i plans by the thinking tree technology, each candidate node in the candidate node set of the i+1th level having a corresponding candidate plan;
[0384] determine a score of each candidate node in the candidate node set of the i+1th level based on a candidate plan evaluation parameter;
[0385] determine a target node of the i+1th level in the candidate node set of the i+1th level based on the score of each candidate node in the candidate node set of the i+1th level, and determine a candidate plan corresponding to the target node of the i+1th level as the i+1th plan.
[0386] In a possible implementation, the second processing unit 104 is specifically configured to:
[0387] Using the tool proxy technology, based on the (i+1)th plan, the tool description information, the task to be processed, and the execution results corresponding to the previous i plans, the target tool for executing the (i+1)th plan, as well as the input parameters of the target tool, are determined.
[0388] Using the tool proxy technology, based on the target tool and its input parameters, the (i+1)th plan is executed to obtain the execution result corresponding to the (i+1)th plan.
[0389] In one possible implementation, the second processing unit 104 is specifically used for:
[0390] Perform a fourth operation, which includes: using the discrimination technique, determining whether the target plan meets the quality requirements based on the execution results corresponding to the task to be processed and the target plan; the target plan initially includes the first i+1 plans, and the execution results corresponding to the target plan initially include the execution results corresponding to each of the first i+1 plans;
[0391] If the target plan meets the quality requirements, the second response information is determined based on the execution results corresponding to the target plan.
[0392] In one possible implementation, the second processing unit 104 is further configured to:
[0393] If the target plan does not meet the quality requirements, the target plan is updated using the mind tree technique to obtain an updated target plan.
[0394] Using the aforementioned discrimination technique, the fourth operation is repeated based on the execution result corresponding to the updated target plan.
[0395] The task processing device provided in this application embodiment is used to execute the above method embodiment. Its implementation principle and technical effect are similar, and will not be described again here.
[0396] Figure 2 Schematic diagram of the structure of the task processing device provided in the embodiments of this application Figure 11 .like Figure 1 As shown, the task processing device includes: a memory 1101, a processor 1102, and a transceiver 1103.
[0397] Memory 1101 is used to store program instructions.
[0398] The processor 1102 is used to execute program instructions stored in the memory so that the task processing device performs the method steps in the above embodiments.
[0399] The transceiver 1103 can include a transmitter and / or a receiver. The transmitter can also be referred to as a sender, a transmitter, a transmission port or a transmission interface, and the like. The receiver can also be referred to as a receiver, a receiving port or a receiving interface, and the like. Exemplarily, the memory 1101, the processor 1102 and the transceiver 1103 are connected with each other through the bus 1104.
[0400] All or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. The foregoing program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the foregoing memory (storage medium) includes a read-only memory (ROM), a RAM, a flash memory, a hard disk, a solid state disk, a magnetic tape, a floppy disk, an optical disc and any combination thereof.
[0401] The embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores computer execution instructions. When the computer execution instructions are executed by a processor, the computer execution instructions are used to implement the method steps in the method embodiments.
[0402] The embodiment of the present application further provides a computer program product, and the computer program product includes a computer program. When the computer program is executed by a processor, the computer program can implement the method steps in the method embodiments.
[0403] The computer program instructions can also be stored in a computer readable memory capable of guiding a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including instruction devices, which implement the functions specified in the flow Figure 1 One flow or multiple flows and / or the functions specified in the block Figure 1 One block or multiple blocks.
[0404] The computer program instructions can also be loaded into a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in the flow Figure 1 One flow or multiple flows and / or the functions specified in the block One block or multiple blocks.
[0405] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other manners. For example, the division of the above-described device embodiment is merely an example, and there can be other division manners. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between different units, or the among different units, can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.
[0406] The units described as separated components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments.
[0407] In addition, each functional unit in the embodiments of the present application can be integrated in a processing unit, or each unit can exist physically as a separate unit, or two or more units can be integrated in one unit. The integrated unit can be implemented in the form of hardware, or in the form of a software functional unit.
[0408] Those skilled in the art can understand that all or part of the steps of the above-described method embodiments can be completed by a program instruction related to hardware. The aforementioned computer program can be stored in a computer readable storage medium. When the computer program is executed by a processor, the steps of the method embodiments described above are implemented; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, and various media that can store program codes.
[0409] Finally, it should be noted that: the above embodiments are merely used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the above embodiments, or make equivalent replacement to some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A task processing method, characterized in that, include: Receive input tasks to be processed; Based on the description information of the task to be processed and the tools, an initial plan for processing the task to be processed is determined, the initial plan including the initial steps for processing the task to be processed and the tools required by the initial plan; Based on the initial steps and the tools required for the initial plan, the initial plan is executed to obtain the execution result corresponding to the initial plan; Based on the execution results corresponding to the initial plan, the response information for the task to be processed is determined.
2. The method according to claim 1, characterized in that, The step of determining an initial plan for processing the task to be processed based on the task description information and tool description information includes: Based on the task to be processed and the tool description information, a first candidate plan set is generated, the first candidate plan set including at least one candidate plan; Based on the candidate plan evaluation parameters, the score of each candidate plan in the first candidate plan set is determined; Based on the scores of each candidate plan in the first candidate plan set, the initial plan is determined in the first candidate plan set.
3. The method according to claim 1, characterized in that, The step of determining the response information for the task to be processed based on the execution result corresponding to the initial plan includes: Based on the execution results corresponding to the initial plan, determine whether the pending task has been completed; If it is determined that the task to be processed has been completed, the first response information is determined based on the execution results corresponding to the task to be processed and the initial plan; If it is determined that the pending task has not been completed, a second response is determined based on the pending task, the tool description information, and the execution result corresponding to the initial plan.
4. The method according to claim 3, characterized in that, The step of determining the second response information based on the task to be processed, the tool description information, and the execution result corresponding to the initial plan includes: Perform a first operation, which includes: determining the (i+1)th plan for processing the task to be processed based on the task to be processed, the tool description information, and the execution results corresponding to the first i plans; executing the (i+1)th plan to obtain the execution result corresponding to the (i+1)th plan; where i is initially 1 and i is a positive integer greater than or equal to 1; If it is determined that the task to be processed has not been completed based on the execution results of the first i+1 plans, update i to i+1 and repeat the first operation; If the task to be processed has been completed based on the execution results of the first i+1 plans, the second response information is determined based on the execution results of the first i+1 plans.
5. The method according to claim 4, characterized in that, The step of determining the (i+1)th plan for processing the task to be processed based on the task to be processed, the tool description information, and the execution results of the first i plans includes: Based on the task to be processed, the tool description information, and the execution results corresponding to the first i plans, a candidate plan set of the (i+1)th time is generated, wherein the candidate plan set of the (i+1)th time includes at least one candidate plan; Based on the candidate plan evaluation parameters, determine the score of each candidate plan in the (i+1)th candidate plan set; Based on the scores of each candidate plan in the (i+1)th candidate plan set, the (i+1)th plan is determined in the (i+1)th candidate plan set.
6. The method according to claim 4 or 5, characterized in that, The execution of the (i+1)th plan and the resulting execution outcome of the (i+1)th plan include: Based on the (i+1)th plan, the tool description information, the task to be processed, and the execution results corresponding to the first i plans, determine the target tool for executing the (i+1)th plan, as well as the input parameters of the target tool; Based on the target tool and its input parameters, the (i+1)th plan is executed to obtain the execution result corresponding to the (i+1)th plan.
7. The method according to claim 5, characterized in that, The determination of the second response information based on the execution results of the first i+1 plans includes: Perform a second operation, which includes: determining whether the target plan meets the quality requirements based on the execution results corresponding to the task to be processed and the target plan; the target plan initially includes the first i+1 plans, and the execution results corresponding to the target plan initially include the execution results corresponding to each of the first i+1 plans; If the target plan meets the quality requirements, the second response information is determined based on the execution results corresponding to the target plan.
8. The method according to claim 7, characterized in that, The method further includes: If the target plan does not meet the quality requirements, the target plan is updated to obtain an updated target plan; The second operation is repeated based on the execution results corresponding to the updated target plan.
9. The method according to claim 8, characterized in that, The step of updating the target plan to obtain the updated target plan includes: In the candidate plan sets corresponding to the first i+1 plans, determine the candidate plan set corresponding to the j-th plan, wherein there are unexecuted candidate plans in the candidate plan set corresponding to the j-th plan, and j is a positive integer less than or equal to i+1; Based on the scores of the unexecuted candidate plans, a target candidate plan is determined from among the unexecuted candidate plans; Based on the target candidate plan, the target plan is updated to obtain the updated target plan.
10. The method according to claim 1, characterized in that, The step of determining an initial plan for processing the task to be processed based on the task description information and tool description information includes: Using mind tree technology, based on the task to be processed and the tool description information, a candidate node set for the first level of the mind tree is generated, and each candidate node in the candidate node set for the first level has a corresponding candidate plan. The score of each candidate node in the candidate node set of the first level is determined based on the candidate plan evaluation parameters; Based on the scores of each candidate node in the candidate node set of the first level, the target node of the first level is determined in the candidate node set of the first level, and the candidate plan corresponding to the target node of the first level is determined as the initial plan.
11. The method according to claim 1 or 10, characterized in that, The step of determining the response information for the task to be processed based on the execution result corresponding to the initial plan includes: Using tool proxy technology, based on the execution results corresponding to the initial plan, it is determined whether the task to be processed has been completed; If it is determined that the task to be processed has been completed, the first response information is determined by using a discrimination technique based on the execution results corresponding to the task to be processed and the initial plan; If it is determined that the task to be processed has not been completed, a second response is determined based on the task to be processed, the tool description information, and the execution result corresponding to the initial plan, using mind tree technology and the tool proxy technology.
12. The method according to claim 11, characterized in that, The second response information is determined based on the task to be processed, the tool description information, and the execution result corresponding to the initial plan, using mind tree technology and tool proxy technology. This includes: Perform a third operation, which includes: using the mind tree technology, based on the task to be processed, the tool description information, and the execution results corresponding to the first i plans, determining the (i+1)th plan for processing the task to be processed; using the tool proxy technology, executing the (i+1)th plan to obtain the execution result corresponding to the (i+1)th plan; where i is initially 1 and is a positive integer greater than or equal to 1; If, through the tool proxy technology, it is determined that the task to be processed has not been completed based on the execution results of the first i+1 plans, i is updated to i+1, and the third operation is repeated. If the task to be processed is determined to be completed based on the execution results of the first i+1 plans using the tool proxy technology, the second response information is determined based on the execution results of the first i+1 plans using the discrimination technology.
13. The method according to claim 12, characterized in that, The step of determining the (i+1)th plan for processing the task to be processed, based on the task to be processed, the tool description information, and the execution results of the previous i plans, using the mind tree technology, includes: Using the mind tree technology, based on the task to be processed, the tool description information, and the execution results corresponding to the first i plans, a candidate node set at the (i+1)th level is generated, and each candidate node in the (i+1)th level candidate node set has a corresponding candidate plan. The score of each candidate node in the candidate node set of the (i+1)th level is determined based on the candidate plan evaluation parameters; Based on the scores of each candidate node in the candidate node set of the (i+1)th level, the target node of the (i+1)th level is determined in the candidate node set of the (i+1)th level, and the candidate plan corresponding to the target node of the (i+1)th level is determined as the (i+1)th plan.
14. The method according to claim 12 or 13, characterized in that, The step of executing the (i+1)th plan using the tool proxy technology to obtain the execution result corresponding to the (i+1)th plan includes: Using the tool proxy technology, based on the (i+1)th plan, the tool description information, the task to be processed, and the execution results corresponding to the previous i plans, the target tool for executing the (i+1)th plan, as well as the input parameters of the target tool, are determined. Using the tool proxy technology, based on the target tool and its input parameters, the (i+1)th plan is executed to obtain the execution result corresponding to the (i+1)th plan.
15. The method according to claim 13, characterized in that, The step of determining the second response information based on the execution results of the first i+1 plans using a discrimination technique includes: Perform a fourth operation, which includes: using the discrimination technique, determining whether the target plan meets the quality requirements based on the execution results corresponding to the task to be processed and the target plan; the target plan initially includes the first i+1 plans, and the execution results corresponding to the target plan initially include the execution results corresponding to each of the first i+1 plans; If the target plan meets the quality requirements, the second response information is determined based on the execution results corresponding to the target plan.
16. The method according to claim 15, characterized in that, The method further includes: If the target plan does not meet the quality requirements, the target plan is updated using the mind tree technique to obtain an updated target plan. Using the aforementioned discrimination technique, the fourth operation is repeated based on the execution result corresponding to the updated target plan.
17. A task processing device, characterized in that, include: The receiving unit is used to receive input tasks to be processed. The first processing unit is configured to determine an initial plan for processing the task to be processed based on the task to be processed and the tool description information. The initial plan includes initial steps for processing the task to be processed and the tools required by the initial plan. An execution unit is configured to execute the initial plan based on the initial steps and the tools required by the initial plan, and obtain the execution result corresponding to the initial plan; The second processing unit is used to determine the response information of the task to be processed based on the execution result corresponding to the initial plan.
18. A task processing device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the task processing method as described in any one of claims 1-16.
19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a controller, are used to implement the task processing method as described in any one of claims 1-16.
20. A computer program product, characterized in that, It includes a computer program that, when executed by a controller, implements the task processing method according to any one of claims 1-16.
Citation Information
Patent Citations
Task-based dialogue processing method and device, equipment and storage medium
CN116541497A
Trip planning method and device, electronic equipment and storage medium
CN117150153A
Task execution method and device, equipment, medium and program product
CN118193754A
Response generation for conversational computing interface
US20210050006A1