Interactive methods, devices, equipment, media and program products

By injecting business components into the large model interaction system, the problem of limited interaction between the large model interaction system and the business system was solved, achieving cross-system support and streaming rendering, thus improving development efficiency and user experience.

CN119415654BActive Publication Date: 2025-11-14SHANGHAI BILIBILI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411515430.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-11-14
Estimated Expiration
2044-10-28

AI Technical Summary

Technical Problem

Large-scale model interaction systems have limited functionality and are difficult to use effectively, making it hard to interact with business systems. This forces developers to focus on both business logic and model interaction, impacting development efficiency and user experience.

Method used

By injecting business components, interaction with business systems is achieved in the large model interaction system, providing a streaming rendering mode to support the rendering needs of various business systems and reducing the focus of developers.

Benefits of technology

It enables easy support for interaction of all business systems in a large model interaction system, improves development efficiency and user experience, provides a better streaming rendering mode, and adapts to model interfaces that do not implement streaming output.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415654B_ABST
    Figure CN119415654B_ABST
Patent Text Reader

Abstract

This application provides an interaction method, apparatus, device, medium, and program product. One specific embodiment of the interaction method includes: generating a question message based on a question operation; inputting the question message into a large model to obtain streaming response data returned by the large model's interface; converting the streaming response data into text content type and performing streaming rendering using business components in the large model interaction system to generate an answer message corresponding to the question message. This embodiment, by injecting business components, can easily achieve interaction with business systems within the large model interaction system, thereby enabling support for all business systems through a single system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to an interaction method, apparatus, device, medium, and program product. Background Technology

[0002] In recent years, the development of AI (Artificial Intelligence) has been gradually changing people's lives and work. In particular, AIGC (Artificial Intelligence Generated Content) has shone brightly in the advertising creative business. With simple instructions, creative advertising content can be generated, greatly saving manpower and brainpower and significantly improving the efficiency of advertising generation.

[0003] In addition, the company's internal systems have an increasingly strong demand for AI. For example, product personnel need AI to generate creative images and videos, as well as SQL (Structured Query Language) statements for querying data. Data personnel, for instance, hope that AI can generate visually appealing charts. Furthermore, CRM (Customer Relationship Management) systems desire efficient AI customer service. Through AI customer service, invoicing or account opening for customers can be easily presented through dialogue, or specific advertising creatives can be easily approved in the operations backend by asking AI questions, without needing to go through complex operations to reach business components.

[0004] Technically speaking, the core technology of large model input / output lies in the model or algorithm itself; the design and data of the large model determine its level of intelligence. However, for a system that deeply interacts with users, the front-end interaction implementation is also an important component, especially for a system that needs to be deeply coupled with business logic. Summary of the Invention

[0005] This application provides an interactive method, apparatus, device, medium, and program product to address the technical problem of limited functionality and restricted use in large-scale interactive system projects.

[0006] One aspect of this application provides an interaction method, comprising: generating a question message based on a question operation; inputting the question message into a large model to obtain streaming response data returned by the interface of the large model; converting the streaming response data into a text content type, and using business components in the large model interaction system for streaming rendering to generate an answer message corresponding to the question message.

[0007] Another aspect of this application provides an interactive device, comprising: a generation module configured to generate a question message based on a question operation; an input module configured to input the question message into a large model to obtain streaming response data returned by the interface of the large model; and a rendering module configured to convert the streaming response data into a text content type and perform streaming rendering using business components in the large model interactive system to generate an answer message corresponding to the question message.

[0008] In another aspect of this application, an electronic device is provided, the electronic device 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 interaction method as described above.

[0009] In another aspect, this application provides a computer-readable storage medium having computer program instructions stored thereon, which can be executed by a processor to implement the interaction method described above.

[0010] Another aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the interaction method described above.

[0011] The solution provided in this application embodiment easily enables interaction with business systems within a large model interaction system by injecting business components, thereby achieving support for all business systems through a single system. With this system, large model interaction developers do not need to focus on business logic. Similarly, business interaction developers do not need to focus on large model interaction; they only need to organize the relationship between model input and the business components themselves to complete the rendering of business components on the large model interaction. Simultaneously, the system also provides a better streaming rendering mode, enabling front-end streaming rendering simulation for model interfaces that do not implement streaming output, providing a better user experience. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0014] Figure 1A flowchart illustrating an embodiment of the interaction method provided in this application;

[0015] Figure 2 A flowchart illustrating another embodiment of the interaction method provided in this application;

[0016] Figure 3 A flowchart illustrating another embodiment of the interaction method provided in this application;

[0017] Figure 4 Interaction principle diagram of a large-scale interactive system coupled with business logic;

[0018] Figure 5 This is a diagram illustrating a page containing business components.

[0019] Figure 6 A schematic diagram of the structure of an embodiment of the interactive device provided in this application;

[0020] Figure 7 This is a schematic diagram of the structure of a device suitable for implementing the solutions in the embodiments of this application;

[0021] The same or similar reference numerals in the accompanying drawings represent the same or similar parts. Detailed Implementation

