Document generation method and device, intelligent agent, equipment, medium and product

By generating structured outlines from large models and dynamically selecting tools, combined with database queries, the diverse needs of chapter content are addressed, improving the quality and efficiency of document generation.

CN121503429APending Publication Date: 2026-02-10BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511664384.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-13
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing technologies are insufficient to meet the diverse needs of different chapters for content quality and style, resulting in a decline in the overall quality and readability of the target document.

Method used

By analyzing document description information through a large model to generate a structured outline, identifying the content type of each chapter, and dynamically selecting the most suitable tool to generate chapter content, combined with database queries and tool calls, the accuracy of logical structure and content is ensured.

Benefits of technology

It significantly improves the accuracy and professionalism of chapter content, ensures the integrity of the document's logical structure, and enhances the overall quality and efficiency of document generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121503429A_ABST
    Figure CN121503429A_ABST
Patent Text Reader

Abstract

The invention provides a document generation method and device, an intelligent agent, equipment, a medium and a product, relates to the technical field of artificial intelligence, in particular to the technical fields of deep learning, natural language processing and large models, and can be applied to the field of intelligent documents. According to the specific implementation scheme, in response to a received document generation request, document description information carried in the document generation request is input into a large model, document outline information of an output target document is obtained, and the document outline information comprises chapter description information used for describing a target chapter; determining the chapter content type of the target chapter based on the chapter description information; determining a target tool from the plurality of candidate tools based on the chapter content type and the respective tool attribute information of the plurality of candidate tools; based on the tool calling information of the target tool, calling the target tool to generate chapter content of the target chapter; and generating a target document based on the chapter content of the target chapter.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, particularly to the fields of deep learning, natural language processing, and large model technology, and can be applied to the field of intelligent documents. More specifically, this disclosure provides a document generation method, apparatus, intelligent agent, device, medium, and product. Background Technology

[0002] With the continuous development of natural language processing technology, large models have been widely used in various fields. Therefore, how to effectively improve the quality of text generated by large models has gradually become a key issue of concern for users. Summary of the Invention

[0003] This disclosure provides a document generation method, apparatus, intelligent agent, device, medium, and product.

[0004] According to one aspect of this disclosure, a document generation method is provided, comprising: responding to receiving a document generation request, inputting document description information carried in the document generation request into a large model to obtain document outline information of the target document to be output, wherein the document outline information includes chapter description information for describing the target chapter; determining the chapter content type of the target chapter based on the chapter description information; determining a target tool from multiple candidate tools based on the chapter content type and the tool attribute information of multiple candidate tools; invoking the target tool to generate the chapter content of the target chapter based on the tool invocation information of the target tool; and generating a target document based on the chapter content of the target chapter.

[0005] According to another aspect of this disclosure, a document generation apparatus is provided, comprising: an information generation module, configured to, in response to receiving a document generation request, input document description information carried in the document generation request into a large model to obtain document outline information of the target document to be output, wherein the document outline information includes chapter description information for describing the target chapter; a type determination module, configured to determine the chapter content type of the target chapter based on the chapter description information; a tool determination module, configured to determine a target tool from multiple candidate tools based on the chapter content type and tool attribute information of multiple candidate tools; a content generation module, configured to call the target tool to generate the chapter content of the target chapter based on the tool call information of the target tool; and a document generation module, configured to generate the target document based on the chapter content of the target chapter.

[0006] According to another aspect of this disclosure, an intelligent agent for document generation is provided, comprising: an input module for receiving a document generation request; a processing module for determining a target task based on the document generation request received by the input module, determining a large model based on the target task, and obtaining a target document by calling the large model to execute the method described above; and an output module for outputting the target document obtained by the processing module.

[0007] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described above.

[0008] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause a computer to perform the methods described above.

[0009] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method described above.

[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0011] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0012] Figure 1 This illustration schematically shows an exemplary system architecture to which document generation methods and apparatus can be applied according to embodiments of the present disclosure;

[0013] Figure 2 A flowchart illustrating a document generation method according to an embodiment of the present disclosure is shown schematically;

[0014] Figure 3 A flowchart illustrating a document generation process according to a specific embodiment of the present disclosure is shown schematically.

[0015] Figure 4 The illustration shows a schematic diagram of a document generation process according to another specific embodiment of the present disclosure;

[0016] Figure 5 A schematic diagram of a target determination tool according to an embodiment of the present disclosure is shown;

[0017] Figure 6This illustration schematically shows an architecture diagram of a document generation system according to a specific embodiment of the present disclosure;

[0018] Figure 7 A flowchart illustrating the generation of a target document according to a specific embodiment of the present disclosure is shown schematically.

[0019] Figure 8 This illustration schematically shows a document generation interactive page according to a specific embodiment of the present disclosure;

[0020] Figure 9 A block diagram of a document generation apparatus according to an embodiment of the present disclosure is shown schematically;

[0021] Figure 10 An architectural diagram of a document generation system according to an embodiment of the present disclosure is illustrated schematically;

[0022] Figure 11 A schematic diagram illustrating the structure of an intelligent agent of artificial intelligence according to embodiments of the present disclosure is shown.

[0023] Figure 12 A schematic block diagram of an example electronic device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation

[0024] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0025] In the technical solution disclosed herein, the acquisition, storage, and application of user personal information comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and there is no violation of public order and good morals.

[0026] The inventors discovered that each chapter of a target document has its own distinct characteristics, and directly generating the entire document using a single tool often fails to meet the diverse needs of different chapters in terms of content quality and style, thus affecting the overall quality and readability of the target document.

[0027] Embodiments of this disclosure provide a document generation method. The method includes: responding to a received document generation request by inputting document description information carried in the document generation request into a large model to obtain document outline information of the target document, wherein the document outline information includes chapter description information for describing the target chapter; determining the chapter content type of the target chapter based on the chapter description information; determining a target tool from multiple candidate tools based on the chapter content type and tool attribute information of multiple candidate tools; invoking the target tool to generate the chapter content of the target chapter based on the tool invocation information of the target tool; and generating the target document based on the chapter content of the target chapter.

