Intelligent agent tool invocation method and product based on function-as-a-service platform

By transforming and executing tool call requests on the Function as a Service platform, the deployment cost and resource waste of intelligent proxy tools are solved, a unified and scalable toolset is achieved, the call architecture is simplified, and the tool ecosystem is enriched.

CN122285128APending Publication Date: 2026-06-26BEIJING VOLCANO ENGINE TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING VOLCANO ENGINE TECH CO LTD
Filing Date
2026-04-02
Publication Date
2026-06-26

Smart Images

  • Figure CN122285128A_ABST
    Figure CN122285128A_ABST
Patent Text Reader

Abstract

A method and product for invoking intelligent proxy tools based on a Function as a Service (Quais) platform, relating to the field of computer technology, involves converting a first tool invocation request into a first function invocation request, sending the first function invocation request to the Quais platform, retrieving the execution result of the first function corresponding to the first function invocation request from the Quais platform, and returning the first function execution result to the intelligent proxy. This method reuses the resource scheduling, security isolation, high availability, and network transmission capabilities of the Quais platform, eliminating the need to deploy separate model context protocol services for each tool. It provides a unified and scalable toolset for the intelligent proxy at low cost. No protocol modification or code adaptation is required; any function from the Quais platform can be used as a tool for the intelligent proxy, achieving plug-and-play functionality. It can cover all functions already integrated into the Quais platform, greatly enriching the tool ecosystem of the intelligent proxy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The technical solution relates to the field of computer technology, specifically to a method and product for invoking intelligent proxy tools based on a function-as-a-service platform. Background Technology

[0002] With the development of Model Context Protocols (MGPs), the ecosystem of smart agent tools is becoming increasingly rich. While MGPs enable smart agents to invoke tools, they require each tool or toolset to deploy a separate MGP server, leading to a surge in deployment and resource costs. Summary of the Invention

[0003] This summary section is provided to briefly introduce the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0004] Firstly, a method for invoking intelligent proxy tools based on a function-as-a-service platform is provided, including: Receive a first tool invocation request, wherein the first tool invocation request is used to represent a request from the smart agent to invoke the first tool; The first tool call request is converted into a first function call request and sent to the Function as a Service platform. The first function call request is used to request a call to a first function in the Function as a Service platform. The first function corresponds to the first tool, and the first function call request conforms to the format specifications of the Function as a Service platform. The system obtains the execution result of the first function corresponding to the first function call request from the function-as-a-service platform and returns the execution result of the first function to the smart agent.

[0005] Secondly, a smart proxy tool invocation device based on a function-as-a-service platform is provided, comprising: The receiving module is used to receive a first tool invocation request, wherein the first tool invocation request is used to represent a request from the smart agent to invoke the first tool; The conversion module is used to convert the first tool call request into a first function call request and send the first function call request to the function-as-a-service platform; the first function call request is used to request to call a first function in the function-as-a-service platform, the first function corresponds to the first tool, and the first function call request conforms to the format specification of the function-as-a-service platform; The acquisition module is used to obtain the execution result of the first function corresponding to the first function call request from the function-as-a-service platform, and return the execution result of the first function to the smart agent.

[0006] Thirdly, a computer-readable medium is provided having a computer program stored thereon, wherein the computer program, when executed by a processing device, implements the steps of the method described in the first aspect.

[0007] Fourthly, an electronic device is provided, comprising: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the method described in the first aspect.

[0008] Fifthly, a computer program product is provided, comprising a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in the first aspect.

[0009] Based on the above technical solution, by receiving a first tool call request, converting it into a first function call request, sending the first function call request to the Function as a Service (Quais) platform, obtaining the execution result of the first function corresponding to the first function call request from the Quais platform, and returning the execution result to the intelligent agent, the resource scheduling, security isolation, high availability, and network transmission capabilities of the Quais platform can be reused. There is no need to deploy separate model context protocol services for each tool, which not only solves the problems caused by deploying model context protocol services but also provides a unified and scalable toolset for the intelligent agent at low cost. Furthermore, without protocol modification or code adaptation, any function from the Quais platform can be used as a tool for the intelligent agent, achieving plug-and-play functionality and covering all functions already connected to the Quais platform, greatly enriching the tool ecosystem of the intelligent agent. Moreover, all tool accesses by the intelligent agent converge to calls to functions on the Quais platform, greatly simplifying the tool call architecture and chain of the intelligent agent.

[0010] Other features and advantages of the technical solution will be described in detail in the following detailed implementation section. Attached Figure Description

[0011] The above and other features, advantages, and aspects of the technical solution will become more apparent when taken in conjunction with the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings: Figure 1 This is a schematic diagram illustrating application scenarios of intelligent proxy tool invocation methods based on a function-as-a-service platform, based on certain situations.

[0012] Figure 2 This is a flowchart illustrating the invocation method of a smart proxy tool based on a function-as-a-service platform, based on certain scenarios.

[0013] Figure 3 This is a schematic diagram illustrating the provision of a second function with preset fields, based on certain scenarios.

[0014] Figure 4 This is a logical diagram illustrating the calling method of a smart proxy tool based on a function-as-a-service platform, based on certain scenarios.

[0015] Figure 5 This is a schematic diagram illustrating the structure of an intelligent proxy tool invocation device based on a function-as-a-service platform, according to certain scenarios.

[0016] Figure 6 This is a schematic diagram of the structure of an electronic device shown under certain circumstances. Detailed Implementation

[0017] The technical solution will now be described in more detail with reference to the accompanying drawings. Although certain scenarios are shown in the drawings, it should be understood that the technical solution can be implemented in various forms and should not be construed as limited to the scenarios described herein. Rather, these scenarios are provided to provide a more thorough and complete understanding of the technical solution. It should be understood that the accompanying drawings and the scenarios described are for illustrative purposes only and are not intended to limit the scope of protection of the technical solution.

[0018] It should be understood that the steps described in the method implementation may be performed in different orders and / or in parallel. Furthermore, the method implementation may include additional steps and / or omit the steps shown. The scope of the technical solution is not limited in this respect.