[0022] 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.

[0023] In a typical configuration of this application, the terminal and the service network devices each include one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0024] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0025] Computer-readable media include permanent and non-permanent, removable and non-removable media, which can store information by any method or technology. Information can be computer program instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only optical disc (CD-ROM), digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0026] This application provides an interaction method that, by injecting business components, easily enables interaction with business systems within a large model interaction system, thereby achieving support for all business systems through a single system. With this system, large model interaction developers do not need to focus on business logic. Similarly, business interaction developers do not need to focus on large model interaction; they only need to organize the relationship between model input and the business components themselves to complete the rendering of business components on the large model interaction. Simultaneously, the system also provides a better streaming rendering mode, enabling front-end streaming rendering simulation for model interfaces that do not implement streaming output, providing a better user experience.

[0027] In practical scenarios, the entity executing the above method can be a user device, a network device, or a device formed by integrating user devices and network devices through a network, or it can be an application running on the above devices. The user device includes, but is not limited to, various terminal devices such as computers, mobile phones, tablets, smartwatches, and wristbands. The network device includes, but is not limited to, network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets. Here, the cloud consists of a large number of hosts or network servers based on cloud computing, where cloud computing is a type of distributed computing, consisting of a virtual computer composed of a group of loosely coupled computer sets.

[0028] Figure 1 The present application illustrates a processing flow 100 of an embodiment of the interaction method provided in this application, the method comprising at least the following processing steps:

[0029] Step S101: Generate a question message based on the question operation.

[0030] In this embodiment, after the user inputs a question and performs the questioning operation, the execution subject of the interaction method can generate a question message.

[0031] Users can submit their questions to the aforementioned execution entity by entering a question in the input box and clicking the "Ask a Question" button. The execution entity can then generate a question message based on the received question. The question can be a condition or guideline entered by the user to meet their AIGC (AI-Generated Content) generation requirements. Conditions or guidelines can include, but are not limited to, keywords, descriptions, and samples. Content can include, but is not limited to, advertisements, images, videos, SQL statements, and charts.

[0032] A question message can be a data model at the Message level. In large-scale interactive systems, the data model can be based on question-and-answer principles and divided into four levels from bottom to top: TextContent, Text, Message, and Chat.

[0033] TextContent: TextContent is the smallest granularity in question-and-answer processing. Text or images entered by the user when asking a question can all be considered a TextContent. In a large model's streaming response, the text or component description returned in a single response can also be converted into a TextContent. When answering a question, a large model may return several or even hundreds of streaming API responses. All these responses need to be converted into individual TextContent data types within the large model's interaction system. These TextContent data types are then input into the callbacks provided by the large model's interaction system, which then renders these TextContent data types sequentially.

[0034] Text: A complete response from a large model involves data that constitutes a single Text. A question can also be described as a Text. Simply put, a Text is a collection of several TextContents. A Text represents a complete rendering.

[0035] Message: Since a single question can require a user to provide an answer, the collection of Text corresponding to each question is called a Message. On the page, this manifests as the rendering of a single question text, multiple answer texts, or multiple answers to the same question. Of course, a Message may also contain only one Text.

[0036] Chat: A chat window often consists of multiple question-and-answer sessions. In large-scale interactive systems, it is called a Chat.

[0037] Besides managing the specific question-and-answer content, the entire large-scale interactive system sometimes requires configuring multiple Chats, and the data model for managing these multiple Chats is called History. The basic information of a Chat is called a History. At the data level, Chats focus on the specific chat content, while History focuses on the CRUD operations of these Chats. In addition, a ChatState object is used to manage all the data.

[0038] The data model uses Pinia as its state management tool. Pinia | The intuitive store for Vue.js maintains data reactivity. Pinia is the officially recommended state management library for Vue. Based on this, large-scale interactive systems can work well with Vue, using Vue's computed methods to keep the UI (User Interface) responsive as data changes. Simultaneously, developers can configure data to be saved to local storage in real time, reducing data loading time on subsequent accesses. Furthermore, historical data can be fetched from a remote location via functions. Vue is a JavaScript framework for building user interfaces, built on standard HTML (Hypertext Markup Language), CSS (Cascading Style Sheets), and JavaScript, and provides a declarative, component-based programming model to help users develop user interfaces efficiently. `computed` is a computed property in Vue, a cached computation based on dependencies, updated only when its related dependencies change.

[0039] Step S102: Input the query message into the large model and obtain the streaming response data returned by the interface of the large model.

[0040] In this embodiment, the aforementioned execution entity can input a query message into the large model and obtain streaming response data returned by the interface of the large model.

[0041] Large models refer to machine learning models with a large number of parameters and complex computational structures. These models are typically built from deep neural networks and have billions or even hundreds of billions of parameters. The purpose of large models is to improve their expressive and predictive capabilities. Due to algorithmic or hardware limitations, the generation speed of large models is currently slow, often resulting in a continuous output of content, i.e., streaming response data. Each time the interface of a large model returns data, it can be converted into a TextContent-level data model. The streaming response data corresponding to a complete answer is a Text-level data model. The streaming response data corresponding to at least one answer to the same question is a Message-level data model.

