Tool calling method and storage medium

By constructing tool invocation methods and utilizing pre-defined intelligent agents and tool libraries for abstract processing, user intent is accurately captured, and target tools are selected to handle complex problems. This solves the accuracy problem of AI in supporting complex queries and achieves efficient and accurate handling of diverse problems.

CN121704930APending Publication Date: 2026-03-20QUECTEL WIRELESS SOLUTIONS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Existing data analytics platforms suffer from low accuracy in AI query support when dealing with complex problems, resulting in limited AI functionality and difficulty in handling complex tasks, making it unreliable for handling diverse issues.

Method used

By constructing a tool invocation method, leveraging pre-defined intelligent agents and pre-defined tool libraries through abstract processing, the system accurately captures user intent, selects the target tool for processing, and combines the natural language response of a large model with professional data processing to improve the system's compatibility and accuracy.

Benefits of technology

It enables efficient handling of complex problems, reduces resource consumption and process redundancy, improves the system's compatibility with diverse problems and user interactivity, and enhances the reusability and accuracy of the tools.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121704930A_ABST
    Figure CN121704930A_ABST
Patent Text Reader

Abstract

The invention discloses a tool calling method and a storage medium, and the method comprises the steps: determining a first user intention corresponding to a first question in response to the first question of a user; according to the first user intention, a target tool is selected from a to-be-called tool library to process the first problem, and a response result for the first problem is obtained; wherein the to-be-called tool library comprises a preset agent subjected to abstract processing and a preset tool subjected to abstract processing, so that the technical problem of inaccurate tool matching in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, specifically to a tool invocation method and storage medium. Background Technology

[0002] SuperSonic, a data analytics platform, is a conversational business intelligence (ChatBi) framework capable of converting natural language queries into Structured Query Language (SQL) statements. However, its conversion accuracy is currently low, supporting only a limited number of simple single-table queries. This leads to the following limitations in practical applications: for simple queries, individuals with basic database knowledge can manually write the corresponding SQL without relying on artificial intelligence (AI); while for complex problems, AI struggles to provide accurate query support, resulting in limited functionality and weak capabilities, making it unreliable for handling complex tasks. Summary of the Invention

[0003] This application provides a tool invocation method and storage medium to improve the AI's ability and accuracy in handling complex problems.

[0004] On one hand, embodiments of this application provide a tool invocation method, including: In response to the user's first question, determine the first user intent corresponding to the first question; Based on the first user intent, a target tool is selected from the tool library to be invoked to process the first problem, and a response result is obtained for the first problem; The tool library to be invoked includes: a preset intelligent agent that has undergone abstraction and a preset tool that has undergone abstraction.

[0005] On the other hand, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, is used to implement the method described above.

[0006] In the embodiments of this application, determining the corresponding first user intent when responding to the first question can accurately capture the user's core needs, avoid the blindness of tool calls, make the selection of target tools more in line with the actual needs of the problem, improve the pertinence of problem handling, and reduce the resource consumption and process redundancy caused by invalid tool calls. The tool library to be called has abstracted the preset intelligent agents and preset tools, and unified their core attributes and calling logic. On the one hand, it simplifies the management complexity of the tool library and reduces the cost of system maintenance and expansion. On the other hand, it improves the reusability of intelligent agents and tools, eliminating the need to repeatedly develop components with similar functions for different scenarios. At the same time, the abstracted intelligent agents and tools can adapt to different types of user questions based on a unified calling standard. They can directly generate natural language responses that conform to the user's understanding habits through preset intelligent agents, and can also output adapted results after processing professional data through preset tools. This enhances the system's compatibility with diverse questions, thereby improving the technical problem of inaccurate matching between questions and tools in related technologies. Attached Figure Description

[0007] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0008] Figure 1 This is a flowchart illustrating a tool invocation method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the multi-layer fully connected layer filtering process for large model lexical units provided in the embodiments of this application; Figure 3 This is a semantic parsing diagram illustrating the abstract meaning of the problem in the embodiments of this application; Figure 4 A schematic diagram of the task processing framework for generating SQL for large models in related technologies; Figure 5 A schematic diagram of the task processing framework for generating SQL from a large model provided in this application embodiment; Figure 6 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0009] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0010] Intelligent agents can be artificial intelligence systems capable of perceiving their environment, making autonomous decisions, and executing actions. SuperSonic is a next-generation data analytics platform integrating Headless BI and Chat BI, dedicated to analyzing data through natural language dialogue and combining with traditional interactive analytics products to promote data democratization. TestToSQL converts user questions into SQL, retrieves the data the user needs, and presents it in a clear and understandable format. Reactive Interaction Framework (ReAct) is a large-scale model application architecture that allows the large model to parse questions, analyze the necessary tools and parameters, and then invoke the tools to solve the problem. Memory provides historical answers as examples to the large model, thereby improving accuracy. Dataway is an interface configuration tool based on DataQL service aggregation capabilities, designed to provide convenient interface configuration solutions for applications. DataQL is a query language designed to describe the data requirements and interactions of client applications by providing an intuitive and flexible syntax. Groovy is an agile development language based on the Java Virtual Machine (JVM). It combines many powerful features of Python, Ruby, and Smalltalk. Groovy code can be well integrated with Java code and can also be used to extend existing code.

[0011] Generating SQL queries for the database through the intelligent agent is only a small part of the intelligent agent's functional system. The goal of this application is to build a comprehensive intelligent agent capable of handling multiple types of tasks like a real employee. By selecting customized tools instead of general-purpose tools and standardizing the execution process of large models, the execution process can be ensured to be safe and reliable, thereby effectively addressing the security risks caused by the uncertainty of large models. Utilizing a "dialogue rewriting" mechanism and a tool anomaly feedback mechanism, a "ask if you don't understand" interaction mode is achieved for the intelligent agent, enhancing system interactivity and improving the accuracy of the final problem-solving.

[0012] like Figure 1 As shown, Figure 1 This is a flowchart illustrating a tool invocation method provided in an embodiment of this application. The tool invocation method provided in this embodiment includes: Step 101: In response to the user's first question, determine the first user intent corresponding to the first question.

[0013] In this embodiment, after receiving the first question input by the user in natural language, the system triggers the corresponding processing flow. Simultaneously, using preset natural language understanding technologies (e.g., semantic parsing models, intent classification algorithms, etc.), the system performs in-depth analysis of the content of the first question, extracting its core demand direction (e.g., data query, functional consultation, business analysis, etc.), thereby clarifying the first user intent matching the first question. This intent will serve as the core basis for subsequent tool selection. The first question can be the problem information submitted by the user through the input device that needs to be solved. Specifically, the first question can be a question in natural language.

[0014] Step 102: Based on the first user intent, select the target tool from the tool library to be invoked to process the first problem and obtain the response result for the first problem; wherein, the tool library to be invoked includes: a preset intelligent agent and a preset tool that have been abstracted.