[0019] The term "comprising" and its variations as used herein can be open-ended, meaning "including but not limited to". The term "based on" can mean "at least partially based on". The term "one case" means "at least one case"; the term "another case" means "at least one additional case"; the term "some cases" means "at least some cases". Definitions of other terms will be given in the following description.

[0020] It should be noted that the concepts of "first" and "second" mentioned here are only used to distinguish different devices, modules or units, and are not used to limit the order of the functions performed by these devices, modules or units or their interdependencies.

[0021] It should be noted that the terms "one" and "more" used here are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0022] The names of messages or information exchanged between the multiple devices in the implementation are for illustrative purposes only and are not intended to limit the scope of these messages or information.

[0023] Figure 1 This is a schematic diagram illustrating application scenarios of intelligent proxy tool invocation methods based on a function-as-a-service platform, based on certain situations. For example... Figure 1 As shown, application scenarios can include intelligent agent 101, client 102, and Function as a Service (FaaS) platform 103. Function as a Service is a cloud computing service model that allows developers to encapsulate business logic into independent functions and run these functions without managing the underlying servers. The FaaS platform is essentially a cloud service system that hosts, manages, and standardizes the execution of FaaS functions. This FaaS platform uses lightweight functions as its core capability carrier. Tool providers encapsulate specific business actions and dedicated computing logic into standardized FaaS functions and register and upload them to the FaaS platform. Based on its underlying architecture, the FaaS platform provides a unified runtime environment, access control, routing scheduling, and operational support for FaaS functions. Its core function is to package a specific business action or computing logic into a FaaS function that can be triggered by events, run independently, and scale automatically.

[0024] In this context, tool providers can implement business logic as standard FaaS functions and register these functions in the Function as a Service platform 103. Tool providers can refer to the entities that develop and encapsulate business capabilities / tool ​​capabilities, making the tools into schedulable FaaS functions. For example, tool providers can be enterprise developers, individual developers, software service providers, etc. Tool providers primarily encapsulate complex business logic or tool capabilities (such as data cleaning, format conversion, data querying, file processing, etc.) into standard, lightweight FaaS functions based on FaaS platform specifications, and register these FaaS functions on the FaaS platform for intelligent agents to call. FaaS functions are the capability carriers developed and delivered by tool providers, who in turn own, develop, and maintain these FaaS functions.

[0025] In a cloud service scenario, client 102 acts as a proxy connecting the upper-layer intelligent agent 101 and the lower-layer function-as-a-service platform 103. Intelligent agent 101 initiates a tool call request, which client 102 receives. Client 102 then converts the tool call request into a function call request for function-as-a-service platform 103 and sends it to platform 103. Function-as-a-service platform 103 responds to the function call request, executes the function specified in the request, and obtains the execution result. Client 102 retrieves the execution result from platform 103 and returns it to intelligent agent 101.

[0026] An intelligent agent (101) can refer to an entity capable of perceiving its environment and taking actions to achieve specific goals. It should be understood that an intelligent agent (101) can also be called an intelligent agent. An intelligent agent (101) can be software, hardware, or a system, possessing autonomy, adaptability, and interactive capabilities. The intelligent agent (101) perceives changes in the environment (e.g., through sensors or data input), makes judgments and decisions based on its learned knowledge and algorithms, and then executes actions to influence the environment or achieve predetermined goals. For example, an intelligent agent (101) could be an intelligent agent based on a large language model.

[0027] It's important to note that Client 102 does not refer to front-end applications such as applications or browsers, but rather to a tool invocation adaptation component, which is an intermediate scheduling component on the back-end service side. Client 102 essentially acts as a proxy between Smart Proxy 101 and Function as a Service (Quatrain) Platform 103. For Smart Proxy 101, Client 102 is equivalent to a standard Model Context Protocol (MCP) service, allowing Smart Proxy 101 to invoke functions in Quatrain Platform 103 through Client 102. For the functions in Quatrain Platform 103, Client 101 interacts with the functions in Quatrain Platform 103 through the interfaces provided by Quatrain Platform 103.

[0028] It should be understood that client 102 can be deployed inside intelligent agent 101. For example, the logic implemented by client 102 can be integrated into the intelligent agent's software program as a built-in component or a built-in SDK (Software Development Kit). In this way, intelligent agent 101 has the function call capability of directly connecting to function-as-a-service platform 103.

[0029] Of course, client 102 can also be deployed independently of smart agent 101. For example, client 102 and smart agent 101 can be deployed on different electronic devices. For instance, client 102 can be deployed as an independent scheduling service, with all different smart agents uniformly connected to client 102. Client 102 converts tool call requests into function call requests for function-as-a-service platform 103 and sends the function call requests to function-as-a-service platform 103. In this way, different smart agents can all call functions in function-as-a-service platform 103 through the same client 102.

[0030] It should be noted that the deployment method of client 102 can be selected based on the actual business needs. For example, if the functions in the FaaS platform need to be provided to a third-party smart agent, client 102 can be deployed independently of smart agent 101. If the functions in the FaaS platform are provided to a specific internal smart agent, client 102 can be deployed inside smart agent 101.

[0031] In some cases, the intelligent proxy tool invocation method provided by the technical solution, based on a function-as-a-service platform, can be executed by electronic devices, which can be deployed with... Figure 1 The client 102 shown executes the intelligent proxy tool invocation method provided by the technical solution based on the function-as-a-service platform. The electronic device can be at least one of a terminal device and a server.

[0032] Figure 2 This is a flowchart illustrating the invocation methods of intelligent proxy tools based on a function-as-a-service platform, illustrating certain scenarios. For example... Figure 2 As shown, a method for invoking a smart proxy tool based on a function-as-a-service platform is provided. Specifically, it can be executed through a smart proxy tool invoking device based on a function-as-a-service platform, which can be implemented in software and / or hardware. Figure 2 As shown, the method may include the following steps.

[0033] In step 210, a first tool invocation request is received, which indicates that the smart agent requests to invoke the first tool.

