Interface calling method and device based on large model and electronic equipment

By obtaining the interface configuration information and calling the big model to generate reply, the problem of repetitive work in interface development is solved, the interface development efficiency is improved, and the unified call process for different interfaces is realized.

CN119149146APending Publication Date: 2024-12-17BAIDU INT TECH (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411284577.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

There is repetitive work in the development of different interfaces in the prior art, resulting in inefficient interface development and it is difficult to effectively avoid duplicate development.

Method used

By obtaining the configuration information of the target interface, including function call information, prompt word templates and model identification, calling the big model to generate reply, realizing a common interface call process, and avoiding repeated development of different interfaces.

Benefits of technology

It improves the efficiency of interface development, reduces duplicate development work, realizes a unified call process for different interfaces, and enhances development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149146A_ABST
    Figure CN119149146A_ABST
Patent Text Reader

Abstract

The invention provides an interface calling method and device based on a large model and electronic equipment, relates to the technical field of artificial intelligence such as large models, deep learning and natural language processing and the technical field of interface development, and can be applied to interactive scenes based on artificial intelligence, such as application scenes such as generative search, intelligent assistants and intelligent customer service. According to the specific implementation scheme, configuration information of a target interface is obtained, wherein the configuration information comprises first function calling information, a first cue word template and a first model identifier; under the condition that to-be-processed data is received through a target interface, calling a corresponding first entry function according to first function calling information, and determining a first interface processing logic corresponding to the first entry function; according to the first interface processing logic, based on the to-be-processed data and the first cue word template, generating a first cue word; and generating a reply corresponding to the first cue word through the large model corresponding to the first model identifier. Therefore, the interface development efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of artificial intelligence technologies such as big models, deep learning, natural language processing, and interface development technology, and can be applied to interactive scenarios based on artificial intelligence, such as generative search, intelligent assistants, intelligent customer service, and other application scenarios, and in particular to interface calling methods, devices, and electronic devices based on big models. Background Art

[0002] A big model is an advanced artificial intelligence algorithm trained on a large amount of data. It is usually used as a dialogue system. The user first asks a question as the interaction context, and then the model gives an appropriate response. With the continuous enrichment of big model capabilities, various components based on big model capabilities are integrated into platforms such as smart office platforms to realize their corresponding functions, so that the platform can easily integrate various business functions. In order to connect different components to the platform to realize the functions of different components, it is necessary to call the interfaces of different components to provide their functions to the outside world. However, there is repetitive work in the interface development of different components. How to avoid repeated development of different interfaces and improve the efficiency of interface development is a problem that needs to be solved. Summary of the invention

[0003] The present invention provides a method, device and electronic device for calling an interface based on a large model.

[0004] According to a first aspect of the present disclosure, there is provided an interface calling method based on a large model, comprising: obtaining configuration information of a target interface, wherein the configuration information comprises first function calling information, a first prompt word template and a first model identifier; in case of receiving data to be processed through the target interface, determining a first interface processing logic corresponding to the first entry function by calling a corresponding first entry function according to the first function calling information; generating a first prompt word according to the first interface processing logic and based on the data to be processed and the first prompt word template; and generating a reply corresponding to the first prompt word through the large model corresponding to the first model identifier.

[0005] According to a second aspect of the present disclosure, there is provided an interface calling device based on a large model, comprising: an acquisition module, used to acquire configuration information of a target interface, wherein the configuration information comprises first function call information, a first prompt word template and a first model identifier; a first determination module, used to, when receiving data to be processed through the target interface, determine a first interface processing logic corresponding to the first entry function by calling a corresponding first entry function according to the first function call information; a first generation module, used to generate a first prompt word according to the first interface processing logic and based on the data to be processed and the first prompt word template; and a second generation module, used to generate a reply corresponding to the first prompt word through the large model corresponding to the first model identifier.

[0006] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0007] at least one processor; and

[0008] a memory communicatively connected to the at least one processor; wherein,

[0009] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the interface calling method based on the large model as described in the first aspect.

[0010] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the large model-based interface calling method as described in the first aspect.

[0011] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising computer instructions, which, when executed by a processor, implement the large model-based interface calling method as described in the first aspect.

[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0014] Figure 1 It is a flowchart of an interface calling method based on a large model provided according to an embodiment of the present disclosure;

[0015] Figure 2is a flowchart of an interface calling method based on a large model provided according to another embodiment of the present disclosure;

[0016] Figure 3 is a flowchart of an interface calling method based on a large model provided according to another embodiment of the present disclosure;

[0017] Figure 4 is a flowchart of an interface calling method based on a large model provided according to another embodiment of the present disclosure;

[0018] Figure 5 It is a structural diagram of an interface calling device based on a large model provided according to an embodiment of the present disclosure;

[0019] Figure 6 It is a block diagram of an electronic device used to implement the interface calling method based on a large model according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0020] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0021] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information are all carried out with the user's consent, comply with the relevant laws and regulations, and do not violate public order and good morals.

[0022] In order to avoid repeated development of different interfaces and improve the efficiency of interface development, the embodiments of the present disclosure provide an interface calling method, device and electronic device based on a large model.

[0023] The following describes the interface calling method, device and electronic device based on a large model according to an embodiment of the present disclosure with reference to the accompanying drawings.

[0024] It should be noted that the execution subject of the interface calling method based on the big model in this embodiment is the interface calling device based on the big model, and the following embodiments refer to the interface calling device based on the big model as the interface calling device. The interface calling device can be implemented by software and / or hardware, and can be configured in an electronic device, which can include but is not limited to a terminal, a server, etc.

[0025] For example, the interface calling device can be a component service or interface component deployed in a platform such as a smart office platform, which is used to build and call the interfaces of other components connected to the platform. By connecting the interface calling device as a component service or interface component to the platform, basic functions such as authentication and flow control can also be provided to the outside through the platform.

[0026] For the sake of convenience, in each embodiment of the present disclosure, the component in the access platform and whose interface needs to be constructed and called is referred to as a target component.

[0027] Figure 1 It is a flowchart of an interface calling method based on a large model provided according to an embodiment of the present disclosure.

[0028] like Figure 1 As shown, the interface calling method based on the large model includes:

[0029] Step 101: Acquire configuration information of a target interface, wherein the configuration information includes first function call information, a first prompt word template, and a first model identifier.