[0015] In this embodiment, based on the first user's intent, a target tool is selected from the tool library to be invoked to process the first problem and obtain a response result for the first problem. It is necessary to first clarify the composition of the tool library to be invoked: the tool library to be invoked can be a set of functional components pre-built by the system, which includes pre-defined intelligent agents and pre-defined tools that have undergone abstract processing. The abstract processing here refers to the unified and standardized definition of the core attributes and calling logic of the pre-defined intelligent agents and pre-defined tools (for example, unifying the input parameter format and output rules of the two), so that intelligent agents and tools with different functions can be invoked by the system based on the same set of standards.

[0016] After determining the initial user intent, the system matches the corresponding functional component from the tool library based on that intent: if the initial user intent pertains to a natural language interaction-related response, the system selects a pre-defined agent that has undergone abstraction; if the initial user intent pertains to a professional data processing-related requirement, the system selects a pre-defined tool that has undergone abstraction. Once the target tool is selected, it executes the corresponding processing logic based on the content of the initial question (e.g., the pre-defined agent generates a response in natural language, the pre-defined tool performs data querying and processing operations), ultimately outputting a response that matches the user's needs. The response can be natural language information processed by a pre-defined language model to conform to the user's understanding habits.

[0017] In some embodiments, based on a first user intent, a target tool is selected from a tool library to process a first problem, resulting in a response to the first problem, including: The intelligent agent or tool is abstracted to obtain the tool to be invoked and the corresponding invocation data to form a library of tools to be invoked; Based on the call data and the first user intent, the target tool is selected from the tools to be called and called to obtain the response result; the response result is a natural language result understood by the user after being processed by a preset language model.

[0018] In this embodiment, the intelligent agent can be an intelligent processing unit with specific business processing capabilities; the tool can be a processing tool with a single function; the abstract processing can be the process of summarizing and organizing the functions and calling methods of the intelligent agent or tool to form a unified format information; the tool to be called can be a tool obtained after extraction and processing that can be used to respond to user questions. The tool to be called includes preset intelligent agents and preset tools. For example, the tool to be called can be a tool to be called after the large model is determined; the calling data can be relevant information that supports the calling of the tool to be called, including sample name data and usage instructions data. The sample name data can be the name and associated information corresponding to the tool to be called, and the usage instructions data can be the functional description, calling rules, and other information of the tool to be called.

[0019] In this embodiment, the tool invocation method can be applied to a departmental daily work intelligent agent system based on a large model. This system serves as the overall task execution carrier, responsible for handling all types of departmental work tasks (such as tool invocation, problem consultation, and indicator query). SuperSonic, as an open-source indicator system platform, can be the core component for data analysis and indicator management in this system. It possesses the capabilities of multi-source data integration, unified indicator definitions, real-time indicator result calculation, and visualization, supporting the system's data analysis tasks.

[0020] In this embodiment, the intelligent agent system for daily departmental work based on a large model may include a database configuration retrieval module, a memory management module, a Text-to-SQL (TextToSQL) module, a translation module, and an SQL execution module. The database configuration retrieval module, in scenarios where the business system may contain up to 30 tables with extensive table structure information (table names and fields), intelligently identifies and locates the data tables and fields associated with the user's intent by parsing the semantics and rules in the user's questions, thereby effectively filtering irrelevant information. This significantly reduces the token consumption generated when transmitting metadata to the large model and also lays the foundation for subsequent precise queries by narrowing the search scope. The memory management module records historical question-and-answer interactions and stores successfully executed instances in a knowledge base. These successful cases can serve as high-quality samples, supporting similarity-based retrieval, thus providing effective references for handling new and similar queries and improving the overall accuracy and efficiency of the system.

[0021] The TextToSQL module is used to transform user queries into logical SQL. For example: Query the top 5 users with the most visits in the last six months and provide their visit counts. The generated SQL is: SELECT user, SUM(pv) AS visit count FROM s2_log WHERE log_time>= '2025-04-01' AND data_time<= '2025-10-01' GROUP user ORDER BY visit count DESC LIMIT 5. The Translation module transforms the logical SQL generated by the large model into executable SQL. For example: The above logical SQL needs to be transformed into: SELECT user, SUM(pv) AS `visit count` FROM s2_log WHERE log_time>= '2025-04-01' AND log_time<= '2025-10-01' GROUP user ORDER BY `visit count` DESC LIMIT 5, which is SQL that the database can execute. The Execute SQL module executes SQL based on multiple data sources and returns the results to the front end for display.

[0022] In this embodiment, the departmental daily work intelligent agent system based on a large model may further include an intelligent agent encapsulation module and a dedicated tool module. The intelligent agent encapsulation module can store existing SuperSonic TextToSQL as tools in the dedicated tool module, allowing the departmental daily work intelligent agent system based on the large model to call them, thus achieving unified management of intelligent agents and tools and enabling equal access. In some embodiments, to save on tool development costs, the tools need to be scripted; currently, Dataway + Groovy is used to solve this problem. While Dataway's interaction with the database is simple, data processing is cumbersome. Adding a Groovy tag to Dataway allows Groovy scripts to be inserted into Dataql scripts (Dataway scripts).

[0023] In some embodiments, the invoked data includes sample name data; the first user intent includes tool name data and tool parameter data; in response to a user's first question, determining the first user intent corresponding to the first question includes: Obtain multiple sample questions; The first question is matched with each sample question according to the preset embedded model to obtain the matching results; If the matching results indicate that the sample problem matches the first problem, multiple target sample problems are identified. Based on the sample name data of the tools used for each target sample problem, multiple target sample problems are classified to obtain a target mapping relationship; the target mapping relationship indicates that the sample name data corresponds to at least one target sample problem. The tool name data is determined based on the preset language model, target mapping relationship, and the first question; The first question is semantically identified based on a pre-defined language model to obtain tool parameter data.

[0024] In this embodiment, the preset embedded model can be a natural language processing model used to transform text (e.g., questions, sentences, words) into low-dimensional, dense semantic vectors. For example, assigning a numerical label containing the semantics of each text segment. The preset language model can be a large model with natural language processing capabilities. Specifically, the preset language model can be a preset language model that meets the comprehension requirements after passing testing, such as the Wenxin Yiyan model. The first user intent can be relevant information used to determine the tool to be invoked. The tool name data can be the name information used to identify the tool to be invoked; the tool parameter data can be the parameter information required to invoke the tool; and the sample question corresponding to the sample name data can be the sample question example data associated with the sample name data for reference.

[0025] In this embodiment, the process of obtaining multiple sample questions may include: extracting a preset number of sample questions from a preset sample question library. The method further includes: collecting original records related to tool calls and / or data queries, including real user consultation records or business operation records; performing preliminary screening of the original records to remove invalid records that have no actual business relevance or are incoherent and unidentifiable, obtaining the filtered valid records; extracting business-related parameters (e.g., factory name, order code, process name, order number, etc.) from the filtered valid records, constructing corresponding sample questions based on the requirements of the valid records, clarifying the association between the sample questions and the tool, and storing the sample questions in a preset format in the sample question library.

