12.01.2 Using AI nodes to assist with writing a blog article
note
Link to the scenario template
As an example of using AI nodes, let's create a scenario, during the execution of which we will analyze the proposed short text and form a blog article according to the given rules.
For convenience of using such a scenario we can create a table AirTable with columns:
- Summary - for the user to enter the idea and brief content of the article;
- Detailed content - for filling in the result of the scenario execution;
- Date - to record the date of text generation.
To generate the text of the article we will use the node mistral-7b-instruct-v0.1-awq With History (preview) from the group AI: Text Generation.
Several nodes must be added for the scenario to work successfully:
- (1) A New Records node to run a scenario when a new row is added to the LNBlog table. One of the output parameters of the node is the Summary attribute of the added row containing the article idea. Authorization is required for correct operation of the node;
- (2) Node mistral-7b-instruct-v0.1-awq With History (preview) to generate the article text. In the Dialogue History field you need to add instructions in JSON format that will be used by AI when generating the article text. The User Prompt field should be filled with the value of the Summary attribute of the Summary row of the LNBlog table, which is provided by the New Records node;
[{
"role": "system",
"content": "Determine the topic of the article. Carefully analyze the query that will serve as the basis for the article. Identify key features and benefits that should be emphasized. Create text that allows Latenode users to better understand why they should be interested in this feature. The article should be structured into sections. An attention-grabbing headline and opening paragraph that will interest the reader and encourage them to read further is essential. The query provided should be the starting point for more extended paragraphs. The article should contain use cases and interesting facts, as well as opportunities to automate business processes. The article should have a bottom line, you need to highlight the main benefits of using the platform and give readers a clear idea of its value. After creating the text, you should check it for grammatical errors, logical consistency and clarity of presentation."
}]
- (3) Update record node to update the Detailed content attribute of a row in the LNBlog table with the value generated in the mistral-7b-instruct-v0.1-awq With History (preview) node. The current time and date value can be entered as the date of text generation using the
now
operator. Authorization is required for correct operation of the node;
- (4) Webhook response node to generate a response to the scenario execution.
The result of the scenario execution is the "Ok" response of the Webhook response node and the AI generated text of the article in the LNBlog table: