Intelligent agent information processing method and device, electronic equipment and storage medium
By determining the sequence of operations and selecting target tool sets and tools, the agent can process input information efficiently and accurately, solving the problem of decision-making errors caused by a large number of tools with similar functions, and improving the accuracy of information processing.
Patent Information
- Application Number
- CN202410763968.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-10-11
AI Technical Summary
When there are a large number of tools with similar functions, the agent is prone to make mistakes when making decisions among multiple tools, which affects the accuracy of tool selection and leads to a decrease in the accuracy of input information processing results.
By obtaining the input information to be processed, determine the operations and sequence of operations that need to be performed, select the target tool group and target tool from the candidate tool group, generate a step plan to indicate the sequence of operations and tool selection, and then call the tool for processing.
It improves the efficiency and accuracy of tool selection, ensures the accuracy of input information processing results, and avoids decision-making errors caused by too many tools.
Smart Images

Figure CN118760747A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, in particular to artificial intelligence fields such as deep learning, large models, and intelligent agents, and specifically to an information processing method, device, electronic device, and storage medium for an intelligent agent. Background Art
[0002] An agent is a software, hardware or other entity with autonomous and adaptive capabilities. Its goal is to recognize and simulate human intelligent behavior. An agent can be regarded as a computing entity that can function continuously and autonomously and interact with the environment. It has characteristics such as residence, responsiveness, sociality and initiative. Agents have broad application prospects in the field of artificial intelligence. Summary of the invention
[0003] The present application provides an intelligent agent information processing method, device, electronic device and storage medium.
[0004] According to one aspect of the present application, there is provided an information processing method of an intelligent agent, comprising:
[0005] Get the input information to be processed;
[0006] Determine each operation to be performed for processing the input information and the operation sequence of each operation, and determine a target tool group corresponding to each operation from a candidate tool group; wherein the candidate tool group includes at least one tool;
[0007] For any operation, selecting a target tool to be called for the operation from a target tool group corresponding to the operation;
[0008] Generate a first step plan corresponding to the input information according to the operation sequence and the target tool group and target tool corresponding to each operation; wherein the first step plan is used to indicate the operation sequence of each operation, the target tool group to be selected for executing each operation, and the target tool to be called for executing each operation;
[0009] According to the first step, a calling tool is planned to process the input information to obtain a processing result of the input information.
[0010] According to another aspect of the present application, there is provided an information processing device of an intelligent agent, comprising:
[0011] A first acquisition module, used to acquire input information to be processed;
[0012] A first determination module is used to determine various operations that need to be performed to process the input information and the operation sequence of the various operations, and to determine a target tool group corresponding to each operation from a candidate tool group; wherein the candidate tool group includes at least one tool;
[0013] A second determination module is used to select a target tool to be called for any operation from a target tool group corresponding to the operation;
[0014] A generation module, used to generate a first step plan corresponding to the input information according to the operation sequence and the target tool group and target tool corresponding to each operation; wherein the first step plan is used to indicate the operation sequence of each operation, the target tool group to be selected for executing each operation, and the target tool to be called for executing each operation;
[0015] The processing module is used to plan and call the tool according to the first step, process the input information, and obtain the processing result of the input information.
[0016] According to another aspect of the present application, there is provided an electronic device, including:
[0017] at least one processor; and
[0018] a memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor so that the at least one processor can perform the method described in the above embodiment.
[0020] According to another aspect of the present application, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method according to the above embodiment.
[0021] According to another aspect of the present application, a computer program product is provided, including a computer program, wherein the computer program implements the steps of the method described in the above embodiment when executed by a processor.
[0022] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.
[0024] Figure 1A schematic diagram of a flow chart of an information processing method of an intelligent agent provided in one embodiment of the present application;
[0025] Figure 2 A schematic diagram of the information processing process of an intelligent agent provided in an embodiment of the present application;
[0026] Figure 3 A schematic diagram of a flow chart of an information processing method of an intelligent agent provided in another embodiment of the present application;
[0027] Figure 4 A schematic diagram of a flow chart of an information processing method of an intelligent agent provided in another embodiment of the present application;
[0028] Figure 5 A schematic diagram of a flow chart of an information processing method of an intelligent agent provided in another embodiment of the present application;
[0029] Figure 6 A schematic diagram of the structure of an information processing device of an intelligent agent provided in one embodiment of the present application;
[0030] Figure 7 It is a block diagram of an electronic device used to implement the information processing method of the intelligent agent in the embodiment of the present application. DETAILED DESCRIPTION
[0031] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0032] The following describes the information processing method, device, electronic device and storage medium of the intelligent agent in the embodiments of the present application with reference to the accompanying drawings.
[0033] In some embodiments, the intelligent agent can be an advanced artificial intelligence system with a large model as the core reasoning engine. It not only has the language understanding and generation capabilities of the large model, but can also solve various complex problems efficiently and flexibly, further releasing the machine intelligence contained in the large model, thereby providing users with more accurate and personalized services.
[0034] In some embodiments, the agent has planning capabilities. For example, for a problem input by a user, the agent can use a planner to select the tool needed to solve the problem from all available tools, and use the selected tool to process the input problem.
[0035] However, when there are a large number of tools and some of them have similar functions, it may lead to errors in decision-making between multiple tools, thus affecting the accuracy of tool selection.
[0036] Based on this, an embodiment of the present application provides an information processing method. Figure 1 A flowchart of an information processing method for an intelligent agent provided in one embodiment of the present application.
[0037] The information processing method of the intelligent body in the embodiment of the present application can be executed by the information processing device of the intelligent body in the embodiment of the present application, and the device can be configured in an electronic device.
[0038] Among them, the electronic device can be any device with computing capabilities, such as a personal computer, a mobile terminal, a server, etc. The mobile terminal can be, for example, a vehicle-mounted device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, and other hardware devices with various operating systems, touch screens and / or display screens.
[0039] like Figure 1 As shown, the information processing method of the intelligent agent includes:
[0040] Step 101: Obtain input information to be processed.
[0041] Exemplarily, the input information may be information input by the user during the interaction with the agent. Exemplarily, the input information may be a question input by the user, a query statement input by the user, etc.
[0042] For example, the input information is a question input by a user: "How much more is the square of the price of beverage A than the price of beverage B?"
[0043] Step 102, determining each operation that needs to be performed to process the input information and the operation sequence of each operation, and determining a target tool group corresponding to each operation from the candidate tool group.
[0044] In the present application, the input information can be parsed to determine which operations need to be performed to process the input information and the order of these operations. Exemplarily, the operations required to process the input information can be understood as tasks, that is, determining which tasks the processing of the input information can be decomposed into.
[0045] For example, the input information is the question entered by the user, "How much more is the price of beverage A than the price of beverage B?" To get the answer to this question, you need to know the price of beverage A and the price of beverage B, calculate the difference between the two prices, and then calculate the square of the difference. From this, it can be determined that the operations that need to be performed are: query the price of beverage A, query the price of beverage B, calculate the difference between the price of beverage A and the price of beverage B, and calculate the square of the difference.
[0046] In the present application, the candidate tool group may be obtained by grouping a plurality of tools that can be called by the agent in advance, for example, tools with similar functions may be grouped together. Exemplarily, the number of the candidate tool groups may be one or more. Exemplarily, each candidate tool group may include one or more tools. Exemplarily, each candidate tool group may include one tool or a plurality of tools with similar functions.
[0047] for example Figure 2 In the figure, the seven tools are divided into four tool groups, among which tool groups group1, group2, and group3 each contain two tools with similar functions, and tool group group4 contains one tool tool7.
[0048] In the present application, for each operation, a target tool group may be selected from the candidate tool groups for each operation, that is, it may be determined which tool group's tool can be called to complete the operation.
[0049] Exemplarily, the candidate tool group has description information, which may include a functional description. The degree of match between each operation and the description information of the candidate tool may be calculated, and the candidate tool group with the highest degree of match is determined as the target tool group for each operation. Thus, based on the degree of match between each operation and the description information of the candidate tool group, a tool group is selected from the candidate tool group for each operation, thereby improving the accuracy of tool group selection.
[0050] Step 103: for any operation, a target tool to be called is selected for the operation from the target tool group corresponding to the operation.
[0051] Exemplarily, if there is only one tool in the target tool group corresponding to an operation, the tool may be determined as the target tool to be called by the operation.
[0052] For example, if the target tool group corresponding to an operation includes multiple tools, the description information of each tool in the target tool group can be obtained, and the matching degree between the operation and the description information of each tool in the target tool group is calculated, and the tool with the highest matching degree is determined as the target tool to be called by the operation. The higher the matching degree between the operation and the description information of the tool, the higher the accuracy of the result obtained by executing the operation using the tool.
[0053] Exemplarily, the description information of a tool may include the name of the tool, a functional description of the tool, an input of the tool, etc. For example, the description information of a tool is "calculator, input is a mathematical formula".
[0054] For example, if the target tool group corresponding to an operation includes multiple tools, the usage examples of each tool in the target tool group can be obtained, and the similarity between the operation and the usage examples of each tool in the target tool group can be calculated, and the tool with the highest similarity can be determined as the target tool to be called by the operation. The higher the similarity between the operation and the usage examples of the tool, the higher the accuracy of the result obtained by executing the operation using the tool. In addition, the usage examples of the tool can be one or more, which is not limited.
[0055] for example, Figure 2 Examples of using tool tool1 may include "What is the concept of an intelligent agent", and examples of using tool tool2 may include "What is the price of product xxx".
[0056] Thus, by selecting a tool to be called for an operation from a tool group with reference to usage examples of the tool, the accuracy of tool selection can be improved.
[0057] In the present application, when selecting a tool for each operation, a tool group is selected first, and then a tool is selected from the selected tool group. Compared with directly selecting the tool to be called from all tools, the selection range can be narrowed and the efficiency and accuracy of tool selection can be improved.
[0058] It should be noted that in the present application, the target tool group corresponding to each operation can be determined first, and then the tool to be called can be selected from the target tool group corresponding to each operation. Alternatively, the target tool group can be selected for each operation one by one, and the tool to be called can be selected from the target tool group. There is no limitation on this.
[0059] Step 104 , generating a first step plan corresponding to the input information according to the operation sequence and the target tool group and target tool corresponding to each operation.
[0060] Among them, the first step planning can be used to indicate the operation sequence of each operation, the target tool group to be selected to execute each operation, and the target tool to be called to execute each operation.
[0061] Exemplarily, the tool group selection step corresponding to each operation can be obtained according to each operation and the target tool group corresponding to each operation, and the tool calling step corresponding to each operation can be obtained according to each operation and the target tool corresponding to each operation, and then the tool group selection steps and tool calling steps corresponding to each operation are sorted according to the operation sequence to generate the first step plan. Here, the first step plan can be understood as the plan of the tool group selection step and tool calling step corresponding to each operation.
[0062] Exemplarily, a tool group selection step corresponding to an operation may include the operation and a target tool group selected for the operation. Exemplarily, a tool calling step corresponding to an operation may include the operation and a target tool to be called by the operation.
[0063] For example, if the input information is “how much more is the price of beverage A than the price of beverage B?”, the candidate tool set is Figure 2 As shown in , according to the above-mentioned steps, the first step planning of the input information of the planning generation method can be: group1: query the price of beverage A; tool1: query the price of beverage A; group2: query the price of beverage B; tool1: query the price of beverage B; group4: calculate the difference between the price query result of beverage A and the price query result of beverage B; tool7: calculate the difference between the price query result of beverage A and the price query result of beverage B; group4: calculate the square of the difference; tool7: calculate the square of the difference.
[0064] Among them, "group1: query the price of beverage A" represents the tool group selection step of the operation "query the price of beverage A", and "tool1: query the price of beverage A" represents the tool calling step of the operation "query the price of beverage A".
[0065] Therefore, the tool group selection step and the tool calling step of each operation can be based on each operation, and the first step plan can be obtained by sorting them according to the operation sequence, thereby ensuring that the first step plan matches the operation sequence.
[0066] Exemplarily, the tool calling path of the target tool can be determined according to the target tool group and the target tool corresponding to each operation, and the tool calling steps corresponding to each operation can be obtained according to each operation and the tool calling path corresponding to each operation, and then the tool calling steps corresponding to each operation can be sorted according to the operation sequence of each operation to generate the first step plan. Here, the first step plan can be understood as the plan of the tool calling steps corresponding to each operation.
[0067] Exemplarily, a tool calling step corresponding to an operation may include the operation and a tool calling path corresponding to the operation.
[0068] For example, if the input information is “how much more is the price of beverage A than the price of beverage B?”, the candidate tool set is Figure 2As shown in, according to the above-mentioned step planning generation method, the first step planning of the input information can be: 1. group1-tool1: query the price of beverage A; 2. group1-tool1: query the price of beverage B; 3. group4-tool7: calculate the difference between the result of step 1 and the result of step 2; 4. group4-tool7: calculate the square of the result of step 3.
[0069] Among them, "1.group1-tool1: Query the price of beverage A" is the tool calling step of the operation "Query the price of beverage A", "group1-tool1" represents the tool calling path, which means calling the tool tool1 in the tool group group1, and "group1-tool1: Query the price of beverage A" means calling the tool tool1 in the tool group group1 to query the price of beverage A.
[0070] Step 105, calling a tool according to the plan in the first step, processing the input information, and obtaining a processing result of the input information.
[0071] In the present application, the steps in the first step planning can be executed in sequence to process the input information and obtain the processing result of the input information. When executing the steps in the first step planning, the operation is performed by calling the corresponding tool.
[0072] For ease of understanding, the following Figure 2 To explain, Figure 2 There are 4 tool groups in the solution. The question input by the user is "How much more is the price of beverage A than the price of beverage B?" The planner in the agent first determines the operations that need to be performed to solve the problem, the order of operations, and the tool group selected for each operation, and obtains "group1: query the price of beverage A; group1: query the price of beverage B; group4: calculate the difference between the price query results of beverage A and the price query results of beverage B; group4: calculate the square of the difference."
[0073] After that, for "group1: query the price of beverage A", the planner is used to select the tool to be called from group1 to obtain "too11: query the price of beverage A"; for "group1: query the price of beverage B", the planner is used to select the tool to be called from group1 to obtain "too11: query the price of beverage B"; for "group4: calculate the difference between the price query result of beverage A and the price query result of beverage B", the planner is used to select the tool to be called from group4 to obtain "tool7: calculate the difference between the price query result of beverage A and the price query result of beverage B"; for "group4: calculate the square of the difference", the tool to be called from group4 is selected to obtain "tool7: calculate the square of the difference". Thus, the first step plan is obtained through the planner, and then the steps in the above step plan are executed to obtain the processing result.
[0074] In an embodiment of the present application, for each operation that needs to be performed to process input information, a target tool group can be selected from a candidate tool group for each operation, and then a target tool to be called can be selected from the target tool group. Compared with directly selecting the tool to be called from all tools, the selection range of the tool can be narrowed, the efficiency and accuracy of the tool selection can be improved, and the accuracy of the input information processing results can be improved.
[0075] Figure 3 A flowchart of an information processing method for an intelligent agent provided in another embodiment of the present application.
[0076] like Figure 3 As shown, the information processing method of the intelligent agent includes:
[0077] Step 301: Obtain input information to be processed.
[0078] In the present application, step 301 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.
[0079] Step 302: Based on the input information and the description information of the candidate tool set, a large model is used to determine the second step plan corresponding to the input information.
[0080] In some embodiments, the description information of all tools that the agent can call can be informed to the big model, and the big model determines the tools to be called for each operation of the input information. However, if there are too many tools, the limit on the number of characters of the big model may be exceeded, that is, the limit on the length of the big model character window, and no result can be obtained.
[0081] Based on this, in the present application, the description information of the first prompt template and the candidate tool group can be obtained, and the first prompt template can be filled in according to the input information and the description information of the candidate tool group to obtain the first prompt information, and then the first prompt information can be input into the large model for processing to obtain the second step plan corresponding to the input information.
[0082] Exemplarily, the second step planning can be understood as planning of tool group selection steps corresponding to each operation, wherein one operation corresponds to one tool group selection step. Exemplarily, the tool group selection step corresponding to one operation can include the operation and the target tool group corresponding to the operation.
[0083] Exemplarily, the second step planning may include various operations that need to be performed to process the input information, the operation sequence of each operation, and the target tool group corresponding to each operation.
[0084] Exemplarily, the first prompt template can be used to prompt the large model to perform tool group selection and operation planning tasks. Exemplarily, the first prompt template can include slots to be filled, such as input information slots, tool group description information slots, etc. The input information slots in the first prompt template can be filled according to the input information, and the tool group description information slots in the first prompt template can be filled according to the description information of the candidate tool group to obtain the first prompt information.
[0085] Exemplarily, the first prompt information may include input information, description information of the candidate tool group, etc., and may also include output result format requirements, such as JSON format.
[0086] For example, the first prompt information may be "There are the following tool groups: group 1: search, price knowledge, etc.; group 2: drawing tools; group 3: file analysis tools; group 4: calculator. The user's question is {How much more is the square of the price of beverage A than the price of beverage B}. According to the description information of the above tool groups, the tool group selection and operation plan for this problem are given, and the output result format is json format." The first prompt information is processed by the big model, and the first step plan can be "group 1: query the price of beverage A; group 1: query the price of beverage B; group 4: calculate the difference between the price query result of beverage A and the price query result of beverage B; group 4: calculate the square of the difference."
[0087] Among them, "group1: query the price of beverage A" may refer to the tool group selection step of the operation "query the price of beverage A".
[0088] Step 303: for any operation, a target tool to be called is selected for the operation from the target tool group corresponding to the operation.
[0089] In the present application, step 303 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.
[0090] For example, the second step planning can be "group1: query the price of beverage A; group1: query the price of beverage B; group4: calculate the difference between the price query result of beverage A and the price query result of beverage B; group4: calculate the square of the difference". Taking "group1: query the price of beverage A" as an example, the tool to be called can be selected from the tool group group1 for the operation "query the price of beverage A".
[0091] Step 304 , generating a first step plan corresponding to the input information according to the operation sequence and the target tool group and target tool corresponding to each operation.
[0092] In the present application, step 304 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.
[0093] Step 305, calling the tool according to the plan in the first step, processing the input information, and obtaining the processing result of the input information.
[0094] In the present application, step 305 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.
[0095] In an embodiment of the present application, based on the description information of the candidate tools, a large model is used to determine the operations that need to be performed to process the input information, the order of operations of each operation, and the target tool group selected for each operation. Compared with using the large model to select the tool to be called based on the description information of all tools, the number of characters used in the large model can be saved, and the situation in which the result cannot be obtained due to exceeding the length limit of the large model character window can be avoided.
[0096] Figure 4 A flowchart of an information processing method for an intelligent agent provided in another embodiment of the present application.
[0097] like Figure 4 As shown, the information processing method of the intelligent agent includes:
[0098] Step 401: Obtain input information to be processed.
[0099] In the present application, step 401 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.
[0100] Step 402, determining each operation that needs to be performed to process the input information and the operation sequence of each operation, and determining a target tool group corresponding to each operation from the candidate tool group.
[0101] In the present application, step 402 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.
[0102] Step 403: Obtain description information and usage examples of each tool in the target tool group.
[0103] In this application, if there are multiple tools in the target tool group, description information of each tool in the target tool group and usage examples of each tool can be obtained.
[0104] Step 404 : selecting a target tool from the target tool group according to the description information and usage examples of each tool in the target tool group.
[0105] In the present application, for any operation, the matching degree between the operation and the description information of each tool in the target tool group, and the similarity between the operation and the usage examples of each tool in the target tool group can be calculated. Based on the matching degree and similarity corresponding to each tool in the target tool group, the target tool to be called for the operation is selected from the target tool group.
[0106] Exemplarily, the target tool can be determined from the tools in the target tool group whose matching degree is greater than the first threshold and whose similarity is greater than the second threshold. Exemplarily, if there is one tool in the target tool group whose matching degree is greater than the first threshold and whose similarity is greater than the second threshold, the tool can be determined as the target tool. If there are multiple tools in the target tool group whose matching degree is greater than the first threshold and whose similarity is greater than the second threshold, the tool with the greatest matching degree or the greatest similarity can be determined as the target tool.
[0107] Step 405 , generating a first step plan corresponding to the input information according to the operation sequence and the target tool group and target tool corresponding to each operation.
[0108] In the present application, step 405 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.
[0109] Step 406, calling the tool according to the plan in the first step, processing the input information, and obtaining the processing result of the input information.
[0110] In the present application, step 406 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.
[0111] In the embodiment of the present application, the target tool to be called is selected from the target tool group based on the description information of the tool in combination with the usage example of the tool, which can improve the accuracy of tool selection and further improve the accuracy of the input information processing result.
[0112] Figure 5A flowchart of an information processing method for an intelligent agent provided in another embodiment of the present application.
[0113] like Figure 5 As shown, the information processing method of the intelligent agent includes:
[0114] Step 501: Obtain input information to be processed.
[0115] In the present application, step 501 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.
[0116] Step 502, determining each operation that needs to be performed to process the input information and the operation sequence of each operation, and determining a target tool group corresponding to each operation from the candidate tool group.
[0117] In the present application, step 502 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.
[0118] Step 503 , according to the description information of each operation and each tool in the target tool group, the large model is used to select a target tool from the target tool group.
[0119] In the present application, the description information of the second prompt template and each tool in the target tool group can be obtained, and the second prompt template can be filled in according to the description information of each operation and each tool in the target tool group to obtain the second prompt information, and the second prompt information can be input into the large model for processing to select the target tool to be called from the target tool group.
[0120] Exemplarily, the second prompt template can be used to prompt the large model to perform a tool selection task. Exemplarily, the second prompt template can include slots to be filled, such as an operation slot, a tool description information slot, etc. The operation slot of the second prompt template can be filled according to each operation, and the tool description information slot of the second prompt template can be filled according to the description information of the tool, thereby obtaining the second prompt information.
[0121] Exemplarily, the second prompt information may include an operation, description information of each tool in the target tool group, output result format requirements, etc.
[0122] For example, the target tool group corresponding to the operation "query the price of beverage A" is group1, and the second prompt information corresponding to the operation is "The following tools are included in tool group group1: tool1: calculator, the input is a mathematical formula; tool2: product price query, the input is the product name. The operation to be executed is {query the price of beverage A}, select a tool for this operation from tool group group1 based on the description information of the above tools."
[0123] Exemplarily, a usage example of the tool may also be obtained, and the second prompt template may be filled in according to the usage example of the tool, so that the large model may also select the target tool to be called in combination with the usage example of the tool.
[0124] Step 504 , generating a first step plan corresponding to the input information according to the operation sequence and the target tool group and target tool corresponding to each operation.
[0125] In the present application, step 504 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.
[0126] Step 505, calling the tool according to the plan in the first step, processing the input information, and obtaining the processing result of the input information.
[0127] In the present application, step 505 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.
[0128] In an embodiment of the present application, based on the description information of each tool in the target tool group, a large model is used to select the target tool to be called from the target tool group. Compared with selecting the tool to be called based on the description information of all tools using the large model, the number of characters used in the large model can be saved, and the situation in which the result cannot be obtained due to exceeding the length limit of the large model character window can be avoided.
[0129] In one embodiment of the present application, the information processing method of the intelligent agent of the present application may also include: using a large model to group the tools that can be called by the intelligent agent to obtain a tool grouping result.
[0130] In the present application, the third prompt template and the description information of multiple tools to be grouped can be obtained, and the third prompt template can be filled in according to the description information of multiple tools to obtain the third prompt information, and then the third prompt information can be input into the large model for processing to obtain the tool grouping result.
[0131] Illustratively, the tool grouping result may include candidate tool groups, description information of the candidate tool groups, and the like.
[0132] Exemplarily, the third prompt information may include description information, grouping requirements, input format requirements, etc. of multiple tools.
[0133] For example, the third prompt information is "The following tools are known: commodity price query; search engine; tool for drawing animals through text; tool for completing sketches through text; file exploration tool; file data analysis tool; calculator. Please group the above tools according to similar functions, and give a description for each group, and output the final result in json." The third prompt information is input into the big model for processing, and the output result of the big model is:
[0134]
[0135] It can be seen that the above 7 tools are divided into 4 tool groups through the big model, and each tool group has corresponding description information.
[0136] Therefore, based on the description information of multiple tools to be grouped, the multiple tools to be grouped are grouped using a large model, which not only realizes tool grouping, but also obtains the description information of the tool group, thereby improving the accuracy of the tool grouping results.
[0137] In one embodiment of the present application, the information processing method of the intelligent agent of the present application may further include: grouping multiple tools to be grouped based on the similarities between the tools to be grouped.
[0138] In the present application, the description information of multiple tools to be grouped can be obtained, and based on the description information of the multiple tools, the similarity between each two of the multiple tools can be calculated. Based on the similarity between each two of the tools, the multiple tools are clustered to obtain a candidate tool group, and then the description information of the candidate tool group is determined based on the description information of the tools in the candidate tool group.
[0139] Exemplarily, the similarity between the two tools may be obtained by calculating the similarity between the description information of the two tools.
[0140] Exemplarily, if there is one tool in the candidate tool group, the description information of the tool may be used as the description information of the candidate tool group.
[0141] Exemplarily, if there are multiple tools in the candidate tool group, keywords may be extracted from the description information of the multiple tools, and the description information of the candidate tool group may be determined based on the extracted keywords.
[0142] Therefore, multiple tools can be clustered based on the similarity between each two of the multiple tools to be grouped to obtain a candidate tool group, which can improve the accuracy of tool grouping, and the description information of the tool group can be determined based on the description information of the tools in the tool group, which can improve the accuracy of the tool group description information.
[0143] Furthermore, when a new tool is added, the description information of the new tool can be obtained, and based on the description information of the new tool and the description information of each candidate tool group, the matching degree between the new tool and each candidate tool group can be determined. Based on the matching degree between the new tool and each candidate tool group, the candidate tool group to which the new tool belongs can be determined, and the new tool can be added to the candidate tool group to which it belongs.
[0144] Exemplarily, the candidate tool group with a matching degree greater than a third threshold and the highest matching degree may be determined as the candidate tool group to which the newly added tool belongs.
[0145] Exemplarily, if the matching degree between the newly added tool and the candidate tool is less than the third threshold, a tool group may be added to add the newly added tool to the tool group, and the description information of the tool may be determined based on the description information of the newly added tool.
[0146] Therefore, when there are new tools, the new tools can be grouped into appropriate tool groups based on the matching degree between the new tools and the candidate tool groups, thereby improving the accuracy of tool grouping.
[0147] Optionally, the description information of the newly added tool, the existing candidate tool groups and their description information can be input into the big model, and the big model is used to determine the grouping result of the newly added tool. Exemplarily, if the newly added tool does not belong to the existing candidate tool group, the new tool group to which the newly added tool belongs and the description information of the new tool group can be output.
[0148] In order to implement the above-mentioned embodiment, the embodiment of the present application also proposes an information processing device of an intelligent agent. Figure 6 A schematic diagram of the structure of an information processing device of an intelligent entity provided in one embodiment of the present application.
[0149] like Figure 6 As shown, the information processing device 600 of the intelligent agent includes:
[0150] A first acquisition module 610, used to acquire input information to be processed;
[0151] The first determination module 620 is used to determine the operations to be performed to process the input information and the operation sequence of the operations, and to determine the target tool group corresponding to each operation from the candidate tool group; wherein the candidate tool group includes at least one tool;
[0152] The second determination module 630 is used to select a target tool to be called for any operation from the target tool group corresponding to the operation;
[0153] A generating module 640 is used to generate a first step plan corresponding to the input information according to the operation sequence and the target tool group and target tool corresponding to each operation; wherein the first step plan is used to indicate the operation sequence of each operation, the target tool group to be selected for executing each operation, and the target tool to be called for executing each operation;
[0154] The processing module 650 is used to plan and call the tool according to the first step, process the input information, and obtain the processing result of the input information.
[0155] Optionally, the first determining module 620 is configured to:
[0156] Obtaining description information of a first prompt template and a candidate tool group; wherein the first prompt template is used to prompt the large model to perform tool group selection and operation planning tasks;
[0157] Filling a first prompt template according to the input information and the description information of the candidate tool group to obtain first prompt information;
[0158] The first prompt information is input into the large model for processing to obtain a second step plan corresponding to the input information; wherein the second step plan includes each operation, the operation sequence of each operation and a target tool group corresponding to each operation.
[0159] Optionally, the first determining module 620 is configured to:
[0160] Get description information of candidate tool groups;
[0161] Determining the degree of match between each operation and the description information of the candidate tool set;
[0162] The candidate tool group with the highest matching degree is determined as the target tool group.
[0163] Optionally, the second determining module 630 is configured to:
[0164] Get description information and usage examples of each tool in the target tool group;
[0165] Determining a match between the operation and the description information of each tool in the target tool set, and a similarity between the operation and a usage example of each tool in the target tool set;
[0166] A target tool is selected from the target tool group according to the matching degree and similarity corresponding to each tool in the target tool group.
[0167] Optionally, the second determining module 630 is configured to:
[0168] Obtaining a second prompt template and description information of each tool in the target tool group; wherein the second prompt template is used to prompt the large model to perform a tool selection task;
[0169] Filling the second prompt template according to the description information of the operation and each tool in the target tool group to obtain second prompt information;
[0170] The second prompt information is input into the large model for processing to select a target tool from the target tool group.
[0171] Optionally, the generating module 640 is used to:
[0172] According to each operation and target tool group, a tool group selection step corresponding to each operation is obtained;
[0173] According to each operation and target tool, the tool calling steps corresponding to each operation are obtained;
[0174] According to the operation sequence, the tool group selection steps and tool calling steps corresponding to each operation are sorted to generate the first step plan.
[0175] Optionally, the device may further include:
[0176] The second acquisition module is used to acquire a third prompt template and description information of multiple tools; wherein the third prompt template is used to prompt the large model to perform a similar tool grouping task, and the third prompt template includes: tool grouping task information and output tool group description information requirements;
[0177] A third acquisition module, used to fill in a third prompt template according to the description information of the plurality of tools to obtain third prompt information;
[0178] The fourth acquisition module is used to input the third prompt information into the large model for processing to obtain a tool grouping result of multiple tools; wherein the tool grouping result includes a candidate tool group and description information of the candidate tool group.
[0179] Optionally, the device may further include:
[0180] A fifth acquisition module, used to acquire description information of multiple tools, and calculate the similarity between any two tools in the multiple tools according to the description information of the multiple tools;
[0181] A clustering module is used to cluster multiple tools according to the similarity between two tools to obtain a candidate tool group;
[0182] The third determining module is used to determine the description information of the candidate tool group according to the description information of the tools in the candidate tool group.
[0183] Optionally, the device may further include:
[0184] The sixth acquisition module is used to obtain description information of the newly added tool;
[0185] A fourth determination module, used to determine the matching degree between the newly added tool and the candidate tool group according to the description information of the newly added tool and the description information of the candidate tool group;
[0186] The fifth determining module is used to determine the candidate tool group to which the newly added tool belongs according to the matching degree between the newly added tool and the candidate tool group, and add the newly added tool to the candidate tool group to which it belongs.
[0187] It should be noted that the explanation of the aforementioned information processing method embodiment is also applicable to the information processing device of this embodiment, so it will not be repeated here.
[0188] In an embodiment of the present application, for each operation that needs to be performed to process input information, a target tool group can be selected from a candidate tool group for each operation, and then a target tool to be called can be selected from the target tool group. Compared with directly selecting the tool to be called from all tools, the selection range of the tool can be narrowed, the efficiency and accuracy of the tool selection can be improved, and the accuracy of the input information processing results can be improved.
[0189] According to an embodiment of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.
[0190] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0191] like Figure 7 As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 702 or a computer program loaded from a storage unit 708 to a RAM (Random Access Memory) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An I / O (Input / Output) interface 705 is also connected to the bus 704.
[0192] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0193] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as the information processing method of the agent. For example, in some embodiments, the information processing method of the agent may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the information processing method of the agent described above may be executed. Alternatively, in other embodiments, the computing unit 701 may be configured to execute the information processing method of the intelligent agent in any other appropriate manner (eg, by means of firmware).
[0194] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor that may be a dedicated or general-purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0195] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0196] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0197] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0198] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.
[0199] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services (Virtual Private Server). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0200] According to an embodiment of the present application, the present application also provides a computer program product, which, when an instruction processor in the computer program product is executed, executes the information processing method of the intelligent agent proposed in the above embodiment of the present application.
[0201] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.
[0202] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. An information processing method of an intelligent agent, comprising: Get the input information to be processed; Determine each operation to be performed for processing the input information and the operation sequence of each operation, and determine a target tool group corresponding to each operation from a candidate tool group; wherein the candidate tool group includes at least one tool; For any operation, selecting a target tool to be called for the operation from a target tool group corresponding to the operation; Generate a first step plan corresponding to the input information according to the operation sequence and the target tool group and target tool corresponding to each operation; wherein the first step plan is used to indicate the operation sequence of each operation, the target tool group to be selected for executing each operation, and the target tool to be called for executing each operation; According to the first step, a calling tool is planned to process the input information to obtain a processing result of the input information.
2. The method of claim 1, wherein: The determining of each operation to be performed for processing the input information and the operation sequence of each operation, and determining a target tool group corresponding to each operation from the candidate tool group, includes: Acquire a first prompt template and description information of the candidate tool set; wherein the first prompt template is used to prompt the large model to perform tool set selection and operation planning tasks; Filling the first prompt template according to the input information and the description information of the candidate tool group to obtain first prompt information; The first prompt information is input into the large model for processing to obtain a second step plan corresponding to the input information; wherein the second step plan includes each operation, the operation sequence of each operation and the target tool group corresponding to each operation.
3. The method of claim 1, wherein: The step of determining a target tool group corresponding to each operation from the candidate tool group includes: Obtaining description information of the candidate tool group; Determining a degree of match between each operation and the description information of the candidate tool group; The candidate tool group with the highest matching degree is determined as the target tool group.
4. The method of claim 1, wherein: For any operation, selecting a target tool to be called for the operation from a target tool group corresponding to the operation includes: Obtaining description information and usage examples of each tool in the target tool group; Determining a matching degree between the operation and description information of each tool in the target tool set, and a similarity between the operation and a usage example of each tool in the target tool set; The target tool is selected from the target tool group according to the matching degree and similarity corresponding to each tool in the target tool group.
5. The method of claim 1, wherein: For any operation, selecting a target tool to be called for the operation from a target tool group corresponding to the operation includes: Acquire a second prompt template and description information of each tool in the target tool group; wherein the second prompt template is used to prompt the large model to perform a tool selection task; Filling the second prompt template according to the operation and the description information of each tool in the target tool group to obtain second prompt information; The second prompt information is input into the large model for processing to select the target tool from the target tool group.
6. The method of claim 1, wherein: The step of generating a first step plan corresponding to the input information according to the operation sequence and the target tool group and target tool corresponding to each operation includes: According to each operation and the target tool group, a tool group selection step corresponding to each operation is obtained; According to each operation and the target tool, a tool calling step corresponding to each operation is obtained; According to the operation sequence, the tool group selection steps and tool calling steps corresponding to the various operations are sorted to generate the first step plan.
7. The method of claim 1, further comprising: Acquire a third prompt template and description information of multiple tools; wherein the third prompt template is used to prompt the large model to perform a similar tool grouping task, and the third prompt template includes: tool grouping task information and output tool group description information requirements; Filling the third prompt template according to the description information of the multiple tools to obtain third prompt information; The third prompt information is input into the large model for processing to obtain a tool grouping result of the plurality of tools; wherein the tool grouping result includes the candidate tool group and description information of the candidate tool group.
8. The method of claim 1, further comprising: Obtaining description information of a plurality of tools, and calculating similarities between any two of the plurality of tools according to the description information of the plurality of tools; Clustering the multiple tools according to the similarity between any two tools to obtain the candidate tool group; Determine the description information of the candidate tool group according to the description information of the tools in the candidate tool group.
9. The method of claim 8, further comprising: Get the description information of the newly added tool; Determining a matching degree between the newly added tool and the candidate tool group according to the description information of the newly added tool and the description information of the candidate tool group; According to the matching degree between the newly added tool and the candidate tool group, the candidate tool group to which the newly added tool belongs is determined, and the newly added tool is added to the candidate tool group to which it belongs.
10. An information processing device for an intelligent agent, comprising: A first acquisition module, used to acquire input information to be processed; A first determination module is used to determine various operations that need to be performed to process the input information and the operation sequence of the various operations, and to determine a target tool group corresponding to each operation from a candidate tool group; wherein the candidate tool group includes at least one tool; A second determination module is used to select a target tool to be called for any operation from a target tool group corresponding to the operation; A generation module, used to generate a first step plan corresponding to the input information according to the operation sequence and the target tool group and target tool corresponding to each operation; wherein the first step plan is used to indicate the operation sequence of each operation, the target tool group to be selected for executing each operation, and the target tool to be called for executing each operation; The processing module is used to plan and call the tool according to the first step, process the input information, and obtain the processing result of the input information.
11. The device of claim 10, wherein: The first determining module is used to: Acquire a first prompt template and description information of the candidate tool set; wherein the first prompt template is used to prompt the large model to perform tool set selection and operation planning tasks; Filling the first prompt template according to the input information and the description information of the candidate tool group to obtain first prompt information; The first prompt information is input into the large model for processing to obtain a second step plan corresponding to the input information; wherein the second step plan includes each operation, the operation sequence of each operation and the target tool group corresponding to each operation.
12. The device of claim 10, wherein: The first determining module is used to: Obtaining description information of the candidate tool group; Determining a degree of match between each operation and the description information of the candidate tool group; The candidate tool group with the highest matching degree is determined as the target tool group.
13. The device of claim 10, wherein: The second determining module is used to: Obtaining description information and usage examples of each tool in the target tool group; Determining a matching degree between the operation and description information of each tool in the target tool set, and a similarity between the operation and a usage example of each tool in the target tool set; The target tool is selected from the target tool group according to the matching degree and similarity corresponding to each tool in the target tool group.
14. The device of claim 10, wherein: The second determining module is used to: Acquire a second prompt template and description information of each tool in the target tool group; wherein the second prompt template is used to prompt the large model to perform a tool selection task; Filling the second prompt template according to the operation and the description information of each tool in the target tool group to obtain second prompt information; The second prompt information is input into the large model for processing to select the target tool from the target tool group.
15. The device of claim 10, wherein: The generating module is used for: According to each operation and the target tool group, a tool group selection step corresponding to each operation is obtained; According to each operation and the target tool, a tool calling step corresponding to each operation is obtained; According to the operation sequence, the tool group selection steps and tool calling steps corresponding to the various operations are sorted to generate the first step plan.
16. The apparatus of claim 10, further comprising: A second acquisition module is used to acquire a third prompt template and description information of multiple tools; wherein the third prompt template is used to prompt the large model to perform a similar tool grouping task, and the third prompt template includes: tool grouping task information and output tool group description information requirements; A third acquisition module, configured to fill the third prompt template according to the description information of the plurality of tools to obtain third prompt information; The fourth acquisition module is used to input the third prompt information into the large model for processing to obtain a tool grouping result of the multiple tools; wherein the tool grouping result includes the candidate tool group and description information of the candidate tool group.
17. The apparatus of claim 10, further comprising: A fifth acquisition module, configured to acquire description information of a plurality of tools, and calculate similarities between any two of the plurality of tools according to the description information of the plurality of tools; A clustering module, used for clustering the plurality of tools according to the similarity between any two tools, to obtain the candidate tool group; The third determining module is used to determine the description information of the candidate tool group according to the description information of the tools in the candidate tool group.
18. The apparatus of claim 17, further comprising: The sixth acquisition module is used to obtain description information of the newly added tool; A fourth determination module, configured to determine a matching degree between the newly added tool and the candidate tool group according to the description information of the newly added tool and the description information of the candidate tool group; The fifth determining module is used to determine the candidate tool group to which the newly added tool belongs according to the matching degree between the newly added tool and the candidate tool group, and add the newly added tool to the candidate tool group to which it belongs.
19. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 9.
20. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-9.
21. A computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Business data processing model generation method, system construction method and device
CN113468237A
System and method for detecting open door
CN116783455A
Task processing method, device, system and equipment and readable storage medium
CN117094376A
Heating and ventilation system data processing method, device and equipment based on large language model
CN117235223A
Non-transitory computer readable medium, information sharing support system, and information sharing support method
US20140359012A1