[0026] The method also includes: reviewing each constructed sample problem individually, focusing on whether the parameter extraction is accurate and the problem selection (i.e., the association between the sample problem and the target tool) is correct, and selecting sample problems with correct parameter extraction and problem selection; for unqualified samples with incorrect parameter extraction or inappropriate problem selection, manual correction is performed to fix the erroneous parameters and adjust the association between the sample problem and the target tool until the sample meets the requirements of accurate parameter extraction and correct problem selection; the corrected sample problems are manually reviewed again to confirm that there are no deviations in parameter extraction and problem selection, ensuring the accuracy and effectiveness of the samples; qualified samples that have passed manual review (or passed review after correction) are stored in the sample problem database according to a preset format.

[0027] In this embodiment, the first question is transformed into a first semantic vector through an embedded model, while all sample questions in the sample question library are transformed into corresponding second semantic vectors. The similarity between the first semantic vector and each second semantic vector is calculated. Based on the similarity ranking result or a preset filtering number, multiple target sample questions that are semantically closest to the first question are extracted. Each sample question is pre-associated with its corresponding sample name data during construction. Multiple target sample questions are grouped according to the sample name data, ultimately obtaining a target mapping relationship where the tool can correspond to at least one sample question (avoiding tools without sample support).

[0028] In this embodiment, the target mapping relationship and the first question are input into a preset language model. The preset language model analyzes the needs of the first question and compares the semantic features of the example questions corresponding to each tool (for example, the examples corresponding to tool A are all data query questions, and the first question is also a data query question). It then infers the tool name data that best matches the needs of the first question, so that the preset language model can accurately determine which tool should be used for the first question with the help of the semantic reference of the example questions.

[0029] In this embodiment, the process of semantically recognizing the first question based on a preset language model to obtain tool parameter data may include: while determining the tool name data, using the preset language model to perform deep semantic analysis on the first question, recognizing the key information corresponding to the tool, extracting the parameter names and corresponding values ​​that meet the tool parameter requirements, and forming tool parameter data.

[0030] In this embodiment, the departmental daily work intelligent agent system based on a large model may further include a user intent recognition module for recognizing user needs. For example, the user's question might be: "Please check if the test tool XXX exists on the factory's File Transfer Protocol (FTP)." The user intent recognition module can extract the information that the user needs to call the FTP tool and query for the test tool XXX. The process for determining the first user intent corresponding to the first question provided in this embodiment includes: 1{ 2. "Thoughts": "Users who need to query the document distribution status of a specific order number at the Changzhou factory should use an FTP data query tool." 3. "Action": { 4. "Name": "Production Management System - FTP Data Query", 5. Parameters (args): { 6. "Factory": "Changzhou Factory" 7"Bill No": "SCD202509190004"; 8} 9} 10}.

[0031] The large-scale model considers that if a user needs to query the file distribution status of a specific order number at the Changzhou factory, they should use an FTP data query tool. The action to be performed is: "Production Management System - FTP Data Query," with parameters including the factory (Changzhou factory) and the order number (SCD202509190004). The intent recognition module analyzes user input and intelligently determines the appropriate tool and its required parameters. In actual production environments, communication is based on the Model Context Protocol (MCP).

[0032] In intent recognition tasks, large models often suffer from incorrect tool selection or inaccurate parameter extraction. To address this issue, this module employs a combination of the Reasoning and Acting (ReAct) framework and Retrieval-Augmented Generation (RAG) for optimization. Specifically, each tool is equipped with corresponding examples derived from historical question-answering records that are semantically similar to the current question. These examples are all manually verified to ensure accuracy in tool selection and parameter extraction (incorrect samples can be manually corrected and re-added to the database). With the continuous accumulation of high-quality examples, the accuracy of the large model in this task can be gradually improved to near 100%.

[0033] In the embodiments of this application, by obtaining sample questions and matching them with a first question to determine tool name data, and by using a preset language model to perform semantic recognition on the first question to obtain tool parameter data, the name and parameters in the first user intent can be accurately determined, thereby improving the technical problems of inaccurate tool name matching and difficulty in extracting tool parameters in related technologies.

[0034] In some embodiments, the preset language model includes a first model for extracting tool name data and a second model for extracting tool parameter data; in response to a user's first question, determining a first user intent corresponding to the first question includes: The first problem is reasoned based on the first model, and multiple words of the first problem and the probability data of each word are output. n fully connected layers are constructed at the output of the first model, where each fully connected layer processes a different number of tokens; n is a positive integer greater than or equal to 1. Based on sample questions, sample name data, word units and word probability data, the weight parameters of the fully connected layer are optimized and trained to obtain the target weight parameters; Based on the target weight parameters and the probability data of the lexical units, determine the tool name data; The tool parameter data is determined based on the second model, tool name data, and the first question.

[0035] In this embodiment, the first model can be a model for extracting tool name data, such as a lightweight (e.g., Magpie-Qwen-CortexDual-0.6B) large model; the second model can be a model for extracting tool parameter data, such as the large model used in the aforementioned embodiment to perform semantic recognition on the first question to obtain tool parameter data; the inference process can be the process by which the first model performs semantic analysis on the first question to generate relevant lexical units and probabilities; a lexical unit can be the smallest semantic unit obtained after the first model processes the first question; the probability data can be a numerical value representing the degree of association between each lexical unit and the tool name data; the n fully connected layers can be network layers set at the output of the first model to process lexical units and probability data, for example, n=3; the weight parameters can be parameters used in the fully connected layers to adjust the importance of lexical unit data; the target weight parameters can be weight parameters that, after optimized training, can accurately filter the lexical units corresponding to the tool name data.

[0036] In this embodiment, the process of reasoning about the first question based on the first model and outputting multiple tokens of the first question and the probability data of each token may include: the first model performing natural language reasoning processing on the first question input by the user. During the reasoning process, the model performs semantic parsing on the first question, generates multiple tokens corresponding to the question, and simultaneously outputs the probability data of each token related to the tool selection requirement, so as to characterize the possibility of the tool name corresponding to each token; wherein, by default, the first model outputs all tokens (e.g., 151,936 tokens) and corresponding probability data contained in its original token table in a single reasoning operation.

[0037] In this embodiment, the process of constructing n fully connected layers at the output of the first model may include: building n sequentially connected layers at the end of the link between the first model's output lexical and probability data (the value of n can be determined based on the actual number of tools and historical lexical statistics; for example, n=3 for a scenario with 20 tools). The number of nodes in each fully connected layer decreases sequentially, meaning the output of the previous fully connected layer is connected to the input of the next fully connected layer, and the number of lexical units processed by the next layer is less than that of the previous layer; for example, ... Figure 2 As shown, Figure 2 This is a schematic diagram of the multi-layer fully connected layer filtering process for large model lexical units provided in this application embodiment. The first fully connected layer (L1) can be set with 8000 nodes to process all lexical units output by the first model. The second fully connected layer (L2) is set with 6000 nodes to process the lexical units output by L1. The third fully connected layer (L3) is set with nodes that match the actual number of lexical units needed (e.g., 2000, which can be obtained by statistical analysis of lexical units related to tool names that frequently appear in historical tool calls), thereby realizing the stepwise filtering of the number of lexical units.