[0042] Step S103: Convert the streaming response data into a text content type and use the business components in the large model interaction system for streaming rendering to generate the answer message corresponding to the question message.

[0043] In this embodiment, the aforementioned execution entity can convert streaming response data into text content type and use the business components in the large model interaction system to perform streaming rendering to generate answer messages corresponding to the question messages.

[0044] Due to algorithmic or hardware limitations, the generation speed of large models is currently slow, often resulting in a continuous output of content, i.e., streaming response data. The data returned by the large model's interface each time is the latest data in the streaming response, which can be converted to a TextContent type. Business components in the large model interaction system can then perform streaming rendering on this TextContent data.

[0045] To accommodate the output of large-scale models in web page interactions, business components within the large-scale model interaction system can render continuously added TextContent type data, i.e., streaming rendering, based on the existing response data of the large-scale model. This continues until the large-scale model completes its response, generating an answer message corresponding to the question message, thereby reducing user wait time and improving the user experience. The answer message can be a response to the question in the question message, representing a message-level data model.

[0046] A large-scale interactive system refers to a system that displays the output of a large model on a webpage, allowing users to interact with it. Most business operations are typically presented externally as web systems, which appear to users as various webpages. Business components are the individual functional modules on these webpages. In code, business components can be represented as a combination of code files.

[0047] By using the component injection mechanism, any basic or business component can be injected into the large model interaction system. Simply configure the TextContent of the response to the question-and-answer session to the corresponding type. Coupling business components with the large model interaction system through injection allows the large model interaction system to call the functionality of those business components.

[0048] There are two ways to inject a basic component, business component, or any imported component into a large model interaction system:

[0049] Firstly, the component is injected during project initialization, for example, as an option of initLlmUi passed to app.use during project initialization.

[0050] Secondly, the component can be injected before rendering begins. For example, before rendering begins, it can be injected directly using the llm-ui API: registerRenderKey(customRenderKey).

[0051] After injecting business components into the large model interaction system, it can be agreed with the large model input interface developers that when the business component needs to be rendered, a certain type marker should be given to the front end, or the corresponding TextContent can be directly output. Alternatively, the front end can first convert it to TextContent and then call the callback function of the onAsk event. In this way, the injected business component will appear in the rendering of the answer.

[0052] This application provides an interaction method that, by injecting business components, easily enables interaction with business systems within a large model interaction system, thereby achieving support for all business systems through a single system. With this system, large model interaction developers do not need to focus on business logic. Similarly, business interaction developers do not need to focus on large model interaction; they only need to organize the relationship between model input and the business components themselves to complete the rendering of business components on the large model interaction. Simultaneously, the system also provides a better streaming rendering mode, enabling front-end streaming rendering simulation for model interfaces that do not implement streaming output, providing a better user experience.

[0053] Figure 2 The present application illustrates a processing flow 200 of another embodiment of the interaction method provided herein, the method comprising at least the following processing steps:

[0054] Step S201: Generate a question message based on the question operation.

[0055] In this embodiment, after the user inputs a question and performs the questioning operation, the execution subject of the interaction method can generate a question message.

[0056] Users can submit their questions to the aforementioned execution entity by entering a question in the input box and clicking the "Ask a Question" button. The execution entity can then generate a question message based on the received question. The question can be a condition or guideline entered by the user to meet their AIGC (AI-Generated Content) generation requirements. Conditions or guidelines can include, but are not limited to, keywords, descriptions, and samples. Content can include, but is not limited to, advertisements, images, videos, SQL statements, and charts.

[0057] A question message can be a data model at the Message level. In large-scale interactive systems, the data model can be based on question-and-answer principles and divided into four levels from bottom to top: TextContent, Text, Message, and Chat.

[0058] TextContent: TextContent is the smallest granularity in question-and-answer processing. Text or images entered by the user when asking a question can all be considered a TextContent. In a large model's streaming response, the text or component description returned in a single response can also be converted into a TextContent. When answering a question, a large model may return several or even hundreds of streaming API responses. All these responses need to be converted into individual TextContent data types within the large model's interaction system. These TextContent data types are then input into the callbacks provided by the large model's interaction system, which then renders these TextContent data types sequentially.

[0059] Text: A complete response from a large model involves data that constitutes a single Text. A question can also be described as a Text. Simply put, a Text is a collection of several TextContents. A Text represents a complete rendering.

[0060] Message: Since a single question may require a user to provide an answer, the collection of Text corresponding to each question is called a Message. On the page, this manifests as the rendering of a single question text, multiple answer texts, or multiple answers to the same question. Of course, a Message may also contain only one Text.

[0061] Chat: A chat window often consists of multiple question-and-answer sessions. In large-scale interactive systems, it is called a Chat.

