Tool calling method, device and equipment, computer readable storage medium and product

By constructing tool data sets and generating graphical thinking links, the problem that existing technology cannot accurately describe tools is solved, the large model can accurately call multiple target tools, and the accuracy and flexibility of the tool calling process are improved.

CN119337339APending Publication Date: 2025-01-21DOUYIN VISION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411355705.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The existing chain thinking and tree thinking methods cannot accurately implement the description of tools, resulting in the inability to accurately construct thinking links, and thus cannot accurately guide the big model to handle requests.

Method used

By constructing a tool data set in advance, the functional description information, input data types and output data types include the preset tools, determine the request scenario of the initial description information matching, generate the thinking link of the figure, and call it based on the chain -guided model. Target tools.

Benefits of technology

The accurate description of the tools and the construction of the thinking link to ensure that the large model can accurately call multiple target tools, and improve the accuracy and flexibility of the tool call process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119337339A_ABST
    Figure CN119337339A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a tool calling method and device, equipment, a computer readable storage medium and a product. The method comprises the steps that initial description information input into a large model is acquired; determining a request scene matched with the initial description information, and determining a plurality of target tools to be called and a calling sequence associated with the plurality of target tools by adopting a tool data set matched with the request scene; generating a graphical thinking link based on the plurality of target tools and the calling sequence associated with the plurality of target tools, wherein the output data type of the previous target tool is the same as the input data type of the next target tool; and guiding the large model to sequentially call at least one target tool according to the calling sequence based on the graphical thinking link. Therefore, the preset tool can be accurately described to determine a plurality of target tools needing to be called currently. The output data type of the previous target tool is controlled to be the same as the input data type of the next target tool, so that normal execution of the graphic thinking link can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of artificial intelligence technology, and in particular to a tool calling method, device, equipment, computer-readable storage medium and product. Background Art

[0002] With the continuous development of big model technology, how to modularize thinking so that big models can understand, learn and imitate, and process input requests more flexibly and accurately has become an urgent problem to be solved.

[0003] In related technologies, chain of thought (COT) or tree of thought (TOT) under the concept of prompt engineering is generally used to teach the big model how to execute thinking steps, so that the big model can generate responses to perform tasks and realize the implementation and display of long-link logic.

[0004] However, a very important direction in the current application scenarios of big models is the call of big models to tools. The thinking methods of the above two methods are completed through the understanding of text, so the logical links are all pure text modes. In tool calls, since the input and output of the tool itself correspond to multiple different modes, the above two methods cannot achieve an accurate description of the tool, so it is impossible to accurately build a thinking link. Summary of the invention

[0005] The embodiments of the present disclosure provide a tool calling method, apparatus, device, computer-readable storage medium and product, which are used to solve the technical problem that chain thinking and tree thinking cannot accurately describe the tool, and therefore cannot accurately construct a thinking chain to guide a large model for request processing.

[0006] In a first aspect, an embodiment of the present disclosure provides a tool calling method, including:

[0007] Obtaining initial description information input into a preset large model;

[0008] Determine a request scenario that matches the initial description information, and use a tool data set that matches the request scenario to determine multiple target tools to be called and a calling order associated with the multiple target tools, wherein the tool data set includes at least functional description information associated with each preset tool and an input data type and an output data type;

[0009] Generate a graphical thinking link based on the multiple target tools and the call sequence associated with the multiple target tools, wherein the output data type of the previous target tool in the graphical thinking link is the same as the input data type of the next target tool;

[0010] Based on the graphical thinking link, the large model is guided to call the at least one target tool in sequence according to the calling order.

[0011] In a second aspect, an embodiment of the present disclosure provides a tool calling device, including:

[0012] An acquisition module, used to acquire initial description information input into a preset large model;

[0013] a determination module, configured to determine a request scenario matching the initial description information, and to determine a plurality of target tools to be called and a calling order associated with the plurality of target tools using a tool data set matching the request scenario, wherein the tool data set includes at least functional description information associated with each preset tool and an input data type and an output data type;

[0014] A generation module, used for generating a graphical thinking link based on the multiple target tools and the call sequence associated with the multiple target tools, wherein the output data type of the previous target tool in the graphical thinking link is the same as the input data type of the next target tool;

[0015] A calling module is used to guide the large model to call at least one target tool in sequence according to the calling order based on the graphical thinking link.

[0016] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;

[0017] The memory stores computer-executable instructions;

[0018] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the tool calling method described in the first aspect and various possible designs of the first aspect.

[0019] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the tool calling method described in the first aspect and various possible designs of the first aspect is implemented.

[0020] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the tool calling method described in the first aspect and various possible designs of the first aspect.

[0021] The tool calling method, device, equipment, computer-readable storage medium and product provided in this embodiment, by pre-building a tool data set including at least functional description information associated with the preset tool and input data type and output data type, after obtaining the initial description information input by the target user, can first determine the current request scenario, use the tool data set matching the request scenario to determine the multiple target tools to be called and the calling order associated with the multiple target tools, generate a graphical thinking link based on the multiple target tools and the calling order associated with the multiple target tools, and control the output data type of the previous target tool in the graphical thinking link to be the same as the input data type of the next target tool. Then, the large model can be guided to call at least one target tool in sequence according to the calling order. By pre-defining the input data type, output data type and functional description information of the preset tool, the preset tool can be accurately described. In addition, the large model can combine the preset tools according to the user's initial description information, flexibly combine the preset tools in a "building blocks" manner, and control the output data type of the previous target tool to be the same as the input data type of the next target tool, so as to ensure that the graphical thinking link can be executed normally. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0023] Figure 1 A flowchart of a tool calling method provided by an embodiment of the present disclosure;

[0024] Figure 2 A schematic diagram of a graphical thinking link provided by an embodiment of the present disclosure;

[0025] Figure 3 A flowchart of a tool calling method provided by another embodiment of the present disclosure;

[0026] Figure 4 A schematic diagram of an initial tool provided for an embodiment of the present disclosure;

[0027] Figure 5 A schematic diagram of an intermediate tool provided for an embodiment of the present disclosure;

[0028] Figure 6 A schematic diagram of an endpoint tool provided for an embodiment of the present disclosure;

[0029] Figure 7 A flowchart of a tool calling method provided by another embodiment of the present disclosure;

[0030] Figure 8 A flowchart of a tool calling method provided by another embodiment of the present disclosure;

[0031] Fig. 9 A schematic diagram of the structure of a tool calling device provided in an embodiment of the present disclosure;

[0032] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0034] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the type, scope of use, usage scenarios, etc. of the information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0035] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's information. Thus, the user can autonomously choose whether to provide information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0036] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide information to the electronic device.

[0037] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0038] Glossary:

[0039] AI model prompt: It is the initial text input that the model receives to generate a response or complete a task. A set of prompt inputs is input into the AI ​​model to guide the model to generate a response to perform a task. This input can be a question, a description, a set of keywords, or any form of text to guide the model to generate a response with specific content.