[0034] Here, an intelligent agent can refer to a proxy capable of perceiving its environment and taking actions to achieve a specific goal. It should be understood that an intelligent agent can also be called an intelligent agent. An intelligent agent can be software, hardware, or a system, possessing autonomy, adaptability, and interactive capabilities. By perceiving changes in the environment (e.g., through sensors or data input), an intelligent agent makes judgments and decisions based on its learned knowledge and algorithms, and then executes actions to influence the environment or achieve predetermined goals. For example, an intelligent agent could be based on a large language model.

[0035] The first tool invocation request can be sent by the smart agent, used to request the invocation of the first tool. For example... Figure 1 As shown, when the intelligent agent 101 needs to invoke a tool to complete a specific instruction, the intelligent agent 101 can initiate a first tool invocation request. For example, suppose the intelligent agent needs to query the weather for city A tomorrow. The intelligent agent needs to invoke a weather query tool. Accordingly, the intelligent agent can initiate a first tool invocation request to invoke the weather query tool, and the weather query tool is the first tool that the intelligent agent requests to invoke.

[0036] It should be noted that the first tool invocation request can be understood as an invocation request sent by the smart agent to request the invocation of the first tool. The first tool invocation request can specify the first tool to be invoked.

[0037] In step 220, the first tool call request is converted into a first function call request and sent to the function-as-a-service platform. The first function call request is used to request to call the first function in the function-as-a-service platform. The first function corresponds to the first tool, and the first function call request conforms to the format specification of the function-as-a-service platform.

[0038] Here, the first tool call request sent by the intelligent agent can belong to the first protocol format. The first protocol format can be a high-level semantic format used by the intelligent agent or the Model Context Protocol (MCP). The Model Context Protocol is an open standard protocol used to provide a standardized and universal communication framework for the interaction between large language models and external systems (such as databases, file systems, etc.).

[0039] Function as a Service (FaS) is a cloud computing service model that allows developers to encapsulate business logic into independent functions and run these functions without managing the underlying servers. For a FaS platform, it can recognize specific call formats. By converting a primary tool call request into a primary function call request conforming to the FaS platform's format specifications, it can translate the primary tool call request of an intelligent agent into instructions that the FaS platform can execute, enabling the intelligent agent to use functions within the FaS platform.

[0040] The first function call request is used to request the invocation of the first function in the service platform. The first tool request in the first tool call request and the first function call request in the first function call request can have a one-to-one correspondence. In other words, converting a first tool call request into a first function call request can be understood as converting a smart agent's call to a first tool into a smart agent's call to the corresponding first function, thus converting a tool call into a function call.

[0041] The first function call request may belong to the second protocol format, which may refer to the format specification supported by the function-as-a-service platform.

[0042] For example, a first utility call request with a high-level semantic representation like `get_weather(city="A")` can be transformed into a first function call request `CreateFunctionCall("weather-func",{city="A"}))`. Here, `CreateFunctionCall` represents initiating a function call.

[0043] It should be understood that, as a hosting and execution environment for functions, the Function as a Service (FaaS) platform allows all functions registered there to serve as potential tools for intelligent agents. Tool providers can implement business logic as standard FaaS functions and register them on the FaaS platform. Functions registered on the FaaS platform act as business logic units running within it, and any standard FaaS function can be directly used as a tool for intelligent agents without requiring protocol-level modifications.

[0044] In some cases, a client can transform a first tool call request into a first function call request. The client acts as a proxy between the smart agent and the Function as a Service (Quais) platform. For the smart agent, the client is equivalent to a standard Model Context Protocol (MCP) service; for the functions within the Quais platform, the client interacts with them through the interfaces provided by the Quais platform.

[0045] It's worth noting that the client can be deployed internally within the smart agent, or it can be deployed independently on electronic devices for use by different smart agents. For example, the client can receive a first tool call request sent by the smart agent and convert it into a first function call request. By converting the first tool call request into a first function call request, the smart agent can use functions in the FaaS platform seamlessly, just like calling a local function library.

[0046] A client can send a first function call request to the function-as-a-service platform. Since the first function call request is actually equivalent to an instruction that the function-as-a-service platform can execute, the function-as-a-service platform can respond to the first function call request, execute the first function called by the first function call request, and obtain the execution result of the first function. This execution result of the first function can be understood as the function execution result of the first function, which is the function execution result obtained after the first function is executed.

[0047] The first function call request may carry a first function identifier and call parameters. The function-as-a-service platform responds to the function call request by passing the call parameters to the first function indicated by the first function identifier, and executes the first function to obtain the first function execution result output by the first function.

[0048] In step 230, the execution result of the first function corresponding to the first function call request is obtained from the function-as-a-service platform, and the execution result of the first function is returned to the smart agent.

[0049] Here, the client can obtain the function execution result corresponding to the first function call request from the Function as a Service platform. The client can obtain the first function execution result from the Function as a Service platform in several ways. For example, the client can actively query the Function as a Service platform for the first function execution result corresponding to the first function call request; or the client can passively receive the first function execution result corresponding to the first function call request pushed by the Function as a Service platform.

[0050] In some cases, the client can convert the execution result of the first function into a format adapted to the smart agent and return the converted execution result to the smart agent.

[0051] Therefore, by receiving a first tool call request, converting it into a first function call request, sending it to the Function as a Service (Quais) platform, obtaining the execution result of the corresponding first function from the Quais platform, and returning the execution result to the intelligent agent, the resource scheduling, security isolation, high availability, and network transmission capabilities of the Quais platform can be reused. This eliminates the need to deploy separate model context protocol services for each tool, not only solving the problems caused by deploying model context protocol services but also providing a unified and scalable toolset for the intelligent agent at low cost. Furthermore, without protocol modification or code adaptation, any function from the Quais platform can be used as a tool for the intelligent agent, achieving plug-and-play functionality and covering all functions already integrated into the Quais platform, greatly enriching the intelligent agent's tool ecosystem. Moreover, all tool accesses by the intelligent agent converge to calls to functions on the Quais platform, significantly simplifying the tool call architecture and process flow.

[0052] In some cases, the first tool invocation request includes a first tool identifier and first tool invocation parameters.

[0053] Here, the first tool identifier can be the tool name corresponding to the first tool, or it can be a unique identifier corresponding to the first tool. The first tool invocation parameters can refer to the invocation parameters of the first tool invoked by the input smart agent request.