[0028] According to embodiments of this disclosure, by utilizing a large model to parse document description information, a structured outline containing chapter description information is generated, achieving intelligent planning of the document's macro-structure. Based on the chapter description information, the required content type for each chapter is automatically identified, providing a basis for subsequent tool selection. By comparing the chapter content type with the functional attributes of each tool, the most suitable target tool is dynamically selected to complete the content generation for a specific chapter. By scheduling the target tool and integrating and assembling the generated chapter content, a complete target document is finally output. This tool-invocation effectively integrates the planning capabilities of the large model with the content generation capabilities of specialized tools, thereby significantly improving the accuracy and professionalism of specific chapter content while ensuring the document's logical structure.

[0029] Figure 1 An exemplary system architecture for applying document generation methods according to embodiments of this disclosure is illustrated.

[0030] It is important to note that Figure 1 The examples shown are merely examples of system architectures that can be applied to the embodiments of this disclosure, to help those skilled in the art understand the technical content of this disclosure, but do not mean that the embodiments of this disclosure cannot be used in other devices, systems, environments, or scenarios. For example, in another embodiment, an exemplary system architecture to which the content processing methods and apparatus can be applied may include a terminal device, but the terminal device may implement the content processing methods and apparatus provided by the embodiments of this disclosure without interacting with the server.

[0031] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, and 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the terminal devices 101, 102, and 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0032] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (for example only).

[0033] Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0034] Server 105 can be a server that provides various services, such as a backend management server that supports the content browsed by users using terminal devices 101, 102, and 103 (for example only). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.

[0035] It should be noted that the document generation method provided in this embodiment can generally be executed by terminal devices 101, 102, or 103. Correspondingly, the document generation apparatus provided in this embodiment can also be disposed in terminal devices 101, 102, or 103.

[0036] Alternatively, the document generation method provided in this embodiment can generally be executed by server 105. Correspondingly, the document generation apparatus provided in this embodiment can generally be located in server 105. The document generation method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105. Correspondingly, the document generation apparatus provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105.

[0037] For example, terminal devices 101, 102, and 103 can receive document description information input by the user, encapsulate the document description information into a document generation request, and send it to server 105. Server 105 then inputs the document description information carried in the document generation request into a large model to obtain the document outline information of the target document. The document outline information includes chapter description information used to describe the target chapter. Based on the chapter description information, the chapter content type of the target chapter is determined. Based on the chapter content type and the tool attribute information of multiple candidate tools, the target tool is determined from multiple candidate tools. Based on the tool call information of the target tool, the target tool is called to generate the chapter content of the target chapter. Based on the chapter content of the target chapter, the target document is generated and sent to terminal devices 101, 102, and 103.

[0038] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0039] Figure 2 A flowchart illustrating a document generation method according to an embodiment of the present disclosure is shown schematically.

[0040] like Figure 2 As shown, the document generation method includes operations S210~S250.

[0041] In operation S210, in response to receiving a document generation request, the document description information carried in the document generation request is input into the large model to obtain the document outline information of the target document to be output.

[0042] In operation S220, the chapter content type of the target chapter is determined based on the chapter description information.

[0043] In operation S230, the target tool is determined from multiple candidate tools based on the chapter content type and the tool attribute information of each candidate tool.

[0044] In operation S240, based on the tool call information of the target tool, the target tool is invoked to generate the chapter content of the target chapter.

[0045] In operation S250, the target document is generated based on the content of the target chapter.

[0046] In the embodiments of this disclosure, the document generation method can be used to generate research report documents in fields such as finance, consulting, and market research. Users can input document description information on a terminal, describing the target document's theme, content, and format requirements. After receiving the document description information, the terminal can encapsulate the document description information into a document generation request and send it to the server, so that the server can execute the document generation method of this disclosure.

[0047] Upon receiving a document generation request, the server can utilize a large model to process the document description information carried in the request, generating a document outline for the target document. This outline includes chapter descriptions of the target chapters. The target chapters can be sections of the target document, and their descriptions can include the name, summary, and format of each chapter.

[0048] In one example, document description information can be entered into a prompt template used to prompt the large model to generate document outline information. The corresponding prompt information is then sent to the large model so that it can generate the document outline information.

[0049] After obtaining the chapter description information of the target chapter, this information can be further identified to determine the chapter content type. Chapter content can include, for example, text descriptions, data charts, and case studies. Different chapter content types correspond to different presentation formats and generation requirements. For instance, text description chapters emphasize the accuracy and fluency of language, data chart chapters require precise data and appropriate chart types for presentation, and case study chapters need to select typical and representative cases for in-depth analysis.

[0050] Based on the defined chapter content type, the server will select the most suitable target tool from multiple candidate tools. These candidate tools each have unique tool attribute information; for example, some candidate tools excel in text polishing and optimization, some perform well in data visualization, and some have powerful functions for case collection and organization. By comparing and analyzing the chapter content type with the tool attribute information, the target tool can be accurately determined to ensure that the subsequently generated chapter content meets the requirements.

[0051] Once the target tool is identified, the server can directly invoke the corresponding target tool based on its tool invocation information to generate the chapter content for the target chapter. For example, if the target tool is a text generation model, the server will input the theme, keywords, and style requirements from the chapter description information into the model, triggering it to generate chapter text that meets the requirements. If the target tool is a data visualization service, the server will input the dataset to be displayed and the style configuration from the chapter description information to obtain the rendered chart resources.

[0052] In another embodiment, the server may also send tool invocation information to an intermediate server. Upon receiving the tool invocation information, the intermediate server will invoke the corresponding target tool according to the instructions to generate the chapter content of the target chapter and return the chapter content to the server. The intermediate server can provide a Model Context Protocol (MCP) service, which may include information related to multiple preset tools and their respective invocation interfaces, enabling the intermediate server to invoke the target tool based on its tool invocation information.

[0053] In some embodiments, intermediate servers may include multiple intermediate servers. After determining the chapter content types of multiple chapters of the target document, the server can send the chapter content types of the multiple chapters to different intermediate servers respectively, and generate the chapter content of multiple chapters in parallel to improve the generation efficiency of the target document.

[0054] Finally, the server generates a complete target document based on the content of the target chapters from the intermediate server. If the target document contains multiple target chapters, the content of each chapter can be integrated to obtain the complete target document.