[0038] In this embodiment, the process of optimizing and training the weight parameters of the fully connected layers based on sample questions, sample name data, lexical units, and their probability data to obtain the target weight parameters may include: using sample questions and sample name data as training references, and combining the lexical units and probability data output by the first model, iteratively optimizing and training the weight parameters of n fully connected layers. During training, only the weight parameters of the fully connected layers are adjusted, without modifying the parameters of the first model itself, to avoid compromising the stability and basic accuracy of the original model; the training objective is to make the fully connected layers prioritize retaining lexical units related to the tool name and increase the probability weight of such lexical units, while reducing the weight of irrelevant lexical units (lexical units not related to the tool name), ultimately obtaining the target weight parameters that can accurately filter lexical units related to the tool name.

[0039] It should be noted that Magpie-Qwen-CortexDual-0.6B, as a lightweight small model, has limited context carrying capacity, thus limiting the introduction of a large number of examples as input in the tool selection process. To address this limitation, fine-tuning and transfer learning can be employed. Transfer learning can be implemented by adding fully connected layers, training the model with example data. This allows the knowledge inherent in the examples (e.g., problem features, parameter information, and the correlation logic between the target tool) to be directly internalized into the model parameters, eliminating the need for additional example input during the inference phase. For instance, if the training set contains examples such as "Has the tool process name 'Tool Testing Process', tool name 'Laser_Mark', and version 'V1.1.7' been distributed to the Xintai factory? FTP query tool should be used," the model, through training with this type of example data, can learn and memorize the correspondence between "problems with specific parameter combinations and FTP query tools."

[0040] Through the above methods, the model can fully absorb the knowledge contained in the examples by means of fine-tuning or transfer learning training. When performing intent recognition and tool selection in the future, it can directly call the learned association information without adding additional examples, effectively saving the example introduction step in the reasoning stage. This not only adapts to the context carrying capacity limit of small models, but also ensures the accuracy of tool selection.

[0041] In this embodiment, the process of determining tool name data based on target weight parameters and lexical probability data may include: inputting the lexical and probability data output by the first model into n pre-trained fully connected layers; adjusting the probability data of each lexical through the target weight parameters; and selecting lexicals with the highest probability weights that are directly related to the tool name. These selected lexicals are then combined according to semantic logic to form uniquely corresponding tool identifier information, i.e., tool name data. This process uses fully connected layers to accurately filter the number of lexicals from a large number (e.g., 151,936) to a small number (e.g., 2,000), ensuring the accuracy of the tool name data while avoiding excessive token consumption due to the use of a large number of samples.

[0042] In this embodiment, the process of determining tool parameter data based on the second model, tool name data, and the first question may include: after determining the tool name data, using the second model to perform deep semantic analysis on the first question, identifying key information corresponding to the parameter list of the tool, extracting parameter names and corresponding values ​​that meet the tool parameter requirements, and forming tool parameter data. Since a single tool has been identified through the tool name data, the second model does not need to handle the obfuscation problem of multiple tool parameters, and the token consumption focuses only on the parameter extraction of a single tool, balancing the accuracy of parameter extraction with token consumption control. It's worth noting that as the number of tools increases, the system's token consumption rises significantly. This is mainly because ensuring the accuracy of intent recognition requires a sufficient number of reference examples for each tool, and these examples themselves consume a large amount of tokens. To alleviate this problem, analysis revealed that while the model achieves high accuracy in the tool selection phase, its accuracy in the parameter extraction phase is significantly insufficient. Therefore, tool selection and parameter extraction are separated into two independent stages. After this separation, the tool selection phase no longer relies on examples, thus greatly reducing token consumption. Once a specific tool is determined, only the corresponding examples need to be loaded for that tool, effectively controlling the overall token usage.

[0043] However, this approach also introduces new challenges: stage splitting necessitates an additional large model interaction, increasing overall response time and further straining the already slow system performance. To balance efficiency and accuracy, the lightweight mini model Magpie-Qwen-CortexDual-0.6B is selected specifically for the tool selection task. This model is small and has fast inference speed, but its initial accuracy is low. To improve its performance, a combination of "fine-tuning + large model transfer learning" is adopted. The fine-tuning process is not specified here. However, fine-tuning has limited impact on improving the output capability of the large model and relies on a large amount of labeled data. Therefore, the large model transfer learning method is introduced to quickly and significantly improve the output accuracy of the small model on the tool selection task, achieving immediate results.

[0044] The large model generates text through word-by-word prediction, selecting the next word with the highest probability based on the preceding context at each step, much like stringing words together to form sentences, until the sentence is complete. Transfer learning is employed, with fine-tuning of three newly added fully connected layers at the large model's output to achieve the following objectives: First, in tool selection scenarios, the output categories of the large model are relatively fixed. Analysis of historical data revealed that only about 2000 output words are actually needed, so the original output vocabulary was significantly reduced from 151936 to this size. Second, with a smaller vocabulary, the model's weight distribution across effective output categories is more concentrated, thus improving prediction accuracy. Third, during training, the main parameters of the large model are frozen, and only the newly added layers are updated, ensuring that the original model's capabilities are not affected and maintaining system stability. Fourth, because only the three fully connected layers at the end need to be fine-tuned, the model training speed is significantly accelerated, achieving efficient adaptation.

[0045] In the embodiments of this application, by outputting lexical and probability data through the first model, constructing and training a fully connected layer to obtain target weight parameters to determine tool name data, and then using the second model to combine multiple types of data to determine tool parameter data, the hierarchical and accurate extraction of tool names and parameters can be achieved, thereby improving the technical problems in related technologies where tool name extraction is easily interfered with by redundant lexicals and the coupling between parameter extraction and name extraction leads to low accuracy.

[0046] In some embodiments, the invocation data includes usage instructions; based on the invocation data and the first user intent, a target tool is selected from the tools to be invoked and invoked to obtain a response result, including: Based on the tool name data, determine the target tool corresponding to the first question from the tools to be invoked; Based on the user manual data, the first question, and the tool parameter data, the target tool is invoked to obtain the response result.

[0047] In this embodiment, the invocation can be a process of launching the target tool according to a preset method and inputting relevant data to obtain results. In the embodiments of this application, the target tool is determined by the tool name data, and then the target tool is invoked based on the user manual data, the first question, and the tool parameter data. This can achieve accurate positioning and effective invocation of the target tool, thereby improving the technical problems in related technologies where it is difficult to determine the matching tool from multiple tools and the lack of necessary data support for tool invocation leads to invocation failure.

[0048] In some embodiments, the instruction data includes the input parameter format data and output rule data of the tool to be invoked; based on the instruction data, the first question, and the tool parameter data, the target tool is invoked to obtain a response result, including: Based on the input parameter format data, determine the first question and / or tool parameter data as the input parameters of the target tool; If the target tool is a pre-defined agent, the output result is determined as the target tool's response result based on the output rule data; the output result is the result of the target tool outputting based on the input parameters. If the target tool is a preset tool, the preset language model called according to the output rule data performs semantic transformation processing on the output results to obtain the response results.

[0049] In this embodiment, the input parameter format data can be the format requirement information for the target tool to receive input parameters; the output rule data can be the processing rule information for the output results of the target tool; the input parameters can be data that meets the input parameter format data requirements and is used to input the target tool; if the target tool is a preset intelligent agent, its output result can be a natural language result that directly meets the user's understanding; if the target tool is a preset tool, its output result can be the raw data result, which needs to be processed by a preset language model.