[0054] For example, suppose the intelligent agent needs to query the weather for city A tomorrow. The intelligent agent needs to call the weather query tool. The first tool call request sent by the intelligent agent can carry a first tool identifier to indicate the weather query tool and the first tool call parameters (such as city A, tomorrow, etc.) input into the weather query tool.

[0055] Accordingly, in some cases, the first tool identifier can be converted into the first function identifier based on the mapping relationship between the tool identifier and the function identifier. Then, based on the first function identifier and the first tool call parameters, the first function call request is generated according to the format specification of the first interface, and the first interface is called to send the first function call request to the function-as-a-service platform.

[0056] Here, function identifiers are used to identify functions within a Function as a Service (Quatrain) platform. It should be understood that every function registered on the Quatrain platform can have a corresponding function identifier, used to globally and uniquely identify the function. This function identifier can be represented by the function name or by a unique identifier.

[0057] The first function identifier belongs to the function identifier corresponding to the first function. The first function identifier is used to identify the first function in the function i.e., the service platform. In other words, the first function identifier uniquely points to the first function in the function i.e., the service platform.

[0058] The client can convert a first tool identifier into a first function identifier based on a pre-configured mapping between tool identifiers and function identifiers. In this mapping, there is a one-to-one correspondence between tool identifiers and function identifiers. Through this mapping, logical tool identifiers can be mapped to specific FaaS functions.

[0059] The first tool call parameters carried in the first tool call request are equivalent to the input parameters of the requested first tool. The client can generate the first function call request based on the first function identifier and the first tool call parameters, according to the format specification of the first interface. In other words, the generated first function call request conforms to the format specification of the first interface. Specifically, the first function call request may include the first function identifier and first function call parameters that match the first tool call parameters.

[0060] The first interface is provided by the Function as a Service (FaS) platform and is used to initiate function calls to the FaS platform. For example, the first interface can be represented as "CreateFunctionCall", which allows the client to initiate a function call asynchronously.

[0061] It's worth noting that when generating the first function call request based on the first function identifier and the first tool call parameters, the first tool call parameters included in the first tool call request can be processed through parameter structuring or parameter serialization to obtain the converted first function call parameters. These converted first function call parameters can conform to the FaaS format requirements. For example, if FaaS supports JSON (JavaScript Object Notation) strings, the first tool call parameters included in the first tool call request can be converted into first function call parameters represented as JSON strings through parameter mapping. Of course, if the FaaS input parameter specification is consistent with the format specification of the first tool call parameters included in the first tool call request, the first tool call parameters included in the first tool call request can be directly passed through to the first function call request; that is, the first tool call parameters and the first function call parameters can be consistent.

[0062] Accordingly, the first interface can be invoked to send the first function call request to the function-as-a-service platform.

[0063] Here, the client generates the first function call request, and sends it to the Function as a Service platform by invoking the first interface used to initiate function calls to the platform. It should be understood that by converting the first tool call request into the first function call request, the client is essentially converting the smart agent's first tool call request into a call to the first interface of the Function as a Service platform.

[0064] The client can be configured with a call proxy module, which is used to receive the first tool call request sent by the smart agent, convert the first tool call request into a first function call request, and call the first interface provided by the function as a service platform to send the first function call request to the function as a service platform.

[0065] For the client, the client can call the first interface provided by the function as a service platform through the proxy module, and send the first function call request to the function as a service platform through the first interface. The function as a service platform will then respond to the first function call request, input the first function call parameters to the function indicated by the first function identifier, execute the first function indicated by the first function identifier, and obtain the execution result of the first function.

[0066] It should be understood that, in response to a failure to call the first interface, an action matching the error type can be executed. Different actions can correspond to different error types. The action matching the error type can include a first action to re-invoke the first interface and a second action to return error information to the intelligent agent. For different error types, either the first action to re-invoke the first interface or the second action to return error information to the intelligent agent can be executed.

[0067] Therefore, by converting the first tool call request into a first function call request conforming to the format specification of the first interface, and sending the first function call request to the function-as-a-service platform through the first interface provided by the function-as-a-service platform, the first tool call request initiated by the intelligent agent can be converted into a first function call request executable by the function-as-a-service platform, thereby realizing the interaction between the intelligent agent and the functions in the function-as-a-service platform.

[0068] In some cases, function execution results can be obtained from the function-as-a-service platform based on a preset result retrieval mode.

[0069] Here, when sending the first function call request to the function-as-a-service platform, a task identifier corresponding to the first function call request is obtained. The client can associate the task identifier with the original first tool call request and start running a state tracker. Through the state tracker, based on a preset result acquisition mode, the execution result of the first function is obtained from the function-as-a-service platform.

[0070] When the execution result of the first function is obtained from the Function as a Service platform, the state tracker associates the obtained execution result with the session of the smart agent, and returns the obtained execution result to the smart agent through the session, thus ending the tool call of the smart agent.

[0071] The preset result acquisition mode can include either the first result acquisition mode or the second result acquisition mode. You can choose the first result acquisition mode or the second result acquisition mode according to the actual situation to obtain the execution result of the first function from the function as a service platform.

[0072] The client can be configured with a result retrieval module, which is used to retrieve the execution result of the first function from the function-as-a-service platform through either the first result retrieval mode or the second result retrieval mode.

[0073] The first result acquisition mode can be: periodically calling the result query interface provided by the function-as-a-service platform to query the execution result of the first function from the function-as-a-service platform. The result query interface is used to query the execution result of the function.

[0074] The Function as a Service platform provides a result query interface. For example, the result query interface can be represented as "GetFunctionCall", which can be called by clients to query the status and result of function calls.

[0075] The client can periodically call the result query interface to retrieve the execution result of the first function corresponding to the first function call request from the Function as a Service platform, based on the task identifier corresponding to the first function call request. In other words, the result query interface can be used to poll the Function as a Service platform and actively query the execution result of the first function from the platform.

[0076] Based on this, by periodically calling the result query interface, the execution result of the first function can be queried from the Function as a Service platform. The client and the Function as a Service platform can communicate through a single FaaS interface (result query interface), which is simple in structure and easy to manage and debug.