[0030] Among them, the target interface is the interface for the target component of the platform such as the smart office platform to provide its functions to the outside world. It can be a single-modal interface or a multi-modal interface, and the present disclosure does not limit this. Among them, the single-modal interface refers to an interface that only processes the input and output of a single modal data among modal data such as text, pictures, videos, and audio. Multi-modal interface refers to an interface that can process the input and output of multiple modal data such as text, pictures, videos, and audio.

[0031] The first function call information is information for calling the corresponding entry function, which may include, for example, the function name of the entry function to be called, the code module in which the entry function is located, etc. The code module may be, for example, a class in the code. The entry function is the first function called when the program starts executing.

[0032] The first prompt word template is a template used to generate the first prompt word. The prompt word means encapsulating the user's input, i.e., query, into an instruction to interact with the big model. After the prompt word is requested to the big model, the big model can be guided to obtain a response. The response is the output of the big model. After further processing by the system, it can be presented to the user as the final result.

[0033] The content in the first prompt word template can be configured as needed, for example, it can be set according to the function of the target component of the access platform.

[0034] For example, when the target component of the access platform is a component that provides an intent recognition function, the first prompt word template may include the following two sections:

[0035] Please read the following text carefully and decide its intent.

[0036] Text: {text}

[0037] Or for example, when the target component of the access platform is a component that provides a picture translation function, the first prompt word template may include the following four sections:

[0038] Please look carefully at the following pictures and try to describe what is in the pictures in {target language}. You can describe the scenes and objects in the pictures.

[0039] Image content: {image}

[0040] Target language: {language}

[0041] Image Description:

[0042] The first model identifier is an identifier used to uniquely distinguish the large model, and may include at least one of a serial number corresponding to the large model, a name of the large model, and the like.

[0043] As a possible implementation method, a user, such as a platform developer, can configure the target interface of the target component in order to enable the target component to access the platform, and store the configuration information of the target interface in a preset location, so that the interface calling device can obtain the configuration information of the target interface from the preset location.

[0044] Step 102, when the data to be processed is received through the target interface, the first interface processing logic corresponding to the first entry function is determined by calling the corresponding first entry function according to the first function calling information.

[0045] The data to be processed may include one or more of text data, picture data, audio data, and video data, which is not limited in the present disclosure.

[0046] Among them, the target interface receives the data to be processed before the interface calling device obtains the configuration information of the target interface, or after the interface calling device obtains the configuration information of the target interface, or at the same time as the interface calling device obtains the configuration information of the target interface, and the present disclosure does not impose any restrictions on this.

[0047] The interface processing logic includes a series of steps and rules for processing interface requests and responses, such as the rules for processing the data received through the interface, and how to generate the data returned by the interface based on the processed data. The interface processing logic corresponding to each interface has the first function called at the beginning of its program execution, which is the entry function.

[0048] In the disclosed embodiment, the interface processing logic corresponding to the target interface is referred to as the first interface processing logic. The first entry function is the first function called when the program corresponding to the first interface processing logic starts executing. Thus, by calling the corresponding first entry function according to the first function call information, the first interface processing logic corresponding to the first entry function can be determined.

[0049] Step 103: Generate a first prompt word according to the first interface processing logic and based on the data to be processed and the first prompt word template.

[0050] Step 104: Generate a reply corresponding to the first prompt word by identifying the large model corresponding to the first model.

[0051] Among them, the big model is a large neural network model trained with a deep learning algorithm, designed to understand and generate natural language text. The big model is trained with a large amount of text data, and can capture the complexity and nuances of the language, so as to perform various natural language processing tasks, such as text generation, question-answering systems, semantic understanding, and reasoning. This model is designed to improve the expressiveness and predictive performance of the model, and can handle more complex tasks and data, showing human-like intelligence. Among them, the big model can include GPT3 (Generative Pre-trained Transformer, Generative Pre-trained Transformer 3), GPT4, T5 (Text-to-Text Transfer Transformer, Text-to-Text Transformer), LLaMA (Large Language Model Meta AI, lightweight language model), etc.

[0052] In an example embodiment, the first interface processing logic includes processing steps and rules for the data to be processed received by the target interface, including generating a first prompt word based on the data to be processed and a first prompt word template in the configuration information of the target interface, and generating a reply corresponding to the first prompt word through a large model corresponding to a first model identifier in the configuration information of the target interface. Then, after the first interface processing logic corresponding to the first entry function is determined by calling the first entry function, the first prompt word can be generated according to the first interface processing logic, based on the data to be processed and the first prompt word template, and a reply corresponding to the first prompt word can be generated through a large model corresponding to the first model identifier.

[0053] As a possible implementation method, a class of a processing object (handler) may be predefined, in which the first interface processing logic corresponding to the target interface is defined (specifically, it may include a method for generating a first prompt word based on the object to be processed and the first prompt word template, a method for generating a reply corresponding to the first prompt word through a large model corresponding to the first model identifier, etc.). The interface calling device may create an instance of the class of the processing object by calling a first entry function, the input parameters of which include the data to be processed and the configuration information of the target interface, determine and implement the first interface processing logic defined in the class of the processing object, thereby implementing the generation of the first prompt word based on the data to be processed and the first prompt word template in the configuration information of the target interface, and generating a reply corresponding to the first prompt word through the large model corresponding to the first model identifier in the configuration information of the target interface.

[0054] The interface calling method based on the big model provided by the embodiment of the present disclosure obtains the configuration information of the target interface, wherein the configuration information includes the first function calling information, the first prompt word template and the first model identifier. When the data to be processed is received through the target interface, the first interface processing logic corresponding to the first entry function is determined by calling the corresponding first entry function according to the first function calling information, and the first prompt word is generated according to the first interface processing logic and based on the data to be processed and the first prompt word template. The big model corresponding to the first model identifier is used to generate a reply corresponding to the first prompt word. Therefore, the user only needs to provide the configuration information of the target interface, including the first function calling information, the first prompt word template and the first model identifier, and the corresponding first interface processing logic can be executed through a general interface calling process to realize the function of the corresponding component of the target interface, thereby avoiding repeated development of different interfaces and improving the efficiency of interface development.

[0055] Combine the following Figure 2 , the interface calling method based on the large model provided in the embodiment of the present disclosure is further explained.

[0056] Figure 2 It is a flowchart of an interface calling method based on a large model provided according to another embodiment of the present disclosure.

[0057] like Figure 2 As shown, the interface calling method based on the large model includes:

[0058] Step 201: parse the uniform resource identifier sent by the platform to which the target interface is connected, and obtain the configuration items of the target interface.