[0062] Besides managing the specific question-and-answer content, the entire large-scale interactive system sometimes requires configuring multiple Chats, and the data model for managing these multiple Chats is called History. The basic information of a Chat is called a History. At the data level, Chats focus on the specific chat content, while History focuses on the CRUD operations of these Chats. In addition, a ChatState object is used to manage all the data.

[0063] The data model uses Pinia as its state management tool. Pinia | The intuitive store for Vue.js maintains data reactivity. Pinia is the officially recommended state management library for Vue. Based on this, large-scale interactive systems can work well with Vue, using Vue's computed methods to keep the UI responsive as data changes. Simultaneously, developers can configure data to be saved to local storage in real time, reducing data loading time on subsequent visits. Furthermore, historical data can be fetched from a remote location via functions. Vue is a JavaScript framework for building user interfaces, built on standard HTML, CSS, and JavaScript, and provides a declarative, component-based programming model to help users develop user interfaces efficiently. `computed` is a Vue computed property that caches computations based on dependencies, updating only when its related dependencies change.

[0064] Step S202: Create a response message and create text within the response message.

[0065] In this embodiment, the aforementioned execution entity can create a response message and create text within the response message.

[0066] It should be noted that response messages and texts are created empty. A response message can be an answer to the question in the question message; it is a Message-level data model. Text can be the data involved in a complete response within a larger model; it is a Text-level data model. A response message can include at least one text.

[0067] Step S203: Input the query message into the large model and obtain the streaming response data returned by the interface of the large model.

[0068] In this embodiment, the aforementioned execution entity can input a query message into the large model and obtain streaming response data returned by the interface of the large model.

[0069] Large models refer to machine learning models with a large number of parameters and complex computational structures. These models are typically built from deep neural networks and have billions or even hundreds of billions of parameters. The purpose of large models is to improve their expressive and predictive capabilities. Due to algorithmic or hardware limitations, the generation speed of large models is currently slow, often resulting in a continuous output of content, i.e., streaming response data. Each time the interface of a large model returns data, it can be converted into a TextContent-level data model. The streaming response data corresponding to a complete answer is a Text-level data model. The streaming response data corresponding to at least one answer to the same question is a Message-level data model.

[0070] Step S204: Obtain the latest data from the streaming response data returned by the interface each time, and convert it into text content type.

[0071] In this embodiment, the aforementioned execution entity can obtain the latest data from the streaming response data returned by the interface each time and convert it into text content type.

[0072] Due to algorithmic or hardware limitations, the generation speed of large models is currently slow, often resulting in a continuous output of content, i.e., streaming response data. The data returned by the interface of a large model each time is the latest data in the streaming response, which can be converted into a TextContent type. Each latest data returned by the interface can be converted into a data model at the TextContent level.

[0073] Step S205: Pass the latest data of the text content type as a parameter to the callback function, and execute the callback function to obtain the processed data.

[0074] In this embodiment, the aforementioned execution entity can pass the latest data of the text content type as a parameter to the callback function, and execute the callback function to obtain the processed data.

[0075] A callback function can be used to process response data. The large model returns streaming response data via an API, with each return being the latest data in the streaming response. This latest data is converted to a TextContent type and then passed as a parameter to the callback function. Executing the callback function allows for simple processing of the latest data, yielding the processed data.

[0076] Step S206: Add the processed data to the text file.

[0077] In this embodiment, the aforementioned execution entity can add the processed data to the text.

[0078] Step S207: Stream the newly added processing data in the text using the large model stream component until the large model response ends, and generate the answer message corresponding to the question message.

[0079] In this embodiment, the aforementioned execution entity can use the large model stream component to stream the newly added processing data in the text until the large model response ends, generating the answer message corresponding to the question message.

[0080] Due to algorithmic or hardware limitations, the generation speed of large models is currently slow, often resulting in a continuous output of content, i.e., streaming response data. The data returned by the large model's interface each time is the latest data in the streaming response, which can be converted to a TextContent type. Business components in the large model interaction system can then perform streaming rendering on this TextContent data.

[0081] In web page interaction, to accommodate the output of large models, the LlmFlow component can be used to render continuously added TextContent type data based on the existing response data of the large model, i.e., streaming rendering. This continues until the large model response is complete, generating the corresponding answer message for the question message, thereby reducing user waiting time and improving the user experience.

[0082] A large-model interactive system refers to a system that displays the output of a large model on a webpage, allowing users to interact with it. The large-model flow component LlmFlow is a business component. Most business operations are typically presented externally as web systems, which appear to users as various webpages. Business components are the modules with specific functions on these webpages. In code, a business component can be represented as a combination of code files.

[0083] By using the component injection mechanism, any basic or business component can be injected into the large model interaction system. Simply configure the TextContent of the response to the question-and-answer session to the corresponding type. Coupling business components with the large model interaction system through injection allows the large model interaction system to call the functionality of those business components.

[0084] There are two ways to inject a basic component, business component, or any imported component into a large model interaction system:

[0085] Firstly, the component is injected during project initialization, for example, as an option of initLlmUi passed to app.use during project initialization.

