Query doesn't update according to new input

Hi there,

I have created a text input box, a text box and a button.

What I want to do is:

  1. user input a word in text input box;
  2. when the button (Submit) is clicked, it will run an openai resources (POST Chat/Completion) to return a message.
  3. the message will be updated in text box.

I hv got no problem in calling the OpenAI api. When I run the script, it works ok.

But when I change the input text to another word, the message doesn't update accordingly.

Any idea? Or it is something related to the temporary state?

Thanks in advance!

@Kit_Sum_Ng Welcome to the forum!
Can you share a screenshot and/or code where you are having an issue?

1 Like

Hi @ScottR , thanks for reaching out. I think I sorted it out.

Originally, I directly run a query using the OpenAI API. And I think it hold the previous states each time.

Finally, I extract that query in to the query library and set the variable to the textinput.value.

Then it solved my problem.