[0055] According to embodiments of this disclosure, by utilizing a large model to parse document description information, a structured outline containing chapter description information is generated, thus achieving intelligent planning of the document's macro-structure. Based on the chapter description information, the required content type for each chapter is automatically identified, providing a basis for subsequent tool selection. By comparing the chapter content type with the functional attributes of each tool, the most suitable target tool is dynamically selected to complete the content generation for a specific chapter. By scheduling the target tool and integrating and assembling the generated chapter content, a complete target document is finally output. This tool-invocation effectively integrates the planning capabilities of the large model with the content generation capabilities of specialized tools, thereby significantly improving the accuracy and professionalism of specific chapter content while ensuring the document's logical structure.

[0056] Figure 3 A flowchart illustrating a document generation process according to a specific embodiment of the present disclosure is shown schematically.

[0057] like Figure 3 As shown, the document generation process includes operations S310 to S350.

[0058] When operating S310, document outline information is generated based on the document description information input by the user.

[0059] When operating the S320, display the document outline information.

[0060] In operation S330, the updated outline information obtained after the user modifies the document outline information is acquired.

[0061] In operation S340, the target document is generated based on the updated outline information.

[0062] When operating the S350, users can view, download, and save target documents.

[0063] Figure 4 The illustration shows a schematic diagram of a document generation process according to another specific embodiment of the present disclosure.

[0064] like Figure 4 As shown, the document generation process includes operations S410 to S460.

[0065] In operation S410, based on the document description information input by the user, the information to be supplemented in the description is determined.

[0066] In operation S420, the supplementary description information input by the user based on the supplementary description information is obtained.

[0067] In operation S430, document outline information is generated based on the document description information and supplementary description information.

[0068] When operating S440, determine the target tool based on the document outline information.

[0069] When operating the S450, the evaluation results of the target tool are visualized.

[0070] When operating the S460, the target tool is invoked to generate chapter content in order to generate the target document.

[0071] According to embodiments of this disclosure, for Figure 2 The operation S210 shown involves inputting the document description information carried in the document generation request into the large model to generate document outline information of the target document, including: parsing the document description information using the large model to generate initial outline information; and refining the chapter name information of the target chapter based on the initial outline information to generate document outline information including chapter description information of the target chapter.

[0072] In order to improve the quality of document outline generation when using a large model, the process of generating document outline information can be decomposed to guide the large model to gradually reason and generate document outline information.

[0073] In the embodiments of this disclosure, the process of generating document outline information can be decomposed into two stages. The first stage generates macroscopic initial outline information, which includes the chapter names of the target chapters and structural information representing the hierarchical relationships between multiple target chapters. The second stage refines the outline information based on the chapter name information in the initial outline information, generating microscopic chapter description information, ultimately resulting in a complete document outline information that has both a macroscopic framework and microscopic details.

[0074] In a specific example, a thought chain approach can be used, using prompts to guide the large model to first generate initial outline information, and then further generate document outline information based on the generated initial outline information.

[0075] According to embodiments of this disclosure, a two-stage generation process is employed: first, a chapter-level framework is constructed, and then the chapter content elements are refined. Initial outline information is generated to build the basic framework of the document at a macro level, ensuring the integrity and coherence of the overall document logic. Then, based on the initial outline information, the chapter names of the target chapters are refined to generate document outline information containing chapter descriptions. This further clarification of chapter names makes the content direction of each chapter clearer and more specific, avoiding the problem of subsequent content generation deviating from expectations due to overly general chapter names. This improves the clarity of the document outline in terms of structural logic and content direction, thereby enhancing the overall structural clarity and content feasibility of the generated target document.

[0076] According to embodiments of this disclosure, for Figure 2 The operation S230 shown describes determining a target tool from multiple candidate tools based on the chapter content type and the tool attribute information of each candidate tool. This includes: determining an initial target tool from multiple candidate tools based on the chapter content type and the tool function information of each candidate tool; if there are multiple initial target tools, evaluating each initial target tool based on the performance information of each tool to obtain multiple evaluation results; and determining the target tool from the multiple initial target tools based on the multiple evaluation results.

[0077] In embodiments of this disclosure, tool attribute information includes tool function information and tool performance information. Tool function information characterizes the specific functions possessed by a candidate tool, such as proficiency in word processing, data visualization, case analysis, and other related areas. Tool performance information reflects performance metrics such as efficiency, accuracy, and stability of the candidate tool when performing its respective functions. In some embodiments, tool performance information can be determined based on the actual performance of each candidate tool during the execution of historical tasks.

[0078] When determining the initial target tool based on the chapter content type and the tool functionality information of multiple candidate tools, a preliminary screening based on the tool functionality information of each candidate tool is performed first to ensure that the determined target tool can generate the chapter content of the target chapter. Specifically, the server analyzes the specific functions required for each chapter content type and then selects tools with these functions from the candidate tools as the initial target tool. For example, if a chapter content type is data charts, then candidate tools with data visualization functions will be selected as the initial target tool.

[0079] However, in some cases, multiple candidate tools may possess the functionality required to meet the chapter content type, meaning there may be multiple initial target tools. In this situation, the server needs to further evaluate each initial target tool based on its performance information. The evaluation process may include considerations such as tool execution efficiency, accuracy of generated content, and stability. Through evaluation, evaluation results can be obtained for each initial target tool, reflecting the performance advantages and disadvantages of each tool.

[0080] Finally, based on multiple evaluation results, the final target tool can be determined from several initial target tools. The selection criteria can include optimal performance, best overall performance, etc., depending on the actual needs and the set evaluation metrics. In this way, the system can ensure that the selected target tool has the best performance and effect when generating specific chapter content, thereby further improving the overall quality of the generated target document.

[0081] In one example, target tools can be selected based on two dimensions: functional complexity and performance. Specifically, the functional complexity of each initial target tool can be quantified to obtain a complexity metric score. Based on the complexity metric score and the evaluation results characterizing performance, a high-quality target tool can be selected from multiple initial target tools.

[0082] Figure 5 A schematic diagram of a target determination tool according to an embodiment of the present disclosure is shown.

[0083] like Figure 5 As shown, the initial target tools include tool A, tool B, and tool C. Tool A has a complexity quantification score of 25 and an evaluation result of 50, tool B has a complexity quantification score of 50 and an evaluation result of 75, and tool C has a complexity quantification score of 75 and an evaluation result of 75. Accordingly, tool A can be determined to be a low-quality tool, tool B to be a medium-quality tool, and tool C to be a high-quality tool, and tool C is selected as the target tool.