[0086] Secondly, the component can be injected before rendering begins. For example, before rendering begins, it can be injected directly using the llm-ui API: registerRenderKey(customRenderKey).

[0087] After injecting business components into the large model interaction system, it can be agreed with the large model input interface developers that when the business component needs to be rendered, a certain type marker should be given to the front end, or the corresponding TextContent can be directly output. Alternatively, the front end can first convert it to TextContent and then call the callback function of the onAsk event. In this way, the injected business component will appear in the rendering of the answer.

[0088] This application provides an interaction method that, by injecting business components, easily enables interaction with business systems within a large model interaction system, thereby achieving support for all business systems through a single system. With this system, large model interaction developers do not need to focus on business logic. Similarly, business interaction developers do not need to focus on large model interaction; they only need to organize the relationship between model input and the business components themselves to complete the rendering of business components on the large model interaction. Simultaneously, the system also provides a better streaming rendering mode, enabling front-end streaming rendering simulation for model interfaces that do not implement streaming output, providing a better user experience.

[0089] Figure 3 The following is a processing flow 300 of another embodiment of the interaction method provided in this application, the method including at least the following processing steps:

[0090] Step S301: Generate a question message based on the question operation.

[0091] In this embodiment, after the user inputs a question and performs the questioning operation, the execution subject of the interaction method can generate a question message.

[0092] Users can submit their questions to the aforementioned execution entity by entering a question in the input box and clicking the "Ask a Question" button. The execution entity can then generate a question message based on the received question. The question can be a condition or guideline entered by the user to meet their AIGC (AI-Generated Content) generation requirements. Conditions or guidelines can include, but are not limited to, keywords, descriptions, and samples. Content can include, but is not limited to, advertisements, images, videos, SQL statements, and charts.

[0093] A question message can be a data model at the Message level. In large-scale interactive systems, the data model can be based on question-and-answer principles and divided into four levels from bottom to top: TextContent, Text, Message, and Chat.

[0094] TextContent: TextContent is the smallest granularity in question-and-answer processing. Text or images entered by the user when asking a question can all be considered a TextContent. In a large model's streaming response, the text or component description returned in a single response can also be converted into a TextContent. When answering a question, a large model may return several or even hundreds of streaming API responses. All these responses need to be converted into individual TextContent data types within the large model's interaction system. These TextContent data types are then input into the callbacks provided by the large model's interaction system, which then renders these TextContent data types sequentially.

[0095] Text: A complete response from a large model involves data that constitutes a single Text. A question can also be described as a Text. Simply put, a Text is a collection of several TextContents. A Text represents a complete rendering.

[0096] Message: Since a single question may require a user to provide an answer, the collection of Text corresponding to each question is called a Message. On the page, this manifests as the rendering of a single question text, multiple answer texts, or multiple answers to the same question. Of course, a Message may also contain only one Text.

[0097] Chat: A chat window often consists of multiple question-and-answer sessions. In large-scale interactive systems, it is called a Chat.

[0098] Besides managing the specific question-and-answer content, the entire large-scale interactive system sometimes requires configuring multiple Chats, and the data model for managing these multiple Chats is called History. The basic information of a Chat is called a History. At the data level, Chats focus on the specific chat content, while History focuses on the CRUD operations of these Chats. In addition, a ChatState object is used to manage all the data.

[0099] The data model uses Pinia as its state management tool. Pinia | The intuitive store for Vue.js maintains data reactivity. Pinia is the officially recommended state management library for Vue. Based on this, large-scale interactive systems can work well with Vue, using Vue's computed methods to keep the UI responsive as data changes. Simultaneously, developers can configure data to be saved to local storage in real time, reducing data loading time on subsequent visits. Furthermore, historical data can be fetched from a remote location via functions. Vue is a JavaScript framework for building user interfaces, built on standard HTML, CSS, and JavaScript, and provides a declarative, component-based programming model to help users develop user interfaces efficiently. `computed` is a Vue computed property that caches computations based on dependencies, updating only when its related dependencies change.

[0100] Step S302: Create a response message and create text within the response message.

[0101] In this embodiment, the aforementioned execution entity can create a response message and create text within the response message.

[0102] It should be noted that response messages and texts are created empty. A response message can be an answer to the question in the question message; it is a Message-level data model. Text can be the data involved in a complete response within a larger model; it is a Text-level data model. A response message can include at least one text.

[0103] Step S303: Trigger the onAsk event through the chat component.

[0104] In this embodiment, the aforementioned executing entity can trigger the onAsk event through the chat component.

[0105] When creating a response message, the Chat component can raise an onAsk event. The onAsk event is a commonly used strategy event, invoked when the ask price changes. The parameters of the onAsk event can include the question asked by the user and a callback function for processing the response data.

[0106] Step S304: Input the query message into the large model and obtain the streaming response data returned by the interface of the large model.

[0107] In this embodiment, the aforementioned execution entity can input a query message into the large model and obtain streaming response data returned by the interface of the large model.