[0059] The Uniform Resource Identifier, or URI, is a string used to identify and locate resources, which may include a prefix plus a configuration item. The configuration item may be the last section of the Uniform Resource Locator, which is used to identify and locate the configuration information of the target interface.

[0060] As a possible implementation method, in response to the target component receiving the data to be processed through the target interface that provides its functions to the outside, the platform can send a uniform resource locator to the interface calling device, which includes a prefix plus configuration items, so that the interface calling device can parse the uniform resource locator sent by the platform and obtain the configuration items of the target interface.

[0061] Step 202, based on the configuration items of the target interface, obtain the configuration information of the target interface from the configuration file, wherein the configuration information includes first function call information, a first prompt word template and a first model identifier, and the first function call information includes a function name and path information of a first entry function.

[0062] As a possible implementation method, the configuration file may include configuration information of the target interface and configuration items for identifying and locating the configuration information, so that the interface calling device can query the information in the configuration file based on the configuration items of the target interface to obtain the configuration information of the target interface from the configuration file.

[0063] The function name is the name of the first entry function called based on the first function call information.

[0064] The path information of the first entry function may include the path of the first entry function in the code module.

[0065] Therefore, the interface calling device parses the uniform resource identifier sent by the platform to which the target interface is connected to obtain the configuration items of the target interface, and then obtains the configuration information of the target interface from the configuration file based on the configuration items of the target interface, so that a unified access method can be provided to the outside through the platform. The interface calling device only needs to parse the uniform resource identifier sent by the platform to obtain the configuration information of different interfaces, thereby realizing the functions of different interfaces.

[0066] Step 203, when the data to be processed is received through the target interface, the first interface processing logic corresponding to the first entry function is determined by calling the corresponding first entry function according to the first function calling information.

[0067] In a possible implementation form, the process of calling the corresponding first entry function according to the first function calling information in step 203 may include:

[0068] Get the object of the first entry function according to the function name and path information;

[0069] According to the object of the first entry function, the first entry function is called.

[0070] As a possible implementation method, the interface calling device can obtain the path information and function name of the first entry function from the configuration information of the target interface, load the path information of the first entry function, obtain the object of the first entry function according to the path information and function name of the first entry function, and then call the first entry function according to the object of the first entry function. In this way, the first function call information in the configuration information of the target interface is used to accurately call the corresponding first entry function.

[0071] In a possible implementation form, the first interface processing logic corresponding to the target interface may be a built-in interface processing logic, or may be obtained by modifying a built-in basic interface processing logic.

[0072] The basic interface processing logic can be understood as a program that only includes processing logic common to most interfaces. By modifying the built-in basic interface processing logic, the first interface processing logic corresponding to the target interface can be generated.

[0073] Thus, through the built-in interface processing logic, for the target interface whose corresponding interface processing logic is the same as the built-in interface processing logic, the user does not need to repeatedly define the first interface processing logic corresponding to the target interface, but only needs to directly adopt the built-in interface processing logic and provide the configuration information of the target interface, including the first function call information, the first prompt word template and the first model identifier, and then the corresponding first interface processing logic can be executed through a general interface call process to realize the function of the component corresponding to the target interface. Through the built-in basic interface processing logic, for the target interface whose corresponding interface processing logic is different from the built-in basic interface processing logic, the user only needs to make a simple modification to the built-in basic interface processing logic to obtain the first interface processing logic corresponding to the target interface, and then based on the provided configuration information of the target interface, the corresponding first interface processing logic can be executed through a general interface call process to realize the function of the component corresponding to the target interface. Thus, the efficiency of interface development can be further improved.

[0074] Step 204: Obtain the content to be filled according to the first interface processing logic and based on the data to be processed.

[0075] Step 205: Fill the content to be filled into the first prompt word template to obtain the first prompt word.

[0076] The content to be filled is the content to be filled into the first prompt word template.

[0077] In a possible implementation form, when the data to be processed includes text data, the content to be filled includes a field value corresponding to a target field in the text data, wherein the target field is a field corresponding to the characters to be replaced in the first prompt word template; accordingly, step 205 may include:

[0078] Based on the field value corresponding to the target field, the characters to be replaced in the first prompt word template are replaced to obtain the first prompt word.

[0079] For example, assume that the first prompt word template includes the following content:

[0080] Please rewrite this sentence as another description: {$query}.

[0081] The characters to be replaced in the first prompt word template are: {$query}.

[0082] Assume that the data to be processed includes the following text data:

[0083] query: Today is sunny.

[0084] The target field in the text data is query, and the field value corresponding to the target field is: Today is sunny. Based on the field value, the characters to be replaced in the first prompt word template can be replaced to obtain the following first prompt word:

[0085] Please rewrite this sentence into another description: It is a sunny day today.

[0086] Therefore, for text data, based on the first prompt word template specified in the configuration information of the target interface, a first prompt word for guiding the large model to obtain a corresponding reply can be quickly generated through simple character replacement.

[0087] In a possible implementation form, when the data to be processed includes picture data, the content to be filled includes data content of the picture data; accordingly, step 205 may include:

[0088] The data content of the picture data is filled into the corresponding position in the first prompt word template to obtain the first prompt word.

[0089] It should be noted that, when there is a placeholder at a position corresponding to the data content of the picture data in the first prompt word template, the placeholder may be replaced with the data content of the picture data.

[0090] For example, the data to be processed includes picture data, and it is assumed that the picture data specifically includes the data content of the picture data, that is, the elements and information contained in the picture. The first prompt word template includes the following content:

[0091] Please describe this image in words: {image_data}.

[0092] The {image_data} in the first prompt word template is a placeholder corresponding to the data content of the image data.

[0093] Then, the data content of the image data can be obtained from the image data, and the {image_data} in the first prompt word template can be replaced based on the data content to obtain the first prompt word.

[0094] It should be noted that, in a possible implementation form, the data to be processed may include a link address of the image data. In this case, the data content of the image data can be obtained based on the link address in the data to be processed, and then the data content of the image data can be filled into the corresponding position in the first prompt word template to obtain the first prompt word.

[0095] Therefore, for the picture data, the first prompt word for guiding the large model to obtain a corresponding reply can be quickly generated based on the data content of the picture data and the first prompt word template specified in the configuration information of the target interface.

[0096] In a possible implementation form, when the data to be processed includes audio and video data, the content to be filled includes the data content of the audio and video data; accordingly, step 205 may include:

[0097] The data content of the audio and video data is filled into the corresponding position in the first prompt word template to obtain the first prompt word.