[0084] According to embodiments of this disclosure, by comprehensively examining the functional fit and performance of candidate tools, multiple tools are quantitatively evaluated, and the optimal target tool is automatically selected to generate chapter content based on the evaluation results. This ensures the accuracy of the content while improving the efficiency and professionalism of the document generation system.

[0085] According to embodiments of this disclosure, multiple initial target tools are evaluated based on multiple tool performance information to obtain multiple evaluation results, including: evaluating the tool invocation performance of the initial target tools based on latency information to obtain a first evaluation result; evaluating the tool result quality of the initial target tools based on result evaluation information to obtain a second evaluation result; and obtaining an evaluation result based on the first evaluation result and the second evaluation result.

[0086] In embodiments of this disclosure, tool performance information includes latency information and result evaluation information. Latency information represents the duration of task execution, and result evaluation information represents the quality of task results. The task is used to generate content that matches the chapter content type.

[0087] Latency is a crucial factor when evaluating the performance of initial target tools. The server can record the time each initial target tool spends executing historical or simulated tasks, using this as a reference for latency information. Shorter latency generally means the tool can respond and complete tasks faster, which is essential for improving document generation efficiency. Therefore, based on latency information, the server can evaluate the performance of initial target tools, obtaining a preliminary evaluation result, such as sorting tools from shortest to longest latency, or assigning each tool a latency-based score.

[0088] Meanwhile, the results evaluation information is also a key indicator for evaluating tool performance, reflecting the quality of the tool in generating content that matches the chapter's content type. The server can evaluate the quality of the results by comparing the content generated by the tool with the expected content in terms of consistency, accuracy, and completeness. For example, for chapters with data charts, the server can evaluate whether the charts generated by the tool accurately reflect the data relationships and whether the chart type is appropriate; for chapters with text descriptions, the server can evaluate whether the language generated by the tool is fluent, accurate, and conforms to the chapter's theme and requirements. Based on these evaluations, the server can obtain a second evaluation result regarding the quality of the tool's results for the initial target tool.

[0089] Finally, the server can combine the results of the first and second evaluations to obtain a comprehensive evaluation result. This evaluation result can be a comprehensive score or a ranking list, indicating the relative performance advantages and disadvantages of the various initial target tools. Based on this comprehensive evaluation result, the server can determine the final target tool from multiple initial target tools to ensure that the selected tool is both efficient and accurate in generating specific chapter content.

[0090] In some embodiments, the first evaluation result and the second evaluation result can be assigned corresponding weights according to the research report type corresponding to the target document, and the first evaluation result and the second evaluation result can be weighted and summed based on their respective weights to obtain the evaluation result.

[0091] For example, for research reports with high timeliness requirements, a higher weight can be assigned to the first evaluation result to prioritize the use of more efficient tools; while for research reports with extremely high content quality requirements, a higher weight can be assigned to the second evaluation result to ensure that the generated content is highly accurate and professional. By dynamically adjusting the weights, the system can more flexibly adapt to the needs of different research report types, further improving the quality and efficiency of document generation. Furthermore, this weighting mechanism also provides the document generation system with greater customizability, allowing users to fine-tune the evaluation criteria according to specific needs, thereby obtaining document generation results that better meet expectations.

[0092] According to embodiments of this disclosure, by separately evaluating the matching degree between tool functionality and content format, as well as the tool's own performance, and introducing configurable weights to adaptively fuse the two results, a scientific and precise quantitative selection of candidate tools is achieved under specific chapter requirements. Through this evaluation mechanism, the document generation system can dynamically and intelligently select the most suitable tool for generating the current chapter content, thereby significantly improving the accuracy and professionalism of specific chapter content while ensuring the document's logical structure, and ultimately enhancing the overall quality of document generation.

[0093] According to embodiments of this disclosure, for Figure 2 Before operation S240, the document generation method further includes: performing semantic recognition on the chapter description information to obtain chapter feature information; and filling the chapter feature information into the corresponding fields of the preset prompt template to generate tool call information.

[0094] In one embodiment, to improve the quality of tool call information generation, the server first performs semantic recognition on the chapter description information, extracting key chapter feature information from it. This chapter feature information accurately reflects the core content and requirements of the chapter. The chapter feature information may include at least one of chapter topic information, chapter structure information, and formatting requirement information.

[0095] After obtaining the chapter feature information, the server fills this feature information into the corresponding fields of the preset prompt template. The preset prompt template is a structured information carrier pre-built based on the target tool's calling rules or general interaction standards. Specifically, it includes fixed fields corresponding to each dimension of the chapter feature information (such as topic description fields, architecture description fields, format constraint fields, etc.). Its core function is to reduce the complexity of information parsing by the tool through standardized information organization.

[0096] In another embodiment, if the target tool is called through an intermediate server, the intermediate server needs to generate the corresponding chapter content based on the chapter description information of the target chapter. Therefore, the server can integrate the chapter description information into the tool call information so that the intermediate processor can directly generate the chapter content based on the tool call information.

[0097] Therefore, for scenarios where a target tool is invoked through an intermediate server, the preset prompt template used to generate tool invocation information is based on the interface invocation specification defined by the intermediate server. This specification defines how information should be organized so that the intermediate server can correctly parse and invoke the corresponding tool. By filling the prompt template with chapter feature information, the server generates complete tool invocation information.

[0098] In one specific embodiment, different preset prompt templates can be set for different types of chapter description information. When generating tool call information, a suitable preset prompt template can be selected based on the chapter description information first, and then the chapter feature information can be filled into the template to adapt to the diversity and complexity of different chapter description information.

[0099] According to embodiments of this disclosure, by extracting core chapter feature information and converting it into a task to be executed that conforms to the target tool specification, and finally generating standardized call information by filling in a preset prompt template, the tool call information not only contains all the key information required to call the target tool, but also ensures that this information can be transmitted in the desired format, thus achieving accurate and automatic conversion of natural language instructions into machine-executable instructions.

[0100] Furthermore, since the chapter description information is directly integrated into the tool call information, the intermediate server can directly generate chapter content based on this information after receiving the tool call information, without the need for additional information extraction or processing. This not only speeds up document generation but also reduces errors or deviations caused by improper information transmission or processing, thereby further improving the overall quality of document generation.