[0108] Large models refer to machine learning models with a large number of parameters and complex computational structures. These models are typically built from deep neural networks and have billions or even hundreds of billions of parameters. The purpose of large models is to improve their expressive and predictive capabilities. Due to algorithmic or hardware limitations, the generation speed of large models is currently slow, often resulting in a continuous output of content, i.e., streaming response data. Each time the interface of a large model returns data, it can be converted into a TextContent-level data model. The streaming response data corresponding to a complete answer is a Text-level data model. The streaming response data corresponding to at least one answer to the same question is a Message-level data model.

[0109] Step S305: Obtain the latest data from the streaming response data returned by the interface each time, and convert it into text content type.

[0110] In this embodiment, the aforementioned execution entity can obtain the latest data from the streaming response data returned by the interface each time and convert it into text content type.

[0111] Due to algorithmic or hardware limitations, the generation speed of large models is currently slow, often resulting in a continuous output of content, i.e., streaming response data. The data returned by the interface of a large model each time is the latest data in the streaming response, which can be converted into a TextContent type. Each latest data returned by the interface can be converted into a data model at the TextContent level.

[0112] Step S306: Pass the latest data of the text content type as a parameter to the callback function, and execute the callback function to obtain the processed data.

[0113] In this embodiment, the aforementioned execution entity can pass the latest data of the text content type as a parameter to the callback function, and execute the callback function to obtain the processed data.

[0114] The callback function can be the `callback` parameter in the `onAsk` event, used to process the response data. The large model returns streaming response data through an API, with each return being the latest data in the streaming response. This latest data is converted to a `TextContent` type and then passed as a parameter to the `callback` function. Executing the `callback` function allows for simple processing of the latest data, yielding the processed data.

[0115] Step S307: Add the processed data to the text file.

[0116] In this embodiment, the aforementioned execution entity can add the processed data to the text.

[0117] Step S308: In response to the large model stream component detecting text changes, the large model rendering component continuously analyzes the newly added processing data in the text and splits it into rendering arrays.

[0118] In this embodiment, in response to the large model stream component detecting text changes, the aforementioned execution entity can use the large model rendering component to continuously analyze the newly added processing data in the text and split it into rendering arrays.

[0119] The large model flow component LlmFlow can listen for text changes using computed methods. When LlmFlow detects a text change, it can process the newly added data in the text using the processContent of the large model rendering component llmRender. The llmRender component stores the rendering components registered by the application. processContent can continuously analyze the text, breaking it down into rendering arrays of type RenderKey. Each rendering array can include the rendering method to be used and the rendering data. The rendering method can be either using a Markdown rendering component or using a registered component.

[0120] Step S309: Stream the rendering data using the rendering method until the large model responds, and generate the answer message corresponding to the question message.

[0121] In this embodiment, the aforementioned execution entity can use a rendering method to stream the rendering data until the large model response ends, generating an answer message corresponding to the question message.

[0122] By default, a typewriter effect can be streamed using a Markdown rendering component. Furthermore, during continuous analysis, if the key of a registered component is read, the props for handling the response can be passed to the rendering component. The rendering data in this part of the rendering array can be rendered using the registered component. It should be noted that the registered component must provide an `onFinish` event. The `onFinish` event represents the callback when the commit is made.

[0123] In some embodiments, the large model flow component LlmFlow can provide a reactive array of render components, `renderComponents`. The render data `renderData` in the render array processed by the large model render component `llmRender` is sequentially added to the render component array `renderComponents`. The render component array `renderComponents` is rendered internally by a `for` loop within the large model flow component LlmFlow. If the rendering type is markdown, the large model hypertext markup language component `LlmHtml` can be used to render the corresponding render data in the render component array. After the large model hypertext markup language component `LlmHtml` finishes rendering, it internally raises an `onFinish` event (custom registered components do not need to raise an `onFinish` event). After the component raises the `onFinish` event, it retrieves the next render data `renderData` from the render array and adds it to the render component array `renderComponents`, then renders it again. In this way, the content is rendered sequentially within the large model flow component `LlmFlow`, achieving a streaming responsive effect. After the large model response is complete, the `isDone` parameter can be passed to the callback function to end the execution process of the component and data functions.

[0124] Chat component (Chat), large model flow component (LlmFlow), large model rendering component (llmRender), rendering component (markdown), registration component, large model hypertext markup language component (LlmHtml), etc., can all be injected into the large model interaction system. Through the component injection mechanism, any basic or business component can be injected into the large model interaction system; simply configure the TextContent of the response to the corresponding type when answering questions. Coupling business components with the large model interaction system through injection allows the large model interaction system to call the functionality of business components.

[0125] There are two ways to inject a basic component, business component, or any imported component into a large model interaction system:

[0126] Firstly, the component is injected during project initialization, for example, as an option of initLlmUi passed to app.use during project initialization.

[0127] Secondly, the component can be injected before rendering begins. For example, before rendering begins, it can be injected directly using the llm-ui API: registerRenderKey(customRenderKey).