[0098] It should be noted that, when there is a placeholder at the corresponding position of the data content of the audio and video data in the first prompt word template, the placeholder can be replaced by the data content of the audio and video data.

[0099] For example, the data to be processed includes audio and video data, and it is assumed that the audio and video data specifically includes the data content of the audio and video data, that is, the elements and information contained in the audio and video. The first prompt word template includes the following content:

[0100] Please use words to summarize the content of the following audio and video: {Audio / Video_data}.

[0101] The {Audio / Video_data} in the first prompt word template is a placeholder for the data content of the audio / video data.

[0102] Then, the data content of the audio / video data may be obtained from the audio / video data, and {Audio / Video_data} in the first prompt word template may be replaced based on the data content to obtain the first prompt word.

[0103] It should be noted that, in one possible implementation form, the data to be processed may include a link address of audio and video data. In this case, the data content of the audio and video data can be obtained based on the link address in the data to be processed, and then the data content of the audio and video data can be filled into the corresponding position in the first prompt word template to obtain the first prompt word.

[0104] Therefore, for audio and video data, a first prompt word for guiding the large model to obtain a corresponding reply can be quickly generated based on the data content of the audio and video data and the first prompt word template specified in the configuration information of the target interface.

[0105] By obtaining the content to be filled in according to the first interface processing logic and based on the data to be processed, and filling the content to be filled in the first prompt word template to obtain the first prompt word, it is possible to quickly generate the first prompt word for guiding the large model to obtain a response to the data to be processed based on the first prompt word template specified in the configuration information of the target interface.

[0106] Step 206: Generate a reply corresponding to the first prompt word by identifying the large model corresponding to the first model.

[0107] In a possible implementation form, step 206 may be implemented in the following manner:

[0108] generating a request body including a first prompt word;

[0109] Input the request message into the large model corresponding to the first model identifier, and obtain a reply corresponding to the output first prompt word;

[0110] The request message includes a request body, and the request body is used to indicate that a corresponding reply is generated based on the first prompt word through the large model.

[0111] Thus, it is possible to determine the corresponding large model through the first model identifier in the configuration information of the target interface, and then quickly obtain the reply corresponding to the first prompt word through the large model.

[0112] It is understandable that the interfaces of different functional components may include the following types: pure prompt type interface, interface with pre- and post-processing.

[0113] Among them, a pure prompt type interface, that is, a prompt word is generated directly based on the data to be processed received by the interface, and a reply corresponding to the prompt word is generated through a large model, and the reply corresponding to the prompt word is directly used as the data returned by the interface. For this type of interface, the corresponding first interface processing logic can be configured, so that according to the first interface processing logic, the first prompt word is generated based on the first prompt word template in the configuration information of the data to be processed and the target interface, and the reply corresponding to the first prompt word is generated through the large model corresponding to the first model identifier.

[0114] There are pre- and post-processing interfaces, that is, it is necessary to pre-process the data to be processed received by the interface, then generate prompt words based on the pre-processed data, and generate replies corresponding to the prompt words through the large model, and then post-process the replies corresponding to the prompt words, and generate data returned by the interface based on the post-processed data. For this type of interface, the corresponding first interface processing logic can be configured, so that according to the first interface processing logic, the data to be processed is pre-processed according to the preset pre-processing method; based on the pre-processed data to be processed and the first prompt word template, a first prompt word is generated, and the corresponding large model is identified by the first model to generate a reply corresponding to the first prompt word; according to the preset post-processing method, the reply corresponding to the first prompt word generated by the large model is post-processed, and based on the post-processed reply, the data returned by the target interface is generated.

[0115] Accordingly, the method provided by the embodiment of the present disclosure further includes: performing at least one of the following steps according to the first interface processing logic:

[0116] Preprocessing the data to be processed according to a preset preprocessing method, and using the preprocessed data to be processed as the data to be processed used to generate the first prompt word;

[0117] According to a preset post-processing method, the reply corresponding to the first prompt word generated by the large model is post-processed, and based on the post-processed reply, the data returned by the target interface is generated.

[0118] Among them, the preset pre-processing method and post-processing method can be set according to the function of the actual target component.

[0119] By executing at least one of the steps of preprocessing the data to be processed and post-processing the reply corresponding to the first prompt word generated by the large model according to the first interface processing logic, it is possible to achieve, for a target interface with pre- and post-processing, that the user only needs to provide the configuration information of the target interface, including the first function call information, the first prompt word template and the first model identifier, and then execute the corresponding first interface processing logic through a common interface calling process to implement the function of the corresponding component of the target interface, avoid repeated development of different interfaces, and improve the efficiency of interface development.

[0120] In a possible implementation form, the method provided by the embodiment of the present disclosure further includes executing the following steps according to the first interface processing logic:

[0121] When the large model corresponding to the first model identifier fails to generate a response corresponding to the first prompt word, an error message is generated.

[0122] The error information is information used to prompt that an abnormal situation occurs during the execution of the first interface processing logic. The error information may include information that can be set as needed, and the present disclosure does not limit this.

[0123] It should be noted that error messages may also be generated in other situations, such as when an exception occurs during post-processing of a reply corresponding to the first prompt word generated by the large model, or when an exception occurs during generation of the first prompt word based on the first prompt word template.

[0124] Therefore, in the case where the reply corresponding to the first prompt word is not generated by the large model, an error message can be generated to prompt the user that an abnormal situation has occurred during the execution of the first interface processing logic, thereby facilitating the troubleshooting of the abnormal situation based on the error message and ensuring the normal function of the interface.

[0125] Among them, the specific implementation forms of steps 201-206 and similar steps in other embodiments can refer to the detailed descriptions in other embodiments of the present disclosure, and will not be described in detail here.

[0126] In the disclosed embodiment, the configuration items of the target interface are obtained by parsing the uniform resource identifier sent by the platform to which the target interface is connected. Based on the configuration items of the target interface, the configuration information of the target interface is obtained from the configuration file, wherein the configuration information includes first function call information, a first prompt word template and a first model identifier. The first function call information includes a function name and path information of a first entry function. When data to be processed is received through the target interface, the first interface processing logic corresponding to the first entry function is determined by calling the corresponding first entry function according to the first function call information. According to the first interface processing logic and based on the data to be processed, content to be filled is obtained, the content to be filled is filled into the first prompt word template to obtain the first prompt word, and a reply corresponding to the first prompt word is generated through a large model corresponding to the first model identifier. Therefore, the user only needs to provide the configuration information of the target interface, including the first function call information, the first prompt word template and the first model identifier, and the corresponding first interface processing logic can be executed through a general interface call process to realize the function of the component corresponding to the target interface, thereby avoiding repeated development of different interfaces and improving the efficiency of interface development.