[0050] In this embodiment, the process of determining the first question and / or tool parameter data as input parameters of the target tool based on the input parameter format data may include: if the target tool only requires question-related information, then the first question is determined as the input parameter; if the target tool needs to specify parameter information, then the tool parameter data is determined as the input parameter; if the target tool needs to include both question and parameter information, then the first question and tool parameter data are jointly determined as the input parameter, ensuring that the input parameter conforms to the input parameter format requirements of the target tool and provides a compliant input basis for subsequent calls. For example, if the target tool is a preset tool, the first question and tool parameter data are determined as input parameters based on the input parameter format data; if the target tool is a preset intelligent agent, the first question is determined as the input parameter based on the input parameter format data.

[0051] In this embodiment, if the target tool is a preset intelligent agent, the process of determining the output result as the response result of the target tool according to the output rule data may include: the output rule data has been predetermined to show that the output result of the preset intelligent agent can be used as a valid response without additional processing. Therefore, when the target tool is a preset intelligent agent, after the preset intelligent agent completes the calculation based on the input parameters and outputs the result, the output result is directly determined as the response result of the target tool according to the output rule data, without the need for additional data conversion steps, thus ensuring the direct usability of the response result.

[0052] In this embodiment, if the target tool is a preset tool, the process of semantically transforming the output result according to the preset language model invoked based on the output rule data to obtain the response result may include: the preset tool is an abstracted functional component, and its output result based on input parameters is structured data, which cannot be directly understood by the user. To solve this problem, special processing logic for the preset tool is predefined in the output rule data. It does not follow the complete process of the large model ReAct, but integrates the "observation" step into the tool invocation process, that is, it explicitly requires the invocation of the preset language model to process the output result of the preset tool. Based on this output rule data, the invocation of the preset language model is triggered, and the preset language model performs semantic transformation on the structured data output by the preset tool, transforming it into natural language content that the user can understand. Finally, the transformed content is determined as the response result of the target tool, realizing the adaptation between the tool output and the user's understanding.

[0053] In the embodiments of this application, the input parameters are determined by the input parameter format data, and the output results are processed according to the target tool type (preset intelligent agent or preset tool) and output rule data. This can achieve compliance of input parameters and easy understanding of response results, thereby improving the technical problems in related technologies where inconsistent input parameter formats lead to tool call failures and rigid and difficult-to-understand response result formats.

[0054] In some embodiments, based on the user manual data, the first question, and the tool parameter data, the target tool is invoked to obtain a response result, including: The tool parameter data was validated for completeness based on the user manual data, and the validation results were obtained. If the parameter data of the verification result characterization tool is incomplete, a prompt message is generated; the prompt message is used to instruct the user to input a second question. Generate the target question and the corresponding target tool parameter data based on the first question, the second question, and the preset language model; Based on the user manual data, the target problem, and the target tool parameter data, the target tool is invoked to obtain the response result.

[0055] In this embodiment, the integrity check can be a process of determining whether the tool parameter data contains all the parameters required to call the target tool based on the user manual data; the check result can be information that characterizes whether the tool parameter data is complete; the prompt information can be information used to guide the user to supplement the missing parameters; the second question can be the data entered by the user after responding to the prompt information to supplement the missing parameters; the target question can be a question with complete information obtained by combining the first question and the second question; and the target tool parameter data can be the complete tool parameter data obtained based on the target question.

[0056] In this embodiment, the process of verifying the completeness of tool parameter data based on user manual data to obtain the verification result may include: the user manual data contains a list of parameters required for calling the target tool and attribute information of each parameter (such as whether it is a required parameter, parameter format requirements, etc.), which serves as the basis for parameter completeness verification. Using this user manual data as a standard, the acquired tool parameter data is checked item by item to verify whether it covers all required parameters for calling the target tool and whether it meets the parameter format requirements. By comparison, it is determined whether the tool parameter data meets the calling conditions, and finally, a verification result characterizing the completeness of the tool parameter data is generated.

[0057] In this embodiment, when the verification result characterizes the tool parameter data as incomplete, the process of generating a prompt message may include: when the verification result shows that the tool parameter data is missing (such as missing required parameters) or the format is incorrect, generating a clear and instructive prompt message to supplement and improve the parameter information. This prompt message must clearly inform the user of the currently missing parameter type or the parameter problem that needs to be corrected, guiding the user to input content that can supplement the missing parameter information, i.e., the second question, ensuring that the user clearly understands the direction of the supplementary information to be provided.

[0058] In this embodiment, the process of generating a target question and corresponding target tool parameter data based on the first question, the second question, and a preset language model may include: to avoid excessive token consumption and distraction of the large model by directly using the complete historical question-and-answer context, the first question and the second question are integrated and refined through a preset language model to generate a target question that covers complete requirements and necessary parameter information; at the same time, complete parameter information that meets the requirements of the target tool parameters is extracted from the target question to form target tool parameter data, thereby achieving accurate integration of information required for business reasoning and saving token resources for subsequent sample addition, system rule analysis, and other stages.

[0059] In this embodiment, the process of calling the target tool based on the user manual data, the target question, and the target tool parameter data to obtain the response result may include: at this time, the target tool parameter data has been integrated and supplemented to meet the complete requirements, and the target question clarifies the user's complete needs; guided by the calling rules in the user manual data (such as parameter input method, tool execution logic, etc.), the target question and the target tool parameter data are used together as input to start the calling process of the target tool, ensuring that the tool performs the corresponding operation according to the user's complete needs, and finally outputs a response result that meets expectations.

[0060] It's important to note that a context summarization mechanism is employed to achieve efficient context management and optimize large-scale model inference. Since the large model itself doesn't remember historical dialogues, using all historical content as input would lead to token overruns and attention distractions. By guiding the large model to dynamically summarize a complete, independent question based on the current dialogue history, this question can be used for subsequent steps. For example, a user asks, "Help me find the 10 orders with the most questions in the recent order data," missing the "factory" parameter. The model responds by requesting additional factory information, and the user replies, "Changzhou factory." At this point, the model, considering the context, summarizes a new question: "Help me find the 10 orders with the most questions in the recent order data of the Changzhou factory." This solution separates business reasoning from context management, ensuring that subsequent reasoning is based only on concise and complete questions. This frees up significant token resources, which can be used for critical tasks such as integration examples and rule analysis, improving overall system performance and focus.

[0061] In the embodiments of this application, by performing integrity verification on the tool parameter data, a prompt message is generated to guide the user to input a second question when the parameters are incomplete. Then, the target question and target tool parameter data are generated by combining multiple types of data to call the target tool. This can ensure the integrity of the tool parameter data and avoid tool call failure due to missing parameters. This improves the technical problem in related technologies where missing tool parameters lead to call interruption and the user has to repeatedly input the question.

[0062] In some embodiments, generating a target question based on a first question, a second question, and a preset language model includes: Determine whether the first question and / or the second question contain preset keywords, and obtain the determination result; If the judgment result indicates that the first question and / or the second question contain preset keywords, the first question and the second question are extracted to obtain semantic nodes and semantic links. The target problem is determined based on semantic nodes and semantic links.