[0128] After injecting business components into the large model interaction system, it can be agreed with the large model input interface developers that when the business component needs to be rendered, a certain type marker should be given to the front end, or the corresponding TextContent can be directly output. Alternatively, the front end can first convert it to TextContent and then call the callback function of the onAsk event. In this way, the injected business component will appear in the rendering of the answer.

[0129] This application provides an interaction method that, by injecting business components, easily enables interaction with business systems within a large model interaction system, thereby achieving support for all business systems through a single system. With this system, large model interaction developers do not need to focus on business logic. Similarly, business interaction developers do not need to focus on large model interaction; they only need to organize the relationship between model input and the business components themselves to complete the rendering of business components on the large model interaction. Simultaneously, the system also provides a better streaming rendering mode, enabling front-end streaming rendering simulation for model interfaces that do not implement streaming output, providing a better user experience.

[0130] Figure 4 The interaction principle diagram of a large-scale interactive system coupled with business logic is shown below:

[0131] The first step is to convert the output data 401 of the large model to the TextContent type data 402.

[0132] The second step is to transmit the TextContent type data 402 over the network.

[0133] The third step is to destructure the TextContent type data 402 to obtain the business component and data 403.

[0134] Fourth, for the large model interaction system 404 coupled with business components, the business components and data 403 are rendered on demand by calling back the relevant API (Application Programming Interface), resulting in a page 405 containing the business components (see reference). Figure 5 ).

[0135] Some business components can be injected into the large model interaction system using the functions provided in this application.

[0136] Figure 6 A schematic diagram of the structure of an embodiment of the interactive device provided in this application is shown. This device embodiment is similar to... Figure 1 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0137] like Figure 6As shown, the interactive device 600 in this embodiment may include: a generation module 601, an input module 602, and a rendering module 603. The generation module 601 is configured to generate a question message based on a question operation; the input module 602 is configured to input the question message into a large model to obtain streaming response data returned by the large model's interface; the rendering module 603 is configured to convert the streaming response data into text content and perform streaming rendering using business components in the large model's interactive system to generate an answer message corresponding to the question message. The business components are injected into the large model's interactive system through a component injection mechanism.

[0138] In this embodiment, the specific processing of the generation module 601, the input module 602, and the rendering module 603 in the interactive device 600, and the resulting technical effects, can be found by referring to [reference needed]. Figure 1 The relevant descriptions of steps S101-S103 in the corresponding embodiments will not be repeated here.

[0139] In some optional implementations of this embodiment, the interaction device 600 further includes: a creation module configured to create a response message and create text in the response message, wherein the content of the response message and the text is empty when they are created; and a rendering module 603 including: a conversion submodule configured to obtain the latest data from the streaming response data returned by the interface each time and convert it into a text content type; an execution submodule configured to pass the latest data of the text content type as a parameter to a callback function and execute the callback function to obtain processed data; an addition submodule configured to add the processed data to the text; and a rendering submodule configured to use a large model stream component to stream render the newly added processed data in the text until the large model response ends.

[0140] In some optional implementations of this embodiment, the interactive device 600 further includes a triggering module configured to trigger an onAsk event through a chat component, wherein the parameters of the onAsk event include the question asked and a callback function.

[0141] In some optional implementations of this embodiment, the rendering submodule includes: a splitting unit, configured to respond to the large model stream component listening for text changes, continuously analyze the newly added processed data in the text using the large model rendering component, and split it into a rendering array, wherein the rendering array includes rendering methods and rendering data; and a first rendering unit, configured to perform streaming rendering of the rendering data using the rendering methods.

[0142] In some optional implementations of this embodiment, the rendering submodule further includes: a second rendering unit, configured to render the corresponding rendering data using the registered component if a key of the registered component is read during continuous analysis.

[0143] In some optional implementations of this embodiment, the first rendering unit is further configured to: add rendering data sequentially to the rendering component array of the large model flow component; and render the rendering data in the rendering component array sequentially.

[0144] In some optional implementations of this embodiment, the first rendering unit is further configured to: if the rendering type is a markup language type, use the large model hypertext markup language component to render the corresponding rendering data in the rendering component array.

[0145] In some optional implementations of this embodiment, the business component is injected during project initialization or before rendering begins.

[0146] Based on the same inventive concept, this application also provides an electronic device. The method corresponding to the electronic device can be the interaction method in the foregoing embodiments, and its problem-solving principle is similar to that method. The electronic device provided in this application 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 to enable the at least one processor to execute the methods and / or technical solutions of the foregoing embodiments of this application.

[0147] The electronic device can be a user device, or a device formed by integrating user devices and network devices through a network, or it can be an application running on the aforementioned devices. The user device includes, but is not limited to, various terminal devices such as computers, mobile phones, tablets, smartwatches, and wristbands. The network device includes, but is not limited to, network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets, and can be used to implement some processing functions when setting an alarm clock. Here, the cloud consists of a large number of hosts or network servers based on cloud computing. Cloud computing is a type of distributed computing, consisting of a virtual computer composed of a group of loosely coupled computer sets.

