API calling scheme generation method based on large model, electronic equipment, computer readable storage medium and computer program product
By determining the target event processing guide and API information from the knowledge base, and combining the event processing flow and API information to generate the API call scheme, the problem of insufficient reliability of the API call scheme caused by the illusion of the large language model is solved, and logical rigor and high reliability are achieved API call scheme generated.
Patent Information
- Application Number
- CN202411326560.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-14
AI Technical Summary
The existing API call scheme generation method based on large language models has the problem of large language model hallucination, and the generated scheme may have serious logical defects, resulting in insufficient reliability.
By determining the target event processing guide information and API information from the preset knowledge base, and combining the event processing flow and API information to generate API call schemes, avoiding the illusion of large language models and ensuring that the generated scheme logic is rigorous and reliable.
It realizes an API call scheme with rigorous logic and strong reliability, and solves the problem of insufficient reliability in the generation of API call schemes in traditional methods.
Smart Images

Figure CN119311436A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of natural language processing technology, and in particular to a method for generating an API call scheme based on a large model, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] As the complexity of software systems continues to increase and the number of APIs (Application Programming Interfaces) grows rapidly, software developers are faced with the challenge of integrating and using APIs efficiently and accurately. Traditional API integration methods usually rely on the developer's expertise and experience, which is not only time-consuming and labor-intensive, but also prone to errors.
[0003] In recent years, in order to simplify this process, intelligent generation methods for API call plans based on large language models have emerged. However, the large language model obtained by pre-training with massive data has the problem of large language model hallucination. When generating API call plans, it may produce content that seems reasonable but is actually illogical, resulting in serious logical defects in the generated API call plans and insufficient reliability. Summary of the invention
[0004] The main purpose of this application is to provide a method for generating an API call scheme based on a large model, an electronic device, a computer-readable storage medium and a computer program product, aiming to solve the technical problem of insufficient reliability of the intelligently generated API call scheme in the related technology.
[0005] To achieve the above objectives, the present application provides a method for generating an API call scheme based on a large model, comprising:
[0006] In the case where it is determined that the intention of the first prompt text is to generate an API call scheme for a target event, determining target event processing guide information corresponding to the target event from event processing guide information stored in a preset first knowledge base through the first prompt text;
[0007] Generate a target event processing flow corresponding to the target event according to the target event processing guide information, wherein the target event processing flow includes a target event processing node;
[0008] Determine the target API information corresponding to the target event processing node from the API information stored in the preset second knowledge base;
[0009] An API calling scheme for the target event is generated according to the target event processing flow and the target API information.
[0010] In one embodiment, the step of determining, by using the first prompt text, target event processing guide information corresponding to the target event from event processing guide information stored in a preset first knowledge base includes:
[0011] Calculating the first semantic similarity between the event handling guide information stored in the preset first knowledge base and the first prompt text by using a preset semantic similarity algorithm;
[0012] The event processing guide information whose first semantic similarity in the first knowledge base satisfies a first preset similarity condition is determined as the target event processing guide information corresponding to the target event.
[0013] In one embodiment, the step of determining, by using the first prompt text, target event processing guide information corresponding to the target event from event processing guide information stored in a preset first knowledge base, further includes:
[0014] Extracting keywords from the first prompt text to obtain target keywords;
[0015] From the event processing guide information stored in the preset first knowledge base, the event processing guide information matching the target keyword is determined as the target event processing guide information corresponding to the target event.
[0016] In one embodiment, the step of determining the event handling guide matching the target keyword from the event handling guide information stored in the preset first knowledge base as the target event handling guide information corresponding to the target event includes:
[0017] Calculating the second semantic similarity between the event handling guide information stored in the preset first knowledge base and the target keyword by using a preset semantic similarity algorithm;
[0018] The event processing guide information whose second semantic similarity in the first knowledge base satisfies a second preset similarity condition is determined as the target event processing guide information corresponding to the target event.
[0019] In one embodiment, the step of generating a target event processing flow corresponding to the target event according to the target event processing guide information includes:
[0020] Parsing the target event processing guide information to obtain target event processing nodes and a first logical relationship between the target event processing nodes;
[0021] A target event processing flow corresponding to the target event is generated according to the target event processing node and the first logical relationship.
[0022] In one embodiment, the step of generating a target event processing flow corresponding to the target event according to the target event processing guide information includes:
[0023] The target event processing guide information is input into a pre-trained event processing flow generation model to obtain a target event processing flow corresponding to the target event generated by the event processing flow generation model.
[0024] In one embodiment, the step of determining target API information corresponding to the target event processing node from the API information stored in the preset second knowledge base includes:
[0025] According to the node name of the target event processing node, the target API information corresponding to the target event processing node is queried from the API information stored in the preset second knowledge base.
[0026] In one embodiment, the step of determining target API information corresponding to the target event processing node from the API information stored in the preset second knowledge base includes:
[0027] Calculating, by using a preset semantic similarity algorithm, a third semantic similarity between the API information stored in the preset second knowledge base and the description information of the target event processing node;
[0028] The API information in the second knowledge base whose third semantic similarity satisfies a third preset similarity condition is determined as the target API information corresponding to the target event processing node.
[0029] In one embodiment, the target event processing flow further includes the first logical relationship, and the target API information includes a target API corresponding to the target event processing node;
[0030] The step of generating an API call scheme for the target event according to the target event processing flow and the target API information includes:
[0031] Determining a second logical relationship between the target APIs according to the first logical relationship;
[0032] An API calling scheme for the target event is generated according to the second logical relationship and the target API.
[0033] In one embodiment, the step of generating an API calling scheme for the target event according to the second logical relationship and the target API includes:
[0034] Determining a target prompt word template matching the target event from prompt word templates stored in a preset third knowledge base, wherein the target prompt word template is a prompt word template used to assist a pre-trained large language model in generating an API call scheme for the target event;
[0035] Constructing a second prompt text according to the second logical relationship, the target API and the target prompt word template;
[0036] The second prompt text is input into the large language model to obtain an API calling scheme of the target event generated by the large language model.
[0037] In one embodiment, the step of determining a target prompt word template matching the target event from prompt word templates stored in a preset third knowledge base includes:
[0038] Extracting keywords from the first prompt text to obtain target keywords;
[0039] From the prompt word templates stored in the preset third knowledge base, the prompt word template that matches the target keyword is determined as the target prompt word template that matches the target event.
[0040] In addition, to achieve the above-mentioned purpose, the present application also provides an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, the steps of the large model-based API call scheme generation method are implemented as described above.
[0041] In addition, to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the API call solution generation method based on a large model as described above are implemented.
[0042] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the above-mentioned large model-based API call solution generation method.
[0043] The embodiments of the present application provide a method for generating an API call scheme based on a large model, an electronic device, a computer-readable storage medium, and a computer program product. The technical solution of the embodiments of the present application is to determine, through the first prompt text, the target event processing guide information corresponding to the target event from the event processing guide information stored in a preset first knowledge base when it is determined that the intention of the first prompt text is to generate an API call scheme for the target event; generate a target event processing flow corresponding to the target event according to the target event processing guide information, wherein the target event processing flow includes a target event processing node; determine the target API information corresponding to the target event processing node from the API information stored in a preset second knowledge base; generate an API call scheme for the target event according to the target event processing flow and the target API information, so that the present application can combine the event processing guide information and the API information to avoid the illusion of a large language model, and then generate a logically rigorous and reliable API call scheme. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0045] In order to more clearly illustrate the embodiments of the present application 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 only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0046] Figure 1 A first flow chart of a method for generating an API call solution based on a large model provided by the present application;
[0047] Figure 2 A second flow chart of the method for generating an API call solution based on a large model provided by the present application;
[0048] Figure 3 A third flow chart of the method for generating an API call solution based on a large model provided by this application;
[0049] Figure 4 A fourth flow chart of the method for generating an API call solution based on a large model provided by the present application;
[0050] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the API call solution generation method based on a large model in an embodiment of the present application.
[0051] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0052] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0053] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0054] At present, the large language model obtained by relying on pre-training of massive data has the problem of large language model hallucination. When generating API call plans, it may produce content that seems reasonable but is actually illogical, resulting in serious logical flaws in the generated API call plans and insufficient reliability.
[0055] The main solution of the embodiment of the present application is: when it is determined that the intention of the first prompt text is to generate an API calling scheme for the target event, the target event processing guide information corresponding to the target event is determined from the event processing guide information stored in a preset first knowledge base through the first prompt text; based on the target event processing guide information, a target event processing flow corresponding to the target event is generated, wherein the target event processing flow includes a target event processing node; from the API information stored in a preset second knowledge base, the target API information corresponding to the target event processing node is determined; based on the target event processing flow and the target API information, an API calling scheme for the target event is generated.
[0056] The embodiments of the present application can combine event processing guide information and API information to avoid the illusion of a large language model, and then generate a logically rigorous and reliable API calling solution.
[0057] It should be noted that the execution subject of the embodiments of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs (Televisions), desktop computers, etc., or any electronic device that can achieve the above functions, and the embodiments of the present application do not specifically limit this. The following embodiments of the present application are described by taking electronic devices as the execution subject as an example.
[0058] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0059] Please refer to Figure 1 , Figure 1 The first flow chart of the method for generating an API call solution based on a large model is provided in this application.
[0060] The API call solution generation method based on the big model proposed in this application includes steps S100 to S400:
[0061] Step S100: when it is determined that the intention of the first prompt text is to generate an API call scheme for a target event, target event processing guide information corresponding to the target event is determined from event processing guide information stored in a preset first knowledge base through the first prompt text;
[0062] It should be noted that, in this embodiment, the first prompt text may be an initial text input provided by the user, or may be a text input obtained by performing prompt optimization on the initial text input provided by the user.
[0063] Those skilled in the art will know that the API calling scheme refers to the specific method and steps of using the application programming interface. API is an interface that allows different software applications to communicate with each other. It defines a set of rules and protocols that allow different software components to interact with each other without knowing each other's internal implementation details.
[0064] In addition, it should be noted that the target event refers to the specific event or problem that the user wants to handle through the API call. It is the core part of the user's needs and can be part of a business process, such as creating a user account, sending email notifications, processing orders, etc. Event processing guide information refers to the information stored in the first knowledge base on how to handle specific events. This information provides best practices, steps, precautions, etc. for event processing, which can help the large language model to consider carefully when generating API call solutions and avoid large language model hallucinations.
[0065] It should be noted that in this embodiment, one or more event handling guide information can be constructed for each specific event through expert experience and stored in the first knowledge base. Documents such as employee manuals, APP (Application) operation guides, workbench manuals, etc. that record the handling methods, processes, precautions and other information of various specific events can also be stored in the first knowledge base, and a document index can be established according to actual needs.
[0066] It is not difficult to understand that in this embodiment, the intention of the first prompt text can be determined by performing intention recognition on the first prompt, and the intention of the first prompt text can also be determined by keyword extraction.
[0067] It is worth mentioning that, when determining the intention of the first prompt text, this embodiment can clearly determine what event the target event is, or use keywords to refer to the target event. Taking the card replacement event as an example, when determining the intention of the first prompt text, it can be clearly determined that the target event is a card replacement event, or it can extract keywords from the first prompt text and use the extracted keywords such as "card replacement" and "absence" to refer to the target event. It is not difficult to understand that when using keywords to refer to the target event, on the one hand, the first prompt text is subjected to intent recognition to determine whether an API call scheme needs to be generated, and on the other hand, the first prompt text is subjected to keyword extraction, and the extracted keywords are used to refer to the target event, thereby determining whether the intention of the first prompt text is to generate an API call scheme for the target event.
[0068] This embodiment first receives a text submitted by a user or system that describes a problem that the user hopes to solve or a task that the user hopes to complete, that is, a first prompt text, and then parses the first prompt text through natural language processing technology to identify whether an API call solution needs to be generated, and what event's API call solution needs to be generated, so as to accurately understand the user's intention and reduce the risk of misunderstanding or incorrect execution. Then, after determining that the intention of the first prompt text is to generate an API call solution for the target event, this embodiment extracts accurate event processing flow information, that is, target event processing flow information, from a preset first knowledge base to ensure that the solution provided is an effective solution to the user's problem. This embodiment uses the information in the first knowledge base to quickly find a solution that matches the user's needs, ensuring that the API call solution ultimately generated is logically rigorous and reliable.
[0069] For example, Figure 2 As shown, Figure 2 A second flow chart is provided for the method for generating an API call solution based on a large model in this application.
[0070] In a feasible implementation manner, the step of determining the target event processing guide information corresponding to the target event from the event processing guide information stored in the preset first knowledge base through the first prompt text includes steps S110 to S120:
[0071] Step S110, calculating the first semantic similarity between the event handling guide information stored in the preset first knowledge base and the first prompt text by using a preset semantic similarity algorithm;
[0072] Those skilled in the art will know that the semantic similarity algorithm is a natural language processing technology used to evaluate the similarity of meaning between two text fragments or words. The semantic similarity algorithms commonly used by those skilled in the art include methods based on word embedding, methods based on knowledge graphs, methods based on deep learning, methods based on vocabulary and grammar, etc. Among them, the methods based on vocabulary and grammar include cosine similarity algorithm, Euclidean distance method, Pearson correlation coefficient method, etc., and the methods based on vocabulary and grammar include Jaccard coefficient and Dice coefficient method, edit distance method, etc.
[0073] It should be noted that, in this embodiment, the first semantic similarity refers to the degree of semantic similarity between the event handling guide information stored in the first knowledge base and the first prompt text, that is, the similarity between the semantic vector of the event handling guide information stored in the first knowledge base and the semantic vector of the first prompt text.
[0074] In this embodiment, for each event handling guide information stored in the first knowledge base, the semantic similarity between it and the first prompt text is calculated, thereby obtaining the first semantic similarity between each event handling guide information in the first knowledge base and the first prompt text.
[0075] It is worth mentioning that multiple first knowledge bases can also be set up, and different first knowledge bases respectively store event processing guide information of different fields or event types. Therefore, when determining the target event processing guide information, first determine the first knowledge base storing the target event processing guide information according to the field or event type, and then determine the target event processing guide information therefrom, which greatly reduces the amount of data processing, improves the efficiency of determining the target event processing guide information, and also facilitates the maintenance and updating of the event processing guide information in the first knowledge base.
[0076] In addition, in this embodiment, the first knowledge base may be a vector database, that is, in the first knowledge base, the event processing guide information may be stored in the form of a semantic vector.
[0077] It is not difficult to understand that when the first knowledge base is not a vector database, keywords can be extracted from the event processing guide information stored in the first knowledge base to obtain guide information keywords, that is, keywords of the event processing guide information, so that the guide information keywords can be used as the semantic vector of the event processing guide information, or the event processing guide information can be directly vectorized to obtain the semantic vector of the event processing guide information.
[0078] Step S120: determining the event processing guide information in the first knowledge base whose first semantic similarity satisfies a first preset similarity condition as the target event processing guide information corresponding to the target event.
[0079] It should be noted that the first preset similarity condition is used to select the event handling guide information of the target event from the event handling guide information stored in the first knowledge base according to the first semantic similarity, that is, the target event handling guide information corresponding to the target event. The first preset similarity condition can be flexibly set according to actual needs. For example, the first preset similarity condition can be that the first semantic similarity is greater than a preset threshold, or that the first semantic similarity ranks in the top five.
[0080] After calculating the first semantic similarity between the event handling guide information stored in the first knowledge base and the first prompt text, this embodiment determines all the event handling guide information in the first knowledge base whose first semantic similarity meets the first preset similarity condition as the target event handling guide information corresponding to the target event, thereby effectively finding information on how to handle the target event from the first knowledge base, and then assisting the large language model to accurately generate a logically rigorous and reliable API calling solution to meet user needs.
[0081] In addition, this embodiment can also enable the system to adapt to new technologies and changes in user needs by continuously updating the first knowledge base, thereby avoiding the illusion of a large language model caused by outdated data, improving the reliability of intelligent generation of API call plans, and ensuring that the generated API call plans are logically complete and feasible.
[0082] In addition to determining the target event processing guide information in the above manner, this embodiment may also determine the target event processing guide information corresponding to the target event from the event processing guide information stored in the first knowledge base in other manners.
[0083] For example, when event handling guide information is stored in the first knowledge base in the form of event-event handling guide information association mapping, this embodiment can clearly determine that the target event is a specific event when performing intent recognition on the first prompt text, and thus directly query the event handling guide information corresponding to the specific event from the first knowledge base through the mapping relationship between the event and the event handling guide information as the target event handling guide information.
[0084] For example, when event handling guide information is stored in the first knowledge base in the form of documents such as employee manuals and operation guides, this embodiment can also extract keywords from the first prompt text to represent the target event when performing intent recognition on the first prompt text, thereby querying matching event handling guide information from the first knowledge base through keywords as the target event handling guide information.
[0085] Exemplarily, in a feasible implementation manner, the step of determining the target event processing guide information corresponding to the target event from the event processing guide information stored in the preset first knowledge base through the first prompt text further includes steps S130 to S140:
[0086] Step S130, extracting keywords from the first prompt text to obtain target keywords;
[0087] It should be noted that the target keyword is a keyword obtained by extracting keywords from the first prompt text using a keyword extraction technology. The target keyword can be one keyword or multiple keywords.
[0088] Step S140: From the event processing guide information stored in the preset first knowledge base, event processing guide information matching the target keyword is determined as target event processing guide information corresponding to the target event.
[0089] It is not difficult to understand that in this embodiment, after obtaining the target keywords, the documents or a certain chapter and paragraph in the documents that include these keywords in the first knowledge base can be directly queried through direct retrieval, and sorted by the number of times the target keywords appear, and then the event processing guide information that matches the target keywords is determined based on the sorting results, thereby determining the target event processing guide information corresponding to the target event. It is also possible to query the documents or a certain chapter and paragraph in the documents in the first knowledge base that have high semantic similarity with these keywords through a semantic similarity-based retrieval method, and finally determine the event processing guide information that matches the target keywords based on the semantic similarity, thereby determining the target event processing guide information corresponding to the target event.
[0090] Exemplarily, in a feasible implementation manner, the step of determining, from the event handling guide information stored in the preset first knowledge base, the event handling guide information matching the target keyword as the target event handling guide information corresponding to the target event, includes steps S141 to S142:
[0091] Step S141, calculating the second semantic similarity between the event handling guide information stored in the preset first knowledge base and the target keyword by using a preset semantic similarity algorithm;
[0092] It should be noted that, in this embodiment, the second semantic similarity refers to the degree of semantic similarity between the event handling guide information stored in the first knowledge base and the target keyword, that is, the similarity between the semantic vector of the event handling guide information stored in the first knowledge base and the semantic vector of the target keyword.
[0093] It is not difficult to understand that for each event processing guide information stored in the first knowledge base, the semantic similarity between it and the target keyword will be calculated, thereby obtaining the second semantic similarity between each event processing guide information in the first knowledge base and the first prompt text.
[0094] Step S142: determining the event processing guide information in the first knowledge base whose second semantic similarity satisfies a second preset similarity condition as the target event processing guide information corresponding to the target event.
[0095] It should be noted that the second preset similarity condition is used to select the event handling guide information of the target event from the event handling guide information stored in the first knowledge base according to the second semantic similarity, that is, the target event handling guide information corresponding to the target event. The second preset similarity condition can be flexibly set according to actual needs. For example, the second preset similarity condition can be that the second semantic similarity is greater than a preset threshold, or that the second semantic similarity ranks in the top five.
[0096] After calculating the second semantic similarity between the event handling guide information stored in the first knowledge base and the target keyword, this embodiment determines all event handling guide information in the first knowledge base whose second semantic similarity meets the second preset similarity condition as the target event handling guide information corresponding to the target event, thereby effectively finding information on how to handle the target event from the first knowledge base, and then assisting the large language model to accurately generate a logically rigorous and reliable API calling solution to meet user needs.
[0097] It should be noted that in this embodiment, whether it is a direct retrieval method or a retrieval method based on semantic similarity, since a document generally includes event handling guide information of multiple events, this embodiment can first divide the document into multiple parts during retrieval, each part corresponding to the event handling guide information of a specific event (for example, by chapter and paragraph, the event handling guide information of the same event is divided into one part), and then search based on keywords to ensure that the final output content is the event handling guide information of the target event represented by these keywords, that is, the target event processing flow corresponding to the target event.
[0098] In addition, multiple rounds of retrieval can be performed. The first round is to perform retrieval in document units. The second round is to divide the documents retrieved in the first round into multiple modules. Then, the modules are used as units for retrieval. After at least two rounds of retrieval, the target event handling guide information corresponding to the target event is finally determined. It is not difficult to understand that each round of retrieval can be a direct retrieval or a retrieval based on semantic similarity.
[0099] Step S200, generating a target event processing flow corresponding to the target event according to the target event processing guide information, wherein the target event processing flow includes a target event processing node;
[0100] Those skilled in the art will appreciate that the event processing process is a structured process, which includes a series of ordered steps for processing a specific event, wherein each ordered step is an event processing node.
[0101] This embodiment parses the target event processing guide information determined from the first knowledge base, extracts key steps and elements therefrom, and constructs a logically self-consistent and complete event processing flow that can correctly process the target event, that is, a target event processing flow corresponding to the target event. The target event processing flow can be constructed in the form of a flowchart, and each ordered step in the constructed flowchart is a target event processing node.
[0102] For example, Figure 3 As shown, Figure 3 The third flow chart provided for the API call solution generation method based on a large model in this application.
[0103] In a feasible implementation manner, the step of generating a target event processing flow corresponding to the target event according to the target event processing guide information includes steps S210 to S220:
[0104] Step S210, parsing the target event processing guide information to obtain target event processing nodes and a first logical relationship between the target event processing nodes;
[0105] It should be noted that, in this embodiment, the first logical relationship refers to the business logic sequence and dependency relationship between target event processing nodes.
[0106] This implementation may use natural language processing technology to parse the target event processing guide information, extract the target event processing nodes and the first logical relationship between the target event processing nodes.
[0107] It is easy to understand that there can be only one or more target event processing nodes. When only one target event processing node is obtained by parsing the target event processing guide information, there is no first logical relationship. At this time, the target event processing node can be directly used as the target event processing flow.
[0108] In addition, it should be noted that parsing to obtain the target event processing node actually means parsing to obtain the node name, function description, input and output, trigger condition and other information of the target event processing node.
[0109] Step S220: generating a target event processing flow corresponding to the target event according to the target event processing node and the first logical relationship.
[0110] This embodiment uses natural language processing technology to parse the target event processing guide information, extract the target event processing nodes and the first logical relationship between the target event processing nodes, and then generate a logically rigorous and self-consistent target event processing process in a structured manner based on the extracted target event processing nodes and the first logical relationship.
[0111] Specifically, a flowchart can be created to clearly show the location of each target event processing node and the connections between them, and the functions and behaviors of each target event processing node can be specified, including input and output, trigger conditions, etc., to finally obtain a logically self-consistent and complete flowchart as the target event processing process. It is also possible to display the functions and behaviors of each target event processing node in a step-by-step manner in the form of text, and describe the logical relationships and dependencies between different target event processing nodes.
[0112] In addition to the above manner, in another feasible implementation manner, the step of generating a target event processing flow corresponding to the target event according to the target event processing guide information may further include step S230:
[0113] Step S230: input the target event processing guide information into a pre-trained event processing flow generation model to obtain a target event processing flow corresponding to the target event generated by the event processing flow generation model.
[0114] It should be noted that, in this embodiment, the event processing flow generation model is an artificial intelligence model trained by machine learning or deep learning technology, and is used to automatically generate a structured event processing flow according to the input event processing guide information. This embodiment pre-constructs structured event processing flows for a large amount of event processing guide information, thereby using the event processing guide information as a sample feature and the corresponding event processing flow as a sample label to construct a training set for training the event processing flow generation model.
[0115] This embodiment uses artificial intelligence to generate a structured event processing process by inputting the target event processing guide information determined from the first knowledge base into a pre-trained event processing process generation model. There is no need for developers to separately design and parse the target event processing guide information to extract the target event processing nodes and the first logical relationship to generate the relevant program code for the target event processing process.
[0116] Step S300, determining target API information corresponding to the target event processing node from the API information stored in the preset second knowledge base;
[0117] It should be noted that, in this embodiment, the API information includes but is not limited to the API name, parameters, calling method, function description and other information.
[0118] It is not difficult to understand that if the function description, parameters and other information of a certain API information is consistent with the function description, input and output and other information of a certain event processing node, the API information is the API information corresponding to the event processing node.
[0119] In this embodiment, for each target event processing node in the target event processing flow, it is necessary to determine the API information corresponding to each target event processing node, ie, the target API information, from the preset second knowledge base.
[0120] In this embodiment, there are multiple ways to determine the target API information from the preset second knowledge base.
[0121] Exemplarily, in a first feasible implementation manner, the step of determining the target API information corresponding to the target event processing node from the API information stored in the preset second knowledge base may include step S310:
[0122] Step S310: According to the node name of the target event processing node, query the target API information corresponding to the target event processing node from the API information stored in the preset second knowledge base.
[0123] In this embodiment, the API information is pre-associated with the node name of the event processing node and stored in the second knowledge base, so that when determining the target API information, the node name of the target event processing node can be directly queried in the second knowledge base to obtain the API information associated with the node name as the target API information corresponding to the target event processing node.
[0124] This implementation can significantly reduce the search time by directly using the node name as the query condition, thereby improving the response speed of the entire system, and the node name is usually very clear, so the query result is usually very accurate, reducing the possibility of mismatching.
[0125] It is worth mentioning that after querying the API information associated with the node name of the target event processing node from the second knowledge base, the queried API information will also be verified to ensure that the queried API information is suitable for the needs of the target event processing node, such as verifying whether the function description information in the API information is consistent with the function description information of the target event processing node, and verifying whether the parameter information in the API information is consistent with the input and output information of the target event processing node.
[0126] For example, in a second feasible implementation, the step of determining the target API information corresponding to the target event processing node from the API information stored in the preset second knowledge base may further include steps S320 to S330:
[0127] Step S320, calculating a third semantic similarity between the API information stored in the preset second knowledge base and the description information of the target event processing node by using a preset semantic similarity algorithm;
[0128] It should be noted that, in this embodiment, the description information of the target event processing node refers to the functional description information of the target event processing node, which is used to describe the function, role or purpose of the target event processing node.
[0129] In addition, it should be noted that, in this embodiment, the API information includes the functional description information of the API, which is used to describe the function, role or purpose of the API. The third semantic similarity refers to the semantic similarity between the functional description information of the API in the API information stored in the second knowledge base and the description information of the target event processing node, that is, the similarity between the semantic vector of the functional description information of the API in each API information stored in the second knowledge base and the semantic vector of the description information of the target event processing node.
[0130] It is not difficult to understand that for each API information stored in the second knowledge base, the semantic similarity between the functional description information of the API and the description information of each target event processing node will be calculated, thereby obtaining the third semantic similarity between each API information in the first knowledge base and each target event processing node.
[0131] Step S330: Determine the API information in the second knowledge base whose third semantic similarity satisfies a third preset similarity condition as the target API information corresponding to the target event processing node.
[0132] It should be noted that the third preset similarity condition is used to select the API information corresponding to the target event processing node, that is, the target API information, from the API information stored in the second knowledge base according to the third semantic similarity. The third preset similarity condition can be flexibly set according to actual needs. For example, the third preset similarity condition can be that the third semantic similarity is greater than a preset threshold and is the maximum.
[0133] After calculating the third semantic similarity between the API information stored in the second knowledge base and the description information of a target event processing node, this embodiment determines all API information in the second knowledge base whose third semantic similarity meets the third preset similarity condition as the target API information corresponding to the target event processing node, thereby effectively finding the target API information corresponding to each target event processing node from the second knowledge base, and then assisting the large language model to accurately generate logically rigorous and reliable API calling solutions to meet user needs.
[0134] It is not difficult to understand that after calculating the third semantic similarity between each API information and the description information of each target event processing node, for each target event processing node, the API information can be sorted according to the third semantic similarity between each API information and the description information of the target event processing node, so as to quickly find the API information whose third semantic similarity meets the third preset similarity condition as the target API information corresponding to the target event processing node.
[0135] In addition, this embodiment can also enable the system to adapt to changes in API information and user needs by continuously updating the second knowledge base, thereby avoiding the illusion of a large language model caused by outdated data, improving the reliability of intelligent generation of API call plans, and ensuring that the generated API call plans are logically complete and feasible.
[0136] Step S400: Generate an API calling solution for the target event according to the target event processing flow and the target API information.
[0137] In this embodiment, a large number of structured API calling schemes can be constructed in advance based on a large number of known event processing processes and the API information corresponding to their event processing nodes, and the event processing processes and the API information corresponding to their event processing nodes are used as sample features, and the corresponding API calling schemes are used as sample labels to construct a training set, thereby training an AI (Artificial Intelligence) model that automatically generates structured API calling schemes based on the input event processing processes and API information, and then input the target event processing process and the target API information into the AI model to obtain the API calling scheme generated by the AI model as the API calling scheme for the target event.
[0138] In addition, this embodiment may also generate an API calling scheme for a target event in other ways.
[0139] For example, Figure 4 As shown, Figure 4 The fourth flow chart of the method for generating an API call solution based on a large model is provided in this application.
[0140] In a feasible implementation manner, the target event processing flow further includes the first logical relationship, and the target API information includes a target API corresponding to the target event processing node;
[0141] The step of generating an API call scheme for the target event according to the target event processing flow and the target API information includes steps S410 to S420:
[0142] Step S410, determining a second logical relationship between the target APIs according to the first logical relationship;
[0143] It should be noted that the second logical relationship refers to the business logic sequence and dependency relationship between the target APIs.
[0144] In this embodiment, each target event processing node corresponds to at least one target API information, and each target API information includes only one API, namely, the target API corresponding to the target event processing node. Therefore, each target event processing node corresponds to at least one target API. Therefore, the first logical relationship not only reflects the business logic sequence and dependency between the target event processing nodes, but also reflects the business logic sequence and dependency between the target APIs corresponding to different target event processing nodes, so that the second logical relationship can be determined based on the first logical relationship.
[0145] Exemplarily, the target event processing process includes target event processing nodes A and B, A1 and A2 are the target APIs corresponding to A, B1 is the target API corresponding to B, the first logical relationship is to execute the target event processing node A first, and then execute the target event processing node B, then the second logical relationship is to call A1 or A2 first, and then call B1.
[0146] Step S420: Generate an API calling scheme for the target event according to the second logical relationship and the target API.
[0147] This implementation method determines the target API corresponding to each target event node through the target API information, and determines the second logical relationship between the target APIs through the first logical relationship in the target event processing flow, that is, the API that needs to be called to process the target event and its business logic order and dependency relationship are determined. At this time, the second logical relationship and the target API can be directly used as the API calling plan for the target event, or the preset API calling plan template can be applied. According to the second logical relationship, the target API can be filled into the API calling template to obtain the API calling plan for the target event.
[0148] Exemplarily, the API call scheme template may be:
[0149] The first step is to call API1;
[0150] The second step is to call API2;
[0151] The third step is to call API3; ......
[0153] Step N, call APIN.
[0154] Among them, API1, API2, API3...APIN are target APIs that are called in sequence according to the second logical relationship.
[0155] In addition, in the API call plan template, you can also add the prerequisites for each step of the API call, the role that calling the API can play, what results will be produced after calling the API, and how to handle certain events encountered during the API call process. Such information is provided for users' reference, so that users can better make API calls and improve user-friendliness.
[0156] It is not difficult to understand that the above information added to the API call plan template can be extracted from the target API information corresponding to each target API.
[0157] In addition to the above manner, in another feasible implementation manner, the step of generating an API call scheme for the target event according to the second logical relationship and the target API may further include steps S421 to S423:
[0158] Step S421, determining a target prompt word template matching the target event from prompt word templates stored in a preset third knowledge base, wherein the target prompt word template is a prompt word template used to assist a pre-trained large language model in generating an API call scheme for the target event;
[0159] This implementation generates API call schemes for a large number of common events in advance, designs prompt word templates for guiding the large language model on how to generate structured API call schemes, and stores them in a preset third knowledge base.
[0160] For example, in this embodiment, the prompt word template includes:
[0161] 1. Large model role (for example, you are an office worker in the government field and need to analyze business needs and build service processes based on reference documents);
[0162] 2. Generate rules (e.g., strictly follow the steps in the document, do not include relevant code in the answer, etc.);
[0163] 3. Reference document content (dynamically generated based on knowledge base search results);
[0164] 4. Question examples (samples of similar questions and answers);
[0165] 5. Question context (such as conversation history information, dynamically passed in);
[0166] 6. Current issues (such as the API call scheme that generates the target event).
[0167] In this embodiment, the prompt word template can be stored in the third knowledge base in association with the event, so that the prompt word template associated with the target event can be directly queried in the third knowledge base as the target prompt word template matching the target event. Each prompt word template can also be labeled or marked in the form of keywords, so as to determine the target prompt word template by keyword retrieval.
[0168] Exemplarily, the step of determining a target prompt word template matching the target event from prompt word templates stored in a preset third knowledge base includes steps A10 to A20:
[0169] Step A10, extracting keywords from the first prompt text to obtain target keywords;
[0170] Step A20: From the prompt word templates stored in the preset third knowledge base, determine the prompt word template that matches the target keyword as the target prompt word template that matches the target event.
[0171] In this embodiment, keywords can be extracted from the first prompt text to obtain a target keyword that can represent the target event, and then based on the target keyword, a prompt word template matching the target keyword can be queried in a preset third knowledge base as a target keyword template.
[0172] It is not difficult to understand that in addition to extracting keywords from the first prompt text, keywords may also be extracted from the target event processing guide information, thereby querying the target prompt word template based on the keywords extracted from the target event processing guide information.
[0173] Step S422, constructing a second prompt text according to the second logical relationship, the target API and the target prompt word template;
[0174] It should be noted that the second prompt text is a prompt text constructed according to the second logical relationship, the target API and the target prompt word template, and is used to guide the large language model to generate a structured API call solution for the target event.
[0175] This implementation can embed the target API into the target prompt word template according to the second logical relationship to construct the second prompt text, or directly use the second logical relationship and the target API as suffixes of the target prompt word template to construct the second prompt text.
[0176] Step S423: input the second prompt text into the large language model to obtain an API calling scheme of the target event generated by the large language model.
[0177] This implementation method combines the target prompt word template, the second logical relationship and the target API to construct a more instructive prompt text, and inputs it into the large language model to guide the large language model to generate a more structured API call solution.
[0178] This implementation method automatically constructs a second prompt text based on the prompt word template, the second logical relationship and the target API, and provides more context information for the large language model to generate an API call plan for the target event, thereby guiding the large language model to generate a more structured API call plan, so that the API call plan for the target event finally generated is more rigorous and self-consistent in logic, more reliable, and more structured, which is easier for users to understand.
[0179] In addition, it should be noted that since confidential information may be stored in the knowledge base, in order to avoid leakage of confidential information, this embodiment will verify the identity of the user when retrieving information from the knowledge base to determine whether the user has the corresponding authority. It is not difficult to understand that different levels of authority correspond to different information that can be retrieved from the knowledge base, and some confidential information can only be retrieved with high-level authority.
[0180] To further ensure that confidential information is not leaked, this embodiment will also record each API call plan generation operation, summarize the information retrieved from each knowledge base, the user's identity authority, the generated API call plan, and other information, and store it in a designated location for subsequent review and audit.
[0181] This embodiment restricts access to the knowledge base to ensure that sensitive information not related to the problem is not leaked. This embodiment can implement an access control list based on the user's identity role to clarify which users or system roles can access specific information in the knowledge base, and build an audit mechanism to record all access and operations to the knowledge base for review when necessary.
[0182] In addition, please refer to Figure 5 , Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the API call solution generation method based on a large model in an embodiment of the present application.
[0183] The present application also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the steps of the large model-based API call scheme generation method in the above-mentioned embodiment.
[0184] Reference below Figure 5, which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic devices in the embodiments of the present application may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs (Televisions), desktop computers, etc., or any electronic device capable of implementing the above functions. Figure 5 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0185] like Figure 5 As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0186] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a 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, or installed from a storage device 1003, 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 disclosed in the present application are executed.
[0187] The electronic device provided by the present application adopts the API call scheme generation method based on the large model in the above-mentioned embodiment, which can solve the technical problem of insufficient reliability of the intelligently generated API call scheme in the related art. Compared with the prior art, the beneficial effects of the electronic device provided by the present application are the same as the beneficial effects of the API call scheme generation method based on the large model provided by the above-mentioned embodiment, and other technical features in the electronic device are the same as the features disclosed by the API call scheme generation method based on the large model in the above-mentioned embodiment, which will not be repeated here.
[0188] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0189] In addition, the present application also provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, which, when executed, are used to implement the steps of the large model-based API call scheme generation method in the above-mentioned embodiment.
[0190] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of 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 this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0191] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0192] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by an electronic device, the electronic device: when it is determined that the intention of the first prompt text is to generate an API calling scheme for a target event, determine the target event processing guide information corresponding to the target event from the event processing guide information stored in a preset first knowledge base through the first prompt text; generate a target event processing flow corresponding to the target event according to the target event processing guide information, wherein the target event processing flow includes a target event processing node; determine the target API information corresponding to the target event processing node from the API information stored in a preset second knowledge base; and generate an API calling scheme for the target event according to the target event processing flow and the target API information.
[0193] Computer program code for performing the operations of the present application 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 a separate 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 through 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).
[0194] 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 application. 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 alternative implementations, 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.
[0195] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0196] The computer-readable storage medium provided by the present application is a computer-readable storage medium on which computer-readable program instructions (i.e., a computer program) are stored for executing the steps of the API call solution generation method based on a large model in the above-mentioned embodiment, which can solve the technical problem of insufficient reliability of the intelligently generated API call solution in the related art. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the API call solution generation method based on a large model provided in the above-mentioned embodiment, and will not be repeated here.
[0197] In addition, an embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the large model-based API call solution generation method in the above embodiment.
[0198] The computer program product provided by this application can solve the technical problem of insufficient reliability of the intelligently generated API call solution in the related art. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of this application are the same as the beneficial effects of the API call solution generation method based on the large model provided by the above embodiment, which will not be repeated here.
[0199] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for generating an API call scheme based on a large model, characterized in that: The method comprises: In the case where it is determined that the intention of the first prompt text is to generate an API call scheme for a target event, determining target event processing guide information corresponding to the target event from event processing guide information stored in a preset first knowledge base through the first prompt text; Generate a target event processing flow corresponding to the target event according to the target event processing guide information, wherein the target event processing flow includes a target event processing node; Determine the target API information corresponding to the target event processing node from the API information stored in the preset second knowledge base; An API calling scheme for the target event is generated according to the target event processing flow and the target API information.
2. The method for generating an API call scheme based on a large model as claimed in claim 1, characterized in that: The step of determining the target event processing guide information corresponding to the target event from the event processing guide information stored in the preset first knowledge base through the first prompt text includes: Calculating the first semantic similarity between the event handling guide information stored in the preset first knowledge base and the first prompt text by using a preset semantic similarity algorithm; The event processing guide information whose first semantic similarity in the first knowledge base satisfies a first preset similarity condition is determined as the target event processing guide information corresponding to the target event.
3. The method for generating an API call scheme based on a large model as claimed in claim 1, characterized in that: The step of determining the target event processing guide information corresponding to the target event from the event processing guide information stored in the preset first knowledge base through the first prompt text further includes: Extracting keywords from the first prompt text to obtain target keywords; From the event processing guide information stored in the preset first knowledge base, the event processing guide information matching the target keyword is determined as the target event processing guide information corresponding to the target event.
4. The method for generating an API call scheme based on a large model as claimed in claim 3, characterized in that: The step of determining the event processing guide information matching the target keyword from the event processing guide information stored in the preset first knowledge base as the target event processing guide information corresponding to the target event includes: Calculating the second semantic similarity between the event handling guide information stored in the preset first knowledge base and the target keyword by using a preset semantic similarity algorithm; The event processing guide information whose second semantic similarity in the first knowledge base satisfies a second preset similarity condition is determined as the target event processing guide information corresponding to the target event.
5. The method for generating an API call scheme based on a large model as claimed in claim 1, characterized in that: The step of generating a target event processing flow corresponding to the target event according to the target event processing guide information includes: Parsing the target event processing guide information to obtain target event processing nodes and a first logical relationship between the target event processing nodes; A target event processing flow corresponding to the target event is generated according to the target event processing node and the first logical relationship.
6. The method for generating an API call scheme based on a large model as claimed in claim 1, characterized in that: The step of generating a target event processing flow corresponding to the target event according to the target event processing guide information includes: The target event processing guide information is input into a pre-trained event processing flow generation model to obtain a target event processing flow corresponding to the target event generated by the event processing flow generation model.
7. The method for generating an API call scheme based on a large model as claimed in claim 1, characterized in that: The step of determining target API information corresponding to the target event processing node from the API information stored in the preset second knowledge base includes: According to the node name of the target event processing node, the target API information corresponding to the target event processing node is queried from the API information stored in the preset second knowledge base.
8. The method for generating an API call scheme based on a large model as claimed in claim 1, characterized in that: The step of determining target API information corresponding to the target event processing node from the API information stored in the preset second knowledge base includes: Calculating, by using a preset semantic similarity algorithm, a third semantic similarity between the API information stored in the preset second knowledge base and the description information of the target event processing node; The API information in the second knowledge base whose third semantic similarity satisfies a third preset similarity condition is determined as the target API information corresponding to the target event processing node.
9. The method for generating an API call scheme based on a large model as claimed in claim 5, characterized in that: The target event processing flow also includes the first logical relationship, and the target API information includes a target API corresponding to the target event processing node; The step of generating an API call scheme for the target event according to the target event processing flow and the target API information includes: Determining a second logical relationship between the target APIs according to the first logical relationship; An API calling scheme for the target event is generated according to the second logical relationship and the target API.
10. The method for generating an API call scheme based on a large model as claimed in claim 9, characterized in that: The step of generating an API calling scheme for the target event according to the second logical relationship and the target API includes: Determining a target prompt word template matching the target event from prompt word templates stored in a preset third knowledge base, wherein the target prompt word template is a prompt word template used to assist a pre-trained large language model in generating an API call scheme for the target event; constructing a second prompt text according to the second logical relationship, the target API and the target prompt word template; The second prompt text is input into the large language model to obtain an API calling scheme of the target event generated by the large language model.
11. The method for generating an API call scheme based on a large model according to claim 10, characterized in that: The step of determining a target prompt word template matching the target event from the prompt word templates stored in the preset third knowledge base includes: Extracting keywords from the first prompt text to obtain target keywords; From the prompt word templates stored in the preset third knowledge base, the prompt word template that matches the target keyword is determined as the target prompt word template that matches the target event.
12. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the method for generating a large model-based API call solution are implemented as described in any one of claims 1 to 11.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for generating an API call solution based on a large model as described in any one of claims 1 to 11.
14. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method for generating an API call solution based on a large model as claimed in any one of claims 1 to 11 are implemented.