[0063] In this embodiment, the preset keywords can be exclusionary words configured to address the problem of information loss when directly rewriting large models, such as "except for," "not limited to," and "others." Their function is to identify scenarios that need to be extracted through core meaning to avoid rewriting distortion. The judgment result can be information representing whether the first question and / or the second question contains the preset keywords. The extraction process can be the process of extracting key semantic information from the first and second questions. The semantic node can be the extracted key information unit. The semantic link can be information that connects the semantic nodes and represents the relationship between the nodes. The target question can be a question that is complete in information and logically clear, organized based on semantic nodes and semantic links.

[0064] In this embodiment, the process of determining whether the first question and / or the second question contains preset keywords may include: performing a full-text search on the first question and / or the second question using preset keyword matching rules, checking whether the preset keywords exist in the two types of data, and then generating a judgment result of "preset keywords exist" or "preset keywords do not exist".

[0065] In this embodiment, when the judgment result indicates that the first question and / or the second question contain preset keywords, the process of abstracting and extracting semantic nodes and semantic links from the first and second questions may include: when the judgment result shows the presence of preset keywords, to avoid the loss of key information due to direct rewriting of the large model, a technique for extracting core meaning is adopted. For example, the abstract meaning extraction method of the natural language processing tool (HanLP) is used to integrate and extract the first and second questions. This extraction process will split the key information units in the two types of data to form semantic nodes (such as core objects and requirements in the question); at the same time, it will identify and extract the logical relationships between each semantic node to form semantic links (such as semantic association (contrast) links representing the core requirement logic), ensuring that while extracting the core meaning, the key information in the question (such as easily lost information such as factory and process names) is retained.

[0066] In this embodiment, the process of determining the target problem based on semantic nodes and semantic links may include: integrating and reorganizing the two types of information according to the core requirement logic of the problem based on the extracted semantic nodes and semantic links. The reorganization process uses semantic links as a logical framework, filling the framework with the key information corresponding to the semantic nodes to form a structured problem statement that covers the complete core requirements while retaining key information, i.e., the target problem. This process can avoid the distortion problem of directly rewriting large models, and because it focuses only on the core meaning and key information, it can also avoid information loss caused by excessive abstraction, ensuring the accuracy and completeness of the target problem and meeting the needs of subsequent tool calls or business reasoning.

[0067] As an example, the instruction specification and interaction for calling the large model tool in this application embodiment are as follows: #Role: You are an excellent secretary, skilled at summarizing key information from context.

[0068] #Task: You will receive current and historical questions from users, as well as system feedback. Please try to understand the semantics and rewrite the questions.

[0069] #Rules: 1. Always retain relevant entities, metrics, dimensions, values, and date ranges.

[0070] 2. Only answer questions about rewriting.

[0071] 3. Pay attention to the parameters entered by the user and do not distort them, such as parameters contained in "", [], {}, "is", "is", etc.

[0072] 4. Pay attention to the context and try to extract the effective parameters.

[0073] 5. If the latest question contains words such as "in addition to", "not limited to", or "other", please do not mention related information when rewriting.

[0074] 6. Pay close attention to the relationship between the last round of dialogue and the current issue. If there is identical information, it indicates a close relationship. The rewritten question should include key information from both questions, especially the factory information.

[0075] 7. If the current question is unrelated to previous questions and answers, it does not need to be rewritten.

[0076] 8. New questions should not begin with "Rewriting question:".

[0077] #History Q&A: User question: The tool workflow name is "Tool Submission Workflow". The tool name is Laser_Mark, and the version is V1.1.7. Has it been distributed to the Xintai factory?

[0078] System response: The file has not yet been issued; User question: The tool workflow name is Tool Testing Workflow, and the tool name is Laser_Mark. Has it been distributed to the Xintai factory?

[0079] System response: Version V1.1.7 of the tool has been distributed.