[0077] The second result acquisition mode can be: receiving the execution result of the first function pushed by the service platform.

[0078] The client can passively receive the execution result of the first function pushed by the Function as a Service (FAS) platform. After the first function called by the FAS platform completes execution, the FAS platform pushes the corresponding execution result of the first function to the corresponding client based on the task identifier corresponding to the first function call request. In other words, the second result acquisition mode can be understood as an event notification mode, where the FAS platform actively pushes the execution result of the first function to the client.

[0079] Based on this, by passively receiving the execution result of the first function pushed by the function i.e. service platform, invalid polling can be avoided, resource consumption is small, and result acquisition efficiency is high.

[0080] It is worth noting that the first result retrieval mode and the second result retrieval mode can be switched. For example, when retrieving the execution result of the first function through the second result retrieval mode, if the event channel between the client and the function-as-a-service platform is disconnected, the client can switch to the first result retrieval mode to retrieve the execution result of the first function, so as to ensure the availability of the result retrieval function.

[0081] In some cases, when the task failure status is obtained by calling the result query interface, the first error message is returned to the smart agent. The task failure status is used to indicate that the first function execution failed, and the first error message is used to indicate that the tool call failed.

[0082] The task failure status indicates that the first function failed to execute. If the task failure status is obtained from the function-as-a-service platform through the result query interface, it means that the first function failed to execute. Accordingly, the first error information that indicates the failure point of the tool call can be returned to the intelligent agent so that the agent can re-initiate the tool call or switch to call other tools.

[0083] In other cases, if the execution result of the first function is not obtained after a preset time, a second error message is returned to the intelligent agent. The second error message is used to indicate that the tool call has timed out.

[0084] The preset duration can be a specified time period, which can be set according to actual conditions. If the execution result of the first function is not obtained after the preset duration, it can be understood as the execution of the first function failing. If the execution result of the first function is not obtained after the preset duration, a second error message is returned to the intelligent agent, so that the intelligent agent can re-initiate the tool call or switch to another tool.

[0085] It should be understood that "failure to obtain function execution result within the preset time" can refer to the failure to obtain the first function execution result within the preset time using either the first result retrieval mode or the second result retrieval mode in the above example. Therefore, the first function execution result can be obtained from the function-as-a-service platform either actively or passively, and different methods of obtaining the function execution result can be selected according to the task scenario or requirements.

[0086] In some cases, a function list can be obtained from the Function as a Service platform based on a preset function retrieval mode. The function list includes functions registered on the Function as a Service platform and is used by the intelligent agent to initiate tool call requests.

[0087] Here, a tool discovery module can be configured in the client. This module communicates with the Functions as a Service (Quais) platform, retrieves a list of functions from the platform, and maintains this list. The tool discovery module can retrieve the function list from the Quais platform based on a preset function retrieval pattern.

[0088] The function list obtained from the Functions as a Service (Quais) platform can include available functions registered on the platform. The client can maintain this function list in memory, allowing the intelligent agent to initiate tool invocation requests based on it.

[0089] For example, in response to finding a first function corresponding to the first tool in the function list, a first tool call request can be converted into a first function call request.

[0090] For example, in response to the failure to find a first function corresponding to the first tool in the function list, a third error message can be returned to the smart agent, indicating that the first tool cannot be invoked.

[0091] For example, a smart agent can initiate a first tool call request to a client. The client can verify the validity of the first tool call request. If the request is valid, the client searches for the first function corresponding to the first tool requested in the function list. If the first function is found, the client converts the first tool call request into a first function call request and calls the first interface to send a first function call request to the function-as-a-service platform. If the first function corresponding to the first tool requested is not found, the client returns a third error message to the smart agent, indicating that the first tool cannot be called. Since the first function corresponding to the first tool does not exist in the function list, it means that the function-as-a-service platform has not registered the first function. Therefore, the first tool that the smart agent needs to call does not exist. Accordingly, the client returns a third error message indicating that the first tool cannot be called to the smart agent, so that the smart agent can call another tool.

[0092] The preset function retrieval mode can include one of the first function retrieval mode and the second function retrieval mode. You can choose either the first or the second function retrieval mode to retrieve the function list from the function-as-a-service platform according to the actual situation.

[0093] The first function acquisition mode can be: periodically calling the function discovery interface provided by the function-as-a-service platform to obtain a list of functions from the function-as-a-service platform; the function discovery interface is used to discover and obtain a list of functions from the function-as-a-service platform, the list of functions includes functions registered on the function-as-a-service platform, and the list of functions is used for intelligent agents to initiate tool call requests.

[0094] The Function as a Service platform provides a function discovery interface. For example, the function discovery interface is represented as "ListFunctionDefinitions", which is used to discover and retrieve a list of functions from the Function as a Service platform.

[0095] The client can periodically call the function discovery interface provided by the Function as a Service (FAS) platform to retrieve a list of functions from the FAS platform. In other words, the client can actively retrieve a list of functions from the FAS platform by calling the function discovery interface.

[0096] Based on this, by periodically calling the function discovery interface, a list of functions can be obtained from the function-as-a-service platform, and the client only needs to maintain the corresponding FaaS service address. This is simpler to implement and has lower dependence on the client and network.

[0097] The second function acquisition mode can be: subscribing to function change events of the function-as-a-service platform, and in response to function change events, obtaining a list of functions from the function-as-a-service platform through the function discovery interface.

[0098] When a function changes on the Function as a Service (Quais) platform, a corresponding function change event is generated. For example, when a function is added or removed from the Quais platform, a corresponding function change event is generated. Clients can subscribe to the Quais platform's function change events. Upon receiving a function change event, the client can retrieve a list of functions from the Quais platform through the function discovery interface.

[0099] Based on this, the function list is obtained by subscribing to function change events on the Function as a Service platform. When a function is launched or taken offline on the Function as a Service platform, the client can be aware of it in real time, which has great real-time performance.

[0100] It's worth noting that the first function retrieval mode and the second function retrieval mode can be switched. For example, when retrieving the function list using the second function retrieval mode, if the event channel between the client and the Function as a Service platform is disconnected, the client can switch to the first function retrieval mode to retrieve the function list, ensuring the availability of the function list retrieval function.

