Content generation method and apparatus, electronic device, and storage medium
Patent Information
- Application Number
- CN202510483322.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2026-10-23
AI Technical Summary
[0005]本申请提供了一种内容生成方法、装置、电子设备及存储介质,以解决现有技术中内容生成质量受限的技术问题
[0069]本申请实施例提供的上述技术方案与现有技术相比具有如下优点:本申请实施例提供的该方法,通过在响应内容生成请求时先生成初始思维链,并在确定其中存在待确定字段的情况下,主动向用户发起参数获取请求以获取补充信息,随后将用户提供的目标参数值与初始思维链中的待确定字段关联形成目标思维链,最终传递给大语言模型生成符合需求的目标内容,这一系列步骤一方面借助思维链的构建,实现了逻辑连贯的检索过程,确保从海量信息中精准定位与请求紧密相关且逻辑关联紧密的内容,避免了传统检索方式可能出现的信息散乱、逻辑不连贯的问题,为后续生成高质量内容奠定了坚实基础;同时,该方案在生成初始思维链过程中,一旦识别出存在待确定字段,能够主动向用户发起参数获取请求,利用用户的反馈来补全信息缺口。这种动态的信息补充机制,使得生成过程不再受限于用户原始请求中可能存在的信息不足,而是能够根据实际情况不断完善思维链,确保传递给大语言模型的是完整、准确且丰富的信息,从而生成更贴合用户需求、质量更高的目标内容,极大地提升了用户体验和智能生成系统的内容生成质量。
Smart Images