[0101] According to embodiments of this disclosure, for Figure 2Prior to the operation S240 shown, the document generation method further includes: if the target tool is not successfully determined based on the chapter content type and the tool attribute information of multiple candidate tools, generating a query request based on the chapter description information; accessing the database based on the query request, and returning the chapter content retrieved from the database.

[0102] Typically, the server can filter suitable tools for generating the target chapter content based on the tool attributes of each candidate tool, such as tool functionality and performance information. However, there are situations where none of the existing candidate tools can meet the specific requirements for chapter content generation, and a target tool cannot be successfully determined. For example, existing candidate tools may not meet the generation requirements in terms of functionality, or their performance may not meet the required accuracy and efficiency. In such cases, to ensure the continuity and integrity of the document generation process, the generation of chapter content can be achieved by relying on a database.

[0103] In embodiments of this disclosure, when the server fails to identify the target tool, it generates a structured query request based on the chapter description information. This query request may include not only key information such as the chapter's core theme, architectural details, and formatting requirements, but also user preferences for content style or the use of technical terminology.

[0104] In one embodiment, the server can directly access the database through this structured query request. During the access process, the database performs precise retrieval based on information such as the core theme, keywords, and format constraints in the query request, matching relevant chapter fragments or complete content from stored historical documents, standard templates, or structured content libraries. After initial screening and format adaptation, the retrieved chapter content is returned to the server, providing basic materials for subsequent document integration.

[0105] In another embodiment, the server may send the query request to an intermediate server, which will then perform a chapter content query based on the detailed information in the query request. Specifically, after receiving the query request, the intermediate server accesses the relevant database to query the chapter content.

[0106] Specifically, the database can store historical research reports and related professional literature. The intermediate server can retrieve content matching the query request from these historical reports and related professional literature as chapter content and return it to the server. In this way, even if existing candidate tools cannot meet specific needs, chapter content can still be successfully generated, ensuring the smooth document generation process.

[0107] After receiving the returned chapter content, the server can also preprocess and format the chapter content to ensure that it is consistent with the overall style and structure of the target document, thus completing the task of generating the chapter content for the target chapter.

[0108] According to embodiments of this disclosure, when none of the current candidate tools can meet the chapter generation requirements, the system automatically switches to a database query to obtain content, thereby improving the robustness and continuity of the document generation process.

[0109] Figure 6 The illustration shows a schematic diagram of the architecture of a document generation system according to a specific embodiment of the present disclosure.

[0110] like Figure 6 As shown, intermediate servers A, B, and C can provide services to the server based on the model context protocol. Intermediate server A can query database B, intermediate server B can query database B, and intermediate server C can access candidate tool A through an interface.

[0111] According to embodiments of this disclosure, for Figure 2 Before operation S250, the document generation method further includes: performing quality verification on the chapter content and obtaining the verification result; if the verification result indicates that the chapter content needs to be regenerated, determining the target update tool from other candidate tools besides the target tool based on the quality defect type indicated by the verification result and the tool attribute information of each candidate tool; and calling the target update tool to generate the chapter content of the target chapter based on the tool call information of the target update tool.

[0112] To improve the quality of the target document, the server can perform quality checks on the chapter content after receiving it. Specifically, the quality check process can include several aspects, such as: accuracy verification, comparing the content with authoritative data sources or professional standards to check whether the data, facts, and other information in the chapter content are accurate; completeness verification, checking whether the chapter content covers all the key points it should include and whether any important information is missing; logical verification, analyzing whether the argumentation logic in the chapter content is clear, and whether the transitions between parts are natural and well-organized; and format compliance verification, checking whether the chapter content's format conforms to preset specifications, such as font, font size, and layout.

[0113] After obtaining the verification results, if the verification results indicate that the chapter content needs to be regenerated, the server will further analyze the tool attribute information of each candidate tool based on the quality defect type indicated by the verification results. For example, if the quality defect type is that the chapter content contains inaccurate data, the server will select the candidate tool that performs better in terms of data accuracy as the target update tool; if the quality defect type is that the content logic is unclear, the server will select the candidate tool that has advantages in logic processing as the target update tool.

[0114] In one specific embodiment, when determining the target update tool, the evaluation results and complex quantification results of each candidate tool can be combined for screening to select high-quality candidate tools as target update tools.

[0115] In the embodiments of this disclosure, based on the tool invocation information of the target update tool, the server initiates an invocation request to the target update tool. After receiving the invocation information, the target update tool generates chapter content according to the chapter description information therein. During the generation process, the matching between the content and the feature information can be verified in real time, and finally the chapter content of the target chapter that meets the requirements is output and fed back to the server.

[0116] In another embodiment, there are multiple intermediate servers. Specifically, an intermediate server can invoke one or more candidate tools, so the server can store a mapping relationship between intermediate servers and candidate tools so that the server can determine the intermediate server to update based on the target update tool.

[0117] When multiple intermediate servers exist that can call the target update tool, the intermediate servers can be filtered based on their respective load conditions to select the intermediate servers with lower loads as update intermediate servers, thereby improving the efficiency of chapter content generation.

[0118] After the target update tool and the update intermediate server are determined, the server will generate tool call information to invoke the target update tool. This process is similar to the previous method of generating tool call information. It also requires semantic recognition of the chapter description information, extraction of chapter feature information, and filling these feature information into the corresponding fields of the preset prompt template of the update intermediate server.

[0119] The server sends the generated tool call information to the update intermediate server, which calls the target update tool based on the tool call information, thereby regenerating the chapter content of the target chapter to further improve the quality of the target document.

[0120] According to embodiments of this disclosure, when the quality of chapter content is substandard, the defect type can be automatically diagnosed and the most suitable replacement tool can be intelligently selected to regenerate the content, thereby significantly improving the output quality of the final document and the system's fault tolerance.

[0121] According to embodiments of this disclosure, for Figure 2 The operation S250 shown generates a target document based on the chapter content of the target chapter, including: when there are multiple target chapters, structurally integrating the content of multiple chapters according to the chapter identifiers carried in the chapter content of each target chapter to generate an initial document; and performing coherence processing on the initial document to generate the target document.

[0122] In the embodiments of this disclosure, the generated chapter content may carry a chapter identifier, which indicates the position of the target chapter in the target document. The chapter content may be encapsulated as a HyperText Markup Language (HTML) file, which contains the complete chapter content, inline styles, and an adaptive layout for the chapter content, and is wrapped with an outermost layer of... <iframe>The `<style>` tag is used to set style attributes for the HTML file and embed the HTML file within the initial document.

[0123] In one specific embodiment, the style attributes may include the width, height and border of the HTML file. By configuring the width and height of the HTML file, the chapter content can be matched with the height of a browser window, thereby forming an independent "page" visually and physically, and realizing the adaptive layout of the chapter content.

[0124] When integrating multiple chapter contents, the server can first sort the multiple chapter contents according to the chapter identifiers carried by each chapter, and then embed the HTML of each chapter into the target document according to the logical order of the chapters to perform structured integration of the chapter contents, thereby generating an initial document. Specifically, the initial document can also be encapsulated as a main HTML document, by integrating the HTML of each chapter...<iframe> The tags are arranged vertically or in order via a pagination media cascading stylesheet, generating an integrated collection of all chapters.<iframe> The main HTML document, which is viewed by the user when browsing this main HTML document.<iframe> The presentation will be on a continuous series of pages, with each chapter starting on a new page. The page numbers will be clear and the format will be consistent, greatly enhancing the professional look and readability of the report.

[0125] After generating the initial document, in order to further improve the readability and coherence of the document, the server will perform coherence processing on the initial document. Coherence processing may include several aspects, such as adjusting the transitions between paragraphs to ensure that the connection between the content of each chapter is natural and smooth; optimizing the title and subheading hierarchy of the document to make it more in line with the reader's reading habits; and checking and correcting grammatical and spelling errors in the document to improve the overall quality of the document.

[0126] Through coherence processing, the server can generate a target document that is well-structured, coherent, and highly readable. This target document not only meets the user's needs for document content but also enhances the user's experience in reading and using the document.

[0127] According to the embodiments of this disclosure, multi-source content is assembled in an orderly manner through structured integration and coherence processing, and overall optimization at the grammatical and logical levels is performed, thereby achieving efficient organization and optimized presentation of multi-chapter content, ensuring the structural integrity and content coherence of the target document, and thus significantly improving the overall quality of the target document.

[0128] Figure 7 schematically shows a flowchart of generating a target document according to a specific embodiment of the present disclosure.

[0129] As shown in Figure 7, generating the target document includes operations S710 to S740.

[0130] In operation S710, the user inputs document description information.

[0131] In operation S720, the server performs input parsing and outline generation to obtain document outline information 701.

[0132] In an embodiment of the present disclosure, input parsing and outline generation may specifically include three steps: parsing document description information, generating initial outline information, and generating document outline information.

[0133] In operation S730, parallel chapter generation is performed to obtain multiple chapter contents 702.

[0134] In an embodiment of the present disclosure, intermediate server A may be used to generate chapter content A, and at the same time, intermediate server B may be used to generate chapter content B, or the server may be directly used to generate chapter content A and chapter content B simultaneously.

[0135] In operation S740, the server performs content integration and processing to obtain the target document 703.

[0136] In an embodiment of the present disclosure, content integration and processing include structural integration and coherence processing.

[0137] Figure 8 schematically shows a schematic diagram of a document generation interaction page according to a specific embodiment of the present disclosure.

[0138] As shown in Figure 8, after the user enters a document generation request in the interaction box 801 on the left interface, the document generation request and document generation information can be displayed on the left interface. Moreover, the user can click on the generation information of the target tool in the document generation information on the left interface. Taking the user clicking on the generation information of the target tool 4 as an example, the preview chapter content 802 generated by the target tool 4 can be correspondingly displayed on the right interface.

[0139] Based on the document generation method provided in the above embodiments, an embodiment of the present disclosure also provides a document generation device.

[0140] Figure 9 schematically shows a block diagram of a document generation device according to an embodiment of the present disclosure.

[0141] As shown in Figure 9, the document generation device 900 includes an information generation module 910, a type determination module 920, a tool determination module 930, a content generation module 940, and a document generation module 950.

[0142] The information generation module 910 is configured to, in response to receiving a document generation request, input the document description information carried in the document generation request into a large model to obtain the document outline information of the target document as output, where the document outline information includes chapter description information for describing the target chapter.

[0143] The type determination module 920 is configured to determine the chapter content type of the target chapter based on the chapter description information.

[0144] The tool determination module 930 is configured to determine a target tool from multiple candidate tools based on the chapter content type and the tool attribute information of each of the multiple candidate tools.

[0145] The content generation module 940 is configured to call the target tool to generate the chapter content of the target chapter based on the tool call information of the target tool.

[0146] The document generation module 950 is used to generate a target document based on the chapter content of the target chapter.

[0147] According to an embodiment of the present disclosure, the tool attribute information includes tool function information and tool performance information; the tool determination module 930 includes an initial determination submodule, an initial evaluation submodule and a target determination submodule.

[0148] The initial determination submodule is used to determine the initial target tool from multiple candidate tools based on the chapter content type and the tool function information of each candidate tool.

[0149] The initial evaluation submodule is used to evaluate multiple initial target tools based on the performance information of multiple tools when there are multiple initial target tools, and obtain multiple evaluation results.

[0150] The target determination submodule is used to determine the target tool from multiple initial target tools based on multiple evaluation results.

[0151] According to an embodiment of the present disclosure, the tool performance information includes latency information and result evaluation information. The latency information represents the duration of task execution, and the result evaluation information represents the quality of task results. The task is used to generate content that matches the chapter content type. The initial evaluation submodule includes a first evaluation unit, a second evaluation unit, and a result determination unit.

[0152] The first evaluation unit is used to evaluate the tool invocation performance of the initial target tool based on the time delay information, and obtain the first evaluation result.

[0153] The second evaluation unit is used to evaluate the tool result quality of the initial target tool based on the result evaluation information, and obtain the second evaluation result.

[0154] The result determination unit is used to obtain the evaluation result based on the first evaluation result and the second evaluation result.

[0155] According to an embodiment of the present disclosure, the document generation apparatus 900 further includes a semantic recognition module and a call generation module.

[0156] The semantic recognition module is used to perform semantic recognition on the chapter description information to obtain chapter feature information.

[0157] The call recognition module is used to fill the chapter feature information into the corresponding fields of the preset prompt template to generate tool call information.