[0127] Through the above analysis, it can be known that the interfaces of different functional components can include pure prompt type interfaces and interfaces with pre- and post-processing, and these types of interfaces can be single computing node interfaces, that is, a large model is configured in a single computing node, and a function is completed through a single computing node. Among them, the computing node is a computer or server used to perform computing tasks. For example, a component that provides an intent recognition function can receive text data or audio data through its interface, and then perform intent recognition on the data received by the interface through the large model configured in a single computing node, obtain the recognition result, and use the recognition result as the data returned by the interface. In the case where the target node is a single computing node interface, the configuration information of the target interface in the above embodiment can include the configuration information corresponding to a single computing node, and the large model corresponding to the first model identifier in the configuration information can be configured on the computing node, so that after generating the first prompt word according to the first interface processing logic corresponding to the target interface and based on the data to be processed and the first prompt word template in the configuration information, the reply corresponding to the first prompt word is generated through the large model configured on the computing node.

[0128] In a possible implementation form, the interfaces of different functional components may also include a multi-computing node interface, that is, a large model is configured in each of the multiple computing nodes, and there is a dependency relationship between the multiple computing nodes, and the next computing node depends on the processing result of the previous computing node, so that multiple computing nodes are connected in series to complete a function. For example, the interface of a component that provides a picture translation function can be a multi-computing node interface, and the picture translation function is completed by connecting the first computing node and the second computing node in series, wherein the second computing node depends on the processing result of the first computing node. The interface can receive picture data, and then perform picture recognition on the picture data through the large model configured in the first computing node to obtain a recognition result, and then use the recognition result as the input data of the second computing node, and translate the recognition result into the target language through the large model configured in the second computing node, and use the recognition result of the target language as the data returned by the interface.

[0129] The following is for the case where the target interface is a multi-computing node interface. Figure 3 , the interface calling method based on the large model provided in the embodiment of the present disclosure is further explained.

[0130] Figure 3 It is a flowchart of an interface calling method based on a large model provided according to another embodiment of the present disclosure.

[0131] like Figure 3 As shown, the interface calling method based on the large model includes:

[0132] Step 301, obtain configuration information of the target interface, wherein the configuration information includes first function call information, a first prompt word template and a first model identifier corresponding to the first computing node, a dependency relationship between the second computing node and the first computing node, and second function call information, a second prompt word template and a second model identifier corresponding to the second computing node.

[0133] The target interface may be a multi-computing node interface, that is, a large model is configured in each of the multiple computing nodes, and the multiple computing nodes have a dependency relationship, and the next computing node depends on the processing result of the previous computing node, so that the multiple computing nodes are connected in series to complete a function. In this embodiment, a computing node that does not depend on the processing results of other computing nodes is called a first computing node, and a computing node that depends on the processing results of the first computing node is called a second computing node.

[0134] Wherein, in the case where the target interface is a multi-computing node interface, the configuration information of the target interface may include configuration information corresponding to each computing node and the dependency relationship between computing nodes, wherein the configuration information corresponding to each computing node may include corresponding function call information, prompt word template and model identifier. Wherein, the model identifier corresponding to each computing node is the identifier of the large model used when the computing node executes the computing task.

[0135] It can be understood that the first computing node does not rely on the processing results of other computing nodes, and is a computing node that processes the data to be processed. The function call information corresponding to the first computing node is the first function call information in the above embodiment, the prompt word template corresponding to the first computing node is the prompt word template in the above embodiment, and the model identifier corresponding to the first computing node is the model identifier in the above embodiment.

[0136] The function call information corresponding to different computing nodes may be the same or different, the prompt word templates corresponding to different computing nodes may be the same or different, and the model identifiers corresponding to different computing nodes may be the same or different.

[0137] Step 302, when the data to be processed is received through the target interface, the first interface processing logic corresponding to the first entry function is determined by calling the corresponding first entry function according to the first function calling information.

[0138] The first interface processing logic corresponding to the first entry function may include a series of steps and rules for the first computing node to process the target interface request and response. The first entry function is the first function called when the program corresponding to the first interface processing logic starts to execute. Therefore, by calling the corresponding first entry function according to the first function call information, the first interface processing logic corresponding to the first entry function can be determined.

[0139] Step 303: Generate a first prompt word according to the first interface processing logic and based on the data to be processed and the first prompt word template.

[0140] Step 304: Generate a reply corresponding to the first prompt word by identifying the large model corresponding to the first model.

[0141] The large model is configured on the first computing node.

[0142] In an example embodiment, the first interface processing logic includes processing steps and rules for the first computing node to process the data to be processed received by the target interface, including generating a first prompt word based on the data to be processed and a first prompt word template in the configuration information of the target interface, and generating a reply corresponding to the first prompt word through a large model corresponding to the first model identifier in the configuration information of the target interface. Then, after the first interface processing logic corresponding to the first entry function is determined by calling the first entry function, the first prompt word can be generated according to the first interface processing logic, based on the data to be processed and the first prompt word template, and a reply corresponding to the first prompt word can be generated through a large model corresponding to the first model identifier.

[0143] Step 305: Determine the second interface processing logic corresponding to the second entry function by calling the corresponding second entry function according to the second function calling information.

[0144] The second interface processing logic corresponding to the second entry function may include a series of steps and rules for the second computing node to process the target interface request and response. The second entry function is the first function called when the program corresponding to the second interface processing logic starts to execute. Therefore, by calling the corresponding second entry function according to the second function call information, the second interface processing logic corresponding to the second entry function can be determined.

[0145] Step 306, generating a second prompt word according to the second interface processing logic and based on the second prompt word template and the processing result of the first computing node, wherein the processing result of the first computing node is determined based on the reply corresponding to the first prompt word.

[0146] Step 307: Generate a reply corresponding to the second prompt word by identifying the corresponding large model of the second model.

[0147] The large model corresponding to the second model identifier can be configured on the corresponding second computing node.

[0148] In an example embodiment, the second interface processing logic includes steps and rules for the second computing node to process the input data of the computing node, including generating a second prompt word based on the input data and a second prompt word template in the configuration information of the target interface, and generating a reply corresponding to the second prompt word by using a large model corresponding to the second model identifier in the configuration information of the target interface. Wherein, for the second computing node that depends on the processing result of the first computing node, the input data is the processing result of the first computing node, and the processing result of the first computing node is determined based on the reply corresponding to the first prompt word generated by the first computing node.

