Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

ĐẠI HỌC QUỐC GIA THÀNH PHỐ HỒ CHÍ MINH

TRƯỜNG ĐẠI HỌC KHOA HỌC TỰ NHIÊN

Xử lý ngôn ngữ tự nhiên ứng dụng


Lab 01: LLM-enhanced low-code applications

Lớp học phần: CSC15008_21CNTThuc


Sinh viên thực hiện: 21127653 - Nguyễn Hoàng Đức Nguyên
Giảng viên hướng dẫn: Ts. Nguyễn Hồng Bửu Long
1. Node-RED
a. Introduction
- Node-RED is a tool based on Node.js designed to create a web
server that allows users to customize functionalities by dragging and
dropping command blocks (nodes) on a web browser. A Node-RED
application operates on the concept of a "flow" of data. A flow
consists of nodes, linked together in the form of Input => Operation
=> Output.

- Node-RED enables users to connect various devices, services, and


applications easily through an intuitive interface. It is commonly used
for building IoT applications, managing data flows, and automating
processes. The user can use the available Node or JavaScript for
programming.
- This is a project using Node-RED to build an IoT website that we
worked on last semester, including programming with various nodes
and a complete UI interface.
b. How can LLM be applied to Node-RED?
1) Define the use case
- Input Processing: Node-RED could receive user input in
natural language through a chat interface. For example, users
can type “Turn on the pump”. The LLM will take the input and
process it by interacting with the nodes.
- Data Analysis: Node-RED can collect data from various IoT
sensors and devices, such as temperature sensors, motion
detectors, or energy meters. Then, it will provide appropriate
recommendations and alerts based on the analysis results.
- Programming Suggestion: Based on the user requirements,
LLM will suggest a set of nodes and flows to achieve the
desired functionality.
2) API Connectivity
- After obtaining the API keys from the LLM provider, we store
them in credential nodes of Node-RED.
- Using HTTP Request node in Node-RED to send requests to
the API of LLM. We have to have the API keys and data to be
sent.
3) Data handling
- The users enter the prompt on the UI screen
- After that, the data will be sent to the LLM's API by HTTP
request node of Node-RED, with the API key entered before.
- The LLM model will handle the input data and send the result to
UI.
4) Testing and iteration
- Firstly, we can test the response time of the LLM model with
the Node-RED UI, allowing us to make appropriate adjustments
accordingly.
- We can test whether the LLM model operates effectively and
provides the best results for the requests. Since Node-RED
includes various functional nodes, finding a suitable node for
the task is essential.
5) The benefits of using LLM for Node-RED
- Assist users in easily locating appropriate nodes for their
required tasks, saving them considerable time in node
discovery, particularly if they are new to using Node-RED.
- Offer coding recommendations to users for nodes requiring
code implementation, such as CSS or JS.
- Provide guidance to users on finding unavailable nodes. Given
that Node-RED encompasses numerous essential nodes that
may not be readily accessible, users may need to install
additional packages to utilize them. Thus, the LLM can direct
users to the necessary nodes within these packages.
- Additionally, there are numerous services integrated with Node-
RED, such as IFTTT for sending notifications to users, or
Firebase and Thingspeak for data storage. The LLM will
suggest to users which service they need to use for their tasks,
enhancing work efficiency by eliminating the need to spend
time searching for these services.
2. Pipedream
a. Introduction
- Pipedream, a sophisticated web application, streamlines the process
of automating workflows in the daily tasks through the use of low-
code techniques. Users can easily create automated workflows
without the need to write code from scratch. By combining pre-built
blocks, users can create complex processes without requiring deep
programming knowledge.
- Pipedream offers a range of connections to popular services such
as Google Sheets, Slack, Gmail, and many more, allowing users to
integrate data and interact between applications flexibly.
b. How can LLM be applied to Pipedream?
1) Define the use case
- Answer frequently asked questions automatically: We can
let the LLM model answer questions sent from email like the
example above. That will save considerable time for the users,
they don’t have to answer common questions by themselve
anymore.
- Create a YouTube Video Title Based on Similar Videos'
Titles: By integrating with YouTube, we can use LLM to
automatically set titles for new videos on our YouTube channel
by using the title of a similar content video as a template. We
won't need to spend time brainstorming video titles anymore.
This video is an example:
https://www.youtube.com/watch?v=IFemFqsyus0.
2) API Connectivity
- After obtaining the API key from the LLM provider, we will
navigate to the account management section of Pipedream.
Then, select "Connect an App" located in the top right corner,
choose the desired LLM model, and proceed to input the API
key.
- Upon successful connection, the icon of the LLM model will
appear in the list of connected apps. As in the example, I will be
using OpenAI's ChatGPT as the LLM model.

3) Data handling
- The data handling flow is the process of the project, the data
will be handled through each step

4) Testing and iteration


- We can directly test each step in the Pipedream workflow
creation process. This allows us to observe the results and
make easy adjustments as needed.
5) The benefits of using LLM for Pipedream
- Many tasks will be automated, helping us save time for other
work.
- Provide guidance for users across multiple fields, helping them
find directions to solve problems.
- Pipedream can integrate with numerous applications, such as
Google Drive. We can save LLM response results to Drive so
they can be accessed later when needed. Alternatively, it can
be used as a compiler for Python or Node.js. Therefore, when
applying LLM, it can assist users in bug fixing and code
guidance.

You might also like