[0040] Prompt Engineering: Also known as contextual prompts, it is a method to guide the behavior of a network model towards a specific result without updating the model weights / parameters. Prompt Engineering can be used for a variety of tasks, from answering questions to arithmetic reasoning and even various application areas.

[0041] Tool: Code / interface that can perform a specific function. It can be a Python module (User Define function), whose output is the output of the function. Alternatively, it can be an interface, whose input is the input parameter and whose output is the output parameter. Alternatively, it can be a piece of code with input and output.

[0042] In order to solve the technical problem that chain thinking and tree thinking cannot accurately describe the tool and therefore cannot accurately construct a thinking chain to guide the large model to process requests, the present disclosure provides a tool calling method, device, equipment, computer-readable storage medium and product.

[0043] It should be noted that the tool calling method, apparatus, device, computer-readable storage medium and product provided by the present disclosure can be applied to any scenario of tool calling based on a large model.

[0044] With the continuous development of artificial intelligence, the call of big models to tools has become a more important application scenario associated with big models.

[0045] In the related technology, COT or TOT is generally used to teach the big model to generate responses to execute tasks and realize data processing for user requests. However, the thinking mode of COT and TOT is 100% completed through the understanding of text, and the logical chain generated is a single text mode. However, due to the large number of tool types, the input and output of the tool often correspond to multiple different modes. Therefore, it is impossible to accurately describe the tool and generate the thinking chain based on COT and TOT.

[0046] A tool scheduling method is provided in the related art, which can predefine the tool chain through LangChain. The large model can call the tools in sequence according to the tool chain. However, the above scheduling scheme often has a fixed chain and cannot adapt to changing application scenarios.

[0047] In the process of solving the above technical problems, the inventors found through research that in order to accurately describe the preset tools, the input data type and output data type of the preset tools can be defined in advance to construct a tool data set. Therefore, in the subsequent process of building a thinking chain based on the tool data set, the output data type of the previous tool can be controlled to be consistent with the input data type of the next tool, so that an executable accurate thinking chain can be constructed on the basis of accurately describing the tools.

[0048] Furthermore, when there are many tools and the thought chain is more complex, in order to accurately generate the thought chain, a pre-trained fine-tuning model can also be introduced. The fine-tuning model determines the target tool used in the current step based on the intention of the current step, the multiple tools to be selected in the current step, the thinking of selecting the target tool, and predicts the problem to be solved in the next step. Therefore, based on the processing results of the fine-tuning model, the target tool can be determined more flexibly in the tool data set, and the thought chain can be constructed.

[0049] Figure 1 A flowchart of a tool calling method provided in an embodiment of the present disclosure is shown in FIG. Figure 1 As shown, the method includes:

[0050] Step 101: Obtain initial description information input into a preset large model.

[0051] A large model refers to a machine learning model with ultra-large-scale parameters (usually more than one billion) and complex computing structures. It is usually able to process massive amounts of data and complete various complex tasks, such as natural language processing and image recognition. Users can input initial description information into the large model so that the large model can process requests based on the initial description information.

[0052] For example, a user can input into the big model: I have some gids, show me the keywords of the articles with news content.

[0053] Optionally, the large model can process the request by communicating with the user based on the understanding of the text content of the initial description information. Alternatively, for some application scenarios, the large model needs to call multiple preset target tools to process the request based on the initial description information input by the user.

[0054] Step 102: determine a request scenario that matches the initial description information, and use a tool data set that matches the request scenario to determine multiple target tools to be called and a calling order associated with the multiple target tools, wherein the tool data set includes at least functional description information associated with each preset tool and input data type and output data type.

[0055] In this embodiment, after the initial description information is obtained, a request scenario matching the initial description information may be determined, wherein the request scenario may be determined based on the number of target tools required to process the current request and the complexity of the thought chain constructed based on the target number.

[0056] In order to process the request, multiple tool data sets can be pre-built to cope with a variety of request scenarios of different complexity. Among them, the tool data set includes at least the functional description information associated with each preset tool and the input data type and output data type. Therefore, when generating a graphical thinking link later, the preset tool can be accurately described based on the output data type and input data type of each preset tool. The problem of low accuracy caused by text-based description of preset tools is avoided.

[0057] Furthermore, after determining the request scenario, the tool data set matching the request scenario can be used to determine the multiple target tools to be called and the call order associated with the multiple target tools. When determining the call order, the output data type of the previous target tool can be controlled to be consistent with the input data type of the next target tool. This ensures that the next target function can process the output content of the previous target tool.

[0058] Step 103: Generate a graphical thinking link based on the multiple target tools and the calling order associated with the multiple target tools, wherein the output data type of the previous target tool in the graphical thinking link is the same as the input data type of the next target tool.

[0059] In this embodiment, after respectively determining the multiple target tools to be called and the calling order of the multiple target tools, a graphical thinking link can be generated based on the multiple target tools and the calling order of the multiple target tools, wherein the output data type of the previous target tool in the graphical thinking link is the same as the input data type of the next target tool.

[0060] Step 104: Based on the graphical thinking link, guide the large model to call at least one target tool in sequence according to the calling order.

[0061] In this embodiment, after determining the graphical thinking link, the large model can be guided to call at least one target tool in sequence according to the calling order based on the graphical thinking link to realize data processing of the request triggered by the current user.

[0062] Figure 2 A schematic diagram of a graphical thinking link provided by an embodiment of the present disclosure, such as Figure 2As shown, the graphical thinking link 21 may include four target tools. Among them, the four target tools include an initial tool 22, an intermediate tool 23 and a terminal tool 24. The initial tool 22 only includes output data, but does not include input data. The terminal tool 24 only includes input data, but does not include output data. The intermediate tool 23 includes both input data and output data. The output data type of the previous target tool is consistent with the input data type of the next target tool. For example, the output data type of the initial tool 22 is a triangle, and the input data type of the next intermediate tool 23 connected to it is also a triangle. Therefore, a connection relationship can be established between the two.

[0063] The tool calling method provided in this embodiment pre-builds a tool data set including at least functional description information associated with the preset tool and input data type and output data type. After obtaining the initial description information input by the target user, the current request scenario can be first determined, and the tool data set matching the request scenario can be used to determine the calling order of multiple target tools to be called and the associated multiple target tools. A graphical thinking link is generated based on the calling order of multiple target tools and the associated multiple target tools, and the output data type of the previous target tool in the graphical thinking link is controlled to be the same as the input data type of the next target tool. Then, the large model can be guided to call at least one target tool in sequence according to the calling order. By pre-defining the input data type, output data type and functional description information of the preset tool, the preset tool can be accurately described. In addition, the large model can combine the preset tools according to the user's initial description information, flexibly combine the preset tools in a "building blocks" manner, and control the output data type of the previous target tool to be the same as the input data type of the next target tool, so as to ensure that the graphical thinking link can be executed normally.

[0064] Optionally, based on any of the above embodiments, step 102 includes:

[0065] The initial description information is input into a preset content understanding model to obtain a request scenario output by the content understanding model, wherein the request scenario includes multiple preset tools matching the initial description information and prediction links associated with the multiple preset tools.

[0066] If the number of preset tools associated with the request scenario is within a preset first range, and / or the length of the predicted link is within a preset first length interval, the preset first tool data set is used to determine the multiple target tools to be called and the calling order associated with the multiple target tools.

[0067] If the number of preset tools associated with the request scenario is within a preset second range, and / or the length of the predicted link is within a preset second length interval, the preset second tool data set is used to determine the multiple target tools to be called and the calling order associated with the multiple target tools.

[0068] If the number of preset tools associated with the request scenario is within a preset third range, and / or the length of the predicted link is within a preset third length interval, the preset third tool data set is used to determine the multiple target tools to be called and the calling order associated with the multiple target tools.

[0069] In this embodiment, different request scenarios require different numbers of preset tools to be called, and the more preset tools there are, the more complex the corresponding graphical thinking links are.

[0070] In order to cope with different request scenarios, a content understanding model can be pre-trained. After obtaining the initial description information input by the user, the content understanding model can determine the preset tools that need to be called to process the initial description information and the predicted links between the preset tools. Therefore, the current request scenario can be determined based on the number of the preset tools and the predicted links.

[0071] For different request scenarios, since the number of preset tools that need to be called is different and the complexity of the links is different, in order to cope with different request scenarios, a variety of different tool data sets can be pre-built.

[0072] The tool data set may include a first tool data set, a second tool data set, and a third tool data set. The first tool data set may include associated data of multiple preset tools, and the associated data includes functional description information, input data type, and output data type. The second tool data set includes associated data of multiple preset tools, and in order to facilitate the subsequent retrieval of target tools, multiple preset tools may be clustered according to the input data type to obtain preset tools corresponding to multiple categories. Based on the second tool data set, the third tool data set may perform vectorized operations on the functional description information associated with each preset tool.

[0073] Further, after determining the request scenario, the number of preset tools associated with the request scenario and the length of the predicted link may be determined.

[0074] If the number of preset tools associated with the request scenario is within a preset first range, and / or the length of the predicted link is within a preset first length interval, it indicates that the current request scenario is relatively simple, so the preset first tool data set can be used to determine the multiple target tools to be called and the calling order associated with the multiple target tools.

[0075] If the number of preset tools associated with the request scenario is within a preset second range, and / or the length of the predicted link is within a preset second length interval, it indicates that the current request scenario is relatively complex, and the preset second tool data set can be used to determine the multiple target tools to be called and the calling order associated with the multiple target tools.

[0076] If the number of preset tools associated with the request scenario is within a preset third range, and / or the length of the predicted link is within a preset third length interval, the preset third tool data set is used to determine the multiple target tools to be called and the calling order of the multiple target tools.

[0077] The first range is smaller than the second range, which is smaller than the third range. The first length interval is smaller than the second length interval, which is smaller than the third length interval.

[0078] The tool calling method provided in this embodiment pre-builds a variety of different tool data sets, so that different tool data sets can be used to build graphical thinking links for different scenarios, thereby improving the accuracy of tool calling.

[0079] Optionally, based on any of the above embodiments, before step 102, the method further includes:

[0080] The associated data of a plurality of preset tools are obtained, wherein the associated data includes function description information and input data type and output data type.

[0081] The first tool data set is constructed based on the associated data of the plurality of preset tools.

[0082] In this embodiment, before constructing the graph-like thinking link, it is necessary to first construct a first tool data set.

[0083] Optionally, in order to enable the preset tool to be described later by input data types and output data types, associated data of multiple preset tools may be obtained, and a first tool data set may be constructed based on the associated data of multiple preset tools, wherein the associated data includes function description information and input data types and output data types.

[0084] The tool calling method provided in this embodiment constructs a first tool data set based on the associated data of multiple preset tools, so that the construction of a graph-like thinking chain can be accurately realized based on the input and output data types of the preset tools, so that the output data type of the previous target tool in the graph-like thinking chain is consistent with the input data type of the next target tool, thereby ensuring that the large model can realize accurate calling of multiple target tools based on the graph-like thinking chain.

[0085] Further, based on any of the above embodiments, before step 102, the method further includes:

[0086] The associated data of the plurality of preset tools are input into the macro model.

[0087] A preset number of historical cases are input into the large model to guide the large model to learn the thinking mode of request processing based on image thinking links through the historical cases. The historical cases are process data of generating historical graphical thinking links based on the first tool data set and processing requests based on the historical graphical thinking links.

[0088] In this embodiment, in order to enable the big model to accurately determine at least one target tool based on the first tool data set and realize accurate calling of the target tool, the associated data of multiple preset tools can be input into the big model in advance so that the big model can learn the input and output data types of each preset tool.

[0089] In addition, a preset number of historical cases can be input into the big model to guide the big model to learn the thinking mode of request processing based on image thinking links through historical cases. The historical cases are the process data of generating historical graphical thinking links based on the first tool data set and processing requests based on the historical graphical thinking links.

[0090] Optionally, before inputting the associated data of multiple preset tools and a preset number of historical cases into the big model, you can also input text description information into the big model to guide the big model to generate a graphical thinking link based on the first tool data set. For example, the text description information can be: Your responsibility is to build a best path to achieve this request through the first tool data set according to the user's request; when you build the path, you need to pay attention to the output data type of the previous tool must be consistent with the input data type of the next tool. The following is an introduction to the preset tools, and there are also several examples of graphical thinking paths for your reference.

[0091] Therefore, after the large model has learned the associated data of multiple preset tools and a preset number of historical cases, and after obtaining the initial description information, at least one target tool can be determined in the first tool data set, and a graphical thinking chain can be generated according to the idea that the output data type of the previous target tool is consistent with the input data type of the next target tool.

[0092] The tool calling method provided in this embodiment can guide the big model to learn the thinking mode of request processing based on image thinking links through the historical cases by inputting the associated data of multiple preset tools and a preset number of historical cases into the big model in advance, and then can accurately construct a graphical thinking link based on the associated data of the multiple preset tools.

[0093] Figure 3A flowchart of a tool calling method provided by another embodiment of the present disclosure is provided. Based on any of the above embodiments, Figure 3 As shown, step 102 includes:

[0094] Step 301: Determine the output data type and intent information associated with the initial description information.

[0095] Step 302: Determine an initial tool in the first tool data set based on the output data type, where the initial tool is a preset tool that does not include input data and whose output data is consistent with the output data type.

[0096] Step 303: Determine at least one intermediate tool in the first tool data set according to the intention information and a thinking mode based on historical case learning.

[0097] Step 304: Determine whether the last intermediate tool is any preset end point tool, wherein the end point tool is a preset tool that only includes input data but does not include output data.

[0098] Step 305: If yes, the initial tool and at least one intermediate tool are determined as the multiple target tools.

[0099] If not, return to the step of determining at least one intermediate tool in the first tool data set according to the intention information and the thinking mode based on historical case learning, until the last intermediate tool is any preset endpoint tool, and the initial tool and at least one intermediate tool are determined as the multiple target tools.

[0100] In this embodiment, the preset tools can be divided into initial tools, intermediate tools and end point tools.

[0101] Figure 4 The initial tool schematic diagram provided for the embodiment of the present disclosure is as follows: Figure 4 As shown, the initial tool 41 includes no input data, only output data 42 .

[0102] Figure 5 A schematic diagram of an intermediate tool provided in an embodiment of the present disclosure, such as Figure 5 As shown, the intermediate tool 51 includes both input data 52 and output data 53 .

[0103] Figure 6 A schematic diagram of an endpoint tool provided in an embodiment of the present disclosure, such as Figure 6 As shown, the endpoint tool 61 includes only input data 61 and does not include output data 62 .

[0104] Therefore, after obtaining the initial description information, the initial tool, at least one intermediate tool and the terminal tool can be determined in sequence to realize the construction of a graphical thinking link.

[0105] Optionally, the output data type and the intention information associated with the initial description information may be determined. Based on the output data type, an initial tool is determined in the first tool data set, the initial tool being a preset tool that does not include input data and whose output data is consistent with the output data type.

[0106] For example, the initial description information can be: I have some Gids, show me the keywords of news articles. The big model can determine the processing path of the current step based on the analysis of the initial description information and the thinking of historical cases: As a starting point, I need to select a preset tool with no input data and output data as Gid. Then, the initial tool can be determined among all the preset tools.

[0107] Furthermore, at least one intermediate tool can be determined in the first tool data set according to the intention information and the way of thinking learned based on historical cases. Determine whether the last intermediate tool is any preset terminal tool, wherein the terminal tool is a preset tool that only includes input data but does not include output data. If so, the initial tool and at least one intermediate tool are determined as multiple target tools. Otherwise, it is necessary to continue the selection of intermediate tools, and the step of determining at least one intermediate tool in the first tool data set according to the intention information and the way of thinking based on the image thinking link for request processing can be returned to execute until the last intermediate tool is any preset terminal tool, and the initial tool and at least one intermediate tool are determined as multiple target tools.

[0108] The tool calling method provided in this embodiment determines the initial tool, intermediate tool and terminal tool in sequence based on the first tool data set, and controls the output data type of the previous target tool to be consistent with the input data type of the next target tool, so as to accurately and quickly realize the construction of a graphical thinking link.

[0109] Optionally, based on any of the above embodiments, before step 102, the method further includes:

[0110] The associated data of a plurality of preset tools are obtained, wherein the associated data includes function description information and input data type and output data type.

[0111] The plurality of preset tools are clustered according to the input data type to obtain the preset tools corresponding to the plurality of input data types.

[0112] A second tool data set is constructed based on the associated data and preset tools corresponding to the multiple input data types.

[0113] In this embodiment, in order to cope with more complex request scenarios, a second tool dataset may be constructed, wherein the second tool dataset includes associated data of multiple preset tools, and in order to facilitate the subsequent retrieval of target tools, multiple preset tools may be clustered according to the input data type to obtain preset tools corresponding to multiple categories.

[0114] Optionally, association data of multiple preset tools may be obtained, wherein the association data includes function description information and input data type and output data type. Clustering operation is performed on multiple preset tools according to the input data type to obtain preset tools corresponding to multiple input data types. A second tool data set is constructed based on the association data and the preset tools corresponding to the multiple input data types.

[0115] The tool calling method provided in this embodiment classifies the preset tools according to the input data type, so that the preset tools can be retrieved based on the input data type, and then the target tool can be determined within the search scope based on the problem to be solved in the next step, thereby improving the efficiency and accuracy of constructing graphical thinking links.

[0116] Figure 7 A flowchart of a tool calling method provided by another embodiment of the present disclosure is provided. Based on any of the above embodiments, Figure 7 As shown, step 102 includes:

[0117] Step 701: input the associated data of the plurality of preset tools and preset initialization data into the large model, wherein the initialization data includes the intention information of the currently completed node and the current step.

[0118] Step 702: input the initial description information and the multiple preset tools into a preset fine-tuning model to obtain a prediction result output by the fine-tuning model, wherein the prediction result includes the first tool to be selected in the current step, the thinking behind selecting the first tool in the current step, and the first problem to be solved associated with the next step.

[0119] Step 703: Filter multiple preset tools that match the output data type of the first tool in the second tool data set based on the first tool.

[0120] Step 704: input multiple preset tools that match the output data type of the first tool and the unresolved problem associated with the next step into the fine-tuning model to obtain a prediction result of the output of the fine-tuning model, wherein the prediction result includes the second tool to be selected in the current step, the thinking behind selecting the second tool in the current step, and the second unresolved problem associated with the next step.

[0121] Step 705: Determine whether the second tool is any endpoint tool, wherein the endpoint tool is a preset tool that only includes input data but does not include output data.

[0122] Step 706: If yes, determine the first tool and the second tool as the multiple target tools.

[0123] Step 707, if not, determine the second tool as the current first tool, determine the second problem to be solved as the current first problem to be solved, return to execute the step of inputting the multiple preset tools that match the output data type of the first tool and the problem to be solved associated with the next step into the fine-tuning model, and obtain the prediction result of the output of the fine-tuning model, until the second tool is any endpoint tool, and determine the first tool and the second tool as the multiple target tools.

[0124] In this embodiment, for request scenarios where there are a large number of target tools to be called and the links are relatively complex, using the first tool data set to construct a graph-like thinking link may cause the description of the preset tool plus the description of the input and output data to exceed the upper limit of the prompt length, and it is easy to cause selection errors in the process of splicing the graph-like thinking link. Therefore, the second tool data set can be used to generate the graph-like thinking link.

[0125] Among them, a multiple-cycle (Stepwise) approach can be used, where one tool is generated in one cycle, and the tools of multiple cycles are connected to generate a graphical thinking link. In each cycle, this can be achieved with the help of a preset fine-tuning model. The fine-tuning model can select the target tool required for the current step based on the input data, the intention of selecting the target tool, and the problem to be solved in the next step.

[0126] Optionally, the associated data of multiple preset tools and preset initialization data can be input into the large model, and the initialization data includes the intention information of the currently completed node and the current step. The initial description information and multiple preset tools are input into the preset fine-tuning model, so that the fine-tuning model can determine the first tool to be selected in the current step, the thinking of selecting the first tool in the current step, and the first problem to be solved associated with the next step based on the input content, and obtain the prediction result.

[0127] Furthermore, since the second tool data set includes preset tools corresponding to multiple input data types, multiple preset tools matching the output data type of the first tool can be screened in the second tool data set based on the first tool. Then, the target tool of the current step can be selected from the multiple preset tools. The screening range of the target tool is effectively narrowed, and the selection efficiency of the target tool is improved. The multiple preset tools matching the output data type of the first tool and the unsolved problems associated with the next step are input into the fine-tuning model to obtain the prediction results output by the fine-tuning model, wherein the prediction results include the second tool to be selected in the current step, the thinking of selecting the second tool in the current step, and the second unsolved problem associated with the next step.

[0128] Further, determine whether the second tool is any endpoint tool, wherein the endpoint tool is a preset tool that only includes input data but does not include output data. If so, the first tool and the second tool are determined as multiple target tools. Otherwise, it is necessary to continue to loop the selection of the target tool. The second tool can be determined as the current first tool, and the second problem to be solved can be determined as the current first problem to be solved. Return to execute the step of inputting multiple preset tools that match the output data type of the first tool and the problem to be solved associated with the next step into the fine-tuning model to obtain the prediction result output by the fine-tuning model, until the second tool is any endpoint tool, and the first tool and the second tool are determined as multiple target tools.

[0129] The tool calling method provided in this embodiment uses a second tool data set and a preset fine-tuning model to construct a graph-like thinking link when the current request requires calling a large number of tools and the link is relatively complex, thereby being able to accurately determine the target tool corresponding to each step and improving the accuracy of the graph-like thinking link construction.

[0130] Optionally, based on any of the above embodiments, before step 102, the method further includes:

[0131] The associated data of a plurality of preset tools are obtained, wherein the associated data includes function description information and input data type and output data type.

[0132] The plurality of preset tools are clustered according to the input data type to obtain the preset tools corresponding to the plurality of input data types.

[0133] For each preset tool, a vectorization operation is performed on the functional description information associated with the preset tool to obtain a functional vector.

[0134] A third tool data set is constructed based on the associated data of the plurality of preset tools, the preset tools corresponding to the plurality of input data types, and the function vectors associated with each preset tool.

[0135] In this embodiment, in order to more accurately determine the target tool that matches the current problem to be solved, the function description information associated with each preset tool can be vectorized based on the second tool data set to obtain a third tool data set.

[0136] Optionally, the associated data of multiple preset tools can be obtained, wherein the associated data includes function description information and input data type and output data type. The multiple preset tools are clustered according to the input data type to obtain the preset tools corresponding to the multiple input data types. For each preset tool, the function description information associated with the preset tool is vectorized to obtain a function vector. Among them, any vectorization method can be used to implement the vectorization operation of the function description information, and the present disclosure does not limit this. A third tool data set is constructed based on the associated data of multiple preset tools, the preset tools corresponding to the multiple input data types, and the function vectors associated with each preset tool.

[0137] The tool calling method provided in this embodiment, after classifying the preset tools according to the input data type, vectorizes the functional description information associated with each preset tool, so that the target tool can be accurately retrieved based on the vector corresponding to the problem to be solved in the next step.

[0138] Figure 8 A flowchart of a tool calling method provided by another embodiment of the present disclosure is provided. Based on any of the above embodiments, Figure 8 As shown, step 102 includes:

[0139] Step 801: input the associated data of the plurality of preset tools and preset initialization data into the large model, wherein the initialization data includes the intention information of the currently completed node and the current step.

[0140] Step 802: input the initial description information and multiple preset tools into a preset fine-tuning model to obtain a prediction result output by the fine-tuning model, wherein the prediction result includes a third tool to be selected in the current step, the thinking behind selecting the third tool in the current step, and a third problem to be solved associated with the next step.

[0141] Step 803: Filter the second tool data set to include multiple preset tools that match the output data type of the third tool.

[0142] Step 804: perform a vectorization operation on the third problem to be solved to obtain a problem vector.

[0143] Step 805: Calculate the similarity between the question vector and the function vector associated with each preset tool in the third tool data set.

[0144] Step 806: Determine the preset tool whose similarity meets the preset condition as the fourth tool selected in the next step.

[0145] Step 807: Determine whether the fourth tool is any preset endpoint tool, wherein the endpoint tool is a preset tool that only includes input data but does not include output data.

[0146] Step 808: If yes, determine the third tool and the fourth tool as the multiple target tools.

[0147] Step 809: If not, then input multiple preset tools and functional descriptions corresponding to the output data type associated with the fourth tool into the fine-tuning model, determine the fourth problem to be solved associated with the next step based on the fine-tuning model, and determine the preset tools to be selected for at least one subsequent step in the third tool data set in sequence based on the problem vector of the fourth problem to be solved and the output data type of the fourth tool, until the preset tool to be selected for at least one subsequent step is any preset endpoint tool, and determine the third tool, the fourth tool and the preset tool to be selected for at least one subsequent step as the multiple target tools.

[0148] In this embodiment, for request scenarios where a large number of target tools need to be called and the links are very complex, a graphical thinking link can be constructed based on a combination of a third tool data set and a fine-tuning model.

[0149] Optionally, the associated data of multiple preset tools and preset initialization data can be input into the large model, and the initialization data includes the intention information of the currently completed node and the current step. The initial description information and multiple preset tools are input into the preset fine-tuning model to obtain the prediction result output by the fine-tuning model, wherein the prediction result includes the third tool to be selected in the current step, the thinking of selecting the third tool in the current step, and the third problem to be solved associated with the next step.

[0150] Furthermore, since the third tool data set classifies multiple preset tools according to the input data type, and for each preset tool, the associated functional description information is vectorized, multiple preset tools matching the output data type can be determined based on the output data type of the target tool selected in the current step. The target tool to be called in the next step is determined based on the problem vector and the function vector of the problem to be solved in the next step output by the fine-tuning model.

[0151] Therefore, multiple preset tools that match the output data type of the third tool can be screened in the second tool data set. A vectorization operation is performed on the third problem to be solved to obtain a problem vector. The similarity between the problem vector and the function vector associated with each preset tool in the third tool data set is calculated respectively. The preset tool whose similarity meets the preset condition is determined as the fourth tool selected in the next step. For example, the preset tool with the highest similarity can be determined as the fourth tool.

[0152] Further, it can be determined whether the fourth tool is any preset endpoint tool, wherein the endpoint tool is a preset tool that only includes input data but does not include output data. If so, the third tool and the fourth tool are determined as multiple target tools. If not, the multiple preset tools and functional descriptions corresponding to the output data type associated with the fourth tool are input into the fine-tuning model, and the fourth problem to be solved associated with the next step is determined based on the fine-tuning model. Based on the problem vector of the fourth problem to be solved and the output data type of the fourth tool, the preset tools to be selected for at least one subsequent step are sequentially determined in the third tool data set until the preset tool to be selected for at least one subsequent step is any preset endpoint tool, and the third tool, the fourth tool, and the preset tool to be selected for at least one subsequent step are determined as multiple target tools.

[0153] The tool calling method provided in this embodiment predicts the problem to be solved in the next step by fine-tuning the model when the current request requires calling many tools and the links are complex. Therefore, the target tool can be retrieved in the third tool data set based on the problem vector associated with the problem, thereby accurately determining the target tool corresponding to each step, thereby improving the accuracy of constructing graph-like thinking links.

[0154] Furthermore, based on any of the above embodiments, the method further includes:

[0155] A training data set is obtained, wherein the training data set includes multiple groups of training data, the training data includes thinking data and annotation data, the thinking data includes multiple candidate tools with the same input data type and a description of the problem to be solved in the current step, and the annotation data includes the tool selected in the current step, the intention of selecting the tool and the problem to be solved in the next step.

[0156] The preset model to be trained is iteratively trained based on the training data set until the model to be trained meets the preset convergence condition, thereby obtaining the fine-tuning model.

[0157] In this embodiment, in order to assist in generating a graphical thinking link based on a fine-tuning model, it is first necessary to train a fine-tuning model, wherein a model can be fine-tuned using the large model PEFT-LoRA technology.

[0158] Optionally, a training data set may be obtained, wherein the training data set includes multiple sets of training data, the training data includes thinking data and annotation data, the thinking data includes multiple candidate tools with the same input data type and a description of the problem to be solved in the current step, and the annotation data includes the tool selected in the current step, the intention of selecting the tool, and the problem to be solved in the next step. Based on the training data set, the preset model to be trained is iteratively trained until the model to be trained meets the preset convergence condition, thereby obtaining a fine-tuning model.

[0159] For example, the thinking data in the training data can be input into the model to be trained to obtain the processing result of the model to be trained. The processing result includes the tool selected in the current step predicted by the model to be trained, the intention of selecting the tool, and the problem to be solved in the next step. The processing result and the labeled data are processed by a preset loss function to obtain the loss value of the model to be trained. If the loss value reaches the preset convergence condition, the current model to be trained can be determined as a fine-tuning model. Conversely, the parameters of the model to be trained can be adjusted based on the loss value, and iterative training can be continued until the loss value reaches the preset convergence condition, and the current model to be trained can be determined as a fine-tuning model.

[0160] The tool calling method provided in this embodiment pre-trains a fine-tuning model, so that in more complex request scenarios, the target tool can be selected in the current step based on the fine-tuning model, and the problem to be solved in the next step can be predicted, thereby improving the efficiency of constructing graphical thinking links.

[0161] Fig. 9 A schematic diagram of the structure of a tool calling device provided in an embodiment of the present disclosure, such as Fig. 9 As shown, the device includes: an acquisition module 91, a determination module 92, a generation module 93 and a calling module 94. Among them, the acquisition module 91 is used to obtain the initial description information input into the preset large model. The determination module 92 is used to determine the request scenario that matches the initial description information, and use the tool data set that matches the request scenario to determine the multiple target tools to be called and the calling order associated with the multiple target tools. The tool data set at least includes the functional description information and the input data type and output data type associated with each preset tool. The generation module 93 is used to generate a graphical thinking chain based on the multiple target tools and the calling order associated with the multiple target tools, wherein the output data type of the previous target tool in the graphical thinking chain is the same as the input data type of the next target tool. The calling module 94 is used to guide the large model to call at least one target tool in sequence according to the calling order based on the graphical thinking chain.

[0162] Further, on the basis of any of the above embodiments, the determination module is used to: input the initial description information into a preset content understanding model, and obtain a request scenario output by the content understanding model, wherein the request scenario includes multiple preset tools matching the initial description information and predicted links associated with the multiple preset tools. The determination module is used to: if the number of preset tools associated with the request scenario is within a preset first range, and / or the length of the predicted link is within a preset first length interval, then use a preset first tool data set to determine the multiple target tools to be called and the call order associated with the multiple target tools. If the number of preset tools associated with the request scenario is within a preset second range, and / or the length of the predicted link is within a preset second length interval, then use a preset second tool data set to determine the multiple target tools to be called and the call order associated with the multiple target tools. If the number of preset tools associated with the request scenario is within a preset third range, and / or the length of the predicted link is within a preset third length interval, then use a preset third tool data set to determine the multiple target tools to be called and the call order associated with the multiple target tools.

[0163] Further, based on any of the above embodiments, the device further comprises: an acquisition module, configured to acquire associated data of a plurality of preset tools, wherein the associated data comprises function description information and input data type and output data type; and a construction module, configured to construct the first tool data set based on the associated data of the plurality of preset tools.

[0164] Further, based on any of the above embodiments, the device further includes: an input module, used to input the associated data of the plurality of preset tools into the large model. A guiding module, used to input a preset number of historical cases into the large model, guiding the large model to learn the thinking mode of request processing based on the image thinking link through the historical cases, wherein the historical cases are the process data of generating the historical image thinking link based on the first tool data set and processing the request based on the historical image thinking link.

[0165] Further, based on any of the above embodiments, the determination module is used to: determine the output data type and intent information associated with the initial description information. Determine an initial tool in the first tool data set based on the output data type, wherein the initial tool is a preset tool that does not include input data and whose output data is consistent with the output data type. Determine at least one intermediate tool in the first tool data set according to the intent information and a way of thinking based on historical case learning. Determine whether the last intermediate tool is any preset endpoint tool, wherein the endpoint tool is a preset tool that only includes input data but does not include output data. If so, determine the initial tool and at least one intermediate tool as the multiple target tools. If not, return to execute the step of determining at least one intermediate tool in the first tool data set according to the intent information and a way of thinking based on historical case learning until the last intermediate tool is any preset endpoint tool, and determine the initial tool and at least one intermediate tool as the multiple target tools.

[0166] Further, based on any of the above embodiments, the device further comprises: an acquisition module, used to acquire association data of a plurality of preset tools, wherein the association data comprises function description information and input data type and output data type. A clustering module, used to cluster the plurality of preset tools according to the input data type to obtain the preset tools corresponding to the plurality of input data types. A construction module, used to construct a second tool data set based on the association data and the preset tools corresponding to the plurality of input data types.

[0167] Further, on the basis of any of the above embodiments, the determination module is used to: input the associated data of the multiple preset tools and the preset initialization data into the large model, and the initialization data includes the intention information of the current completed node and the current step. Input the initial description information and the multiple preset tools into the preset fine-tuning model to obtain the prediction result output by the fine-tuning model, wherein the prediction result includes the first tool to be selected in the current step, the thinking of selecting the first tool in the current step, and the first problem to be solved associated with the next step. Based on the first tool, multiple preset tools matching the output data type of the first tool are screened in the second tool data set. Multiple preset tools matching the output data type of the first tool and the problem to be solved associated with the next step are input into the fine-tuning model to obtain the prediction result output by the fine-tuning model, wherein the prediction result includes the second tool to be selected in the current step, the thinking of selecting the second tool in the current step, and the second problem to be solved associated with the next step. Determine whether the second tool is any end point tool, wherein the end point tool is a preset tool that only includes input data but does not include output data. If so, the first tool and the second tool are determined as the multiple target tools. If not, the second tool is determined as the current first tool, the second problem to be solved is determined as the current first problem to be solved, and the process returns to the step of inputting the multiple preset tools that match the output data type of the first tool and the problem to be solved associated with the next step into the fine-tuning model to obtain the prediction result output by the fine-tuning model, until the second tool is any endpoint tool, and the first tool and the second tool are determined as the multiple target tools.

[0168] Further, on the basis of any of the above embodiments, the device further includes: an acquisition module, used to acquire associated data of multiple preset tools, wherein the associated data includes function description information and input data type and output data type. A clustering module, used to perform clustering operations on the multiple preset tools according to the input data type to obtain preset tools corresponding to multiple input data types. A vectorization module, used to perform vectorization operations on the function description information associated with each preset tool to obtain a function vector. A construction module, used to construct a third tool data set based on the associated data of the multiple preset tools, the preset tools corresponding to the multiple input data types, and the function vectors associated with each preset tool.

[0169] Further, on the basis of any of the above embodiments, the determination module is used to: input the associated data of the multiple preset tools and the preset initialization data into the large model, wherein the initialization data includes the intention information of the currently completed node and the current step. Input the initial description information and the multiple preset tools into the preset fine-tuning model to obtain the prediction result output by the fine-tuning model, wherein the prediction result includes the third tool to be selected in the current step, the thinking of selecting the third tool in the current step, and the third problem to be solved associated with the next step. Filter multiple preset tools that match the output data type of the third tool in the second tool data set. Vectorize the third problem to be solved to obtain a problem vector. Calculate the similarity between the problem vector and the function vector associated with each preset tool in the third tool data set respectively. Determine the preset tool whose similarity meets the preset condition as the fourth tool selected in the next step. Determine whether the fourth tool is any preset end point tool, wherein the end point tool is a preset tool that only includes input data but does not include output data. If so, determine the third tool and the fourth tool as the multiple target tools. If not, then multiple preset tools and functional descriptions corresponding to the output data type associated with the fourth tool are input into the fine-tuning model, and the fourth problem to be solved associated with the next step is determined based on the fine-tuning model. Based on the problem vector of the fourth problem to be solved and the output data type of the fourth tool, the preset tools to be selected for at least one subsequent step are determined in sequence in the third tool data set until the preset tool to be selected for at least one subsequent step is any preset endpoint tool, and the third tool, the fourth tool and the preset tool to be selected for at least one subsequent step are determined as the multiple target tools.

[0170] Further, based on any of the above embodiments, the device further includes: an acquisition module for acquiring a training data set, wherein the training data set includes multiple sets of training data, the training data includes thinking data and annotation data, the thinking data includes multiple tools to be selected with the same input data type and a description of the problem to be solved in the current step, and the annotation data includes the tool selected in the current step, the intention of selecting the tool, and the problem to be solved in the next step. A training module is used to iteratively train a preset model to be trained based on the training data set until the model to be trained meets the preset convergence conditions, thereby obtaining the fine-tuning model.

[0171] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.

[0172] In order to implement the above embodiments, the embodiments of the present disclosure further provide a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the tool calling method described in any of the above embodiments is implemented.

[0173] In order to implement the above embodiments, the embodiments of the present disclosure further provide a computer program product, including a computer program, which implements the tool calling method as described in any of the above embodiments when executed by a processor.

[0174] In order to implement the above embodiment, the present disclosure also provides an electronic device, including: a processor and a memory;

[0175] The memory stores computer-executable instructions;

[0176] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the tool calling method as described in any of the above embodiments.

[0177] Fig.10 The electronic device 1000 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure, and the electronic device 1000 may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers, portable multimedia players (PMPs), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.10 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0178] like Fig.10 As shown, the electronic device 1000 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 to a random access memory (RAM) 1003. Various programs and data required for the operation of the electronic device 1000 are also stored in the RAM 1003. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0179] Typically, the following devices may be connected to the I / O interface 1005: input devices 1006 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1008 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.10 The electronic device 1000 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0180] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 1009, or installed from a storage device 1008, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0181] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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 above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0182] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0183] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0184] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0185] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0186] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".

[0187] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0188] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may 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.

[0189] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0190] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0191] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A tool calling method, characterized in that: include: Obtaining initial description information input into a preset large model; Determine a request scenario that matches the initial description information, and use a tool data set that matches the request scenario to determine multiple target tools to be called and a calling order associated with the multiple target tools, wherein the tool data set includes at least functional description information associated with each preset tool and an input data type and an output data type; Generate a graphical thinking link based on the multiple target tools and the call sequence associated with the multiple target tools, wherein the output data type of the previous target tool in the graphical thinking link is the same as the input data type of the next target tool; Based on the graphical thinking link, the large model is guided to call the at least one target tool in sequence according to the calling order.

2. The method according to claim 1, characterized in that The determining a request scenario matching the initial description information includes: Inputting the initial description information into a preset content understanding model, and obtaining a request scenario output by the content understanding model, wherein the request scenario includes a plurality of preset tools matching the initial description information and prediction links associated with the plurality of preset tools; The step of using a tool data set matching the request scenario to determine a plurality of target tools to be called and a calling sequence associated with the plurality of target tools includes: If the number of preset tools associated with the request scenario is within a preset first range, and / or the length of the predicted link is within a preset first length interval, a preset first tool data set is used to determine a plurality of target tools to be called and a calling order associated with the plurality of target tools; If the number of preset tools associated with the request scenario is within a preset second range, and / or the length of the predicted link is within a preset second length interval, a preset second tool data set is used to determine a plurality of target tools to be called and a calling order associated with the plurality of target tools; If the number of preset tools associated with the request scenario is within a preset third range, and / or the length of the predicted link is within a preset third length interval, the preset third tool data set is used to determine the multiple target tools to be called and the calling order associated with the multiple target tools.

3. The method according to claim 2, characterized in that Before using the tool data set matching the request scenario to determine the multiple target tools to be called and the calling order associated with the multiple target tools, the method further includes: Acquire association data of a plurality of preset tools, wherein the association data includes function description information and input data type and output data type; The first tool data set is constructed based on the associated data of the plurality of preset tools.