[0080] FTP file list; |File path|File name|File size|Update time|; |:---:|:---:|:---:| :---:|; [ / Tool | Laser_Mark_V1.1.7.zip | 34678445 | 2025-09-10 15:00:22 |; #Current question to be answered: When querying historical version data for the Laser_Mark tool, should data for all versions be included, not just version V1.1.7? #Rewriting issue: When querying historical version data for the Laser_Mark tool, should data from all versions be included, not just version V1.1.7? The rewritten large model lost information such as factory and process names. A method to extract the core meaning and translate it into user language can be used, for example, by employing HanLP's abstract meaning extraction method. Figure 3 As shown, Figure 3This diagram illustrates the abstract semantic meaning of the problem in this embodiment, visualizing the method's return result. The "interrogative" node clarifies the problem's sentence type. The semantic node "should-01" is associated with "interrogative" via the "mode" link and connected to the "contrast" node via the "arg0" link. The "contrast" node is associated with the "contains-01" node via the "operand 1" link and with the "data" node via the "operand 2" link. The "data" node is further associated with the "not only" node via the "domain" link, thus reflecting the contrast logic in the problem. The "query-01" node is associated with the "time" link. The "link connection" should be -01, and is also associated with the "data" node via the "arg1" link. The "data" node is then associated with the "version" node via the "domain" link, and the "version" node is further associated with the "history" node via the "domain" link. The "contains -01" node is associated with the "data" node via the "arg1" link. The "data" node is then associated with the "tool" node, "all" and "version" nodes marked with "|posslaser_mark" via links such as "poss" and "domain". This ultimately presents the logical relationship of each core semantic unit in the user's question, providing a structured semantic basis for subsequent accurate identification of requirements and extraction of parameters. The "mean" node is the association carrier. It is associated with the "v1.1.7" node (corresponding to a specific version identifier) ​​via the "arg1" link, and with the "this" node via the "arg0" link. The "this" node is then associated with the "version" node via the "domain" link. Then, only the contrast link needs to be extracted, that is: it should contain all version data. Another instruction specification and interaction for calling the large model tool in this embodiment is as follows: #Role: You are an excellent secretary, skilled at summarizing key information from context.

[0081] #Task: You will receive current and historical questions from users, as well as system feedback. Please try to understand the semantics and rewrite the questions.

[0082] #Rules: 1. Always retain relevant entities, metrics, dimensions, values, and date ranges.

[0083] 2. Only answer questions about rewriting.

[0084] 3. Pay attention to the parameters entered by the user and do not distort them, such as parameters contained in "", [], {}, "is", "is", etc.

[0085] 4. Pay attention to the context and try to extract the effective parameters.

[0086] 5. If the latest question contains words such as "except for," "not limited to," or "others," please do not mention related information when rewriting.

[0087] 6. Pay close attention to the relationship between the last round of dialogue and the current issue. If there is identical information, it indicates a close relationship. The rewritten question should include key information from both questions, especially the factory information.

[0088] 7. If the current question is unrelated to previous questions and answers, it does not need to be rewritten.

[0089] 8. New questions should not begin with "Rewriting question:".

[0090] #History Q&A: User question: The tool workflow name is "Tool Submission Workflow". The tool name is Laser_Mark, and the version is V1.1.7. Has it been distributed to the Xintai factory?

[0091] System response: The file has not yet been issued; User question: The tool workflow name is Tool Testing Workflow, and the tool name is Laser_Mark. Has it been distributed to the Xintai factory?

[0092] System response: Version V1.1.7 of the tool has been distributed.

[0093] FTP file list; |File path|File name|File size|Update time|; |:---:|:---:|:---:| :---:|; [ / Tool | Laser_Mark_V1.1.7.zip | 34678445 | 2025-09-10 15:00:22 |; #Current question to be answered: Should include data for all versions; #Rewriting issue: The tool workflow name is the tool submission workflow, and the tool name is Laser_Mark. It should contain data sent to the Xintai factory for all versions of this tool.

[0094] After simplifying the problem, the larger model rewrites the problem correctly.

[0095] In the embodiments of this application, by determining whether the first question and the second question contain preset keywords, and extracting semantic nodes and semantic links when keywords exist to determine the target question, the integrity and logic of the target question can be achieved, thereby improving the technical problems of information confusion and unclear logic when generating questions by combining multiple rounds of user input in related technologies.

[0096] In some embodiments, in response to a user's first question, determining a first user intent corresponding to the first question includes: Based on a preset language model and call data, semantic recognition is performed on the first question to obtain the second user intent; The second user intent is segmented using natural language processing tools to obtain multiple segmentation results; The word segmentation results are processed according to the preset information entropy to obtain the recognition results; Based on the recognition results, word segmentation results that do not match the information entropy are removed from multiple word segmentation results to obtain the first user intent.

[0097] In this embodiment, semantic recognition can be the process of parsing the first question using a preset language model and initially extracting tool-related information; the second user intent can be tool-related parameters obtained after semantic recognition but without filtering; the natural language processing tool can be a tool with word segmentation function, such as the HanLP tool; the word segmentation result can be word units obtained after the natural language processing tool segments the second user intent; the preset information entropy is configured based on the core principle of "minimum information entropy" and a dictionary that conforms to the standard values ​​of tool parameters has been pre-built. The information entropy is used to determine whether the word segmentation result is the standard parameter value required by the tool; the recognition process can be the process of judging the validity of the word segmentation result based on the preset information entropy; the recognition result can be information that characterizes whether the word segmentation result meets the preset information entropy requirements; the tool data can be valid tool-related data obtained after removing word segmentation results that do not meet the information entropy requirements.

[0098] In this embodiment, the process of semantically recognizing the first question based on the preset language model and the call data to obtain the second user intent may include: semantically recognizing the first question based on the preset language model and the call data, and initially extracting relevant parameters that may be used for tool calls, i.e., the second user intent; it should be noted that, due to the error in direct recognition by the preset language model (such as the inability to accurately match standard values ​​for subtle differences in parameter descriptions), the second user intent may contain redundant or inaccurate information.

[0099] In this embodiment, the process of segmenting the second user intent using a natural language processing tool to obtain multiple segmentation results may include: the segmentation process is based on the common expression logic of the tool parameters, splitting the long parameter text that may exist in the second user intent into smaller word units, so that each segmentation result corresponds to a clearer semantics, laying the foundation for subsequent selection of standard parameter values.

[0100] In this embodiment, the process of identifying the word segmentation results according to the preset information entropy can include: during the identification process, each word segmentation result is compared with the dictionary corresponding to the preset information entropy to determine whether the word segmentation result meets the information entropy features of the standard parameters (such as whether it belongs to the standard expression in the dictionary), and an identification result representing whether each word segmentation result "matches the preset information entropy" is generated, clarifying which word segmentation results are valid standard parameter candidates and which are redundant or irrelevant words.

[0101] In this embodiment, the process of removing word segmentation results that do not match the information entropy from multiple word segmentation results based on the recognition results to obtain tool data may include: filtering out word segmentation results that match the preset information entropy (i.e., word segmentation that conforms to the standard parameter values), while removing word segmentation results that do not match the preset information entropy (such as redundant modifiers and irrelevant words). Through this removal operation, inaccurate or redundant information in the second user intent is removed, and accurate standard parameter-related data is retained, ultimately forming tool data that can be directly used for tool invocation. This effectively solves the problem of inaccurate parameters caused by semantic recognition errors of the preset language model, and improves the fault tolerance and accuracy of parameter recognition during tool invocation.

[0102] It should be noted that the current large-scale model has errors in identifying key parameters. For example, when a user asks, "Please check the process name 'Laser Engraving and Paper Testing Process,' and the order code (OC) is 'SG530CCNDA-H61-UGADALL'…," the model might output the process parameter as "Laser Engraving and Paper Testing Process." However, in the system, "Laser Engraving and Paper Testing" is the accurate value configured in the dictionary. To improve parameter error tolerance, the HanLP word segmentation tool is introduced to segment the model's output parameters according to the minimum information entropy. For example, "Laser Engraving and Paper Testing Process" can be correctly segmented into "Laser Engraving and Paper Testing" (dictionary word) and "process" (non-keyword). Through part-of-speech tagging and dictionary matching, the system can automatically filter invalid words and lock onto the target parameter, thus accurately identifying user intent under different expression methods.

[0103] In the embodiments of this application, the second user intent is obtained by using a preset language model, and the effective results are filtered by using natural language processing tools for word segmentation and combined with preset information entropy to obtain tool data. This can achieve the effectiveness and accuracy of tool data, thereby improving the technical problem in related technologies where the second user intent contains redundant information and is difficult to use directly for tool invocation.

[0104] The following describes the tool invocation method provided in the embodiments of this application.

[0105] It should be noted that, as Figure 4 As shown, Figure 4 This diagram illustrates the logical flow of a task processing framework for generating SQL from large models in related technologies. For example, if a user wants to use AI to analyze whether or not to buy a stock, the execution logic of the large model and / or agent in the related technology is as follows: Understanding the user's question -> Calling a general tool to obtain all information about the stock -> The question plus the retrieved information is analyzed by the AI ​​again -> The second analysis finds the information is still insufficient -> Another attempt is made to call the general computing tool -> The question plus the retrieved information is analyzed by the AI ​​again -> The result is obtained. During this process, if the user's question information is insufficient, the agent also attempts to answer.

[0106] Because the company has very high requirements for accuracy in this application, the stock analysis process needs to be developed into a complete tool; this is a rule defined by the company. For example... Figure 5 As shown, Figure 5 This is a schematic diagram of the task processing framework for generating SQL from a large model, provided in this application embodiment. The user's question is the starting point of the entire process; the user inputs their requirements in natural language. The question enters the intent judgment module, which identifies the core intent of the user's question and determines its requirement type. The result of the intent judgment is passed to the tool management module, which distributes the question to the corresponding processing tool or process according to the requirement type. If it is a data query requirement, the SuperSonic tool is invoked, and the data query is completed by parsing the question into SQL, executing the SQL, and returning the result. If it is a function query requirement, the knowledge base tool is invoked, and the function-related consultation is completed by knowledge retrieval, generating content from the large model, and returning the result. If it is analysis requirement 1 or analysis requirement 2, analysis tool 1 is invoked, and the business analysis is completed by executing the analysis steps, obtaining key data, analyzing data in the large model, and returning the result. After each branch completes its corresponding processing, it outputs results back to the user, achieving a closed-loop response to the user's question.

[0107] The execution flow of this application is as follows: Understanding the user's problem -> Calling the tool that satisfies the problem -> Calling the tool to determine if the parameters are complete; if incomplete, request the user to provide them -> Rewriting the question through multiple rounds of dialogue, using useful contextual information to form a new question -> Understanding the new question -> Calling the tool to obtain professional and complete indicator parameters (not raw data) -> AI performing secondary analysis on these indicators -> Answering the question. In this process, high accuracy is required; incomplete parameters will prevent execution. Secondly, the main analysis process is completed by the tool, while the AI ​​"encapsulates" the analyzed results to make them easier to understand.

[0108] To implement the method of the embodiments of this application, Figure 6 A schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application, such as... Figure 6 As shown in the illustration, this application embodiment also provides an electronic device 60 that may include: a memory 601 for storing a computer program; and a processor 602 for implementing the method described above when executing the computer program. The processor 602 can implement the steps of any of the methods described above, which will not be repeated here.

[0109] It should be noted that the cabinet parameter design equipment and cabinet parameter design method provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0110] Of course, in practical applications, such as Figure 6 As shown, the electronic device 60 may further include at least one network interface 603. The various components in the cabinet's parameter design device are coupled together via a bus system 604. It is understood that the bus system 604 is used to implement communication between these components. In addition to a data bus, the bus system 604 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 6Various buses are labeled as bus system 604. The number of processors 602 can be at least one. Network interface 603 is used for wired or wireless communication between the cabinet's parameter design device and other devices. Memory 601 in this embodiment is used to store various types of data to support the operation of the cabinet's parameter design device. The methods disclosed in the above embodiments can be applied to processor 602, or implemented by processor 602. Processor 602 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 602 or by instructions in software form. The processor 602 can be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 602 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly reflected in the combined execution of hardware and software modules in a microcontroller. The software module may reside in a storage medium located in memory 601. Processor 602 reads information from memory 601 and, in conjunction with its hardware, completes the steps of the aforementioned method. In an exemplary embodiment, electronic device 60 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to execute the aforementioned method.

[0111] Specifically, embodiments of this application provide a computer-readable storage medium storing a computer program thereon, such as a memory 601 storing the computer program, which can be executed by a processor 602 to complete the aforementioned method steps. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.

[0112] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0113] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0114] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0115] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