[0101] It should be understood that the Function as a Service (FaS) platform can provide a function registration interface, which is used to register functions within the FaS platform. For example, the function registration interface can be represented as "CreateFunctionDefinition". By calling the function registration interface, functions can be registered on the FaS platform to be used as tools by intelligent agents.

[0102] For example, a tool provider can implement business logic as a standard FaaS function and register the function in the FaaS platform by calling the function registration interface provided by the FaaS platform.

[0103] Therefore, by periodically calling the function discovery interface provided by the function-as-a-service platform or by subscribing to the function change events of the function-as-a-service platform, a list of functions can be obtained from the function-as-a-service platform. Different methods of obtaining functions can be selected according to the task scenario or requirements.

[0104] In some cases, the first tool invocation request includes a request based on the Model Context Protocol. Accordingly, the first tool invocation request can be received using a second interface, which is used for smart agent invocation that supports the Model Context Protocol to receive the first tool invocation request sent by the smart agent.

[0105] Here, the second interface can be an interface provided by the client, used by smart agents that support the Model Context Protocol (MGP) to call, in order to receive a first tool invocation request sent by the smart agent that supports the MGP. The first tool invocation request sent by the smart agent that supports the MGP to the client can be a request based on the MGP.

[0106] When a smart agent supports using the Model Context Protocol to initiate tool call requests, the smart agent can initiate a first tool call request based on the Model Context Protocol to the client by calling a second interface provided by the client.

[0107] In response to the call to the second interface, a server supporting JSON-RPC (a remote procedure call protocol) can be started inside the client. The server converts the first tool call request into a first function call request, sends the first function call request to the function-as-a-service platform, obtains the execution result of the first function from the function-as-a-service platform, and returns the execution result of the first function to the smart agent.

[0108] Therefore, when the smart agent calls the client's second interface, the client acts as an MCP service, providing services to the outside world. In this way, through the second interface, the client can selectively simulate an MCP service, achieving compatibility with smart agents that use MCP.

[0109] In some cases, the second function included in the Function as a Service platform has a preset field that is used to mark the second function as a function that supports the Model Context Protocol.

[0110] Continuing from the previous example, tool providers can register their functions within the Function as a Service platform using the function registration interface. In this case, the tool provider can configure preset fields within the function to mark it as a function that supports the Model Context Protocol.

[0111] For example, you can add a preset field to the function definition to mark that the function belongs to a function that supports the model context protocol.

[0112] The second function referred to in this content can be a function registered in a function-as-a-service platform that carries preset fields. Of course, the first function in the example above can also carry preset fields.

[0113] For the client, preset fields can be used to identify whether a second function carrying these preset fields belongs to an MCP-compatible tool, and the behavior of the second function carrying these preset fields can be adjusted accordingly. In other words, by configuring preset fields in the function definition, an ordinary FaaS function can be given the role of an MCP tool.

[0114] Accordingly, in response to a call to the second interface, a second function can be provided to the smart agent using the model context protocol. The second function is used by the smart agent to call the second function as a second tool, and the second interface is used by the smart agent that supports the model context protocol to call it.

[0115] When a smart agent using the Model Context Protocol (MCP) calls the second interface, the client is essentially an MCP service. In this case, the client can provide a second function containing preset fields to the smart agent using the MCP, so that the smart agent using the MCP can call the second function containing preset fields as a second tool.

[0116] Figure 3 This is a schematic diagram illustrating the provision of a second function with preset fields, based on certain scenarios. For example... Figure 3 As shown, when the second interface provided by the client is called, the client essentially acts as an MCP service. In this case, the client can provide a second function, including preset fields, to the smart agent using the Model Context Protocol (MCP), enabling the smart agent to call this second function as a second tool. For example... Figure 3 As shown, the client's tool cache includes a second tool that supports the Model Context Protocol (MCP) and other tools. When the second interface is invoked, it can expose the second tool that supports the MCP to the smart agent. The second tool supporting the MCP can refer to a second function that includes preset fields. It should be understood that the first tool is actually the tool invoked by the smart agent. If the smart agent invokes the second tool, the second tool acts as the first tool; if the smart agent invokes other tools, those other tools act as the first tool. In other words, the first tool can be either other tools or the second tool.

[0117] Therefore, without modifying the function's code itself, an ordinary FaaS function can be given the role of an MCP tool, thus providing a second function, including preset fields, to the smart agent using the Model Context Protocol when the client simulates serving as an MCP.

[0118] The following is in conjunction with the appendix Figure 4 The above technical solutions are described in detail.

[0119] Figure 4 This is a logical diagram illustrating the invocation method of a smart proxy tool based on a function-as-a-service platform, based on certain scenarios. For example... Figure 4 As shown, functions from multiple business services (such as business service 1 and business service 2) can be registered to the Function as a Service platform. Business services can include second functions supporting the Model Context Protocol (MCP) and other functions. For example, second functions supporting the MCP can be marked using the aforementioned preset fields. In some cases, the Function as a Service platform can provide a function registration interface, allowing business services to register their functions to the platform by calling this interface.

[0120] The tool discovery module in the client retrieves a list of functions from the Functions as a Service platform based on a preset function retrieval mode (such as the first function retrieval mode or the second function retrieval mode). This list includes functions registered in the Functions as a Service platform.

[0121] The tool generator in the client can encapsulate functions into tools that conform to smart agent invocation based on the metadata corresponding to each function in the function list. This metadata can include function identifiers and function parameter formats. Essentially, the tool generator converts the original functions into a language that the smart agent can understand, establishing a mapping between tool identifiers and function identifiers.

[0122] The communication module in the client is used to communicate with the Function as a Service platform. The basic interface in the client is used to convert tool call requests using protocols other than the Model Context Protocol into corresponding function call requests. The second interface in the client is used to convert tool call requests using the Model Context Protocol into corresponding function call requests.