[0149] By calling the second entry function and determining the second interface processing logic corresponding to the second entry function, the second prompt word can be generated according to the second interface processing logic and based on the second prompt word template and the processing result of the first computing node, and the corresponding large model of the second model identifier can be used to generate a reply corresponding to the second prompt word.

[0150] The processing result of the first computing node may be a reply to the first prompt word corresponding to the first computing node, or may be obtained by post-processing the reply to the first prompt word corresponding to the first computing node, or may be obtained by other means, and the present disclosure does not impose any limitation on this.

[0151] In the example embodiment, according to the second interface processing logic, and based on the second prompt word template and the processing result of the first computing node, a second prompt word is generated, and after the corresponding large model is identified by the second model and the reply corresponding to the second prompt word is generated, the processing result of the second computing node can be generated according to the reply corresponding to the second prompt word, and based on the processing result, the data returned by the target interface is generated.

[0152] It should be noted that the above embodiment is described by taking the computing nodes corresponding to the multi-computing node interface, including the first computing node and the second computing node as an example. In a possible implementation form, at least one third computing node having a dependency relationship with the second computing node may also be included, and each computing node depends on the processing result of the previous computing node. Accordingly, the configuration information of the target interface may include the function call information, prompt word template and model identifier corresponding to each computing node and the dependency relationship between computing nodes. Among them, the function call information corresponding to different computing nodes may be the same or different, the prompt word templates corresponding to different computing nodes may be the same or different, and the model identifiers corresponding to different computing nodes may be the same or different. Accordingly, the steps 305-307 can be performed again, and it is only necessary to update the information corresponding to the second computing node to the information corresponding to the third computing node, and update the processing result of the first computing node to the processing result of the previous computing node. Among them, the processing result of the previous computing node is determined based on the reply corresponding to the prompt word generated by the previous computing node. Then, based on the reply corresponding to the prompt word generated by the last computing node, the data returned by the target interface is generated.

[0153] Combine the following Figure 4 , the above interface calling method based on the large model is exemplarily described by taking the case where the computing nodes corresponding to the multi-computing node interface include N computing nodes, where N is an integer greater than or equal to 2. Among them, there are dependencies between the N computing nodes.

[0154] like Figure 4 As shown, when the data to be processed is received through the target interface, the interface calling device can parse the uniform resource identifier sent by the platform to which the target interface is connected (corresponding to step 401) to obtain the configuration information of the target interface, and determine whether the configuration information corresponding to the computing node n (n is an integer greater than or equal to 1 and less than or equal to N, and the initial value of n is 1) is obtained (corresponding to step 402). If not obtained, the data returned by the target interface is generated (corresponding to step 407), where the data may include error information.

[0155] In the case of obtaining the configuration information corresponding to computing node n, the entry function corresponding to computing node n can be called according to the function call information corresponding to computing node n in the configuration information, and the interface processing logic corresponding to the entry function can be determined (corresponding to step 403), and then according to the interface processing logic, the corresponding prompt word is generated based on the input data of computing node n and the corresponding prompt word template (corresponding to step 404), and the reply corresponding to the prompt word is generated through the large model identified by the model identifier corresponding to computing node n (corresponding to step 405). Wherein, in the case that n is 1, the input data of computing node n is the data to be processed received through the target interface.

[0156] It is then possible to determine whether the multiple computing nodes corresponding to the target interface include the next computing node that depends on the processing result of computing node n (corresponding to step 406). If not, the data returned by the target interface can be generated based on the reply to the prompt word corresponding to computing node n (corresponding to step 407).

[0157] If the target interface corresponds to multiple computing nodes, including the next computing node that depends on the processing result of computing node n, then n can be added by 1, and then it is further determined whether the configuration information corresponding to computing node n (n is 2 at this time) is obtained (corresponding to step 402). If it is not obtained, the data returned by the target interface is generated (corresponding to step 407), wherein the data is the data generated based on the reply to the prompt word corresponding to computing node n (i.e., n is 1) before n is added by 1. In the case of obtaining the configuration information corresponding to computing node n (i.e., n is 2), the entry function corresponding to computing node n can be called according to the function call information corresponding to computing node n in the configuration information to determine the interface processing logic corresponding to the entry function (corresponding to step 403), and then according to the interface processing logic, based on the input data of computing node n and the corresponding prompt word template, the corresponding prompt word is generated (corresponding to step 404), and the reply corresponding to the prompt word is generated through the large model identified by the model identifier corresponding to computing node n (corresponding to step 405). When n is 2, the input data of computing node n, namely the processing result of the previous computing node, is generated based on the reply to the prompt word corresponding to the previous computing node.

[0158] It is then possible to determine whether the multiple computing nodes corresponding to the target interface include the next computing node that depends on the processing result of computing node n (corresponding to step 406). If not, the data returned by the target interface can be generated based on the reply to the prompt word corresponding to computing node n (corresponding to step 407).

[0159] If the target interface corresponds to multiple computing nodes, including the next computing node that depends on the processing result of computing node n, the process can return to continue executing step 402, thereby looping through step 402 and subsequent steps to achieve the serial execution of the corresponding interface processing logic by multiple computing nodes, thereby achieving the function of the component corresponding to the target interface.

[0160] In a possible implementation form, the first interface processing logic and the second interface processing logic are both built-in interface processing logic; or, the first interface processing logic and the second interface processing logic are both obtained by modifying the built-in basic interface processing logic.

[0161] Through the built-in interface processing logic, for computing nodes whose corresponding interface processing logic is the same as the built-in interface processing logic, users do not need to repeatedly define the interface processing logic corresponding to the computing node. Instead, they only need to directly adopt the built-in interface processing logic and provide the configuration information of the target interface, including the function call information, prompt word template and model identifier corresponding to the computing node. Then, through a general interface call process, the interface processing logic corresponding to the computing node can be executed to realize the function of the component corresponding to the target interface. Through the built-in basic interface processing logic, for computing nodes whose corresponding interface processing logic is different from the built-in basic interface processing logic, users only need to simply modify the built-in basic interface processing logic to obtain the interface processing logic corresponding to the computing node. Then, based on the provided configuration information of the target interface, through a general interface call process, the interface processing logic corresponding to the computing node can be executed to realize the function of the component corresponding to the target interface. Thus, the efficiency of interface development can be further improved.

[0162] For steps 301-307 similar to those in other embodiments, reference can be made to the detailed description in other embodiments of the present disclosure, and will not be described in detail here.

