How do I implement tag auto-completion?

As a beginner, how should I implement tag auto-completion similar to a1111-sd-webui-tagcomplete?

Here is an example of what I tried:

This is my directory:

test
├── main.py
├── tagAutocomplete.js
└── tags
    ├── config.json
    └──danbooru.csv

This is main.py:

import gradio as gr

with open("tagAutocomplete.js") as file:
    js = file.read()

with gr.Blocks(js=js) as demo:
    positive_input = gr.TextArea(label="txt2img_prompt")


demo.launch()

This is the early js file:

raw.githubusercontent.com/DominikDoom/a1111-sd-webui-tagcomplete/4047e2da3d7df25a5486f857a3ab97dcff168351/tagAutocomplete.js

I don’t know the front-end and js, but Gradio brings me infinite possibilities. If there is a simple way to achieve this function, please tell me.