Claims

1. A method for invoking a tool, characterized in that, include: In response to the user's first question, determine the first user intent corresponding to the first question; Based on the first user intent, a target tool is selected from the tool library to be invoked to process the first problem and obtain a response result for the first problem; wherein, the tool library to be invoked includes: a preset intelligent agent that has been abstracted and a preset tool that has been abstracted.

2. The method according to claim 1, characterized in that, The step of selecting a target tool from the tool library to be invoked to process the first problem according to the first user intent, and obtaining a response result for the first problem, includes: The intelligent agent or tool is abstracted to obtain the tool to be invoked and the invocation data corresponding to the tool to be invoked, so as to form the tool library to be invoked; Based on the call data and the first user intent, a target tool is selected from the tools to be called and called to obtain the response result; the response result is a natural language result understood by the user after processing by a preset language model.

3. The method according to claim 2, characterized in that, The call data includes sample name data; the first user intent includes tool name data and tool parameter data; the step of responding to the user's first question and determining the first user intent corresponding to the first question includes: Obtain multiple sample questions; The first problem is matched with each of the sample problems according to a preset embedded model to obtain matching results; If the matching result indicates that the sample problem matches the first problem, then multiple target sample problems are determined; Based on the sample name data of the tool used for each target sample problem, the multiple target sample problems are classified to obtain a target mapping relationship; the target mapping relationship indicates that the sample name data corresponds to at least one target sample problem; The tool name data is determined based on the preset language model, the target mapping relationship, and the first question; The tool parameter data is obtained by semantically recognizing the first question based on the preset language model.

4. The method according to claim 3, characterized in that, The preset language model includes a first model for extracting the tool name data and a second model for extracting the tool parameter data; The step of responding to the user's first question and determining the first user intent corresponding to the first question includes: Based on the first model, the first problem is reasoned and processed, and multiple word elements of the first problem and probability data of each word element are output. n fully connected layers are constructed at the output of the first model, wherein each fully connected layer processes a different number of the terms; where n is a positive integer greater than or equal to 1. Based on the example problem, the example name data, the lexical units and their probability data, the weight parameters of the fully connected layer are optimized and trained to obtain the target weight parameters; The tool name data is determined based on the target weight parameters and the probability data of the lexical units; The tool parameter data is determined based on the second model, the tool name data, and the first question.

5. The method according to claim 3, characterized in that, The invocation data includes usage instructions; the step of selecting a target tool from the tools to be invoked based on the invocation data and the first user intent, and obtaining the response result, includes: Based on the tool name data, determine the target tool corresponding to the first problem from the tools to be invoked; Based on the user manual data, the first question, and the tool parameter data, the target tool is invoked to obtain the response result.

6. The method according to claim 5, characterized in that, The user manual data includes the input parameter format data and output rule data of the tool to be invoked; the process of invoking the target tool based on the user manual data, the first question, and the tool parameter data to obtain the response result includes: The first question and / or the tool parameter data are determined as the input parameters of the target tool based on the input parameter format data. If the target tool is the preset intelligent agent, the output result is determined as the response result of the target tool according to the output rule data; the output result is the result of the target tool outputting based on the input parameters. If the target tool is the preset tool, the output result is semantically transformed by the preset language model called according to the output rule data to obtain the response result.

7. The method according to claim 5, characterized in that, The step of invoking the target tool based on the user manual data, the first question, and the tool parameter data to obtain the response result includes: The tool parameter data is verified for integrity based on the user manual data, and the verification result is obtained. If the verification result indicates that the tool parameter data is incomplete, a prompt message is generated; the prompt message is used to instruct the user to input a second question. Generate a target question and target tool parameter data corresponding to the target question based on the first question, the second question, and the preset language model; Based on the user manual data, the target problem, and the target tool parameter data, the target tool is invoked to obtain the response result.

8. The method according to claim 7, characterized in that, The step of generating a target question based on the first question, the second question, and the preset language model includes: Determine whether the first question and / or the second question contain preset keywords, and obtain the determination result; If the judgment result indicates that the first question and / or the second question contain the preset keyword, the first question and the second question are extracted to obtain semantic nodes and semantic links; The target problem is determined based on the semantic nodes and the semantic links.

9. The method according to claim 2, characterized in that, The step of responding to the user's first question and determining the first user intent corresponding to the first question includes: Based on a preset language model and the call data, semantic recognition is performed on the first question to obtain the second user intent; The second user intent is segmented using natural language processing tools to obtain multiple segmentation results; The word segmentation results are processed according to a preset information entropy to obtain the recognition result; Based on the recognition results, word segmentation results that do not match the information entropy are removed from the multiple word segmentation results to obtain the first user intent.

10. A computer-readable storage medium, characterized in that, The computer-readable medium stores a computer program that, when executed by a processor, is used to implement the method according to any one of claims 1 to 9.