[0158] According to an embodiment of the present disclosure, the document generation apparatus 900 further includes a request generation module and a chapter query module.

[0159] The request generation module is used to generate a query request based on the chapter description information when the target tool cannot be successfully determined based on the chapter content type and the tool attribute information of multiple candidate tools.

[0160] The chapter query module is used to access the database based on the query request and return the chapter content obtained from the database.

[0161] According to an embodiment of the present disclosure, the document generation device 900 further includes a chapter verification module, a tool update module, and an update call module.

[0162] The chapter verification module is used to verify the quality of chapter content and obtain the verification result.

[0163] The tool update module is used to determine the target update tool from other candidate tools besides the target tool, based on the quality defect type indicated by the verification result and the tool attribute information of each candidate tool, when the verification result indicates that the chapter content needs to be regenerated.

[0164] The update module is used to call the target update tool to generate the chapter content of the target chapter based on the tool call information of the target update tool.

[0165] According to an embodiment of the present disclosure, the document generation module 950 includes a chapter receiving submodule and a coherence processing submodule.

[0166] The chapter receiving submodule is used to structurally integrate the contents of multiple chapters according to the chapter identifier carried in the contents of each target chapter when there are multiple target chapters, and generate an initial document, wherein the chapter identifier represents the position of the target chapter in the target document.

[0167] The coherence processing submodule is used to perform coherence processing on the initial document to generate the target document.

[0168] According to an embodiment of the present disclosure, the information generation module 910 includes an information parsing submodule and an information generation submodule.

[0169] The information parsing submodule is used to parse the document description information using a large model to generate initial outline information, wherein the initial outline information includes the chapter name information of the target chapter and the structural information representing the hierarchical relationship between multiple target chapters.

[0170] The information generation submodule is used to refine the chapter name information of the target chapter based on the initial outline information, and generate document outline information including the chapter description information of the target chapter.

[0171] Based on the document generation method provided in the above embodiments, an embodiment of the present disclosure also provides a document generation system.

[0172] Figure 10 schematically shows an architecture diagram of the document generation system according to an embodiment of the present disclosure.

[0173] As shown in Figure 10, in another embodiment, to adapt to the distributed processing scenario and improve the flexibility of content generation, the document generation system 1000 includes a document generation terminal 1010 and an intermediate server 1020, and the two implement data interaction and collaborative work through a preset communication protocol.

[0174] Specifically, the document generation terminal 1010 is configured to, in response to receiving a document generation request, input the document description information carried in the document generation request into a large model to obtain the document outline information of the output target document, where the document outline information includes chapter description information for describing a target chapter; based on the chapter description information, determine the chapter content type of the target chapter; based on the chapter content type and the tool attribute information of each of the multiple candidate tools, determine a target tool from the multiple candidate tools; send the tool call information for calling the target tool to the intermediate server 1020; and generate a target document based on the chapter content of the target chapter from the intermediate server 1020.

[0175] The intermediate server 1020 is configured to, based on the received tool call information, call the target tool to generate the chapter content of the target chapter, and return the chapter content to the document generation terminal 1010.

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

[0177] According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.

[0178] According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method described above.

[0179] According to an embodiment of the present disclosure, a computer program product includes a computer program that implements the method described above when executed by a processor.

[0180] Figure 11 schematically shows a block diagram of the structure of an agent of artificial intelligence according to an embodiment of the present disclosure.

[0181] In an embodiment of the present disclosure, inspired by the von Neumann architecture in modern computer theory, as shown in Figure 11, the AI agent 1100 may include five core modules: an input module 1110, a processing module 1120, and an output module 1130.

[0182] The input module 1110 is responsible for receiving or sensing information such as queries, requests, instructions, signals, or data from the outside world (such as users or the external environment), and converting it into a format that the AI agent 1100 can understand and process. The input module 1110 is the primary link for the AI agent 1100 to interact with the outside world, enabling the AI agent 1100 to efficiently and accurately obtain necessary "sensory" information from the outside world and respond to this information.

[0183] In an example, the input module 1110 may receive the document generation request described above.

[0184] In an embodiment of the present disclosure, the processing module 1120 may include a control module 1121, a storage module 1122, and an arithmetic module 1123. The processing module 1120 is used to determine a target task based on the document generation request received by the input module 1110, determine a target large model based on the target task, and execute a large model-based document generation method by invoking the target large model to obtain a target document.

[0185] The control module 1121 is the core support for the AI agent 1100 to handle complex tasks. The control module 1121 may execute the large model-based document generation method described above.

[0186] In the example, the control module 1121 will continuously interact with the storage module 1122, the arithmetic module 1123, and / or the output module 1130 during operation. However, it should be noted that in the embodiments of this disclosure, the control module 1121 initiates communication with the storage module 1122, the arithmetic module 1123, and / or the output module 1130 as a single initiator, and there is no communication coupling between the storage module 1122, the arithmetic module 1123, and the output module 1130.

[0187] In the example, the performance of the control module 1121 can be closely related to the large model on which the AI ​​agent 1100 is based. In order to fully utilize the capabilities of the large language model, the internal structure of the control module 1121 can be designed to be highly configurable and scalable in order to cope with various types of tasks and needs in real-world scenarios.

[0188] The storage module 1122 can be responsible for persistently storing and remembering the content output by the large model.

[0189] In the example, after receiving a document generation request, the AI ​​agent 1100 can trigger the document generation process, obtain the target document, and feed it back to the control module 1121. Then, the control module 1121 can pass the returned target document to the output module 1130.

[0190] The operation module 1123 can be regarded as a predefined tool library.

[0191] In the example, when the AI ​​agent 1100 needs to process data, it can call relevant tools from the computing module 1123 and feed them back to the control module 1121. Then, the control module 1121 can use the fed-back tools to process the relevant data. It is understood that although large language models have excellent language understanding and generation capabilities, like humans, they can only solve a limited number of tasks without the aid of any tools. When the AI ​​agent 1100 is given the ability to call tools, it can perform tasks such as timing alignment using tools for timing alignment.

[0192] The output module 1130 can output the target document described above.

[0193] The AI ​​agent 1100 according to the embodiments of the present disclosure can simply and effectively improve the level of intelligence, and enhance flexibility and versatility.

[0194] Figure 12 schematically shows a schematic block diagram of an example electronic device that can be used to implement embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, personal digital processors, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementations of the present disclosure described and / or claimed herein.

[0195] As shown in Figure 12, the device 1200 includes a computing unit 1201, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1202 or a computer program loaded from a storage unit 1208 into a random access memory (RAM) 1203. In the RAM 1203, various programs and data required for the operation of the device 1200 can also be stored. The computing unit 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.

[0196] A plurality of components in the device 1200 are connected to the input / output (I / O) interface 1205, including: an input unit 1206, such as a keyboard, a mouse, etc.; an output unit 1207, such as various types of displays, speakers, etc.; a storage unit 1208, such as a magnetic disk, an optical disc, etc.; and a communication unit 1209, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1209 allows the device 1200 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0197] The computing unit 1201 can be various general and / or special processing components having processing and computing capabilities.Examples of computing unit 1201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Computing unit 1201 performs the various methods and processes described above, such as document generation methods. For example, in some embodiments, the document generation method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1208. In some embodiments, part or all of the computer program may be loaded and / or installed on device 1200 via ROM 1202 and / or communication unit 1209. When the computer program is loaded into RAM 1203 and executed by computing unit 1201, one or more steps of the document generation method described above may be performed. Alternatively, in other embodiments, computing unit 1201 may be configured to perform document generation methods by any other suitable means (e.g., by means of firmware).

[0198] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0199] Program code for implementing the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus such that, when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0200] In the context of this disclosure, 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.

[0201] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0202] The systems and techniques described herein can be implemented in computing systems that include back-end components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and techniques described herein), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0203] A computer system may include a client and a server. Clients and servers are generally located far apart from each other and typically interact via a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other.The server can be a cloud server, a distributed system server, or a server that incorporates blockchain technology.

[0204] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and no limitation is imposed herein.

[0205] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.< / iframe>

Claims

1. A document generation method, comprising: In response to receiving a document generation request, the document description information carried in the document generation request is input into the large model to obtain the document outline information of the target document, wherein the document outline information includes chapter description information for describing the target chapter; Based on the chapter description information, determine the chapter content type of the target chapter; Based on the chapter content type and the tool attribute information of each of the multiple candidate tools, the target tool is determined from the multiple candidate tools; Based on the tool call information of the target tool, the target tool is invoked to generate the chapter content of the target chapter; The target document is generated based on the content of the target chapter.

2. The method according to claim 1, wherein, The tool attribute information includes tool function information and tool performance information; The process of determining the target tool from among the multiple candidate tools based on the chapter content type and the tool attribute information of each candidate tool includes: Based on the chapter content type and the tool function information of each of the candidate tools, an initial target tool is determined from the candidate tools; When there are multiple initial target tools, the multiple initial target tools are evaluated based on the performance information of the multiple tools, resulting in multiple evaluation results; The target tool is determined from the multiple initial target tools based on the multiple evaluation results.

3. The method according to claim 2, wherein, The tool performance information includes latency information and result evaluation information. The latency information represents the duration of task execution, and the result evaluation information represents the quality of the task result. The task is used to generate content that matches the chapter content type. The method involves evaluating multiple initial target tools based on the performance information of these tools, resulting in multiple evaluation results, including: Based on the latency information, the tool invocation performance of the initial target tool is evaluated to obtain a first evaluation result; Based on the evaluation information, the tool result quality of the initial target tool is evaluated to obtain a second evaluation result; The evaluation result is obtained based on the first evaluation result and the second evaluation result.

4. The method according to claim 1, wherein, The method further includes: Semantic recognition is performed on the chapter description information to obtain chapter feature information; The chapter feature information is filled into the corresponding fields of the preset prompt template to generate the tool call information.

5. The method according to claim 1, wherein, The method further includes: If the target tool cannot be successfully determined based on the chapter content type and the tool attribute information of each of the multiple candidate tools, a query request is generated based on the chapter description information; The database is accessed based on the query request, and the chapter content retrieved from the database is returned.

6. The method according to claim 1, wherein, The method further includes: The content of the aforementioned chapters was subjected to quality verification, and the verification results were obtained. If the verification result indicates that the chapter content needs to be regenerated, based on the quality defect type indicated by the verification result and the tool attribute information of each candidate tool, the target update tool is determined from the other candidate tools besides the target tool. Based on the tool call information of the target update tool, the target update tool is invoked to generate the chapter content of the target chapter.

7. The method according to claim 1, wherein, Generating the target document based on the chapter content of the target chapter includes: When there are multiple target chapters, the content of the multiple chapters is structurally integrated according to the chapter identifier carried in the content of each target chapter to generate an initial document, wherein the chapter identifier represents the position of the target chapter in the target document; The initial document is processed for coherence to generate the target document.

8. The method according to claim 1, wherein, The step of inputting the document description information carried in the document generation request into the large model to obtain the document outline information of the output target document includes: The document description information is parsed using the large model to generate initial outline information, wherein the initial outline information includes the chapter name information of the target chapters and structural information representing the hierarchical relationship between the multiple target chapters; Based on the initial outline information, the chapter name information of the target chapter is refined to generate document outline information including the chapter description information of the target chapter.

9. A document generation apparatus, comprising: The information generation module is used to respond to a received document generation request by inputting the document description information carried in the document generation request into the large model to obtain the document outline information of the target document, wherein the document outline information includes chapter description information for describing the target chapter. The type determination module is used to determine the chapter content type of the target chapter based on the chapter description information; The tool determination module is used to determine the target tool from the multiple candidate tools based on the chapter content type and the tool attribute information of each candidate tool; The content generation module is used to invoke the target tool to generate the chapter content of the target chapter based on the tool invocation information of the target tool; The document generation module is used to generate the target document based on the chapter content of the target chapter.

10. An intelligent agent for document generation, comprising: The input module is used to receive document generation requests; The processing module is configured to determine a target task based on the document generation request received by the input module, determine a large model based on the target task, and obtain the target document by calling the large model to execute the method described in any one of claims 1 to 8; An output module is used to output the target document obtained by the processing module.

11. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 8.

12. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 8.

13. A computer program product comprising a computer program stored on at least one of a readable storage medium and an electronic device, the computer program implementing the method according to any one of claims 1 to 8 when executed by a processor.

Citation Information

Cited By

  • Writing method and device based on intelligent agent, equipment and medium

    CN121808055A