[0148] Figure 7The diagram illustrates the structure of an apparatus suitable for implementing the methods and / or technical solutions in the embodiments of this application. The apparatus 700 includes a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes based on a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage portion 708 into a Random Access Memory (RAM) 703. The RAM 703 also stores various programs and data required for system operation. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An Input / Output (I / O) interface 705 is also connected to the bus 704.

[0149] The following components are connected to I / O interface 705: an input section 706 including a keyboard, mouse, touchscreen, microphone, infrared sensor, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), LED display, OLED display, etc., and speakers, etc.; a storage section 708 including one or more computer-readable media such as hard disk, optical disk, magnetic disk, semiconductor memory, etc.; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet.

[0150] In particular, the methods and / or embodiments in this application can be implemented as computer software programs. For example, the embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. When the computer program is executed by a central processing unit (CPU) 701, it performs the functions defined in the methods of this application.

[0151] Another embodiment of this application provides a computer-readable storage medium having computer program instructions stored thereon, which can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of this application described above.

[0152] Specifically, this embodiment may employ any combination of one or more computer-readable media. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device.

[0153] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including—but not limited to—electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0154] The program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0155] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

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

[0157] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0158] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or page components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.

[0159] 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 units can be selected to achieve the purpose of this embodiment according to actual needs.

[0160] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.

[0161] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0162] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

[0163] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a device claim may also be implemented by a single unit or device through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any specific order.

Claims

1. An interaction method, comprising: Based on the questioning action, a question message is generated; Create an answer message and create text within the answer message, wherein the answer message and the text are empty when created; The query message is input into the large model to obtain the streaming response data returned by the interface of the large model; The streaming response data is converted into text content type and streamed using business components in the large model interaction system to generate the answer message corresponding to the question message. The business components are injected into the large model interaction system through the component injection mechanism. The step of converting the streaming response data into text content and performing streaming rendering using business components in the large model interaction system to generate the answer message corresponding to the question message includes: The latest data is obtained from the streaming response data returned by the interface each time, and converted into the text content type; The latest data of the text content type is passed as a parameter to the callback function, and the callback function is executed to obtain the processed data; Add the processed data to the text; The newly added processed data in the text is rendered in a streaming manner using the large model streaming component until the large model response ends; The process of using a large model streaming component to stream newly added processed data in the text includes: In response to the large model stream component detecting changes in the text, the large model rendering component continuously analyzes the newly added processed data in the text and splits it into a rendering array, which includes rendering methods and rendering data. The rendering method described above is used to perform streaming rendering of the rendering data.

2. The method according to claim 1, wherein, The method further includes: The onAsk event is triggered by the chat component, where the parameters of the onAsk event include the question to be asked and the callback function.

3. The method according to claim 1, wherein, The method of using a large model stream component to perform streaming rendering of the newly added processed data in the text also includes: If a key of the registered component is read during the continuous analysis, the corresponding rendering data is rendered using the registered component.

4. The method according to claim 3, wherein, The step of using the rendering method to perform streaming rendering of the rendering data includes: The rendering data is sequentially added to the rendering component array of the large model flow component; The rendering data in the rendering component array is rendered sequentially.

5. The method according to claim 4, wherein, The step of rendering the rendering data in the rendering component array sequentially includes: If the rendering type is markup language, the large model hypertext markup language component is used to render the corresponding rendering data in the rendering component array.

6. The method according to any one of claims 1-5, wherein, The business components are injected during project initialization or before rendering begins.

7. An interactive device, comprising: The generation module is configured to generate question messages based on the questioning operation; A creation module is configured to create an answer message and text within the answer message, wherein the answer message and the text are empty when created. The input module is configured to input the query message into the large model and obtain the streaming response data returned by the interface of the large model; The rendering module is configured to convert the streaming response data into a text content type and perform streaming rendering using business components in the large model interaction system to generate an answer message corresponding to the question message. The business components are injected into the large model interaction system through a component injection mechanism. The rendering module includes: The conversion submodule is configured to obtain the latest data from the streaming response data returned by the interface each time, and convert it into the text content type; The execution submodule is configured to pass the latest data of the text content type as a parameter to the callback function, and execute the callback function to obtain the processed data; A new submodule is added, configured to add the processed data to the text. The rendering submodule is configured to use the large model streaming component to stream the newly added processed data in the text until the large model response ends. The rendering submodule includes: The splitting unit is configured to respond to the large model flow component listening for changes in the text, and to continuously analyze the newly added processed data in the text using the large model rendering component, splitting it into a rendering array, the rendering array including rendering methods and rendering data; The first rendering unit is configured to perform streaming rendering of the rendering data using the rendering method.

8. An electronic device, the 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-6.

9. A computer-readable medium having stored thereon computer program instructions that can be executed by a processor to implement the method as described in any one of claims 1-6.

10. A computer program product comprising a computer program that, when executed by a processor, implements the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • TS processing method friendly to artificial intelligence algorithm and application thereof

    CN108712677A

  • Man-machine interaction method, device and equipment based on large model, medium and product

    CN118656476A