[0123] When the client receives a first tool call request from the intelligent agent, it searches for the corresponding first tool identifier in the function list stored in the tool cache. Upon finding the first tool identifier, if the first tool call request belongs to the Model Context Protocol (MCP), the client uses the second interface to convert it into a first function call request. Then, using the communication module, it calls the first interface provided by the Function as a Service (FAS) to send the first function call request to the FAS platform. If the first tool call request does not belong to the MCP, the client uses the basic interface to convert it into a first function call request. Then, using the communication module, it calls the first interface provided by the FAS to send the first function call request to the FAS platform. If the first tool identifier is not found, the client returns a third error message to the intelligent agent, indicating that the first tool cannot be called.

[0124] Upon receiving a first function call request, the Function as a Service (FaS) platform executes the first function within the corresponding business service and obtains the execution result. The client can utilize the communication module to call the result query interface provided by the FaS platform, retrieve the execution result of the first function, and return it to the intelligent agent via the basic interface or the second interface.

[0125] Figure 5 This is a schematic diagram illustrating the structure of an intelligent proxy tool invocation device based on a function-as-a-service platform, illustrating certain scenarios. For example... Figure 5As shown, a smart proxy tool invocation device 500 based on a function-as-a-service platform is provided. The smart proxy tool invocation device 500 based on a function-as-a-service platform may include: The receiving module 501 is used to receive a first tool invocation request, wherein the first tool invocation request is used to represent a request from the smart agent to invoke the first tool; The conversion module 502 is used to convert the first tool call request into a first function call request and send the first function call request to the function as a service platform; the first function call request is used to request to call a first function in the function as a service platform, the first function corresponds to the first tool, and the first function call request conforms to the format specification of the function as a service platform; The acquisition module 503 is used to acquire the execution result of the first function corresponding to the first function call request from the function as a service platform, and return the execution result of the first function to the smart agent.

[0126] In some cases, the first tool invocation request includes the first tool identifier and the first tool invocation parameters; the conversion module 502 is used to: Based on the mapping relationship between tool identifiers and function identifiers, the first tool identifier is converted into a first function identifier, which is used to identify the first function in the function service platform; Based on the first function identifier and the first tool call parameters, the first function call request is generated according to the format specification of the first interface. The first interface is an interface provided by the function-as-a-service platform and is used to initiate a function call to the function-as-a-service platform. The first interface is invoked to send the first function call request to the function-as-a-service platform.

[0127] In some cases, the intelligent proxy tool invocation device 500 based on the function-as-a-service platform may further include: The execution module is used to respond to the failure of calling the first interface by performing an action that matches the error type corresponding to the failure of calling the first interface.

[0128] In some cases, the acquisition module 503 is used for: The result query interface provided by the Function as a Service platform is periodically called to query the execution result of the first function from the Function as a Service platform, wherein the result query interface is used to query the function execution result; or Receive the execution result of the first function pushed by the function service platform.

[0129] In some cases, the intelligent proxy tool invocation device 500 based on the function-as-a-service platform may further include: The first return module is used to return first error information to the intelligent agent when a task failure status is obtained by calling the result query interface. The task failure status indicates that the first function failed to execute, and the first error information indicates that the tool call failed; or The second return module is used to return a second error message to the smart agent when the execution result of the first function is not obtained after a preset time. The second error message is used to indicate that the tool call timed out.

[0130] In some cases, the intelligent proxy tool invocation device 500 based on the function-as-a-service platform may further include: The calling module is used to periodically call the function discovery interface provided by the Function as a Service platform to obtain a list of functions from the platform; the function discovery interface is used to discover and obtain the list of functions from the platform, the list including functions registered on the platform, and the list is used by the intelligent agent to initiate tool call requests; or The subscription module is used to subscribe to function change events of the Function as a Service platform, and in response to the function change event, to obtain the function list from the Function as a Service platform through the function discovery interface.

[0131] In some cases, the conversion module 502 is used for: In response to finding a first function corresponding to the first tool in the function list, the first tool call request is converted into the first function call request.

[0132] In some cases, the receiving module 501 is used to: The first tool invocation request is received using a second interface, which is used for invocation by a smart agent that supports the Model Context Protocol. The first tool invocation request sent by the smart agent includes a request based on the Model Context Protocol.

[0133] In some cases, the second function included in the function-as-a-service platform has a preset field, which is used to mark that the second function belongs to a function that supports the model context protocol; the intelligent proxy tool invocation device 500 based on the function-as-a-service platform may further include: A function providing module is provided to provide the second function to a smart agent using the Model Context Protocol in response to a call to the second interface. The second function is used by the smart agent to call the second function as a second tool. The second interface is used by smart agents that support the Model Context Protocol.

[0134] It should be understood that the execution logic of each functional module in the intelligent proxy tool invocation device 500 based on the function as a service platform has been described in detail in the section on the intelligent proxy tool invocation method based on the function as a service platform. You can refer to the relevant description of the intelligent proxy tool invocation method based on the function as a service platform.

[0135] The following is for reference. Figure 6 The diagram illustrates a structural schematic of an electronic device (e.g., a terminal device or a server) 600 suitable for implementing the above-described technical solutions. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Personal Computers), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs (Televisions), desktop computers, etc. Figure 6 The electronic device shown is merely an example and should not be construed as limiting its functionality or scope of use.

[0136] like Figure 6 As shown, electronic device 600 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. The random access memory 603 also stores various programs and data required for the operation of electronic device 600. The processing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. An input / output (I / O) interface 605 is also connected to bus 604.

[0137] Typically, the following devices can be connected to the input / output interface 605: input devices 606 including, for example, a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 608 including, for example, magnetic tape, hard disk, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0138] In particular, depending on certain circumstances, the processes described in the flowchart above can be implemented as computer software programs. For example, a computer program product is provided, comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. This computer program can be downloaded and installed from a network via communication device 609, or installed from storage device 608, or installed from read-only memory 602. When the computer program is executed by processing device 601, it performs the functions defined in the above-described methods.

[0139] It should be noted that the aforementioned computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM, or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In one case, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In another case, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. The transmitted data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (Radio Frequency), etc., or any suitable combination thereof.

