Asynchronous Task for execute python script

Hi,
I am trying to make a chat system using LLM model through python, and it did work but there is a problem is that while the engine waiting response from the LLM server and game will frozen untill they get the response from the server. I’m try to make it become a asynchronous task so it won’t block the game thread anymore. But I’m new in this kind of stuffs and not sure is this possible or not. Can someone tell me if there are any ways to do that kind of things plz?



And this is the Python script and the widget blueprint I used to create the chat system.