[0163] Therefore, for a target interface in which multiple computing nodes are connected in series to complete a function, the user only needs to provide the configuration information of the target interface, including the function call information, prompt word template and model identifier corresponding to each computing node and the dependency relationship between the computing nodes. Through a common interface calling process, multiple computing nodes can be connected in series to execute the corresponding interface processing logic and realize the functions of the corresponding components of the target interface, avoiding repeated development of different interfaces and improving the efficiency of interface development.

[0164] In order to implement the above embodiments, the present disclosure also provides an interface calling device based on a large model.

[0165] Figure 5 It is a structural diagram of an interface calling device based on a large model provided according to an embodiment of the present disclosure.

[0166] like Figure 5 As shown, the interface calling device 500 based on the large model includes:

[0167] An acquisition module 501 is used to acquire configuration information of a target interface, wherein the configuration information includes first function call information, a first prompt word template and a first model identifier;

[0168] A first determination module 502 is used to determine the first interface processing logic corresponding to the first entry function by calling the corresponding first entry function according to the first function calling information when receiving the to-be-processed data through the target interface;

[0169] A first generating module 503, configured to generate a first prompt word according to the first interface processing logic, based on the data to be processed and the first prompt word template;

[0170] The second generating module 504 is used to generate a reply corresponding to the first prompt word by identifying a large model corresponding to the first model.

[0171] As a possible implementation of the embodiment of the present disclosure, the acquisition module 501 includes:

[0172] A parsing unit, used for parsing a uniform resource identifier sent by a platform to which a target interface is connected, and obtaining configuration items of the target interface;

[0173] The first acquisition unit is used to acquire configuration information of the target interface from a configuration file based on the configuration items of the target interface.

[0174] As a possible implementation of the embodiment of the present disclosure, the first function call information includes a function name and path information of the first entry function;

[0175] The first determining module 502 includes:

[0176] A second acquisition unit, used for acquiring an object of the first entry function according to the function name and the path information;

[0177] The calling unit is used to call the first entry function according to the object of the first entry function.

[0178] As a possible implementation of the embodiment of the present disclosure, the first generating module 503 includes:

[0179] A third acquisition unit, configured to acquire content to be filled according to the first interface processing logic and based on the data to be processed;

[0180] The filling unit is used to fill the content to be filled into the first prompt word template to obtain the first prompt word.

[0181] As a possible implementation of the embodiment of the present disclosure, the data to be processed includes text data, and the content to be filled includes a field value corresponding to a target field in the text data, wherein the target field is a field corresponding to the characters to be replaced in the first prompt word template;

[0182] Filling unit, comprising:

[0183] The replacement subunit is used to replace the characters to be replaced in the first prompt word template based on the field value corresponding to the target field to obtain the first prompt word.

[0184] As a possible implementation of the embodiment of the present disclosure, the second generating module 504 includes:

[0185] A generating unit, configured to generate a request body including a first prompt word;

[0186] A processing unit, configured to input the request message into a large model corresponding to the first model identifier, and obtain a reply corresponding to the output first prompt word;

[0187] The request message includes a request body, and the request body is used to indicate that a corresponding reply is generated based on the first prompt word through the large model.

[0188] As a possible implementation of the embodiment of the present disclosure, the interface calling device 500 based on the large model further includes at least one of the following modules:

[0189] A first processing module, configured to pre-process the data to be processed according to the first interface processing logic and a preset pre-processing method, and use the pre-processed data to be processed as the data to be processed used to generate the first prompt word;

[0190] The second processing module is used to post-process the reply corresponding to the first prompt word generated by the large model according to the first interface processing logic and a preset post-processing method, and generate data returned by the target interface based on the post-processed reply;

[0191] The third generation module is used to generate an error message according to the first interface processing logic when the large model corresponding to the first model identifier fails to generate a reply corresponding to the first prompt word.

[0192] As a possible implementation of the embodiment of the present disclosure, the large model is configured on the first computing node, and the configuration information also includes: the dependency relationship between the second computing node and the first computing node, and the second function call information, the second prompt word template and the second model identifier corresponding to the second computing node; the interface calling device 500 based on the large model also includes:

[0193] A second determining module, configured to determine a second interface processing logic corresponding to the second entry function by calling the corresponding second entry function according to the second function calling information;

[0194] a fourth generating module, configured to generate a second prompt word according to the second interface processing logic and based on the second prompt word template and the processing result of the first computing node, wherein the processing result of the first computing node is determined based on the reply corresponding to the first prompt word;

[0195] The fifth generating module is used to generate a reply corresponding to the second prompt word by identifying the large model corresponding to the second model.

[0196] As a possible implementation method of the embodiment of the present disclosure, the first interface processing logic and the second interface processing logic are both built-in interface processing logic; or, the first interface processing logic and the second interface processing logic are both obtained by modifying the built-in basic interface processing logic.

[0197] It should be noted that the aforementioned explanation of the interface calling method based on the large model is also applicable to the interface calling device based on the large model of this embodiment, and will not be repeated here.

[0198] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0199] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0200] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 602 or a computer program loaded from a storage unit 605 to a RAM (Random Access Memory) 603. In RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An I / O (Input / Output) interface 605 is also connected to the bus 604.

[0201] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 605, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0202] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as an interface calling method based on a large model. For example, in some embodiments, the interface calling method based on a large model may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 605. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the interface calling method based on the large model described above may be executed. Alternatively, in other embodiments, the computing unit 601 may be configured to execute the interface calling method based on the large model in any other appropriate manner (for example, by means of firmware).

[0203] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor that may be a dedicated or general-purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0204] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0205] 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 device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0206] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0207] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.

[0208] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0209] It should be noted that artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.

[0210] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0211] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. An interface calling method based on a large model, comprising: Acquire configuration information of the target interface, wherein the configuration information includes first function call information, a first prompt word template, and a first model identifier; In the case where the data to be processed is received through the target interface, the first interface processing logic corresponding to the first entry function is determined by calling the corresponding first entry function according to the first function calling information; Generate a first prompt word according to the first interface processing logic and based on the data to be processed and the first prompt word template; A reply corresponding to the first prompt word is generated by using a large model corresponding to the first model identifier.

2. The method according to claim 1, wherein: The obtaining of the configuration information of the target interface includes: Parsing the uniform resource identifier sent by the platform to which the target interface is connected, and obtaining the configuration items of the target interface; Based on the configuration items of the target interface, configuration information of the target interface is acquired from a configuration file.