[0140] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol, such as HTTP (Hypertext Transfer Protocol), and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (LANs), wide area networks (WANs), the internet (e.g., the Internet), and peer-to-peer networks (e.g., ad-hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0141] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0142] The aforementioned computer-readable medium carries one or more programs. When the electronic device executes the aforementioned one or more programs, the electronic device causes the following: it receives a first tool invocation request, the first tool invocation request representing a request from a smart agent to invoke a first tool; it converts the first tool invocation request into a first function invocation request and sends the first function invocation request to a function-as-a-service platform; the first function invocation request is used to request the invocation of a first function in the function-as-a-service platform, the first function corresponding to the first tool, and the first function invocation request conforming to the format specification of the function-as-a-service platform; it obtains the execution result of the first function corresponding to the first function invocation request from the function-as-a-service platform and returns the first function execution result to the smart agent.

[0143] Computer program code for performing the above operations can be written in one or more programming languages ​​or a combination thereof. These programming languages ​​include, but are not limited to, object-oriented programming languages, as well as conventional procedural programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0144] The flowcharts and block diagrams in the accompanying figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products under various scenarios. In this respect, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the figures. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0145] The modules mentioned above can be implemented in software or hardware. In some cases, the name of a module does not necessarily limit the functionality of that module.

[0146] The functions described above can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field-Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application-Specific Standard Parts (ASSPs), Systems on Chips (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0147] In this context, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0148] The above description is merely illustrative and explains the technical principles employed. Those skilled in the art should understand that the scope of the technical solution is not limited to specific combinations of the above-described technical features, but also includes other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features provided herein that have similar functions.

[0149] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. Multitasking and parallel processing may be advantageous in certain environments. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limitations on the scope of the technical solution. Certain features described in the context of a single example can also be implemented in combination in a single example. Conversely, various features described in the context of a single example can also be implemented individually or in any suitable sub-combination in multiple examples.

[0150] Although the technical solution has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims. Regarding the aforementioned apparatus, the specific manner in which each module performs its operation has already been described in detail in the section concerning the method, and will not be elaborated upon here.

Claims

1. A method for invoking a smart proxy tool based on a function-as-a-service platform, comprising: Receive a first tool invocation request, wherein the first tool invocation request is used to represent a request from the smart agent to invoke the first tool; The first tool call request is converted into a first function call request and sent to the Function as a Service platform. The first function call request is used to request a call to a first function in the Function as a Service platform. The first function corresponds to the first tool, and the first function call request conforms to the format specifications of the Function as a Service platform. The system obtains the execution result of the first function corresponding to the first function call request from the function-as-a-service platform and returns the execution result of the first function to the smart agent.

2. The method according to claim 1, wherein, The first tool invocation request includes the first tool identifier and the first tool invocation parameters; The step of converting the first tool call request into a first function call request and sending the first function call request to the function-as-a-service platform includes: Based on the mapping relationship between tool identifiers and function identifiers, the first tool identifier is converted into a first function identifier, which is used to identify the first function in the function service platform; Based on the first function identifier and the first tool call parameters, the first function call request is generated according to the format specification of the first interface. The first interface is an interface provided by the function-as-a-service platform and is used to initiate a function call to the function-as-a-service platform. The first interface is invoked to send the first function call request to the function-as-a-service platform.

3. The method according to claim 2, wherein, The method further includes: In response to the failure to call the first interface, an action matching the error type is executed based on the error type corresponding to the failure to call the first interface.

4. The method according to claim 1, wherein, The step of obtaining the execution result of the first function corresponding to the first function call request from the function-as-a-service platform includes: The result query interface provided by the Function as a Service platform is periodically called to query the execution result of the first function from the Function as a Service platform, wherein the result query interface is used to query the function execution result; or Receive the execution result of the first function pushed by the function service platform.

5. The method according to claim 4, wherein, The method further includes: When the result query interface is invoked and a task failure status is obtained, a first error message is returned to the intelligent agent. The task failure status indicates that the first function has failed to execute, and the first error message indicates that the tool call has failed; or If the execution result of the first function is not obtained within a preset time, a second error message is returned to the smart agent. The second error message is used to indicate that the tool call timed out.

6. The method according to claim 1, wherein, The method further includes: The function discovery interface provided by the Function as a Service platform is periodically invoked to obtain a list of functions from the platform. The function discovery interface is used to discover and obtain the list of functions from the platform, which includes functions registered on the platform. This list is used by the intelligent agent to initiate tool invocation requests. Subscribe to function change events of the Function as a Service platform, and in response to the function change events, obtain the list of functions from the Function as a Service platform through the function discovery interface.

7. The method according to claim 6, wherein, The step of converting the first tool call request into a first function call request includes: In response to finding a first function corresponding to the first tool in the function list, the first tool call request is converted into the first function call request.

8. The method according to any one of claims 1-7, wherein, The receiving of the first tool invocation request includes: The first tool invocation request is received using a second interface, which is used for invocation by a smart agent that supports the Model Context Protocol. The first tool invocation request sent by the smart agent includes a request based on the Model Context Protocol.

9. The method according to any one of claims 1-7, wherein, The function-as-a-service platform includes a second function with a preset field, which is used to mark that the second function belongs to a function that supports the model context protocol; the method further includes: In response to a call to the second interface, the second function is provided to a smart agent using the Model Context Protocol. The second function is used by the smart agent to invoke the second function as a second tool. The second interface is used by a smart agent that supports the Model Context Protocol to invoke the second function.

10. A smart proxy tool invocation device based on a function-as-a-service platform, comprising: The receiving module is used to receive a first tool invocation request, wherein the first tool invocation request is used to represent a request from the smart agent to invoke the first tool; The conversion module is used to convert the first tool call request into a first function call request and send the first function call request to the function-as-a-service platform; the first function call request is used to request to call a first function in the function-as-a-service platform, the first function corresponds to the first tool, and the first function call request conforms to the format specification of the function-as-a-service platform; The acquisition module is used to obtain the execution result of the first function corresponding to the first function call request from the function-as-a-service platform, and return the execution result of the first function to the smart agent.

11. A computer-readable medium having a computer program stored thereon, wherein, When the computer program is executed by the processing device, it implements the steps of the method according to any one of claims 1-9.

12. An electronic device, comprising: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the method according to any one of claims 1-9.

13. A computer program product comprising a computer program, wherein, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-9.