Task processing method, system and equipment and storage medium
The single agent framework uses scene identification to determine the target tool to process task requests, solving the problems of complex coordinated scheduling and low stability in the multi-agent framework, and achieving efficient and stable task processing.
Patent Information
- Application Number
- CN202510524159.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-08-26
AI Technical Summary
The existing multi-agent framework has problems such as complex coordinated scheduling, high development and maintenance costs, low stability and poor response performance in task processing, which is difficult to meet the needs of high real-time scenarios.
The single agent framework is adopted to determine the target tool from the preset tool library by receiving scene identification, and directly handle task requests, avoiding coordinated scheduling and complex communication between agents, and using the single agent framework to realize task processing.
It reduces the development and maintenance costs of the agent, improves the stability and efficiency of task processing, shortens the response time, and improves the robustness and reliability of the system.
Smart Images

Figure CN120540796A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to technical fields such as artificial intelligence, large language models, and intelligent services. Background Art
[0002] In recent years, with the increasing maturity of artificial intelligence technology, intelligent agents have acquired the ability to provide services such as intelligent question-answering and task processing. Current intelligent agent service solutions use a multi-agent framework to implement multi-scenario task processing. Specifically, corresponding agents are set up for different business scenarios. Upon receiving a task request from the user, the multi-agent framework dispatches the corresponding agent based on the task scenario, and the dispatched agent performs the task processing. Due to the need to maintain multiple agents and coordinate scheduling between them, the efficiency and stability of task processing are low due to the complex message communication mechanism of coordinated scheduling and the chain reaction that scheduling failures may cause. Therefore, how to improve the efficiency and stability of task processing for multi-scenario task requests has become a pressing issue. Summary of the Invention
[0003] The present disclosure provides a task processing method, system, device, and storage medium.
[0004] According to one aspect of the present disclosure, a task processing method is provided, comprising:
[0005] Receive task request and scenario identification;
[0006] Determining, based on the scenario identifier, at least one target tool for processing the task request from a preset tool library;
[0007] The task request is processed using the at least one target tool to obtain a response result for the task request.
[0008] According to another aspect of the present disclosure, a task processing system is provided, comprising a receiving unit and a processing unit; wherein,
[0009] A receiving unit, configured to receive a task request and a scene identifier;
[0010] The processing unit is used to determine at least one target tool for processing the task request from a preset tool library according to the scenario identifier; and use the at least one target tool to process the task request to obtain a response result for the task request.
[0011] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0012] at least one processor; and
[0013] a memory communicatively connected to the at least one processor; wherein,
[0014] 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 any method in the embodiments of the present disclosure.
[0015] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any method according to the embodiments of the present disclosure.
[0016] According to another aspect of the present disclosure, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the computer program implements any one of the methods according to the embodiments of the present disclosure.
[0017] This disclosure proposes a task processing method that determines a target tool for processing task requests based on a scenario identifier and uses this target tool to respond to the task request. This avoids scheduling task requests across different agents, thereby enabling task request processing within a single-agent framework. Because this solution utilizes a single-agent framework to process task requests, there's no need to maintain multiple agents or coordinate scheduling between them. This approach avoids the adverse effects of current multi-agent implementations on task processing efficiency and stability, thereby improving both efficiency and stability.
[0018] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.
[0020] Figure 1 This is a schematic diagram of the principle of the multi-agent framework;
[0021] Figure 2 is a schematic diagram of an application scenario according to an embodiment of the present disclosure;
[0022] Figure 3 is a flowchart of an implementation method of a task processing method according to an embodiment of the present disclosure;
[0023] Figure 4 is a schematic diagram of a process for obtaining a response result according to an embodiment of the present disclosure;
[0024] Figure 5 is a flowchart of a task processing method according to an embodiment of the present disclosure;
[0025] Figure 6 This is a flowchart of a task processing method for an intelligent customer service service according to an embodiment of the present disclosure;
[0026] Figure 7 is a structural diagram of a task processing system 700 according to an embodiment of the present disclosure;
[0027] Figure 8 is a structural diagram of a task processing system 800 according to an embodiment of the present disclosure;
[0028] Figure 9 A schematic block diagram of an example electronic device 900 is shown, which may be used to implement embodiments of the present disclosure. DETAILED DESCRIPTION
[0029] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be appreciated by those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0030] The “and / or” in the embodiments of the present disclosure indicates that there may be three relationships. For example, A and / or B may indicate three situations: A exists alone, A and B exist at the same time, and B exists alone. The term “at least one” herein indicates any combination of at least two of any one or more of a plurality of. For example, at least one of A, B, and C may indicate any one or more elements selected from the set consisting of A, B, and C. The terms “first” and “second” herein refer to and distinguish between multiple similar technical terms, and do not mean to limit the order or to limit the meaning to only two. For example, the first feature and the second feature refer to two categories / two features. The first feature may be one or more, and the second feature may also be one or more.
[0031] With the rapid development of artificial intelligence (AI), agent technology, as a key branch, is maturing. With its powerful interactive and task-processing capabilities, agents are now able to provide services such as intelligent question-answering and task processing.
[0032] However, in real-world applications, the same agent needs to master different knowledge, business logic, and operational processes when facing different business scenarios, such as instant messaging (IM), enterprise resource planning (ERP), and finance. This results in the same agent being able to answer vastly different questions and handle different tasks in different business scenarios.
[0033] Traditional agent implementations require independent agents to meet diverse needs across different business scenarios. These agents each possess independent models, knowledge bases, and business logic processing capabilities, working together through parallel scheduling to achieve comprehensive coverage of their capabilities across different business scenarios.
[0034] For example, most traditional intelligent agent implementation solutions use a multi-agent framework, such as Figure 1 As shown in Figure 2, in this framework, a parent agent dispatches tasks to child agents, and multiple child agents collaborate to complete a task. Currently, mainstream open-source multi-agent solutions include AutoGen, Swarm, and CrewAI.
[0035] The solution based on the Multiagent framework handles tasks in different business scenarios by disassembling a series of sub-agents. This solution has the following problems: on the one hand, it is necessary to maintain multiple agents at the same time, which makes the collaborative scheduling and message communication mechanism between agents complicated, increasing development and maintenance costs; on the other hand, since the agents are interconnected, once a single agent fails or encounters an abnormality during operation, its error state may be propagated through preset communication protocols, shared resources or task dependencies, triggering chain failures of other related agents, and thus significantly reducing the overall robustness of the system; in addition, the serial scheduling method of multiple agents will slow down the response performance, making it difficult to meet the needs of high real-time scenarios.
[0036] In order to solve the above problems, an embodiment of the present disclosure proposes a task processing method. The method determines at least one target tool for processing the task request from a preset tool library through the received scene identification, and then uses the at least one target tool to process the task request to obtain a response result of the task request. Since the method of the embodiment of the present disclosure can be implemented based on a single-agent architecture, the method can reduce the development and maintenance costs of the agent compared to the multi-agent framework. At the same time, under the single-agent framework, since there is no risk of system performance collapse caused by the failure of a single agent to operate in the collaborative operation of multiple agents, the stability of the system operation is improved, thereby effectively improving the efficiency and reliability of task processing.
[0037] Figure 2 is a schematic diagram of an application scenario according to an embodiment of the present disclosure, such as Figure 2 As shown, the application scenario diagram of the embodiment of the present disclosure may include but is not limited to a terminal device 210 and a task processing system 220, and the terminal device 210 and the task processing system 220 may communicate with each other through any type of wired or wireless network. Specifically, the terminal device 210 may receive information input by a user, or actively obtain information; for example, receive a task request input by a user, or actively obtain a scene identifier based on the scene in which the terminal device 210 is located when the user inputs the task request. The terminal device 210 may also send the received or actively obtained information to the task processing system 220 via a wired or wireless network with the task processing system 220. The task processing system 220 may be used to receive information from the terminal device 210 and execute the task corresponding to the information.
[0038] The terminal devices 210 proposed in the embodiments of the present disclosure include, but are not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, in-vehicle terminals, game consoles, e-book readers, multimedia playback devices, wearable devices, and other electronic devices; the task processing system 220 may include a server or server cluster. Furthermore, the embodiments of the present disclosure do not specifically limit the number of terminal devices 210. For example, the application scenario diagrams of the embodiments of the present disclosure may include one or more terminal devices 210.
[0039] Figure 3 This is a flowchart of an implementation of a task processing method according to an embodiment of the present disclosure, including:
[0040] S310, receiving a task request and a scenario identifier;
[0041] S320: Determine, based on the scenario identifier, at least one target tool for processing the task request from a preset tool library;
[0042] S330: Utilize the at least one target tool to process the task request to obtain a response result for the task request.
[0043] In some examples, a task request may include specific work instructions or requirements that need to be processed. For example, in an e-commerce system, a user-submitted request to "query order details" may be a task request. Scenario identifiers can be used to distinguish the specific application scenarios or business scenarios within which different task requests reside. Specifically, scenario identifiers may include scenario names, numbers, codes, etc. In embodiments of the present disclosure, a single-agent framework can be used to receive task requests and scenario identifiers sent by terminal devices.
[0044] In this example, the scenario identifier can be determined by the interface of the terminal device used to send the task request. Specifically, when a user sends a task request using a terminal device (such as a smartphone, tablet computer, smart wearable device, etc.), the terminal device can automatically identify the interface of the task request and determine the scenario of the interface as a business scenario. Here, a business scenario refers to a scenario in which relevant participants (such as users, merchants or platforms, etc.) carry out business activities in accordance with established operating procedures and with the help of various resources (such as data, technology or equipment, etc.) in a specific business field with the core of achieving a specific business goal.
[0045] For example, in the e-commerce field, business scenarios may include product browsing, ordering, payment settlement, and after-sales service. When a user sends a task request to "query product inventory" through a terminal device, the terminal device can automatically recognize that the user is currently in the product browsing interface and, based on this interface, can determine that the business scenario is a product browsing scenario. If the user sends a task request to "submit an order," the terminal device can automatically recognize that the user is currently in the payment interface and, based on this interface, can determine that the business scenario is an ordering scenario.
[0046] On this basis, the single-agent framework receives the task request sent by the terminal device and the scene identifier of the specific scene in which the task request is located, and then processes the task request based on this information. For example, if the user sends a task request from the service account interface, the specific scene in which the task request is located is the service account scene. Furthermore, the single-agent framework receives the scene identifier corresponding to the task request and the service account scene.
[0047] In some examples, a preset tool library can be a pre-built collection of tools that can be used to handle different types of task requests. These tools can include software modules, computational methods, function libraries, external service interfaces, and so on. For example, for data analysis scenarios, the preset tool library may include data cleaning tools and statistical analysis tools; for text processing scenarios, the preset tool library may also include word segmentation tools and text classification tools.
[0048] In the embodiment of the present disclosure, since a task request may involve multiple processing steps or require multiple tools to work together, it may be necessary to determine at least one target tool.
[0049] Furthermore, the task request is processed according to a predetermined processing logic by calling at least one determined target tool. For example, if the target tool is a data query tool, the tool can perform a query operation by parsing the query conditions provided by the user to return the query results.
[0050] After processing by the target tool, a response to the task request is generated. The format and content of the response depend on the type of task request and the processing results of the target tool. For example, for a task request to "query order details," the response might be structured data containing detailed information such as the order number, product information, and order status.
[0051] It can be seen from the above steps that the task processing method proposed in the embodiment of the present disclosure can realize task processing based on a single-agent framework. Specifically, when a user's task request and scenario identification are received, the target tool for processing the task request is determined according to the scenario identification, and the target tool is used to respond to the task request, thereby avoiding scheduling the task request between different agents. Compared with the current task processing method based on a multi-agent framework, this method can reduce the cost of building and maintaining the agent. At the same time, this method avoids the risk of global collapse caused by local failures in the multi-agent framework, thereby improving the stability of task processing. In addition, this method does not need to wait for collaborative feedback from other agents, which improves the response speed of task requests, thereby shortening the task processing cycle, reducing the risk of delays caused by waiting for feedback, and improving task processing efficiency and reliability.
[0052] In some embodiments, determining at least one target tool for processing the task request from a preset tool library based on the scenario identifier includes:
[0053] According to the scenario identifier, obtaining a plurality of tool capabilities corresponding to the scenario identifier from the preset tool library;
[0054] At least one target tool for processing the task request is determined from the plurality of tool capabilities.
[0055] In the disclosed embodiment, based on the scenario identifier, multiple tool capabilities associated with the scenario identifier are searched from a preset tool library. For example, if the scenario identifier is "user complains about product quality issues," the tool capabilities associated with the scenario identifier may include: a text analysis tool (e.g., for analyzing the specific content of the user's complaint), a product quality assessment tool (e.g., for determining whether the product has quality issues), a solution recommendation tool (e.g., for providing corresponding solutions based on the assessment results), etc.
[0056] However, when actually processing a task request, it is not necessarily necessary to use all tool capabilities. Therefore, these tool capabilities may be further screened to determine at least one target tool for processing the task request.
[0057] The above method allows, based on the scenario identifier, to retrieve at least one tool capability corresponding to the scenario identifier from a preset tool library, avoiding blind searches within the preset tool library and saving time in finding tool capabilities. Furthermore, based on the specific requirements of the task request, at least one target tool can be determined from the at least one retrieved tool capability, avoiding the use of unnecessary or inefficient tools and thereby improving task processing efficiency.
[0058] In some embodiments, the method further includes pre-saving a mapping relationship between scenarios and tool capabilities, wherein the mapping relationship between scenarios and tool capabilities includes multiple scenario identifiers and identifiers of tool capabilities corresponding to each scenario identifier;
[0059] Based on the scenario identifier, multiple tool capabilities corresponding to the scenario identifier are determined from the preset tool library, including:
[0060] Using the scenario identifier to search for a mapping relationship between the scenario and the tool capability, and determining identifiers of multiple tool capabilities corresponding to the scenario identifier;
[0061] A plurality of tool capabilities corresponding to the identifiers of the plurality of tool capabilities are obtained from the preset tool library.
[0062] In the embodiment of the present disclosure, there is a mapping relationship between scenes and tool capabilities, which is used to store multiple scene identifiers and the identifiers of the tool capabilities corresponding to each scene identifier. In other words, for each scene identifier in the mapping relationship between scenes and tool capabilities, a series of specific tool capability identifiers are bound. Here, the mapping relationship between scenes and tool capabilities can be implemented in the form of lists, key-value pairs, dictionaries, etc. For example, two lists are used to store the identifiers of scenes and corresponding tool capabilities respectively, and a mapping relationship is established through indexing; a list is used to store key-value pairs, and each key-value pair contains a scene and the identifier of the corresponding tool capability; a dictionary is used to implement the mapping between scenes and tool capabilities, the key can be a scene, and the value can be a list containing the identifier of the tool capability corresponding to the scene.
[0063] Furthermore, based on the input scenario identifier, a search is performed in the mapping relationship between scenarios and tool capabilities to determine the identifiers of all tool capabilities corresponding to the scenario identifier. After determining the identifiers of all tool capabilities corresponding to the scenario identifier, the tool capabilities corresponding to these tool capability identifiers need to be obtained from the preset tool library for subsequent task processing.
[0064] By adopting the above method, by utilizing the mapping relationship between pre-saved scenarios and tool capabilities, it is possible to determine the identifiers of multiple tool capabilities corresponding to the scenario identifier based on the scenario identifier. Furthermore, based on the identifiers of these tool capabilities, it is possible to obtain the corresponding multiple tool capabilities from the preset tool library. In this way, the situation of tool capability acquisition errors can be reduced, and a data basis is provided for the processing of subsequent task requests.
[0065] In some implementations, the preset tool library stores capability description information of each tool capability;
[0066] Determining at least one target tool for processing the task request from a plurality of tool capabilities includes:
[0067] Analyze the task request to obtain demand information corresponding to the task request;
[0068] Match the requirement information with the capability description information of each tool capability;
[0069] At least one target tool for processing the task request is determined from the plurality of tool capabilities according to the matching result.
[0070] In the disclosed embodiments, for each tool capability, corresponding capability description information is stored in the preset tool library. This capability description information is used to detail the function, purpose, input and output, and restrictions of the corresponding tool capability. For example, for the tool capability "Create Work Order," its capability description information may include: generating a new work order in the system to record an issue or task; inputting the work order type, title, description, etc.; outputting the work order ID, creation time, status, etc.; and restricting that only users with the corresponding permissions can create the work order.
[0071] In the disclosed embodiments, character requests can be analyzed using technologies such as text cleaning, language recognition, and natural language processing (NLP). Specifically, text cleaning can be used to remove irrelevant characters, spaces, line breaks, and other characters from task requests to unify the text format for subsequent processing. If the task request contains multiple languages, language recognition technology can be used to determine the primary language so that appropriate NLP tools can be selected.
[0072] Furthermore, NLP technology can be used to parse task requests. For example, NLP technology can be used to segment the task request text into individual words and annotate each word with its part of speech (such as noun, verb, adjective, etc.) to understand the grammatical structure and semantics of the task request. Named entity recognition tools can be used to extract key entities in the task request, such as place names, time, and numbers. This entity information can be used to understand the requirements in the task request. Semantic understanding tools can be used to combine contextual information and domain knowledge to identify the true intent of the task request and obtain the requirement information corresponding to the task request.
[0073] In one example, keyword matching can be used to match requirement information with the capability descriptions of various tool capabilities. Specifically, keywords are extracted from the requirement information and capability descriptions, and the similarity between the keywords is calculated using algorithms such as cosine similarity and Jaccard similarity to obtain matching results between the requirement information and capability descriptions.
[0074] In another example, matching can be performed based on the semantic relationship between keywords in the requirement information and the capability description information of each tool capability. This approach is not only based on the surface similarity of keywords, but also requires understanding the inherent meaning of keywords. Specifically, using NLP technologies such as word vector models (such as Word2Vec, GloVe) and pre-trained language models (such as BERT, GPT), the keywords in the requirement information and capability description information are converted into vector representations, and the similarity between the vectors is calculated to obtain the matching results between the requirement information and capability description information.
[0075] In some embodiments, determining at least one target tool for processing the task request from a plurality of tool capabilities based on the matching result includes:
[0076] Compare the matching result with a preset threshold value, and determine the target capability description information corresponding to the matching result that is greater than or equal to the preset threshold value;
[0077] From a plurality of tool capabilities, a tool capability corresponding to at least one target capability description information is determined as at least one target tool for processing the task request.
[0078] In the disclosed embodiment, after obtaining a match result between the requirement information and the capability description information of each tool capability, a preset threshold can be used to determine at least one target tool for processing the task request from multiple tool capabilities. Specifically, the matching results between the requirement information and the capability description information can be first sorted, and the sorting result reflects the degree of fit between the tool capabilities corresponding to the capability description information and the requirement information; then, the matching result is compared with the preset threshold. If the matching result is greater than or equal to the preset threshold, the capability description information corresponding to the matching result is determined as the target capability description information, and further, the tool capability corresponding to the target capability description information is determined as the target tool.
[0079] By adopting the above method, tool capabilities that do not meet the requirements are filtered out through preset thresholds and target tools are determined, which reduces the risk of task processing failure caused by the incompatibility between tool capabilities and task requests, thereby improving the stability and reliability of task processing.
[0080] In the embodiment of the present disclosure, the specific value of the preset threshold can be set according to actual conditions, and the present disclosure does not impose any specific restrictions on it.
[0081] Using this method, we analyze the task request, extract specific requirements, and then match this with the capability descriptions of each tool, ensuring that the selected target tool better meets the actual requirements of the task request. Furthermore, this method automates the matching of requirements and capability descriptions, improving the efficiency of target tool selection.
[0082] In some embodiments, processing the task request using at least one target tool to obtain a response result for the task request includes:
[0083] Processing the task request using at least one target tool to obtain a processing result;
[0084] Based on the processing result and the task request, a response result for the task request is generated.
[0085] Through this approach, a single task request can be processed separately by multiple target tools. Upon receiving a task request from a user, each of the corresponding target tools can independently process the different subtasks within the task request and obtain their own processing results. These processing results are then combined to generate a response to the task request. This response is then returned to the user and displayed on the terminal device where the user is logged in. Using target tools to process task requests improves task request processing efficiency and shortens the task request processing cycle. Furthermore, by comprehensively considering the processing results and task request, the accuracy of the response to the task request can be improved.
[0086] Figure 4 The figure is a flowchart of obtaining a response result according to an embodiment of the present disclosure.
[0087] In some embodiments, processing the task request using at least one target tool to obtain a processing result includes:
[0088] Get the address and input parameter description information of the target tool;
[0089] Extracting the input parameter content of the target tool from the task request according to the input parameter description information;
[0090] According to the address of the target tool, the input parameter content is input into the target tool, and the target tool outputs the processing result.
[0091] In the disclosed embodiments, the target tool may be a software program, an online service interface, a script file, etc., and its address is a specific location identifier that can be used to locate the target tool. For example, if the target tool is a network service interface deployed on a server, the target tool's address may be a Uniform Resource Locator (URL), through which a call request can be sent to the target tool on the server.
[0092] The input parameter description information is a detailed description of the input parameter content, which may include the name of the input parameter content, data type (such as string, integer, floating point number, Boolean value, etc.), value range, etc. The input parameter content is the data required for the target tool to execute or process the task.
[0093] In some embodiments, obtaining the address and input parameter description information of the target tool includes:
[0094] According to the target tool, the address of the target tool and the input parameter description information are obtained from the configuration file;
[0095] The configuration file is used to store a mapping relationship between the target tool, the address of the target tool, and the input parameter description information.
[0096] In the disclosed embodiment, a structured configuration file may be pre-written, in which a mapping relationship between the target tool 420, its address, and the input parameter description information is established. In other words, the configuration file stores the mapping relationship between the target tool 420 and its address, and also stores the mapping relationship between the target tool 420 and the input parameter description information.
[0097] Furthermore, after determining the target tool 420 , the large model 410 may obtain the address and input parameter description information of each target tool from the configuration file.
[0098] By adopting the above method, the address and input parameter description information of the target tool are directly obtained through the configuration file, which can reduce the repeated positioning of the target tool and the repeated matching calculation of the input parameter description information during the task processing process, thereby optimizing the task processing process and improving the task processing efficiency.
[0099] According to the input parameter description information, the corresponding input parameter content is extracted from the task request. In one example, the large model 410 can be used to parse the format of the task request and match and extract the input parameter content from the task request according to the input parameter description information.
[0100] In the disclosed embodiments, the extracted input parameter content can be input into the target tool in a suitable manner based on the address of the target tool. For example, if the target tool is a network service interface, a Hypertext Transfer Protocol (HTTP) client library (such as the requests library in Python) can be used to send an HTTP request to input the input parameter content into the target tool at the specified address.
[0101] Furthermore, if Figure 4 As shown, the large model 410 inputs the input parameter content into the target tool 420. After the target tool 420 receives the input parameter content, the target tool 420 processes the input parameter content using its own internal logic and algorithm, and finally feeds back the processing results of the input parameter content to the large model 410.
[0102] This approach provides accurate guidance for subsequent task request processing by explicitly obtaining the target tool's address and input parameter description. Furthermore, extracting the target tool's required input parameters from the task request based on the input parameter description reduces the risk of incorrect or incomplete parameter extraction.
[0103] Furthermore, based on the target tool's address, the extracted input parameters are fed into the target tool, ensuring that the target tool receives the correct input parameters and, in turn, executes the corresponding task request based on them. This process, relying on accurate input parameters, reduces processing errors caused by incorrect parameters, thereby improving overall task processing efficiency.
[0104] In some embodiments, generating a response result to the task request based on the processing result and the task request includes:
[0105] Get the output parameter description information of the target tool;
[0106] Extracting the output parameter content of the target tool from the processing result according to the output parameter description information;
[0107] A response result for the task request is generated based on the output parameter content, the task request and context information of the task request.
[0108] In the embodiments of the present disclosure, the output parameter description information is a detailed description of the output parameter content of the target tool, and may include the name, data type, value range, etc. of the output parameter content. In one example, the output parameter description information of the target tool can be obtained from the technical documentation, user manual, or development documentation provided by the target tool by calling a metadata interface.
[0109] Furthermore, based on the output parameter description information, the large model 410 can extract the output parameter content of the target tool from the processing results.
[0110] Specifically, during this process, an appropriate parsing method can be selected based on the data format of the processing result. For example, if the processing result is in JSON format, a corresponding JSON parsing library (such as Python's json library) can be used to parse the processing result. Based on the parsed processing result and output parameter description information, the output parameter content of the target tool can be extracted from the processing result using the large model 410 based on predefined extraction logic.
[0111] In the embodiment of the present disclosure, context information may be stored in a user configuration file, a system log, or a database. The large model 410 obtains the context information by querying the database, reading the configuration file, etc., and associates it with the output parameter content and the task request.
[0112] In the embodiment of the present disclosure, the big model 410 can analyze the obtained output parameter content, task request and context information of the task request. Based on the analysis results, the big model 410 uses its own NLP capabilities, reasoning capabilities and text generation capabilities to generate a response result for the task request and feed back the response result to the user.
[0113] This approach, by capturing the output parameter descriptions of the target tool, lays the data foundation for accurately extracting the output parameter content from the subsequent processing results. Furthermore, based on the extracted output parameter content, the task request, and its contextual information, the large model can more comprehensively understand the user's intent and needs, thereby generating responses that better meet their actual needs, improving the relevance and accuracy of the responses.
[0114] Figure 5 It is a flowchart of a task processing method according to an embodiment of the present disclosure.
[0115] like Figure 5 As shown, first, the single agent framework 511 in the framework layer 510 is used to obtain the scene identifier, user identifier, and task request sent by the user through the terminal device. Here, the user identifier is used to distinguish different users. Each user can be identified through the user identifier to avoid information confusion between users.
[0116] Based on the scenario identifier, the single-agent framework 511 determines the corresponding business scenario (such as business scenario 1, business scenario 2, or business scenario 3 in the figure) in the application layer 530. Here, business scenario 1, business scenario 2, or business scenario 3 has the same function as the scenario identifier, and is used to represent the scenario in which the current task request is located.
[0117] Next, based on the scenario identifier corresponding to the business scenario, the mapping relationship between the scenario and the tool capability is searched to determine the identifier of the tool capability corresponding to the scenario identifier. Then, based on the identifier of the tool capability, multiple tool capabilities corresponding to the identifier of the tool capability are pulled from the capability layer 520 (i.e., the preset tool library).
[0118] In the embodiment of the present disclosure, the mapping relationship between the scenario and the tool capability includes multiple scenario identifiers and the identifiers of the tool capabilities corresponding to each scenario identifier. In other words, the mapping relationship between the scenario and the tool capability will bind the scenario identifier to the tool capability, thereby constructing a mapping relationship between the scenario identifier and the tool capability. For example, the mapping relationship between the scenario and the tool capability can store the identifiers of business scenario 1 and the corresponding tool capabilities (such as tool capability 1 and tool capability 2), the identifiers of business scenario 2 and the corresponding tool capabilities (such as tool capability 1, tool capability 3 and tool capability 4), and the identifiers of business scenario 3 and the corresponding tool capabilities (such as tool capability 5 and tool capability 6). Here, one business scenario may correspond to multiple tool capabilities, and the tool capabilities corresponding to different business scenarios may be partially different or completely different. Further, based on the scenario identifier, the identifier of the corresponding tool capability is obtained, and according to the identifier of the tool capability, the corresponding tool capability is obtained from the capability layer 520.
[0119] In the embodiment of the present disclosure, the capability layer 520 includes not only multiple tool capabilities corresponding to the scenario identifiers, but also capability description information of each tool capability.
[0120] It should be noted that, in addition to storing some standard capabilities corresponding to scenario identifiers, the capability layer 520 can also store some private capabilities developed by users.
[0121] Furthermore, based on the task request and the capability description information corresponding to each tool capability, at least one target tool is determined from multiple tool capabilities, and then the task request is processed using the at least one target tool to obtain a response result for the task request.
[0122] The task processing method proposed in this disclosure, based on a single-agent framework, is capable of recording execution context across multiple scenarios, facilitating subsequent scenario analysis and request tracing. Furthermore, this architectural design improves performance during online calls and enhances the responsiveness of task processing.
[0123] Figure 6 This is a flowchart of a task processing method for intelligent customer service business according to an embodiment of the present disclosure.
[0124] like Figure 6 As shown, first, the single-agent framework 611 in the framework layer 610 obtains the scenario identifier, user identifier, and task request sent by the user through the terminal device. Based on the scenario identifier, the single-agent framework 611 determines the corresponding business scenario (such as the service account scenario, group chat scenario, or private chat scenario shown in the figure) in the application layer 630.
[0125] Next, based on the scenario identifier corresponding to the business scenario, the mapping relationship between the scenario and the tool capability is searched, the identifier of the tool capability corresponding to the scenario identifier is determined, and then multiple tool capabilities corresponding to the identifier of the tool capability are pulled from the capability layer 620 (i.e., the preset tool library).
[0126] Among them, the mapping relationship between scenarios and tool capabilities covers multiple scenario identifiers and the identifiers of tool capabilities corresponding to each scenario identifier. In other words, the mapping relationship between scenarios and tool capabilities will bind the scenario identifier to the tool capability, thereby constructing a mapping relationship between scenario identifiers and tool capabilities. For example, in the mapping relationship between scenarios and tool capabilities, the identifiers of service number scenarios and corresponding tool capabilities (such as smart Q&A and transfer to manual), group chat scenarios and corresponding tool capabilities (such as smart Q&A, creating work orders, work order reminders and ending work orders), and private chat scenarios and corresponding tool capabilities (such as smart Q&A, creating work orders and ending work orders) can be stored. A business scenario may correspond to multiple tool capabilities, and the tool capabilities corresponding to different business scenarios may be partially different or completely different. Furthermore, based on the scenario identifier, the identifier of the corresponding tool capability is obtained, and according to the identifier of the tool capability, the corresponding tool capability is obtained from the capability layer 620.
[0127] In the embodiment of the present disclosure, the capability layer 620 includes not only multiple tool capabilities corresponding to the scenario identifiers, but also capability description information of each tool capability.
[0128] It should be noted that, in addition to storing some standard capabilities corresponding to scenario identifiers, the capability layer 620 can also store some private capabilities developed by users.
[0129] Furthermore, based on the task request and the capability description information corresponding to each tool capability, at least one target tool is determined from multiple tool capabilities, and then the task request is processed using the at least one target tool to obtain a response result for the task request.
[0130] In the above-mentioned intelligent customer service business, if a multi-agent architecture is used, it is necessary to build agents for service account scenarios, group chat scenarios, and private chat scenarios respectively, and it is necessary to upload knowledge to each agent separately, and at the same time bind the tool capabilities adapted to each scenario.
[0131] Furthermore, from a capability perspective, the capabilities of these three agents overlap to a certain extent. When the parent agent schedules tasks, the ambiguity of scenario boundaries can easily lead to inaccurate scheduling. Furthermore, creating and maintaining multiple agents requires a significant amount of repetitive work, increasing development costs.
[0132] In contrast, the task processing method proposed in the disclosed embodiments can be implemented within a single-agent framework. Therefore, only a unified scenario-based configuration of the agent needs to be maintained. The framework layer connects scenario identifiers to enable the acquisition and invocation of tool capabilities in different scenarios. Compared to multi-agent frameworks, this method effectively reduces the development threshold and maintenance burden of agents, while improving the overall performance and stability of the system.
[0133] The present disclosure also provides a task processing system. Figure 7 FIG. 7 is a schematic diagram of the structure of a task processing system 700 according to an embodiment of the present disclosure, including:
[0134] Receiving unit 710, configured to receive a task request and a scenario identifier;
[0135] The processing unit 720 is configured to determine, based on the scenario identifier, at least one target tool from a preset tool library for processing the task request; and process the task request using the at least one target tool to obtain a response result for the task request.
[0136] Figure 8 is a schematic diagram of the structure of a task processing system 800 according to an embodiment of the present disclosure. In some implementations, the processing unit 720 includes a single-agent framework 821 and a large model 822; wherein,
[0137] The single agent framework 821 is used to obtain multiple tool capabilities corresponding to the scene identifier from a preset tool library according to the scene identifier;
[0138] The large model 822 is used to determine at least one target tool for processing the task request from a plurality of tool capabilities.
[0139] In some implementations, the task processing system 800 further includes a capability management unit 830:
[0140] A capability management unit 830 is used to manage a preset tool library and a mapping relationship between scenarios and tool capabilities, wherein the mapping relationship between scenarios and tool capabilities includes multiple scenario identifiers and identifiers of tool capabilities corresponding to each scenario identifier;
[0141] The single-agent framework 821 is used to use the scene identifier to find the mapping relationship between the scene and the tool capability, determine the identifiers of multiple tool capabilities corresponding to the scene identifier; and obtain multiple tool capabilities corresponding to the identifiers of the multiple tool capabilities from the preset tool library.
[0142] In some implementations, the preset tool library stores capability description information of each tool capability;
[0143] The large model 822 is used to analyze the task request to obtain the requirement information corresponding to the task request; match the requirement information with the capability description information of each tool capability; and determine at least one target tool for processing the task request from multiple tool capabilities based on the matching results.
[0144] In some embodiments, the macro model 822 is used to:
[0145] Compare the matching result with a preset threshold value, and determine the target capability description information corresponding to the matching result that is greater than or equal to the preset threshold value;
[0146] From a plurality of tool capabilities, a tool capability corresponding to at least one target capability description information is determined as at least one target tool for processing the task request.
[0147] In some embodiments, the macro model 822 is used to:
[0148] Processing the task request using at least one target tool to obtain a processing result;
[0149] Based on the processing result and the task request, a response result for the task request is generated.
[0150] In some embodiments, the macro model 822 is used to:
[0151] Get the target tool's address and input parameter description information;
[0152] Extracting the input parameter content of the target tool from the task request according to the input parameter description information;
[0153] According to the address of the target tool, the input parameter content is input into the target tool, and the target tool output processing result is received.
[0154] In some embodiments, the macro model 822 is used to:
[0155] According to the target tool, obtain the address and input parameter description information of the target tool from the configuration file;
[0156] The configuration file is used to store a mapping relationship between the target tool, the address of the target tool, and the input parameter description information.
[0157] In some embodiments, the macro model 822 is used to:
[0158] Get the output parameter description information of the target tool;
[0159] Extracting the output parameter content of the target tool from the processing result according to the output parameter description information;
[0160] A response result for the task request is generated based on the output parameter content, the task request and context information of the task request.
[0161] For the description of specific functions and examples of each unit and sub-unit of the device in the embodiment of the present disclosure, please refer to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.
[0162] In the technical solution disclosed herein, the acquisition, storage and application of personal information of users involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0163] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0164] Figure 9 A schematic block diagram of an example electronic device 900 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, 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 assistants, cellular phones, smartphones, 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 disclosure described and / or claimed herein.
[0165] like Figure 9 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. Various programs and data required for the operation of the device 900 can also be stored in the RAM 903. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0166] Multiple components in the device 900 are connected to the I / O interface 905, including an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a magnetic disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0167] The computing unit 901 can be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as the task processing method. For example, in some embodiments, the task processing method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the task processing method described above can be performed. Alternatively, in other embodiments, the computing unit 901 can be configured to perform the task processing method by any other appropriate means (e.g., by means of firmware).
[0168] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system comprising at least one programmable processor, which can be a special purpose or general purpose programmable processor that can 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.
[0169] The program code for implementing the method of the present disclosure 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 when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0170] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0171] 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).
[0172] The systems and techniques described herein can be implemented in a computing system that includes back-end 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 front-end components (e.g., a user computer having 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 back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0173] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0174] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.
[0175] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A task processing method, comprising: Receive task request and scenario identification; Determining at least one target tool for processing the task request from a preset tool library according to the scenario identifier; The task request is processed using the at least one target tool to obtain a response result for the task request.
2. The method according to claim 1, wherein The determining, based on the scenario identifier, at least one target tool for processing the task request from a preset tool library includes: According to the scenario identifier, obtaining a plurality of tool capabilities corresponding to the scenario identifier from the preset tool library; The at least one target tool for processing the task request is determined from the plurality of tool capabilities.
3. The method according to claim 2, further comprising pre-saving a mapping relationship between scenarios and tool capabilities, wherein the mapping relationship between scenarios and tool capabilities includes a plurality of scenario identifiers and identifiers of tool capabilities corresponding to each scenario identifier; The determining, based on the scenario identifier, a plurality of tool capabilities corresponding to the scenario identifier from the preset tool library includes: Using the scenario identifier to search for a mapping relationship between the scenario and the tool capability, and determining identifiers of a plurality of tool capabilities corresponding to the scenario identifier; A plurality of tool capabilities corresponding to the identifiers of the plurality of tool capabilities are obtained from the preset tool library.
4. The method according to claim 2 or 3, wherein: The preset tool library stores capability description information of each tool capability; The step of determining the at least one target tool for processing the task request from among the plurality of tool capabilities includes: Analyzing the task request to obtain requirement information corresponding to the task request; Matching the requirement information with the capability description information of each tool capability respectively; According to the matching result, the at least one target tool for processing the task request is determined from the plurality of tool capabilities.
5. The method according to claim 4, wherein Determining, based on the matching result, the at least one target tool for processing the task request from the plurality of tool capabilities includes: Comparing the matching result with a preset threshold value, and determining target capability description information corresponding to the matching result that is greater than or equal to the preset threshold value; From the plurality of tool capabilities, a tool capability corresponding to at least one of the target capability description information is determined as the at least one target tool for processing the task request.
6. The method according to any one of claims 1 to 3, wherein: The processing of the task request by using the at least one target tool to obtain a response result for the task request includes: Processing the task request using the at least one target tool to obtain a processing result; Based on the processing result and the task request, a response result for the task request is generated.
7. The method according to claim 6, wherein: The processing of the task request by using the at least one target tool to obtain a processing result includes: Obtaining the address and input parameter description information of the target tool; Extracting input parameter content of the target tool from the task request according to the input parameter description information; According to the address of the target tool, the input parameter content is input into the target tool, and the target tool outputs the processing result.
8. The method according to claim 7, wherein: The obtaining of the target tool's address and input parameter description information includes: According to the target tool, obtaining the address of the target tool and the input parameter description information from a configuration file; The configuration file is used to store a mapping relationship between the target tool, the address of the target tool, and the input parameter description information.
9. The method according to claim 6, wherein: The generating a response result to the task request based on the processing result and the task request includes: Obtaining output parameter description information of the target tool; extracting the output parameter content of the target tool from the processing result according to the output parameter description information; A response result for the task request is generated based on the output parameter content, the task request and context information of the task request.
10. A task processing system, comprising a receiving unit and a processing unit; wherein, The receiving unit is used to receive a task request and a scene identifier; The processing unit is used to determine at least one target tool for processing the task request from a preset tool library based on the scenario identifier; and use the at least one target tool to process the task request to obtain a response result for the task request.
11. The system according to claim 10, wherein: The processing unit includes: A single agent framework is used to obtain, based on the scenario identifier, a plurality of tool capabilities corresponding to the scenario identifier from the preset tool library; The large model is used to determine the at least one target tool for processing the task request from the plurality of tool capabilities.
12. The system according to claim 11, wherein The system further comprises a capability management unit: The capability management unit is configured to manage the preset tool library and the mapping relationship between scenarios and tool capabilities, wherein the mapping relationship between scenarios and tool capabilities includes multiple scenario identifiers and identifiers of tool capabilities corresponding to each scenario identifier; The single-agent framework is configured to use the scenario identifier to search for a mapping relationship between the scenario and the tool capability, and determine identifiers of multiple tool capabilities corresponding to the scenario identifier; A plurality of tool capabilities corresponding to the identifiers of the plurality of tool capabilities are obtained from the preset tool library.
13. The system according to claim 11 or 12, wherein: The preset tool library stores capability description information of each tool capability; The large model is used to analyze the task request to obtain demand information corresponding to the task request; The requirement information is matched with the capability description information of each tool capability respectively; and based on the matching result, the at least one target tool for processing the task request is determined from the multiple tool capabilities.
14. The system according to claim 13, wherein: The large model is used to: Comparing the matching result with a preset threshold value, and determining target capability description information corresponding to the matching result that is greater than or equal to the preset threshold value; From the plurality of tool capabilities, a tool capability corresponding to at least one of the target capability description information is determined as the at least one target tool for processing the task request.
15. The system according to any one of claims 10 to 13, wherein: The large model is used to: Processing the task request using the at least one target tool to obtain a processing result; Based on the processing result and the task request, a response result for the task request is generated.
16. The system according to claim 15, wherein: The large model is used to: Obtaining the address and input parameter description information of the target tool; Extracting input parameter content of the target tool from the task request according to the input parameter description information; According to the address of the target tool, the input parameter content is input into the target tool, and the target tool outputs the processing result.
17. The system according to claim 16, wherein: The large model is used to: According to the target tool, obtaining the address of the target tool and the input parameter description information from a configuration file; The configuration file is used to store a mapping relationship between the target tool, the address of the target tool, and the input parameter description information.
18. The system according to claim 15, wherein: The large model is used to: Obtaining output parameter description information of the target tool; extracting the output parameter content of the target tool from the processing result according to the output parameter description information; A response result for the task request is generated based on the output parameter content, the task request and context information of the task request.
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 to 9.
21. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 9.