4. The method according to claim 3, characterized in that Before using the tool data set matching the request scenario to determine the multiple target tools to be called and the calling order associated with the multiple target tools, the method further includes: Inputting the associated data of the plurality of preset tools into the macro model; A preset number of historical cases are input into the large model to guide the large model to learn the thinking mode of request processing based on image thinking links through the historical cases. The historical cases are process data of generating historical graphical thinking links based on the first tool data set and processing requests based on the historical graphical thinking links.

5. The method according to claim 4, characterized in that The step of using a tool data set matching the request scenario to determine a plurality of target tools to be called and a calling sequence associated with the plurality of target tools includes: Determine the output data type and intent information associated with the initial description information; Determine an initial tool in the first tool data set based on the output data type, the initial tool being a preset tool that does not include input data and whose output data is consistent with the output data type; Determine at least one intermediate tool in the first tool data set according to the intention information and a thinking mode based on historical case learning; Determine whether the last intermediate tool is any preset end point tool, wherein the end point tool is a preset tool that only includes input data but does not include output data; If yes, determining the initial tool and at least one intermediate tool as the multiple target tools; If not, return to the step of determining at least one intermediate tool in the first tool data set according to the intention information and the thinking mode based on historical case learning, until the last intermediate tool is any preset endpoint tool, and the initial tool and at least one intermediate tool are determined as the multiple target tools.

6. The method according to claim 2, characterized in that Before using the tool data set matching the request scenario to determine the multiple target tools to be called and the calling order associated with the multiple target tools, the method further includes: Acquire association data of a plurality of preset tools, wherein the association data includes function description information and input data type and output data type; Performing a clustering operation on the plurality of preset tools according to the input data type to obtain the preset tools corresponding to the plurality of input data types; A second tool data set is constructed based on the associated data and preset tools corresponding to the multiple input data types.

7. The method according to claim 6, characterized in that The step of using a tool data set matching the request scenario to determine a plurality of target tools to be called and a calling sequence associated with the plurality of target tools includes: Inputting the associated data of the plurality of preset tools and preset initialization data into the large model, wherein the initialization data includes the intention information of the currently completed node and the current step; Input the initial description information and the plurality of preset tools into a preset fine-tuning model to obtain a prediction result output by the fine-tuning model, wherein the prediction result includes a first tool to be selected in the current step, a mindset for selecting the first tool in the current step, and a first problem to be solved associated with the next step; screening, based on the first tool, a plurality of preset tools in the second tool data set that match an output data type of the first tool; Input a plurality of preset tools matching the output data type of the first tool and the problem to be solved associated with the next step into the fine-tuning model to obtain a prediction result output by the fine-tuning model, wherein the prediction result includes a second tool to be selected in the current step, the thinking of selecting the second tool in the current step, and a second problem to be solved associated with the next step; Determining whether the second tool is any endpoint tool, wherein the endpoint tool is a preset tool that includes only input data but no output data; If yes, determining the first tool and the second tool as the multiple target tools; If not, the second tool is determined as the current first tool, the second problem to be solved is determined as the current first problem to be solved, and the process returns to the step of inputting the multiple preset tools that match the output data type of the first tool and the problem to be solved associated with the next step into the fine-tuning model to obtain the prediction result output by the fine-tuning model, until the second tool is any endpoint tool, and the first tool and the second tool are determined as the multiple target tools.

8. The method according to claim 2, characterized in that: Before using the tool data set matching the request scenario to determine the multiple target tools to be called and the calling order associated with the multiple target tools, the method further includes: Acquire association data of a plurality of preset tools, wherein the association data includes function description information and input data type and output data type; Performing a clustering operation on the plurality of preset tools according to the input data type to obtain the preset tools corresponding to the plurality of input data types; For each preset tool, perform vectorization operation on the function description information associated with the preset tool to obtain a function vector; A third tool data set is constructed based on the associated data of the plurality of preset tools, the preset tools corresponding to the plurality of input data types, and the function vectors associated with each preset tool.

9. The method according to claim 8, characterized in that The step of using a tool data set matching the request scenario to determine a plurality of target tools to be called and a calling sequence associated with the plurality of target tools includes: Inputting the associated data of the plurality of preset tools and preset initialization data into the large model, wherein the initialization data includes the intention information of the currently completed node and the current step; Inputting the initial description information and a plurality of preset tools into a preset fine-tuning model to obtain a prediction result output by the fine-tuning model, wherein the prediction result includes a third tool to be selected in the current step, the thinking of selecting the third tool in the current step, and a third problem to be solved associated with the next step; screening the second tool data set for a plurality of preset tools that match the output data type of the third tool; Performing a vectorization operation on the third problem to be solved to obtain a problem vector; respectively calculating the similarity between the question vector and the function vector associated with each preset tool in the third tool data set; Determine the preset tool whose similarity meets the preset condition as the fourth tool selected in the next step; Determining whether the fourth tool is any preset endpoint tool, wherein the endpoint tool is a preset tool that includes only input data but not output data; If yes, determining the third tool and the fourth tool as the multiple target tools; If not, then multiple preset tools and functional descriptions corresponding to the output data type associated with the fourth tool are input into the fine-tuning model, and the fourth problem to be solved associated with the next step is determined based on the fine-tuning model. Based on the problem vector of the fourth problem to be solved and the output data type of the fourth tool, the preset tools to be selected for at least one subsequent step are determined in sequence in the third tool data set until the preset tool to be selected for at least one subsequent step is any preset endpoint tool, and the third tool, the fourth tool and the preset tool to be selected for at least one subsequent step are determined as the multiple target tools.

10. The method according to claim 7 or 9, characterized in that: The method further comprises: Acquire a training data set, wherein the training data set includes multiple sets of training data, the training data includes thinking data and annotation data, the thinking data includes multiple candidate tools with the same input data type and a description of the problem to be solved in the current step, and the annotation data includes the tool selected in the current step, the intention of selecting the tool, and the problem to be solved in the next step; The preset model to be trained is iteratively trained based on the training data set until the model to be trained meets the preset convergence condition, thereby obtaining the fine-tuning model.

11. A tool calling device, characterized in that: include: An acquisition module, used to acquire initial description information input into a preset large model; a determination module, configured to determine a request scenario matching the initial description information, and to determine a plurality of target tools to be called and a calling order associated with the plurality of target tools using a tool data set matching the request scenario, wherein the tool data set includes at least functional description information associated with each preset tool and an input data type and an output data type; A generation module, for generating a graphical thinking link based on the multiple target tools and the call sequence associated with the multiple target tools, wherein the output data type of the previous target tool in the graphical thinking link is the same as the input data type of the next target tool; A calling module is used to guide the large model to call at least one target tool in sequence according to the calling order based on the graphical thinking link.

12. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor executes the tool calling method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the tool calling method according to any one of claims 1 to 10 is implemented.

14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the tool calling method according to any one of claims 1 to 10 is implemented.