Figure CN122965644A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and more particularly to a content generation method, apparatus, electronic device, and storage medium. Background Technology
[0002] Currently, artificial intelligence technology is profoundly changing the way people obtain information and solve problems. Among them, Retrieval-Augmented Generation (RAG) technology, as an intelligent service model that integrates retrieval and generation capabilities, has shown great application potential in multiple fields.
[0003] Currently, the mainstream process of RAG services can be summarized in the following steps: When a user submits a query to the server through a client, the server first performs a retrieval operation in a web repository or specific dataset based on the request to locate documents, web pages, knowledge entries, and other information highly relevant to the requested content. Subsequently, the server preprocesses the retrieved results, including extracting key information, organizing structured data, and adding carefully designed prompts to guide the generative language model to more accurately understand the user's intent and task requirements. Finally, the input data containing the retrieval results and prompts is sent to the generative language model. Based on its powerful language understanding and generation capabilities, the model generates a response to the user's request and returns it to the user.
[0004] While existing RAG workflows have achieved a degree of integration between retrieval and generation, they still face numerous challenges in practical applications. Specifically, existing RAG workflows often assume that the request itself contains sufficient information to drive the generation process. However, in practice, user requests may be poorly worded, lack information, or have limitations in domain knowledge, resulting in limited quality of the final content generated. Summary of the Invention
[0005] This application provides a content generation method, apparatus, electronic device, and storage medium to solve the technical problem of limited content generation quality in the prior art.
[0006] Firstly, this application provides a content generation method, the method comprising:
[0007] In response to a content generation request, an initial thought chain is generated based on the content generation request;
[0008] If it is determined that there is a field to be determined in the initial thought chain, a parameter acquisition request is sent to the user to obtain the target parameter value provided by the user for the field to be determined.
[0009] The target parameter value is associated with the field to be determined in the initial thinking chain to obtain the target thinking chain;
[0010] The target thought chain is passed to the large language model to generate target content that meets the content generation request.
[0011] In one possible implementation, generating the initial thought chain based on the content generation request includes:
[0012] The intent parameters are parsed from the content generation request, and the target intent type is determined based on the intent parameters;
[0013] For the target intent type, at least two task modules are decomposed, and for each task module, at least one execution unit is determined;
[0014] An initial thought chain is generated based on the target intent type, the task module, and the execution unit.
[0015] In one possible implementation, generating the initial thought chain based on the target intent type, the task module, and the execution unit includes:
[0016] Using the target intent type as the root node, each task module is attached as a branch node to the root node, and the execution unit is attached as a leaf node to the corresponding branch node, thus generating an initial thought chain with a tree structure.
[0017] In one possible implementation, determining that a field to be determined exists in the initial thought chain includes:
[0018] For each leaf node in the initial thought chain, if it is determined that the predefined parameter set of the leaf node contains a first parameter field, the first parameter field is determined as the field to be determined.
[0019] In this case, the parameter value of the parent node mapped by the parameter inheritance mechanism in the first parameter field is empty, or the first parameter field is empty.
[0020] In one possible implementation, initiating a parameter retrieval request to the user to obtain the target parameter value provided by the user for the field to be determined includes:
[0021] Based on the field to be determined, generate the corresponding prompt message and send the prompt message to the user;
[0022] The target parameter values provided by the user based on the prompt information are obtained through a visual interface.
[0023] In one possible implementation, the method further includes:
[0024] If it is determined that there is a field to be determined in the initial thought chain, the target parameter value corresponding to the field to be determined is obtained from the user's data space.
[0025] In one possible implementation, passing the target thought chain to a large language model to generate target content that conforms to the content generation request includes:
[0026] Based on the target thinking chain, content retrieval is performed to obtain the target retrieval content;
[0027] Input information is generated based on the target thought chain and the target retrieval content, and then passed to the large language model to generate target content that meets the content generation request.
[0028] In one possible implementation, the step of performing content retrieval based on the target thought chain to obtain the target retrieval content includes:
[0029] Determine the dependencies between the task modules in the target thinking chain;
[0030] Based on the aforementioned dependencies, the content retrieval tasks corresponding to each of the aforementioned task modules are executed sequentially to obtain the target retrieval content.
[0031] In one possible implementation, the content retrieval task corresponding to the task module is executed to obtain the target retrieval content, including:
[0032] A second leaf node is determined from the leaf nodes of the task module, wherein the filling type of the second leaf node is a second type;
[0033] Execute the content retrieval task corresponding to the second leaf node to obtain the target retrieval content.
[0034] In one possible implementation, performing the content retrieval task corresponding to the second leaf node to obtain the target retrieval content includes:
[0035] Determine the content retrieval path corresponding to the second leaf node;
[0036] The content retrieval task is executed according to the content retrieval path corresponding to the second leaf node to obtain the target retrieval content.
[0037] Secondly, this application provides a content generation apparatus, the apparatus comprising:
[0038] An initial generation module is used to generate an initial thought chain based on a content generation request in response to the content generation request.
[0039] The supplementary module is used to initiate a parameter retrieval request to the user to obtain the target parameter value provided by the user for the field to be determined when it is determined that there is a field to be determined in the initial thinking chain.
[0040] The target generation module is used to associate the target parameter value with the field to be determined in the initial thinking chain to obtain the target thinking chain;
[0041] The content generation module is used to pass the target thought chain to the large language model and generate target content that conforms to the content generation request.
[0042] In one possible implementation, the initial generation module includes:
[0043] An intent parsing unit is used to parse intent parameters from the content generation request and determine the target intent type based on the intent parameters;
[0044] The task decomposition unit is used to decompose at least two task modules for the target intent type, and to determine at least one execution unit for each task module;
[0045] The generation unit is used to generate an initial thought chain based on the target intent type, the task module, and the execution unit.
[0046] In one possible implementation, the generating unit is specifically used for:
[0047] Using the target intent type as the root node, each task module is attached as a branch node to the root node, and the execution unit is attached as a leaf node to the corresponding branch node, thus generating an initial thought chain with a tree structure.
[0048] In one possible implementation, the supplementary module includes:
[0049] The checking unit is used to determine the first parameter field as a field to be determined for each leaf node in the initial thought chain, if it is determined that the predefined parameter set of the leaf node contains the first parameter field.
[0050] In this case, the parameter value of the parent node mapped by the parameter inheritance mechanism in the first parameter field is empty, or the first parameter field is empty.
[0051] In one possible implementation, the supplementary module includes:
[0052] The interaction unit is used to generate corresponding prompt information based on the field to be determined, and send the prompt information to the user; and to obtain the target parameter value provided by the user based on the prompt information through a visual interface.
[0053] In one possible implementation, the device further includes:
[0054] An automatic supplementation module is used to obtain the target parameter value corresponding to the field to be determined from the user's data space when it is determined that there is a field to be determined in the initial thought chain.
[0055] In one possible implementation, the content generation module includes:
[0056] The retrieval unit is used to perform content retrieval based on the target thinking chain to obtain the target retrieval content;
[0057] The generation unit is used to generate input information based on the target thought chain and the target retrieval content, and pass it to the large language model to generate target content that meets the content generation request.
[0058] In one possible implementation, the retrieval unit is specifically used for:
[0059] Determine the dependencies between the task modules in the target thinking chain;
[0060] Based on the aforementioned dependencies, the content retrieval tasks corresponding to each of the aforementioned task modules are executed sequentially to obtain the target retrieval content.
[0061] In one possible implementation, the retrieval unit is specifically used for:
[0062] A second leaf node is determined from the leaf nodes of the task module, wherein the filling type of the second leaf node is a second type;
[0063] Execute the content retrieval task corresponding to the second leaf node to obtain the target retrieval content.
[0064] In one possible implementation, the retrieval unit is specifically used for:
[0065] Determine the content retrieval path corresponding to the second leaf node;
[0066] The content retrieval task is executed according to the content retrieval path corresponding to the second leaf node to obtain the target retrieval content.
[0067] Thirdly, this application provides an electronic device, including: a processor and a memory, wherein the processor is configured to execute a content generation program stored in the memory to implement the content generation method described in any one of the first aspects.
[0068] Fourthly, this application provides a storage medium storing one or more programs that can be executed by one or more processors to implement the content generation method described in any one aspect.
[0069] Compared with the prior art, the technical solution provided in this application has the following advantages: The method provided in this application generates an initial thought chain when responding to a content generation request. If it is determined that there is a field to be determined, it actively initiates a parameter acquisition request to the user to obtain supplementary information. Then, it associates the target parameter value provided by the user with the field to be determined in the initial thought chain to form a target thought chain. Finally, it passes the target content that meets the requirements to the large language model. This series of steps, on the one hand, realizes a logically coherent retrieval process by building the thought chain, ensuring that the content closely related to the request and logically connected is accurately located from massive information. This avoids the problems of scattered information and logical incoherence that may occur in traditional retrieval methods, and lays a solid foundation for the subsequent generation of high-quality content. At the same time, in the process of generating the initial thought chain, once the existence of a field to be determined is identified, the solution can actively initiate a parameter acquisition request to the user and use the user's feedback to fill in the information gaps. This dynamic information supplementation mechanism frees the generation process from the potential lack of information in the user's original request. Instead, it continuously improves the thought chain based on the actual situation, ensuring that the large language model receives complete, accurate, and rich information. This results in the generation of target content that better meets user needs and is of higher quality, greatly enhancing the user experience and the content generation quality of the intelligent generation system. Attached Figure Description
[0070] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0071] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0072] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0073] Figure 1 A flowchart illustrating an embodiment of a content generation method provided in this application;
[0074] Figure 2 A schematic diagram of an initial thought process provided for an embodiment of this application;
[0075] Figure 3 A flowchart illustrating an embodiment of another content generation method provided in this application;
[0076] Figure 4 A flowchart illustrating another embodiment of the content generation method provided in this application;
[0077] Figure 5 A block diagram illustrating an embodiment of a content generation apparatus provided in this application;
[0078] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0079] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0080] The following disclosure provides numerous different embodiments or examples for implementing various structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0081] To address the technical problem of limited content generation quality in existing technologies, this application provides a content generation method, apparatus, electronic device, and storage medium that can generate target content that better meets user needs and is of higher quality, greatly improving user experience and the content generation quality of intelligent generation systems.
[0082] Figure 1 A flowchart illustrating an embodiment of a content generation method provided in this application is shown below. Figure 1 As shown, the process includes the following steps:
[0083] Step 101: In response to the content generation request, generate an initial thought chain based on the content generation request.
[0084] A content generation request refers to a user's or system's request to generate specific content. For example, a content generation request may include key parameters specified by the user, such as the theme, format, style, and content length. In one embodiment, the content can encompass a wide variety of formats, including text, images, audio, video, files, and links.
[0085] In one embodiment, users can submit content generation requests through a visual interface or an API (Application Programming Interface). Regarding the format of the requested content, the request can be in text format, such as a user entering a brief description like "Help me create a travel plan from Zhuhai to Guangzhou," requesting the system to generate a detailed travel plan. The request can also be in voice format, such as a user inputting the same sentence verbally. Here, the system also involves converting the voice-based content generation request into text for further processing, which will not be detailed here.
[0086] A thought chain is a structured logical framework that breaks down a complex problem into a series of executable subtasks through a step-by-step reasoning process. Each subtask corresponds to one or more logical steps. By executing these steps sequentially, the system can generate a final solution or output. In other words, a thought chain refers to a structured problem-solving path that transforms an input request (such as a content generation request) into a specific output (such as target content) through a series of logical steps. Through thought chains, systems can handle complex tasks more efficiently and flexibly, while ensuring the integrity of the output content.
[0087] In step 101, an initial thought chain is first generated based on the user's content generation request. This initial thought chain defines the steps and processes required to resolve the content generation request. For example, for a content generation request like "Help me create a travel plan from Zhuhai to Guangzhou with a budget of 5000 yuan," the initial thought chain would be as follows: Figure 2 As shown.
[0088] Figure 2 The initial thought process shown includes the following key steps and procedures:
[0089] Determine the transportation plan: The initial thought process involves a subtask (outline item with id 1) that details the transportation options. Specifically, this includes querying the time and price of various modes of transportation (airplane, high-speed rail, train, etc.) from "Zhuhai" to "Guangzhou," considering both outbound and return travel times. The query logic is defined using the `func` field: `req.from` to `req.to`, outbound `req.start`, return `req.end`, and the time and price for each mode of transportation.
[0090] Determining the travel itinerary: The initial thought process detailed the travel itinerary through a subtask (outline item with id 2). Specifically, this included querying attractions near "Guangzhou" and determining which attractions could be visited based on the user-specified number of days (calculated from req.end - req.start). The query logic was defined using the func field: "req.to attractions that can be visited in the vicinity for (req.end - req.start) days".
[0091] Determine the accommodation plan: The initial thought process included a subtask (outline item with id 3) to plan the accommodation options. This involved querying hotel and price information in Guangzhou from the start to the end of the trip, including hotel type (1-5 stars, guesthouses, etc.), price, and total cost.
[0092] Therefore, the initial thought chain provides clear guidance for generating travel plans that meet user needs through a series of structured steps and processes.
[0093] In some embodiments, the initial thought chain is a task configuration file, which configures subtasks and their parameter information. During specific applications, subtasks and their parameter information are read from the initial thought chain; based on the subtask's parameter information, the subtask is executed.
[0094] In one embodiment, when the parameter information of a subtask indicates the dependencies between subtasks, the execution order of the subtasks and the information sharing between the subtasks are determined based on the dependencies.
[0095] Step 102: If it is determined that there are fields to be determined in the initial thought chain, initiate a parameter retrieval request to the user to obtain the target parameter values provided by the user for the fields to be determined.
[0096] Step 103: Associate the target parameter value with the field to be determined in the initial thinking chain to obtain the target thinking chain.
[0097] In the initial thought process, "fields to be determined" refer to those fields that are not explicitly filled in and require further clarification. For example, see... Figure 2In the example's initial thought chain, the departure point (from), destination (to), and budget (budget) can be obtained by parsing the user's content generation request. However, some key steps and processes require information such as the specific departure time (start), return time (end), mode of transportation (e.g., airplane, car, ship), and accommodation preferences (e.g., hotel star rating, guesthouse preference). Therefore, these parameter fields are in an unfilled state when generating the initial thought chain. These unfilled parameter fields, crucial to completing the travel plan, are referred to as fields to be determined.
[0098] Therefore, although the fields to be determined are key elements for completing content generation requests, such as formulating a complete travel plan, the specific information of these fields cannot be directly obtained based solely on the user's current input. To address this technical challenge, this application proposes: initiating a parameter retrieval request to the user, guiding the user to provide corresponding parameter information (referred to as target parameter values for convenience) for these fields to be determined. Furthermore, in step 103, the target parameter values are associated with the fields to be determined in the initial thought chain, thereby completing the originally incomplete initial thought chain and forming the target thought chain.
[0099] In one embodiment, the specific implementation of initiating a parameter acquisition request to the user to obtain the target parameter value provided by the user for the field to be determined includes: generating corresponding prompt information based on the field to be determined and sending the prompt information to the user; and obtaining the target parameter value provided by the user based on the prompt information through a visual interface.
[0100] The aforementioned prompts guide the user to provide specific parameter information for the field to be determined. As an optional implementation, a sequential prompting approach can be used. Specifically, prompts can be generated and sent to the user in a certain order, such as the order in which the field appears in the initial thought process. The next round of prompts is only given after the user provides the corresponding parameter information based on the current prompt. Figure 2 Taking the initial thought process shown as an example, firstly, for the "Departure Time (start)" field that needs to be determined, the corresponding prompt message "Please select your travel date" is generated and sent. After the user completes the selection, for the "Return Time (end)" field that needs to be determined, the corresponding prompt message "Please select your return date" is generated and sent. This sequential prompting method allows the user to clearly understand the task to be completed at each step, with clear logic, which helps the user to complete the parameter filling step by step.
[0101] As another optional implementation method, a one-time prompt approach can be adopted. Specifically, prompts for all fields to be determined are sent to the user all at once. This method is simpler and helps users gain a comprehensive understanding of the parameters that need to be filled in. For example, a visual interface can clearly and intuitively display all fields to be determined, with an input box next to each field for easy parameter input. The input box can take various forms. For example, it could be a text box where users can directly enter text information; it could be a radio button / checkbox where users can simply click to select; or it could be a dropdown list where users can easily complete the input by selecting from the dropdown menu. Taking the "Transportation Mode" field as an example, the system can prompt "Please select transportation mode (options: airplane / car / ship)" in the visual interface, allowing users to clearly see the available options. This visual interface design greatly lowers the barrier to entry for users. Users do not need professional technical knowledge; they can easily complete the parameter filling simply by following the interface prompts. At the same time, this design also improves the efficiency and accuracy of parameter acquisition, reduces errors caused by complex operations or unclear information, and makes the entire content generation process smoother and more efficient.
[0102] Step 104: Pass the target thought chain to the large language model to generate target content that meets the content generation request.
[0103] In step 104, the target thought chain is passed to the large language model so that the large language model can generate the target content according to the logical steps and detailed information contained in the target thought chain.
[0104] Taking the generation of a complete travel plan from Zhuhai to Guangzhou as an example, the target content may cover a rich and detailed range of information, such as departure time, mode of transportation, number of travel days, daily attractions, accommodation booking, and restaurant recommendations.
[0105] As can be seen from the above description, the goal-oriented thinking chain includes complete logical steps and the detailed information required for each step. Therefore, the large language model generates target content based on the goal-oriented thinking chain, ensuring that the generated content highly matches the user's actual needs. It not only covers all aspects the user expects in terms of content but also possesses logical coherence and rationality. For example, from the beginning to the end of the trip, the time arrangement fully considers the distance between different attractions and the time required for each visit, avoiding an overly tight or loose itinerary; regarding transportation options, it combines the user's travel preferences and actual circumstances to provide the most suitable travel suggestions.
[0106] Furthermore, leveraging its powerful language processing capabilities and rich knowledge base, the large language model can optimize and expand content appropriately while adhering to the target's thought process, making the content more attractive and readable. For example, when introducing tourist attractions, the large language model can incorporate interesting background information into the target content, allowing users to gain a deeper understanding of the attractions; when recommending restaurants, the large language module can describe the flavor and texture of specialty dishes in detail within the target content, stimulating users' appetites, and so on.
[0107] In summary, by passing a structured, clear, and logical target thought chain to the large language model to generate target content, it is possible to achieve efficient transformation from vague user needs to accurate and high-quality content, providing users with content generation services that are highly practical and offer a good experience, and reducing the problem of inaccurate content generation that is prone to occur in the large language model itself.
[0108] The technical solution provided in this application generates an initial thought chain when responding to a content generation request. If a field to be determined is identified, a parameter retrieval request is proactively initiated to the user to obtain supplementary information. Subsequently, the target parameter values provided by the user are associated with the field to be determined in the initial thought chain to form a target thought chain. This target thought chain is then passed to a large language model to generate target content that meets the requirements. This series of steps, on the one hand, leverages the construction of the thought chain to achieve a logically coherent retrieval process, ensuring accurate location of content closely related to the request and logically connected from massive amounts of information. This avoids the problems of scattered information and logical incoherence that may occur with traditional retrieval methods, laying a solid foundation for the subsequent generation of high-quality content. On the other hand, during the generation of the initial thought chain, once a field to be determined is identified, the solution proactively initiates a parameter retrieval request to the user, using user feedback to fill in the information gaps. This dynamic information supplementation mechanism means that the generation process is no longer limited by the potential lack of information in the user's original request, but can continuously improve the thought chain according to the actual situation, ensuring that the information passed to the large language model is complete, accurate, and rich. This results in target content that is more in line with user needs and of higher quality, greatly improving the user experience and the content generation quality of the intelligent generation system.
[0109] Figure 3 A flowchart illustrating an embodiment of another content generation method provided in this application. Figure 3 The process shown is in Figure 1 Based on the illustrated process, an exemplary implementation of generating an initial thought chain based on a content generation request is described. For example... Figure 3 As shown, the process includes the following steps:
[0110] Step 301: Parse the intent parameters from the content generation request and determine the target intent type based on the intent parameters.
[0111] In content generation scenarios, user content generation requests often contain specific intentions. To accurately understand user needs and generate content that meets expectations, parameters that characterize the user's intent type—intent parameters—are extracted from the content generation request. Intent parameters are key elements for understanding the core intent of a user's request. By analyzing and identifying intent parameters, the target intent type corresponding to the user's request can be further determined.
[0112] For example, when the content generation request is "Help me generate a teaching material on the chicken and rabbit problem," "chicken and rabbit problem" clearly defines the specific topic area involved in the content, while "teaching material" directly reflects the user's desired content format. Together, they constitute the intent parameters. Based on these intent parameters, the target intent type of the request can be determined to be "teaching material," meaning the user wants to obtain a teaching material on the chicken and rabbit problem.
[0113] For example, when the content generation request is "Help me create a travel plan from Zhuhai to Guangzhou", "from Zhuhai to Guangzhou" limits the geographical scope of the travel plan, and "travel plan" clarifies the type of content the user needs. Based on this, the target intent type can be determined as "travel plan", which means that the user wants to obtain a travel planning suggestion for the trip from Zhuhai to Guangzhou.
[0114] In one embodiment, an artificial intelligence model can be used to parse intent parameters from content generation requests and determine the target intent type based on these parameters. Specifically, a specialized intent recognition model is constructed, which can be based on a deep learning framework, such as a recurrent neural network or a long short-term memory network. The model is trained using a large amount of labeled content generation request data, which includes the content generation requests, their corresponding intent parameters, and target intent type labels. During training, the model learns the mapping relationship between content generation requests, intent parameters, and target intent types, thereby enabling it to automatically extract intent parameters from the currently input content generation request and determine the target intent type accordingly.
[0115] In another embodiment, a rule-based matching method can be used to parse intent parameters from content generation requests and determine the target intent type based on these parameters. Specifically, a series of rules are predefined, based on the analysis and summarization of common content generation requests. Rules can include keyword matching, phrase pattern matching, etc. For example, the rule could be defined as: "If the request contains words such as 'teaching materials' or 'lesson plan,' then the target intent type is teaching-related content; if the request contains words such as 'travel plan' or 'travel guide,' then the target intent type is travel-related content." Furthermore, to enhance the flexibility and accuracy of the rules, synonyms can be accommodated; for example, "travel planning" and "travel program" are considered equivalent terms.
[0116] The above two methods can effectively parse the intent parameters from the content generation request and determine the target intent type based on the intent parameters, providing an accurate basis for subsequent content generation and ensuring that the generated content meets the user's actual needs.
[0117] Step 302: For the target intent type, decompose at least two task modules, and for each task module, determine at least one execution unit.
[0118] Within this framework, each task module represents an indispensable part of achieving the intended goal. Each task module has its specific function and objective, working together to complete the entire content generation task. The execution unit corresponding to each task module is the key component implementing that module's task, and also the smallest operational unit specifically implementing the module's functionality. It possesses clearly defined input, output, and processing logic. The execution unit has a predefined set of parameters, which provide the necessary information input and are indispensable key parameters that enable the execution unit to perform corresponding operations based on specific parameter values, thereby completing its assigned task.
[0119] For example, for the goal intent type of "travel plan," it can be broken down into task modules such as transportation plan, accommodation plan, and sightseeing plan. The transportation plan includes at least one execution unit for planning travel, with each execution unit corresponding to a specific mode of transportation (such as airplane, high-speed rail, or train). These execution units have a predefined set of parameters including departure point, destination, departure time, and return time. Through these parameter fields, the execution unit can query the specific time schedule and price details for a particular mode of transportation. By flexibly calling different execution units, it is possible to compare the time schedules and price details of different modes of transportation, thereby providing the user with the optimal transportation plan.
[0120] The accommodation solution includes at least one execution unit for booking accommodation, each corresponding to a specific accommodation type (such as a star-rated hotel, budget guesthouse, etc.). These execution units have a predefined set of parameters including accommodation location (related to the destination), check-in date (related to departure time), and check-out date (related to return time). Using these parameters, the execution unit can search and filter accommodation options that meet the user's needs. By comprehensively utilizing different execution units, prices for different accommodation types can be compared horizontally, thus providing the user with the optimal accommodation solution.
[0121] The travel plan involves an execution unit for planning the travel itinerary. The predefined parameter set of this execution unit includes parameter fields such as travel location and number of travel days. Using these parameter fields, the execution unit can search for key information such as suitable activities and travel order for the user.
[0122] In one embodiment, rule matching can be used to decompose at least two task modules for a target intent type, and for each task module, at least one execution unit can be determined. Specifically, task templates corresponding to different intent types are preset, and each task template includes multiple task modules and an execution unit corresponding to each task module. Accordingly, when a content generation request is received and the target intent type is determined, the target intent type is matched with the preset task templates. Specifically, through techniques such as keyword matching and semantic analysis, the target intent type is accurately mapped to the task template, thereby determining the task template corresponding to the target intent type. By parsing the task template corresponding to the target intent type, multiple task modules and the execution unit corresponding to each task module are obtained.
[0123] In some embodiments, the task modules described above can be independent, dependent, or nested. For example, if a task module is a sub-task module of another task module, then the two task modules have a nested relationship; or if the input of one task module is the output of another task module, then the two task modules have a dependent relationship.
[0124] Step 303: Generate an initial thought chain based on the target intent type, task module, and execution unit.
[0125] In one embodiment, the specific implementation of generating an initial thought chain based on the target intent type, task module, and execution unit includes: taking the target intent type as the root node, attaching each task module as a branch node to the root node, and attaching the execution unit as a leaf node to the corresponding branch node, thereby generating a tree-structured initial thought chain.
[0126] It should be noted that due to the possibility of cross-level references between task modules—for example, task module C might reference parameters from task module A, even though task module C and task module A do not have a direct parent-child relationship; or some execution units might reference parameters from other execution units, and these referenced execution units are still attached as leaf nodes under their corresponding task module nodes—the generated initial thought chain may contain circular references or cross-level parameter passing relationships. Therefore, this initial thought chain does not strictly follow a tree structure, but rather adopts a tree structure that supports nesting, dependencies, and cross-level references. This structure significantly enhances its adaptability to complex task relationships.
[0127] by Figure 2Taking the initial thought chain shown as an example, the target intent type "travel plan" serves as the root node, clearly defining the starting direction and core objective of the entire thought chain. Multiple branch nodes extend from this root node, representing different task modules, such as "transportation plan," "travel plan," and "accommodation plan." Each task module, as a branch node, carries the key steps involved in that task, i.e., one or more execution units.
[0128] Specifically, the "Transportation Plan" branch node carries an execution unit (the execution unit with id 1, "type" "query", and "data" "transportation mode" under the "Transportation Plan" branch). The predefined parameter set of this execution unit includes parameter fields such as departure point, destination, departure time, and return time (see the definition of the func field in this execution unit: "req.from to req.to, outbound req.start, return req.end", the time and price of various transportation modes).
[0129] Under the "Travel Plan" branch node is an execution unit (the execution unit of "Travel Plan" with "type" as "query" and "data" as "travel plan"). The predefined parameter set of this execution unit includes parameter fields such as travel location and number of travel days (see the definition of the func field in this execution unit: "req.to attractions that can be visited in the next (req.end-req.start) days").
[0130] Under the "Accommodation Plan" branch node is an execution unit (an execution unit under the "Accommodation Plan" branch with "type" as "query" and "data" as "Accommodation Method"). The predefined parameter set of this execution unit includes parameter fields such as accommodation location, check-in date, and check-out date (see the definition of the func field in this execution unit: "hotel and price from req.start to outline[2].res[].city.(req.end)").
[0131] By using the target intent type as the root node, task modules as branch nodes, and the smallest execution unit as the leaf node, a structure like this was generated. Figure 2The tree-like initial thought chain shown provides a clear and organized framework and basis for subsequent content generation. Furthermore, the tree-like thought chain achieves modular task management through branch nodes, breaking down the overall goal into a hierarchical set of subtasks. This hierarchical architecture not only facilitates the decomposition of complex intentions but also accurately maps high-order requirements into atomic operations that can be executed in parallel or sequentially, thereby ensuring the integrity of information acquisition and the logical coherence of generated content. Moreover, from a long-term maintainability perspective, the modular task management design implemented through branch nodes reduces system coupling, and its dynamic expansion characteristics allow for flexible adjustment of branch paths based on real-time feedback during task execution, effectively responding to unexpected situations or changes in requirements, thus making function iteration and upgrades more convenient. These advantages collectively construct an efficient, flexible, and scalable task processing framework, providing solid support for intelligent decision-making and content generation in complex scenarios.
[0132] Figure 3 The illustrated process parses intent parameters from content generation requests and determines the target intent type based on these parameters. For each target intent type, at least two task modules are further decomposed, breaking down complex intent processing into multiple relatively independent and operable sub-tasks. Each sub-task module focuses on a specific aspect of processing, making the overall process clearer and more organized. Subsequently, for each task module, at least one execution unit is identified. These execution units are the smallest operational units that implement the functionality of the task module, possessing clearly defined input, output, and processing logic. Finally, based on the target intent type, task modules, and execution units, an initial thought chain is generated, resulting in a tree-structured initial thought chain. This tree-structured thought chain is hierarchical, starting from the top-level intent type and gradually extending downwards to each task module, and then delving into the specific execution units. The logical relationships between each level are close and clearly defined, not only clearly demonstrating the complete path from intent to specific execution steps but also providing an intuitive and effective basis for subsequent task scheduling, resource allocation, and execution monitoring, greatly improving the understandability, maintainability, and scalability of the content generation process.
[0133] exist Figure 3 Based on the process shown, in one embodiment, the specific implementation of determining that there is a field to be determined in the initial thinking chain includes: for each leaf node in the initial thinking chain, if the predefined parameter set of the leaf node contains a first parameter field, the first parameter field is determined as the field to be determined; wherein, the parameter value of the parent node mapped by the first parameter field through the parameter inheritance mechanism is empty, or the first parameter field is empty.
[0134] In a hierarchical data structure or logical model, parameter inheritance refers to a mechanism where child nodes or elements can automatically acquire certain attribute values or parameter settings from their parent nodes or elements, thus avoiding the duplication of the same information across child nodes. If a parameter field uses parameter inheritance, it inherits the parameter values defined by its parent node (which could be the root node), eliminating the need for explicit definition. However, if a parameter field uses inheritance but inherits an empty parameter value from its parent node, it means that the parameter field lacks a valid value source in the current context, and is therefore designated as a field to be determined. Alternatively, if a parameter field does not use parameter inheritance and is not populated with a specific parameter value (i.e., is empty), it requires further clarification and is thus designated as a field to be determined.
[0135] See Figure 2 The example, "req.", illustrates the parameter inheritance mechanism. For instance, "req.start" means it inherits from the root node parameter "start". Figure 2 The example clearly shows that the "start" field in the root node parameters has an empty value. Based on this, the "start" parameter field is determined as the field to be determined. Similarly, "req.to" indicates inheritance from the root node parameter "to". Figure 2 The example clearly shows that in the root node parameters, the "to" field's parameter value is not empty. Based on this, the "to" parameter field will not be determined as a field to be determined. This also demonstrates that the parameter inheritance mechanism effectively avoids the problem of the same parameter field being repeatedly defined in the thought chain.
[0136] Figure 4 A flowchart illustrating another embodiment of the content generation method provided in this application. Figure 4 The process shown is in Figure 1 Based on the illustrated process, an exemplary implementation of generating an initial thought chain based on a content generation request is described. For example... Figure 4 As shown, the process includes the following steps:
[0137] Step 401: In response to the content generation request, generate an initial thought chain based on the content generation request.
[0138] Step 402: If it is determined that there are fields to be determined in the initial thought chain, initiate a parameter retrieval request to the user to obtain the target parameter values provided by the user for the fields to be determined.
[0139] Step 403: Associate the target parameter value with the field to be determined in the initial thinking chain to obtain the target thinking chain.
[0140] For a detailed description of steps 401 to 403, please refer to the relevant descriptions in the above embodiments, which will not be repeated here.
[0141] Step 404: Perform content retrieval based on the target thinking chain to obtain the target retrieval content.
[0142] Step 405: Generate input information based on the target thinking chain and target retrieval content, and pass it to the large language model to generate target content that meets the content generation request.
[0143] Step 404 aims to retrieve content closely related to key nodes in the target thought chain, supporting reasoning and creation during the content generation process—that is, the target retrieval content. For example, in the scenario of travel planning, the target thought chain encompasses multiple key nodes such as travel dates, destination, budget range, and travel preferences. Based on the target thought chain, the content retrieval system initiates a comprehensive, multi-layered information search. Moreover, because information on the fields to be determined is supplemented before the search, the retrieval results are more accurate and comprehensive, further improving the quality of content generated by the large model and compensating for the lag and lack of logical coherence inherent in large model-generated content.
[0144] Taking hotel search as an example, the system conducts in-depth searches across major hotel booking platforms and travel information websites based on key nodes in the target mindset regarding destination and budget range. It then filters out hotel information that meets the criteria, including hotel name, address, price range, and user reviews. For transportation timetables and prices, the system combines travel dates and destinations to retrieve timetables and fare information for different modes of transportation, such as flights, trains, and long-distance buses, from airline websites, railway ticketing systems, and long-distance bus websites. Through this content retrieval, the resulting search results not only comprehensively cover the information involved in each key node of the target mindset but also possess high relevance and accuracy, providing a rich and reliable data foundation for subsequent content generation.
[0145] Furthermore, in complex tasks, different task modules often do not exist in isolation, but rather have dependencies or nesting relationships. For example, if one task module is a sub-task module of another task module, then the two task modules have a nesting relationship; or, if the input of one task module is the output of another task module, then the two task modules have a dependency relationship. Figure 2Taking the example of the thought chain, the "Accommodation Plan" task module heavily relies on the query results from the "Travel Plan" task module when performing the operation of querying hotels and prices. This is because only by clarifying information such as the locations and time arrangements involved in the travel plan can the accommodation location, duration, and budget range be accurately determined, thereby obtaining hotel and price information that meets the needs. These interrelationships between task modules, such as dependencies and nesting relationships, constitute a complex yet orderly collaborative network among task modules in the content generation system.
[0146] Therefore, when retrieving content based on the target thinking chain and obtaining the target search content, the dependencies between the task modules in the target thinking chain are determined. Based on these dependencies, the content retrieval tasks corresponding to each task module are executed sequentially to obtain the target search content. Specifically, when performing content retrieval based on the target thinking chain, the dependencies between each task module are first dynamically resolved, and the execution order of the modules is determined by identifying parameter references or data flow between nodes. For example, in... Figure 2 In the initial thought chain example, by identifying parameter references between nodes, the output of the "Travel Plan" module is determined to be the input of the "Accommodation Plan" module. Therefore, the content retrieval task in the "Travel Plan" module is executed first. Then, the retrieval results from the "Travel Plan" module are used to provide accurate data support for the "Accommodation Plan" module, thereby completing the precise retrieval of hotel information and prices. For task modules without dependencies, such as the "Transportation Plan" module and the "Travel Plan" module, these two task modules can be executed concurrently after the thought chain is completed. This sequential execution method ensures that each task module can operate based on accurate information provided by the preceding modules, avoiding retrieval biases caused by missing or incorrect information, and ultimately obtaining comprehensive and accurate target retrieval content, laying a solid foundation for subsequent content generation.
[0147] For example, dependencies between task modules can be implemented through fine-grained parameter definitions. For instance, in... Figure 2 In the thought process shown, the request "'func':' in req.to from req.start to..." issued by the task module "Accommodation Plan"
[0148] The request "outline[2].res[].city.(req.end)Hotels and Prices" not only depends on the information provided by the user, but also on the results produced by the "travel plan" (i.e., outline[2].res[].city.(req.end)). This parameter definition clearly shows the dependency relationship between task modules, providing strong guidance for subsequent content retrieval work.
[0149] Furthermore, in one embodiment, not all execution units are involved in retrieval tasks. Therefore, the content retrieval task corresponding to the execution task module is executed to obtain the target retrieval content, which includes: determining a second leaf node from the leaf nodes of the task module, wherein the execution type of the second leaf node is a second type; and executing the content retrieval task corresponding to the second leaf node to obtain the target retrieval content.
[0150] The second type can refer to the "query" type, which is typically represented by a clear identifier in the task module, such as "type: query". The leaf nodes for the query type are responsible for initiating query requests to relevant data sources or services based on preset parameters and conditions during task execution to obtain the required information. For example, in... Figure 2 In the example of the thought chain shown, multiple leaf nodes are defined as query types, such as transportation mode query in "Transportation Plans", attraction query in "Travel Plans", and hotel and price query in "Accommodation Plans". These query type leaf nodes define the content and logic of the query through their specific "func" field, providing clear guidance for subsequent content retrieval tasks.
[0151] Once the second leaf node is identified, the content retrieval task corresponding to that node can be executed. This process involves constructing a corresponding query request based on the "func" field definition of the leaf node and sending the request to the appropriate data source or service. By parsing the returned query results, the target content can be obtained, providing strong support for subsequent task processing or decision-making.
[0152] Furthermore, in one embodiment, the specific implementation of executing the content retrieval task corresponding to the second leaf node to obtain the target retrieval content includes: determining the content retrieval path corresponding to the second leaf node; and executing the content retrieval task according to the content retrieval path corresponding to the second leaf node to obtain the target retrieval content.
[0153] Different leaf nodes may point to different retrieval paths based on their functional requirements and data sources. The choice of retrieval path directly determines the execution method and efficiency of subsequent retrieval tasks. For example, the retrieval path is determined based on the "func" field definition of the second leaf node and the system's preset rules. These rules may cover various factors such as the type of data source, access permissions, and data format, which are not limited in this embodiment.
[0154] Content retrieval paths include, but are not limited to, the following, and a leaf node can correspond to one or more content retrieval paths simultaneously:
[0155] Knowledge base query: A knowledge base is a collection of large amounts of structured or semi-structured data pre-built or integrated by the system. By querying the knowledge base, the system can quickly obtain information related to the second leaf node. This method is suitable for scenarios that require frequent access and where the data does not change frequently.
[0156] API calls: APIs (Application Programming Interfaces) serve as bridges for data interaction between different systems or services. By calling specific API interfaces, a system can obtain the latest data information from external data sources. This approach is suitable for scenarios requiring real-time data acquisition or where data sources are geographically dispersed. For example, calling API interfaces is an efficient query method when performing tasks such as querying weather conditions, obtaining real-time traffic information, or synchronizing personal schedules. Furthermore, the functionality of APIs extends far beyond data querying; their powerful extensibility enables them to support diverse non-query operations, including complex calculations and instant information push notifications. This application's embodiments do not impose limitations on these operations.
[0157] Web crawler: For publicly accessible web page data, the system can use web crawler technology to automatically crawl and extract the required information. A web crawler can traverse web pages according to preset rules and extract the necessary information. This method is suitable for scenarios that require collecting data from multiple web pages, but it is essential to comply with relevant laws and regulations and the website's terms of use.
[0158] Accessing a database: A database is a system for storing and managing data. Through SQL queries or other database access technologies, the system can retrieve the required data from the database. This method is suitable for scenarios requiring access to structured data and involving large volumes of data.
[0159] In the above embodiments, during the content retrieval task, an appropriate retrieval method is selected based on the specific requirements of the second leaf node, and the process is executed step by step according to the retrieval path. As the retrieval task progresses, the system continuously collects, organizes, and analyzes the retrieved data until the target retrieval content that meets the requirements is obtained. This process not only ensures the accuracy and efficiency of the retrieval task but also improves the system's flexibility and scalability, enabling the system to adapt to data retrieval needs in different scenarios.
[0160] Step 405: Generate input information based on the target thinking chain and target retrieval content, and pass it to the large language model to generate target content that meets the content generation request.
[0161] In one embodiment, the target thought chain and target retrieval content are integrated to generate the input information required by the large language model. The input information may include the structure of the thought chain, information about key nodes, the target retrieval content, and a summary of the target retrieval content. Furthermore, the generation of the input information may take into account factors such as the input format and length limitations of the large language model, and the target thought chain and target retrieval content may be processed in terms of format and length.
[0162] Furthermore, the generated input information is passed to a large language model, which leverages its generative capabilities to generate target content that meets the content generation request. This large language model may be based on deep learning algorithms, such as the Transformer architecture, which learns language rules and patterns by training on a large amount of text data, thereby generating high-quality content.
[0163] Figure 4 The process shown is in Figure 1 Based on the process shown, content retrieval is performed based on the target thinking chain to obtain the target retrieval content. Finally, input information is generated according to the target thinking chain and the target retrieval content and passed to the large language model to generate target content that meets the content generation request. This content retrieval method based on the target thinking chain can obtain more comprehensive and detailed auxiliary content. Thus, the large language model can generate target content that not only meets the content generation request but also has depth based on this comprehensive and detailed auxiliary content, which significantly improves the efficiency and quality of content generation.
[0164] Finally, this application also provides the following embodiments:
[0165] If it is determined that there is a field to be determined in the initial thought chain, the target parameter value corresponding to the field to be determined is obtained from the user's data space.
[0166] The user's data space includes, but is not limited to, the following three types of information:
[0167] User account information: This stores a user's basic information, preferences, etc., which may contain potential answers to certain fields that need to be determined. For example, occupation information in a user account may be used to complete industry-related thought chain fields.
[0168] The full context of a user's historical interactions records their recent interactions. By analyzing this context, we can uncover information that the user may have wanted to express but did not explicitly state, thus completing the undetermined fields in their thought process. For example, when a user is continuously discussing a product, the context of their historical interactions may contain descriptions of the product's relevant features. These descriptions can be used to complete the undetermined fields regarding product features in the user's thought process.
[0169] Backend service process retention for a single user interaction: Based on a unique key combining the user ID, request session, and thought chain ID, the backend service process information for a single user interaction is temporarily stored on the server. In this way, the system can completely retain the data stream of a single user interaction, including the original information input by the user, the system's feedback, and rich data such as intermediate calculation results generated during the interaction. This retained data provides solid and rich support for completing the fields to be determined in the thought chain, enabling the system to more accurately and efficiently improve the thought chain when handling complex interaction scenarios, thereby enhancing user experience and interaction quality.
[0170] In some implementations, the user's access to the data space is determined based on the user's authorization.
[0171] This embodiment provides a mechanism for automatically completing fields to be determined without user intervention. By utilizing the rich information in the user's data space, it can intelligently infer the possible values of the field to be determined and complete them into the initial thought chain, thereby improving the completeness and accuracy of the thought chain.
[0172] As an optional implementation, if it is determined that there is a field to be determined in the initial thought chain, the target parameter value corresponding to the field to be determined is obtained from the user's data space. This process is completed automatically by the system without any user intervention.
[0173] As another optional implementation, if it is determined that there are fields to be determined in the initial thought chain, the system first attempts to obtain target parameter values for these fields from the user, using the technical solution provided in the above embodiments. If the user cannot provide target parameter values or cannot provide valid target parameter values, the system then retrieves the target parameter values corresponding to the fields to be determined from the user's data space. This approach respects the user's autonomy while ensuring that the system can still complete the fields to be determined in the thought chain even when the user cannot provide valid information.
[0174] As another optional implementation, if it is determined that there are fields to be determined in the initial thought chain, the target parameter value corresponding to the field to be determined is first obtained from the user's data space, and the user is allowed to confirm it. If the user believes that the obtained target parameter value is inaccurate or does not meet their intention, the user can provide the target parameter value for the field to be determined. This approach ensures the efficiency of the system's automatic completion while also providing users with opportunities for correction and optimization, thereby further improving the accuracy of the thought chain and user satisfaction.
[0175] Figure 5 This is a block diagram illustrating an embodiment of a content generation apparatus provided in this application. Figure 5 As shown, the device includes:
[0176] Initial generation module 51 is used to generate an initial thought chain based on the content generation request in response to the content generation request;
[0177] Supplementary module 52 is used to initiate a parameter acquisition request to the user to obtain the target parameter value provided by the user for the field to be determined when it is determined that there is a field to be determined in the initial thinking chain;
[0178] The target generation module 53 is used to associate the target parameter value with the field to be determined in the initial thinking chain to obtain the target thinking chain;
[0179] The content generation module 54 is used to pass the target thought chain to the large language model and generate target content that conforms to the content generation request.
[0180] In one possible implementation, the initial generation module 51 includes:
[0181] An intent parsing unit is used to parse intent parameters from the content generation request and determine the target intent type based on the intent parameters;
[0182] The task decomposition unit is used to decompose at least two task modules for the target intent type, and to determine at least one execution unit for each task module;
[0183] The generation unit is used to generate an initial thought chain based on the target intent type, the task module, and the execution unit.
[0184] In one possible implementation, the generating unit is specifically used for:
[0185] Using the target intent type as the root node, each task module is attached as a branch node to the root node, and the execution unit is attached as a leaf node to the corresponding branch node, thus generating an initial thought chain with a tree structure.
[0186] In one possible implementation, the supplementary module 52 includes:
[0187] The checking unit is used to determine the first parameter field as a field to be determined for each leaf node in the initial thought chain, if it is determined that the predefined parameter set of the leaf node contains the first parameter field.
[0188] In this case, the parameter value of the parent node mapped by the parameter inheritance mechanism in the first parameter field is empty, or the first parameter field is empty.
[0189] In one possible implementation, the supplementary module 52 includes:
[0190] The interaction unit is used to generate corresponding prompt information based on the field to be determined, and send the prompt information to the user; and obtain the target parameter value provided by the user based on the prompt information through a visual interface.
[0191] In one possible implementation, the device further includes:
[0192] An automatic supplementation module is used to obtain the target parameter value corresponding to the field to be determined from the user's data space when it is determined that there is a field to be determined in the initial thought chain.
[0193] In one possible implementation, the content generation module 54 includes:
[0194] The retrieval unit is used to perform content retrieval based on the target thinking chain to obtain the target retrieval content;
[0195] The generation unit is used to generate input information based on the target thought chain and the target retrieval content, and pass it to the large language model to generate target content that meets the content generation request.
[0196] In one possible implementation, the retrieval unit is specifically used for:
[0197] Determine the dependencies between the task modules in the target thinking chain;
[0198] Based on the aforementioned dependencies, the content retrieval tasks corresponding to each of the aforementioned task modules are executed sequentially to obtain the target retrieval content.
[0199] In one possible implementation, the retrieval unit is specifically used for:
[0200] A second leaf node is determined from the leaf nodes of the task module, wherein the filling type of the second leaf node is a second type;
[0201] Execute the content retrieval task corresponding to the second leaf node to obtain the target retrieval content.
[0202] In one possible implementation, the retrieval unit is specifically used for:
[0203] Determine the content retrieval path corresponding to the second leaf node;
[0204] The content retrieval task is executed according to the content retrieval path corresponding to the second leaf node to obtain the target retrieval content.
[0205] like Figure 6As shown in the figure, this application provides an electronic device, including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0206] Memory 113 is used to store computer programs;
[0207] In one embodiment of this application, when the processor 111 executes a program stored in the memory 113, it implements the content generation method provided in any of the foregoing method embodiments, including:
[0208] In response to a content generation request, an initial thought chain is generated based on the content generation request;
[0209] If it is determined that there is a field to be determined in the initial thought chain, a parameter acquisition request is sent to the user to obtain the target parameter value provided by the user for the field to be determined.
[0210] The target parameter value is associated with the field to be determined in the initial thinking chain to obtain the target thinking chain;
[0211] The target thought chain is passed to the large language model to generate target content that meets the content generation request.
[0212] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the content generation method provided in any of the foregoing method embodiments.
[0213] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0214] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0215] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.
[0216] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A content generation method, characterized in that, The method includes: In response to a content generation request, an initial thought chain is generated based on the content generation request; If it is determined that there is a field to be determined in the initial thought chain, a parameter acquisition request is sent to the user to obtain the target parameter value provided by the user for the field to be determined. The target parameter value is associated with the field to be determined in the initial thinking chain to obtain the target thinking chain; The target thought chain is passed to the large language model to generate target content that meets the content generation request.
2. The method according to claim 1, characterized in that, The generation of the initial thought chain based on the content generation request includes: The intent parameters are parsed from the content generation request, and the target intent type is determined based on the intent parameters; For the target intent type, at least two task modules are decomposed, and for each task module, at least one execution unit is determined; An initial thought chain is generated based on the target intent type, the task module, and the execution unit.
3. The method according to claim 2, characterized in that, The generation of an initial thought chain based on the target intent type, the task module, and the execution unit includes: Using the target intent type as the root node, each task module is attached as a branch node to the root node, and the execution unit is attached as a leaf node to the corresponding branch node, thus generating an initial thought chain with a tree structure.
4. The method according to claim 3, characterized in that, The determination that there are fields to be determined in the initial thought chain includes: For each leaf node in the initial thought chain, if it is determined that the predefined parameter set of the leaf node contains a first parameter field, the first parameter field is determined as the field to be determined. In this case, the parameter value of the parent node mapped by the parameter inheritance mechanism in the first parameter field is empty, or the first parameter field is empty.
5. The method according to claim 1, characterized in that, The step of initiating a parameter retrieval request to the user to obtain the target parameter value provided by the user for the field to be determined includes: Based on the field to be determined, generate the corresponding prompt message and send the prompt message to the user; The target parameter values provided by the user based on the prompt information are obtained through a visual interface.
6. The method according to claim 1, characterized in that, The method further includes: If it is determined that there is a field to be determined in the initial thought chain, the target parameter value corresponding to the field to be determined is obtained from the user's data space.
7. The method according to claim 3, characterized in that, The step of passing the target thought chain to the large language model to generate target content that conforms to the content generation request includes: Based on the target thinking chain, content retrieval is performed to obtain the target retrieval content; Input information is generated based on the target thought chain and the target retrieval content, and then passed to the large language model to generate target content that meets the content generation request.
8. The method according to claim 7, characterized in that, The content retrieval based on the target thought chain to obtain the target retrieval content includes: Determine the dependencies between the task modules in the target thinking chain; Based on the aforementioned dependencies, the content retrieval tasks corresponding to each of the aforementioned task modules are executed sequentially to obtain the target retrieval content.
9. The method according to claim 8, characterized in that, Execute the content retrieval task corresponding to the task module to obtain the target retrieval content, including: A second leaf node is determined from the leaf nodes of the task module, wherein the execution type of the second leaf node is the second type; Execute the content retrieval task corresponding to the second leaf node to obtain the target retrieval content.
10. The method according to claim 9, characterized in that, The step of executing the content retrieval task corresponding to the second leaf node to obtain the target retrieval content includes: Determine the content retrieval path corresponding to the second leaf node; The content retrieval task is executed according to the content retrieval path corresponding to the second leaf node to obtain the target retrieval content.
11. A content generation apparatus, characterized in that, The device includes: An initial generation module is used to generate an initial thought chain based on a content generation request in response to the content generation request. The supplementary module is used to initiate a parameter retrieval request to the user to obtain the target parameter value provided by the user for the field to be determined when it is determined that there is a field to be determined in the initial thinking chain. The target generation module is used to associate the target parameter value with the field to be determined in the initial thinking chain to obtain the target thinking chain; The content generation module is used to pass the target thought chain to the large language model and generate target content that conforms to the content generation request.
12. An electronic device, characterized in that, include: A processor and a memory, the processor being configured to execute a content generation program stored in the memory to implement the content generation method according to any one of claims 1-10.
13. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the content generation method according to any one of claims 1-10.