Method and device for dynamically developing agent, storage medium and computer device
By using a dynamic approach to develop intelligent agents and leveraging a built-in parser to identify and load tool code, the problems of inflexible changes and high costs in intelligent agent development are solved, enabling flexible program generation and low-cost, rapid response.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA PING AN PROPERTY INSURANCE CO LTD
- Filing Date
- 2026-03-06
- Publication Date
- 2026-06-09
AI Technical Summary
Existing intelligent agent development methods suffer from insufficient flexibility in changes, high development complexity, and high deployment costs, especially when facing the need for rapid iteration and flexible response.
By receiving information related to the user's intelligent agent configuration, the built-in parser performs structural decomposition and logical identification of the program template, identifies dynamic elements, and combines tool call identifiers and large model call logic to dynamically load tool code to generate a real-time executable process, supporting real-time adjustments and no need for recompilation.
It improves the flexibility of intelligent agent programs, reduces development and maintenance complexity, lowers costs, adapts to various task scenarios, simplifies the development process, and is especially suitable for users without extensive programming skills.
Smart Images

Figure CN122173077A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of program development technology, and is applicable to the fields of financial technology and smart healthcare. In particular, it relates to a method and apparatus, storage medium, and computer equipment for dynamically developing intelligent agents. Background Technology
[0002] In the fintech and smart healthcare sectors, many industry products still employ predefined toolsets and fixed logic orchestrations for their intelligent agent programs. Developers need to predetermine the required tools (such as Python functions and API interfaces) and orchestrate the logic to generate a static program or API service.
[0003] With technological advancements, particularly the improvement of large-scale models and natural language processing capabilities, traditional intelligent agent development methods have gradually revealed some shortcomings and limitations. For example, the execution logic and toolset are fixed during the development phase. When new functionalities or tools need to be integrated, the program must be rewritten and redeployed, significantly increasing time and development costs. Secondly, because each change requires rewriting and redeploying, developers not only have to maintain a large amount of code but also manage cumbersome deployment and version control, increasing operational costs. Therefore, existing intelligent agent development methods have significant disadvantages in terms of rapid iteration and flexible response when facing constantly changing requirements or tasks. Summary of the Invention
[0004] In view of this, the present invention provides a method and apparatus, storage medium and computer equipment for dynamically developing intelligent agents, the main purpose of which is to solve the problems of insufficient flexibility in changing existing static orchestration modes of intelligent agents, high development complexity and high deployment cost.
[0005] According to one aspect of the present invention, a method for dynamically developing intelligent agents is provided, comprising: Receive agent configuration information transmitted by the user according to dynamic needs. The agent configuration information includes at least program templates, model selection information, tool transmission information, input variables, and output variables. The program template is structurally decomposed and logically identified using a built-in parser to identify dynamic elements embedded in the template; these dynamic elements include tool call identifiers, variable placeholders, and flow control logic. Based on the model selection information, the corresponding large model calling logic is loaded to establish an interaction channel between the large model and the intelligent agent execution process; The tool code is dynamically loaded by combining the information transmitted by the tool and the tool call identifier; Substitute the input variables into the parsed program template, combine the loaded tool code and the large model calling logic to generate a real-time executable process; The executable process is executed, the inference task is completed through the large model, the specified function processing is completed through dynamically loaded tool code, and the execution results are summarized and fed back to the user according to the preset format of the output variables.
[0006] Furthermore, the flow control logic in the program template includes conditional judgment syntax and loop execution syntax; During the process of structural decomposition and logical identification of the program template, the built-in parser constructs an execution branch structure based on the conditional judgment syntax and the loop execution syntax.
[0007] Furthermore, the tool delivery information represents a set of tool codes delivered in the form of key-value pairs of names and codes; The dynamic loading of tool code by combining the tool-transmitted information and the tool-invocation identifier includes: Extract all tool call identifiers from the parsed program template, and break down and summarize the tool name and call parameters in each identifier to form a tool call list; Iterate through each tool name in the tool call list and match it with the key-value pairs in the tool transmission information to obtain the matching results; Based on the matching results, the corresponding tool code or supplementary tool is associated to convey information.
[0008] Furthermore, the step of conveying information by associating the corresponding tool code or supplementary tool based on the matching result includes: If the matching result is successful, the tool call identifier of the successful match is marked as loadable, and the corresponding tool code is associated with it; If the matching result is a failure, a prompt message related to the missing tool is returned. The prompt message includes the name of the missing tool and the corresponding template call location, so that the user can supplement the tool's information based on the prompt message.
[0009] Furthermore, the process of performing the specified function through dynamically loaded tool code includes: Obtain the mapping relationship between tool names and code execution entry points; When the tool call identifier is triggered in the executable process, the corresponding tool code is called according to the mapping relationship so that the tool code performs a specific function.
[0010] Furthermore, the output variables include requirements for output data type, format, and display method; When summarizing the execution results, the large model inference results and tool execution results are formatted and integrated according to the requirements of the output variables.
[0011] Furthermore, during the execution of the executable process, the method further includes: Receives an update instruction for intelligent agent configuration information dynamically supplemented by the user, the update instruction including at least one of template modification content, tool code update or variable adjustment information; The update instruction is parsed, and the ongoing process is adjusted in real time based on the parsed content to be updated, without stopping or restarting the execution process.
[0012] According to another aspect of the present invention, an apparatus for dynamically developing intelligent agents is provided, comprising: The configuration module is used to receive agent configuration-related information transmitted by the user according to dynamic needs. The agent configuration-related information includes at least program templates, model selection information, tool transmission information, input variables, and output variables. The parsing module is used to perform structural decomposition and logical identification processing on the program template through a built-in parser, and to identify the dynamic elements embedded in the template; the dynamic elements include tool call identifiers, variable placeholders and flow control logic; The large model invocation module is used to load the corresponding large model invocation logic according to the model selection information and establish an interaction channel between the large model and the intelligent agent execution process. The tool loading module is used to dynamically load tool code by combining the tool transmission information and the tool call identifier; The process generation module is used to substitute input variables into the parsed program template, combine the loaded tool code and the large model calling logic to generate a real-time executable process; The execution and aggregation module is used to execute the executable process, complete the inference task through the large model, complete the specified function processing through dynamically loaded tool code, and aggregate the execution results according to the preset format of the output variables and feed them back to the user.
[0013] Furthermore, the flow control logic in the program template includes conditional judgment syntax and loop execution syntax; the built-in parser in the parsing module constructs an execution branch structure based on the conditional judgment syntax and the loop execution syntax during the process of structural decomposition and logical identification of the program template.
[0014] Furthermore, the tool delivery information represents a set of tool codes delivered in key-value pairs of name and code; the tool loading module is also used for: Extract all tool call identifiers from the parsed program template, and break down and summarize the tool name and call parameters in each identifier to form a tool call list; Iterate through each tool name in the tool call list and match it with the key-value pairs in the tool transmission information to obtain the matching results; Based on the matching results, the corresponding tool code or supplementary tool is associated to convey information.
[0015] Furthermore, the tool loading module is also used for: If the matching result is successful, the tool call identifier of the successful match is marked as loadable, and the corresponding tool code is associated with it; If the matching result is a failure, a prompt message related to the missing tool is returned. The prompt message includes the name of the missing tool and the corresponding template call location, so that the user can supplement the tool's information based on the prompt message.
[0016] Furthermore, the execution and aggregation module is also used for: Obtain the mapping relationship between tool names and code execution entry points; When the tool call identifier is triggered in the executable process, the corresponding tool code is called according to the mapping relationship so that the tool code performs a specific function.
[0017] Furthermore, the output variables include various requirements such as output data type, format requirements, and display method; when summarizing the execution results, the execution and summarization module performs format conversion and integration on the large model inference results and tool execution results according to the requirements of the output variables.
[0018] Furthermore, the device also includes a dynamic adjustment module, which is used for: Receives an update instruction for intelligent agent configuration information dynamically supplemented by the user, the update instruction including at least one of template modification content, tool code update or variable adjustment information; The update instruction is parsed, and the ongoing process is adjusted in real time based on the parsed content to be updated, without stopping or restarting the execution process.
[0019] According to another aspect of the present invention, a storage medium is provided, wherein at least one executable instruction is stored therein, the executable instruction causing a processor to perform operations corresponding to the method for dynamically developing intelligent agents described above.
[0020] According to another aspect of the present invention, a computer device is provided, including a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; The memory is used to store at least one executable instruction that causes the processor to perform operations corresponding to the method for dynamically developing intelligent agents described above.
[0021] By employing the above-described technical solutions, the technical solutions provided by the embodiments of the present invention have at least the following advantages: This invention provides a method, apparatus, storage medium, and computer device for dynamically developing intelligent agents. Compared with existing technologies, this invention receives intelligent agent configuration information from a user, including program templates, model selection information, tool transmission information, input variables, and output variables. It then performs structural decomposition and logical identification processing on the program template to obtain dynamic elements including tool call identifiers, variable placeholders, and flow control logic. Based on the model selection information, it loads the corresponding large model call logic. Combining the tool transmission information and tool call identifiers, it dynamically loads tool code. Substituting the input variables into the parsed program template, and combining the tool code and large model call logic, it generates an executable flow, greatly improving program flexibility. Users can flexibly choose the tools to use according to their needs and customize the tool code without modifying or recompiling the program itself. This allows intelligent agent programs to adapt to various different task scenarios, avoiding the hassle of frequent updates and redeployments due to changing requirements in traditional methods. Furthermore, the development process of this invention is simple and clear, reducing the complexity of program writing and maintenance, and lowering the workload of developers. Especially for users without extensive programming skills, it allows for easy customization and execution of tasks.
[0022] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0023] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 A flowchart illustrating a method for dynamically developing intelligent agents according to an embodiment of the present invention is shown; Figure 2 A flowchart illustrating another method for dynamically developing intelligent agents provided by an embodiment of the present invention is shown; Figure 3 A flowchart illustrating another method for dynamically developing intelligent agents provided by an embodiment of the present invention is shown; Figure 4 This diagram illustrates the structure of a device for dynamically developing intelligent agents according to an embodiment of the present invention. Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention is shown. Detailed Implementation
[0024] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0025] This invention provides a method for dynamically developing intelligent agents, such as... Figure 1 As shown, the method includes: 101. Receive agent configuration information transmitted by the user according to dynamic needs. The agent configuration information includes at least program templates, model selection information, tool transmission information, input variables, and output variables. In this embodiment of the invention, to eliminate the need for predefined toolsets and execution logic, the current execution end dynamically determines the required tools and logic based on user requests, i.e., by receiving agent configuration information transmitted by the user according to dynamic needs. The core function of the method is to parse and execute agent requests corresponding to the agent configuration information to meet agent needs in different scenarios. For example, in the fintech field, generating financial service agents enables services that "can listen, can answer, and can process"; in the smart healthcare field, generating medical document agents enables structured electronic medical record writing, and generating medical service agents enables services such as medical registration guidance and medical consultation. This embodiment of the invention does not impose specific limitations.
[0026] In this embodiment, the agent configuration information includes at least a template, a model selection information, a tool transfer information, an input variable, and an output variable.
[0027] It should be noted that in this embodiment, the program template can use a template syntax similar to Handlebars, allowing users to flexibly define the logic and flow of task execution, and embed dynamic content such as tool calls and variable inputs into the template.
[0028] The tool delivery information in the agent configuration information represents a set of tool codes delivered in the form of key-value pairs of names and codes. This set can be dynamically adjusted according to changes in requirements, which is more flexible than the pre-defined tool set in traditional agent programs.
[0029] The model selection information in the intelligent agent configuration information is obtained by the user selecting and passing large models required for various scenarios, such as PingaAnGPT, Qwen, GLM, etc., to perform inference tasks. The program has pre-integrated the calling logic of large models.
[0030] The input and output variables in the agent configuration information allow for dynamic setting of input and output parameters based on specific needs for each request, thereby further enhancing the flexibility of agent generation.
[0031] 102. The program template is structurally decomposed and logically identified using a built-in parser to identify the dynamic elements embedded in the template; the dynamic elements include tool call identifiers, variable placeholders, and flow control logic; In this embodiment of the invention, the current execution end performs structural decomposition and logic identification processing through a built-in parser program template. The built-in parser can be, for example, a Handlebars-compatible parser for template syntax similar to Handlebars, etc., but this embodiment of the invention does not specifically limit its scope. The parser can be used to identify multiple dynamic elements embedded in the program template. These dynamic elements can include tool call identifiers, variable placeholders, and flow control logic, etc., but this embodiment of the invention does not specifically limit their scope. Variable placeholders can use {InputVariable.variableName} to represent input variables, such as {InputVariable.productId}; and {OutputVariable.targetVariableName} to declare output variables. Tool call identifiers can use {Tool.toolName(parameters)} to embed tool call logic, such as {Tool.priceCrawler({InputVariable.url}, {InputVariable.dateRange})}, etc., but this embodiment of the invention does not specifically limit their scope.
[0032] It should be noted that the flow control logic in the program template in this embodiment includes conditional judgment syntax, such as using {#if condition} and { / if} to determine whether data exists; and loop execution syntax, such as using {#each list} and { / each} to process multiple sets of data in a loop. This embodiment of the invention does not impose specific limitations on these aspects. During the structural decomposition and logical identification processing of the program template, the built-in parser constructs an execution branch structure based on the conditional judgment syntax and the loop execution syntax, such as generating an abstract syntax tree. This embodiment of the invention does not impose specific limitations on these aspects.
[0033] 103. Based on the model selection information, load the corresponding large model calling logic and establish an interaction channel between the large model and the agent's execution process; In this embodiment of the invention, the current execution terminal loads the corresponding large model invocation logic based on the model selection information selected and transmitted by the user, thereby establishing an interaction channel between the large model and the agent's execution flow. The large model may include PingaAnGPT, Qwen, GLM, etc., and this embodiment of the invention does not impose specific limitations. The model selection information may include a large model identifier and inference parameters. When loading the large model invocation logic, the inference accuracy, response time threshold, etc., of the large model are configured according to the inference parameters, and this embodiment of the invention does not impose specific limitations.
[0034] 104. Dynamically load tool code by combining the information transmitted by the tool and the tool call identifier; In this embodiment of the invention, the current execution end dynamically loads tool code by combining the tool-transmitted information and the tool call identifier. The loading of tool code depends entirely on the information transmitted by the user and the call identifier in the template. There is no predefined loading logic, and real-time replacement and addition of tool code are supported.
[0035] It should be noted that the tool code loaded in this embodiment is only valid in the isolated environment of the current request. After execution, the environment is destroyed and the code is cleared, without occupying long-term system resources. It has the core design of "dynamic parsing and execution".
[0036] 105. Substitute the input variables into the parsed program template, combine the loaded tool code and the large model calling logic, and generate a real-time executable process; In this embodiment of the invention, the current execution end substitutes the input variable into the parsed program template, such as replacing the variable placeholder in the template with the specific value of InputVariable; then, combined with the loaded tool code and the large model calling logic, a real-time executable flow is generated, specifically: dynamically loading the tool code passed by the user and establishing a mapping relationship of "tool name - code execution entry point"; parsing the flow control logic and determining the execution rules such as conditional branches and loops; combining the parsed template with the bound variables and tools to form a real-time executable flow that does not require compilation and does not require the generation of intermediate configuration files.
[0037] 106. Execute the executable process, complete the inference task through the large model, complete the specified function processing through dynamically loaded tool code, and summarize the execution results and feed them back to the user according to the preset format of the output variables.
[0038] In this embodiment of the invention, the current execution end executes the executable flow obtained in step 105 above, completes the inference task through a large model, and completes the specified functional processing through dynamically loaded tool code, specifically including: (1) Obtain the mapping relationship between tool names and code execution entry points; (2) When the tool call identifier is triggered in the executable process, the corresponding tool code is called according to the mapping relationship so that the tool code performs a specific function.
[0039] In addition, the current execution terminal also summarizes the execution results and feeds them back to the user according to the preset format of the output variables. Among them, the output variables include various requirements such as output data type, format requirements, and display method; when summarizing the execution results, the current execution terminal performs format conversion and integration of the large model inference results and tool execution results according to the requirements of the output variables.
[0040] Furthermore, as a refinement and extension of the specific implementation methods described above, in order to achieve the core effects of "no pre-compilation required, no redeployment required, and real-time customization," and to support real-time correction when tools are missing, another method for dynamically developing intelligent agents is provided, such as... Figure 2 As shown, the steps, which combine the information transmitted by the tool and the tool call identifier to dynamically load the tool code, include: 201. Extract all tool call identifiers from the parsed program template, and break down and summarize the tool name and call parameters in each identifier to form a tool call list; In this embodiment of the invention, the current execution end receives tool transmission information (i.e., a collection of tool codes in the form of name-code key-value pairs) transmitted by the user through an API, and performs format validation to ensure that it is a standard JSON structure, with the key being a non-empty string (tool name) and the value being a valid code snippet (supporting scripting languages such as Python and JavaScript or API call code). Then, from the parsed program template, all tool call identifiers are extracted, and the tool name and call parameters (including parameter source and data type) in each identifier are split and summarized to form a tool call list. This tool call list includes the tool name, call location, and parameter requirements, etc., which are not specifically limited in this embodiment of the invention.
[0041] 202. Iterate through each tool name in the tool call list and match it with the key-value pairs in the tool transmission information to obtain the matching results; In this embodiment of the invention, the current execution end traverses each tool name in the above tool call list and performs matching processing with the key-value pairs in the tool transmission information to obtain the matching result. During the matching, the key (i.e., the tool name) in the key-value pair is precisely matched with each tool name in the tool call list. The matching result obtained includes successful matching and failed matching (i.e., there is no corresponding key-value pair for the tool name in the list). This embodiment of the invention does not make specific limitations.
[0042] 203. Based on the matching results, associate the corresponding tool code or supplementary tool to transmit information.
[0043] In this embodiment of the invention, the current execution end associates the corresponding tool code or supplementary tool information based on the above matching results, specifically: If the matching result is successful, the tool call identifier of the successful match is marked as loadable, and the corresponding tool code is associated with it; If the matching result is a failure, a prompt message related to the missing tool is returned. The prompt message includes the name of the missing tool and the corresponding template call location, so that the user can supplement the tool's information based on the prompt message.
[0044] It should be noted that in this embodiment, the validity period of the tool invocation identifier is completely synchronized with the lifecycle of the corresponding "name-code" key-value pair—from the moment the user passes the configuration parameters until the end of the process execution, both are only valid within the lifecycle of the current request. After the process execution is completed, the tool code is destroyed from the isolated environment, the mapping table is cleared, and the tool invocation identifier no longer has execution capability; even if the next request uses the same name, the tool code needs to be passed again, and there is no situation where "the tool code is preset and the identifier is valid indefinitely". The "name-code" key-value pair passed by the user in each request is only bound to the template tool invocation identifier in the current request; identifiers and codes with the same name in different requests are independent of each other and do not affect each other.
[0045] Furthermore, as a refinement and extension of the specific implementation of the above embodiments, in order to improve the flexibility of agent changes, another method for dynamically developing agents is provided, such as... Figure 3 As shown, during the execution of the executable process, the method further includes: 301. Receive an update instruction for intelligent agent configuration information dynamically supplemented by the user, wherein the update instruction includes at least one of template modification content, tool code update or variable adjustment information; In this embodiment of the invention, the current execution terminal receives update instructions from the user via API, interactive interface, or voice input. The update instructions must clearly indicate the update type, such as template modification, tool code update, variable adjustment, and specific content. This embodiment of the invention does not impose specific limitations.
[0046] It should be noted that in this embodiment, the current execution end also needs to standardize the format of the instructions: template modifications need to specify the modification location (such as "tool call parameters on line 5"), tool code updates need to be passed with "name-new code" key-value pairs, and variable adjustments need to specify the variable name and new value to ensure that subsequent parsing is unambiguous.
[0047] 302. Parse the update instruction and adjust the currently executing process in real time based on the parsed content to be updated, without stopping or restarting the execution process.
[0048] In this embodiment of the invention, the current execution end parses the content to be updated in the instruction, such as extracting specific fields modified in the template, the name and new code of the tool code, the name and new value of the variable, etc., and associates it with the currently executing process node to determine the current execution stage, such as the "data crawling" stage and "model inference" stage in financial analysis, and the "report interpretation" stage and "solution generation" stage in medical analysis, etc. This embodiment of the invention does not impose specific limitations. When making real-time adjustments, the current execution end can perform adaptation processing according to the type of content to be updated, as follows: (1) Variable adjustment: directly replace the corresponding variable value in the current process. If the variable has been used, update the subsequent execution logic that depends on the variable, such as recalculating interest after the financial interest rate is adjusted. This embodiment of the invention does not make specific limitations.
[0049] (2) Tool code update: Load new tool code in the isolated environment, replace the original mapping relationship, and automatically execute the new code when the tool is called in the future.
[0050] (3) Template modification: If the modification does not involve the executed node, update the template logic directly; if it involves the executed node, regenerate the execution flow after the node according to the scope of the modification to ensure logical continuity.
[0051] In this embodiment, the current execution end does not need to stop or restart the process. The adapted content to be updated is injected into the current execution chain: unexecuted nodes are executed directly according to the updated logic; currently executing nodes (such as running tool code) automatically switch to the updated logic after the current step is completed. An adjustment log is recorded synchronously, including update time, update type, adjustment content, and execution node, facilitating traceability. This dynamic execution method of the present invention eliminates the need for frequent modifications at the code level. Users only need to adjust the input template, tool code, and other parameters to quickly respond to changes in requirements without altering the source code, thereby significantly reducing the frequency of program refactoring and deployment. This dynamism makes the system more efficient and adaptable to complex and rapidly changing task requirements, performing particularly well in application scenarios requiring rapid response or adjustment.
[0052] This invention provides a method for dynamically developing intelligent agents. Compared with existing technologies, this invention receives intelligent agent configuration information from a user, including a program template, model selection information, tool transmission information, input variables, and output variables. The program template is structurally decomposed and logically identified to obtain dynamic elements including tool call identifiers, variable placeholders, and flow control logic. The corresponding large model call logic is loaded based on the model selection information. Tool code is dynamically loaded by combining the tool transmission information and tool call identifier. Input variables are substituted into the parsed program template, and an executable flow is generated by combining the tool code and the large model call logic. This greatly improves the flexibility of the program. Users can flexibly choose the tools to use according to their needs and customize the tool code without modifying or recompiling the program itself. This allows the intelligent agent program to adapt to various different task scenarios, avoiding the hassle of frequent updates and redeployments due to changing requirements in traditional methods. Furthermore, the development process of this invention is simple and clear, reducing the complexity of program writing and maintenance, and lowering the workload of developers. Especially for users without extensive programming skills, it allows for easy customization and execution of tasks.
[0053] As a response to the above Figure 1 The implementation of the method shown in this invention provides an apparatus for dynamically developing intelligent agents, such as... Figure 4 As shown, the device includes: Configuration module 41 is used to receive intelligent agent configuration-related information transmitted by the user according to dynamic needs. The intelligent agent configuration-related information includes at least program templates, model selection information, tool transmission information, input variables, and output variables. The parsing module 42 is used to perform structural decomposition and logical identification processing on the program template through the built-in parser, and to identify the dynamic elements embedded in the template; the dynamic elements include tool call identifiers, variable placeholders and flow control logic; The large model invocation module 43 is used to load the corresponding large model invocation logic according to the model selection information and establish an interaction channel between the large model and the intelligent agent execution process. Tool loading module 44 is used to dynamically load tool code by combining the tool transmission information and the tool call identifier; The process generation module 45 is used to substitute the input variables into the parsed program template, combine the loaded tool code and the large model calling logic to generate a real-time executable process; The execution and summarization module 46 is used to execute the executable process, complete the inference task through the large model, complete the specified function processing through dynamically loaded tool code, and summarize the execution results and feed them back to the user according to the preset format of the output variables.
[0054] Furthermore, the flow control logic in the program template includes conditional judgment syntax and loop execution syntax; the built-in parser in the parsing module 42 constructs an execution branch structure based on the conditional judgment syntax and the loop execution syntax during the process of structural decomposition and logical identification of the program template.
[0055] Furthermore, the tool delivery information represents a set of tool codes delivered in key-value pairs of name and code; the tool loading module 44 is also used for: Extract all tool call identifiers from the parsed program template, and break down and summarize the tool name and call parameters in each identifier to form a tool call list; Iterate through each tool name in the tool call list and match it with the key-value pairs in the tool transmission information to obtain the matching results; Based on the matching results, the corresponding tool code or supplementary tool is associated to convey information.
[0056] Furthermore, the tool loading module 44 is also used for: If the matching result is successful, the tool call identifier of the successful match is marked as loadable, and the corresponding tool code is associated with it; If the matching result is a failure, a prompt message related to the missing tool is returned. The prompt message includes the name of the missing tool and the corresponding template call location, so that the user can supplement the tool's information based on the prompt message.
[0057] Furthermore, the execution and summarization module 46 is also used for: Obtain the mapping relationship between tool names and code execution entry points; When the tool call identifier is triggered in the executable process, the corresponding tool code is called according to the mapping relationship so that the tool code performs a specific function.
[0058] Furthermore, the output variables include various requirements such as output data type, format requirements, and display method; when summarizing the execution results, the execution and summarization module 46 performs format conversion and integration of the large model inference results and tool execution results according to the requirements of the output variables.
[0059] Furthermore, the device also includes a dynamic adjustment module, which is used for: Receives an update instruction for intelligent agent configuration information dynamically supplemented by the user, the update instruction including at least one of template modification content, tool code update or variable adjustment information; The update instruction is parsed, and the ongoing process is adjusted in real time based on the parsed content to be updated, without stopping or restarting the execution process.
[0060] This invention provides a device for dynamically developing intelligent agents. Compared with existing technologies, this invention receives intelligent agent configuration information from a user, including a program template, model selection information, tool transmission information, input variables, and output variables. It then performs structural decomposition and logical identification processing on the program template to obtain dynamic elements including tool call identifiers, variable placeholders, and flow control logic. Based on the model selection information, it loads the corresponding large model call logic. It dynamically loads tool code by combining the tool transmission information and tool call identifier. Finally, it substitutes the input variables into the parsed program template and combines the tool code and large model call logic to generate an executable flow, greatly improving program flexibility. Users can flexibly choose the tools to use according to their needs and customize the tool code without modifying or recompiling the program itself. This allows intelligent agent programs to adapt to various different task scenarios, avoiding the hassle of frequent program updates and redeployments due to changing requirements in traditional methods. Furthermore, the development process of this invention is simple and clear, reducing the complexity of program writing and maintenance, and lowering the workload of developers. Especially for users without extensive programming skills, it allows for easy customization and execution of tasks.
[0061] According to one embodiment of the present invention, a storage medium is provided, the storage medium storing at least one executable instruction, the computer-executable instruction being able to execute the method for dynamically developing intelligent agents in any of the above method embodiments.
[0062] Figure 5 The diagram illustrates a structural schematic of a computer device according to an embodiment of the present invention. The specific embodiments of the present invention do not limit the specific implementation of the computer device.
[0063] like Figure 5 As shown, the computer device may include: a processor 502, a communications interface 504, a memory 506, and a communications bus 508.
[0064] The processor 502, communication interface 504, and memory 506 communicate with each other via communication bus 508.
[0065] Communication interface 504 is used to communicate with other network elements such as clients or other servers.
[0066] The processor 502 is used to execute program 510, which can specifically execute the relevant steps of the above-mentioned method for dynamically developing intelligent agents.
[0067] Specifically, program 510 may include program code that includes computer operation instructions.
[0068] Processor 502 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The computer device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0069] Memory 506 is used to store program 510. Memory 506 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0070] Specifically, program 510 can be used to cause processor 502 to perform the following operations: Receive agent configuration information transmitted by the user according to dynamic needs. The agent configuration information includes at least program templates, model selection information, tool transmission information, input variables, and output variables. The program template is structurally decomposed and logically identified using a built-in parser to identify dynamic elements embedded in the template; these dynamic elements include tool call identifiers, variable placeholders, and flow control logic. Based on the model selection information, the corresponding large model calling logic is loaded to establish an interaction channel between the large model and the intelligent agent execution process; The tool code is dynamically loaded by combining the information transmitted by the tool and the tool call identifier; Substitute the input variables into the parsed program template, combine the loaded tool code and the large model calling logic to generate a real-time executable process; The executable process is executed, the inference task is completed through the large model, the specified function processing is completed through dynamically loaded tool code, and the execution results are summarized and fed back to the user according to the preset format of the output variables.
[0071] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0072] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for dynamically developing intelligent agents, characterized in that, include: Receive agent configuration information transmitted by the user according to dynamic needs. The agent configuration information includes at least program templates, model selection information, tool transmission information, input variables, and output variables. The program template is structurally decomposed and logically identified using a built-in parser to identify dynamic elements embedded in the template; these dynamic elements include tool call identifiers, variable placeholders, and flow control logic. Based on the model selection information, the corresponding large model calling logic is loaded to establish an interaction channel between the large model and the intelligent agent execution process; The tool code is dynamically loaded by combining the information transmitted by the tool and the tool call identifier; Substitute the input variables into the parsed program template, combine the loaded tool code and the large model calling logic to generate a real-time executable process; The executable process is executed to complete the inference task through a large model and to complete the specified functional processing through dynamically loaded tool code. The system then summarizes the execution results according to the preset format of the output variables and provides feedback to the user.
2. The method according to claim 1, characterized in that, The flow control logic in the program template includes conditional judgment syntax and loop execution syntax; During the process of structural decomposition and logical identification of the program template, the built-in parser constructs an execution branch structure based on the conditional judgment syntax and the loop execution syntax.
3. The method according to claim 1, characterized in that, The tool delivery information represents a set of tool codes delivered in the form of key-value pairs of names and codes; The dynamic loading of tool code by combining the tool-transmitted information and the tool-invocation identifier includes: Extract all tool call identifiers from the parsed program template, and break down and summarize the tool name and call parameters in each identifier to form a tool call list; Iterate through each tool name in the tool call list and match it with the key-value pairs in the tool transmission information to obtain the matching results; Based on the matching results, the corresponding tool code or supplementary tool is associated to convey information.
4. The method according to claim 3, characterized in that, The information transmitted by the tool code or supplementary tool associated with the matching result includes: If the matching result is successful, the tool call identifier of the successful match is marked as loadable, and the corresponding tool code is associated with it; If the matching result is a failure, a prompt message related to the missing tool is returned. The prompt message includes the name of the missing tool and the corresponding template call location, so that the user can supplement the tool's information based on the prompt message.
5. The method according to claim 1, characterized in that, The process of performing the specified function through dynamically loaded tool code includes: Obtain the mapping relationship between tool names and code execution entry points; When the tool call identifier is triggered in the executable process, the corresponding tool code is called according to the mapping relationship so that the tool code performs a specific function.
6. The method according to claim 1, characterized in that, The output variables include requirements for output data type, format, and display method. When summarizing the execution results, the large model inference results and tool execution results are formatted and integrated according to the requirements of the output variables.
7. The method according to any one of claims 1 to 6, characterized in that, During the execution of the executable process, the method further includes: Receives an update instruction for intelligent agent configuration information dynamically supplemented by the user, the update instruction including at least one of template modification content, tool code update or variable adjustment information; The update instruction is parsed, and the ongoing process is adjusted in real time based on the parsed content to be updated, without stopping or restarting the execution process.
8. A device for dynamically developing intelligent agents, characterized in that, include: The configuration module is used to receive agent configuration-related information transmitted by the user according to dynamic needs. The agent configuration-related information includes at least program templates, model selection information, tool transmission information, input variables, and output variables. The parsing module is used to perform structural decomposition and logical identification processing on the program template through a built-in parser, and to identify the dynamic elements embedded in the template; the dynamic elements include tool call identifiers, variable placeholders and flow control logic; The large model invocation module is used to load the corresponding large model invocation logic according to the model selection information and establish an interaction channel between the large model and the intelligent agent execution process. The tool loading module is used to dynamically load tool code by combining the tool transmission information and the tool call identifier; The process generation module is used to substitute input variables into the parsed program template, combine the loaded tool code and the large model calling logic to generate a real-time executable process; The execution and aggregation module is used to execute the executable process, complete the inference task through the large model, and complete the specified function processing through dynamically loaded tool code. The system then summarizes the execution results according to the preset format of the output variables and provides feedback to the user.
9. A storage medium, characterized in that, The storage medium stores at least one executable instruction, which performs the operation corresponding to the method for dynamically developing intelligent agents as described in any one of claims 1-7.
10. A computer device, characterized in that, It includes a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus; The memory is used to store at least one executable instruction that causes the processor to perform the operation corresponding to the method for dynamically developing intelligent agents as described in any one of claims 1-7.