3. The method according to claim 1, wherein: The first function call information includes a function name and path information of the first entry function; In the case where the data to be processed is received through the target interface, calling the corresponding first entry function according to the first function calling information to determine the first interface processing logic corresponding to the first entry function includes: Obtaining the object of the first entry function according to the function name and the path information; According to the object of the first entry-point function, the first entry-point function is called.

4. The method according to claim 1, wherein: The generating a first prompt word according to the first interface processing logic and based on the data to be processed and the first prompt word template includes: Acquire content to be filled according to the first interface processing logic and based on the data to be processed; The content to be filled is filled into the first prompt word template to obtain the first prompt word.

5. The method according to claim 4, wherein: The data to be processed includes text data, and the content to be filled includes a field value corresponding to a target field in the text data, wherein the target field is a field corresponding to the characters to be replaced in the first prompt word template; The step of filling the content to be filled into the first prompt word template to obtain the first prompt word includes: The characters to be replaced in the first prompt word template are replaced based on the field value corresponding to the target field to obtain the first prompt word.

6. The method according to claim 1, wherein: The step of generating a reply corresponding to the first prompt word by using the large model corresponding to the first model identifier includes: generating a request body including the first prompt word; Inputting the request message into the large model corresponding to the first model identifier, and obtaining a response corresponding to the first prompt word; The request message includes the request body, and the request body is used to indicate that a corresponding reply is generated based on the first prompt word through the large model.

7. The method according to any one of claims 1 to 6, wherein: The method further comprises, according to the first interface processing logic, performing at least one of the following steps: Preprocessing the data to be processed according to a preset preprocessing method, and using the preprocessed data to be processed as the data to be processed used to generate the first prompt word; Post-processing the reply corresponding to the first prompt word generated by the large model according to a preset post-processing method, and generating data returned by the target interface based on the post-processed reply; When the large model corresponding to the first model identifier fails to generate a response corresponding to the first prompt word, an error message is generated.

8. The method according to any one of claims 1 to 6, wherein: The large model is configured on a first computing node, and the configuration information further includes: a dependency relationship between a second computing node and the first computing node, and second function call information, a second prompt word template, and a second model identifier corresponding to the second computing node; The method further comprises: Determine the second interface processing logic corresponding to the second entry function by calling the corresponding second entry function according to the second function calling information; generating a second prompt word according to the second interface processing logic and based on the second prompt word template and the processing result of the first computing node, wherein the processing result of the first computing node is determined based on the reply corresponding to the first prompt word; A reply corresponding to the second prompt word is generated by using the large model corresponding to the second model identifier.

9. The method according to claim 8, wherein: The first interface processing logic and the second interface processing logic are both built-in interface processing logics; or, the first interface processing logic and the second interface processing logic are both obtained by modifying the built-in basic interface processing logic.

10. An interface calling device, comprising: An acquisition module, used for acquiring configuration information of a target interface, wherein the configuration information includes first function call information, a first prompt word template and a first model identifier; A first determining module is used to determine a first interface processing logic corresponding to the first entry function by calling the corresponding first entry function according to the first function calling information when receiving the to-be-processed data through the target interface; A first generating module, configured to generate a first prompt word according to the first interface processing logic and based on the data to be processed and the first prompt word template; The second generating module is used to generate a reply corresponding to the first prompt word by using the large model corresponding to the first model identifier.

11. The device according to claim 10, wherein: The acquisition module comprises: A parsing unit, used for parsing a uniform resource identifier sent by a platform to which the target interface is connected, to obtain a configuration item of the target interface; The first acquisition unit is used to acquire the configuration information of the target interface from a configuration file based on the configuration item of the target interface.

12. The device according to claim 10, wherein: The first function call information includes a function name and path information of the first entry function; The first determining module includes: A second acquisition unit, configured to acquire an object of the first entry function according to the function name and the path information; A calling unit is used to call the first entry function according to the object of the first entry function.

13. The device according to claim 10, wherein: The first generating module comprises: A third acquisition unit, configured to acquire content to be filled according to the first interface processing logic and based on the data to be processed; A filling unit is used to fill the content to be filled into the first prompt word template to obtain the first prompt word.

14. The device according to claim 13, wherein: The data to be processed includes text data, and the content to be filled includes a field value corresponding to a target field in the text data, wherein the target field is a field corresponding to the characters to be replaced in the first prompt word template; The filling unit comprises: The replacement subunit is used to replace the characters to be replaced in the first prompt word template based on the field value corresponding to the target field to obtain the first prompt word.

15. The device according to claim 10, wherein: The second generating module comprises: A generating unit, configured to generate a request body including the first prompt word; A processing unit, configured to input the request message into a large model corresponding to the first model identifier, and obtain an output reply corresponding to the first prompt word; The request message includes the request body, and the request body is used to indicate that a corresponding reply is generated based on the first prompt word through the large model.

16. The device according to any one of claims 10 to 15, wherein: The device further comprises at least one of the following modules: A first processing module, configured to pre-process the data to be processed according to the first interface processing logic and a preset pre-processing method, and use the pre-processed data to be processed as the data to be processed used to generate the first prompt word; A second processing module is used to post-process the reply corresponding to the first prompt word generated by the large model according to the first interface processing logic and a preset post-processing method, and generate data returned by the target interface based on the post-processed reply; The third generation module is used to generate an error message according to the first interface processing logic when the large model corresponding to the first model identifier fails to generate a reply corresponding to the first prompt word.

17. The device according to any one of claims 10 to 15, wherein: The large model is configured on a first computing node, and the configuration information also includes: a dependency relationship between a second computing node and the first computing node, and second function call information, a second prompt word template, and a second model identifier corresponding to the second computing node; the device also includes: A second determining module, configured to determine a second interface processing logic corresponding to the second entry function by calling the corresponding second entry function according to the second function calling information; a fourth generating module, configured to generate a second prompt word according to the second interface processing logic and based on the second prompt word template and a processing result of the first computing node, wherein the processing result of the first computing node is determined based on a reply corresponding to the first prompt word; The fifth generating module is used to generate a reply corresponding to the second prompt word by identifying the large model corresponding to the second model.

18. The device according to claim 17, wherein: The first interface processing logic and the second interface processing logic are both built-in interface processing logics; or, the first interface processing logic and the second interface processing logic are both obtained by modifying the built-in basic interface processing logic.

19. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 9.

20. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 9.

21. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 9.

Citation Information

Cited By

  • Data processing method, electronic equipment and computer storage medium

    CN120893560A