OpenAI "Complete Chat" action duplicate generation

I have a table consisting of user-specific columns that I use as a form to input values. Once I fill them, these values are sent to the prompt. The result is then added to the history table, and the values in the first table are cleared.

However, I am facing an issue where the cleared values from the table unexpectedly reappear in the prompt after generating a result after I insert new ones. (I don’t see them in the table but the result is identically the same). This issue persists even when changing the output language value in the user’s table that is not user-specific, which fails to apply on the first attempt. (UPD: output language works at the first attempt now but user-specific values still appear from the previous generation)

Essentially, every initial attempt to generate new content results in a duplicate of the previous generation. This problem corrects itself on the second attempt but consistently reoccurs with each new generation attempt, leading to two identical copies of the generation each time.

What could be causing this issue?

Did you ever find a solution to this @Bio_Sam? I found this post when searching for a solution to the same problem. Or at least I think it’s the same problem. My history of user input looks correct when I inspect in debugger, but every other attempt to submit a new response elicits what is clearly another reply to the first question.

So I’ll ask:

  1. How are you?
  2. What’s your name?

And I’ll get a proper response to the first question, then another response to the first question when submitting the second question, then a response to the second question when submitting the third.

I’ve validated that I’m consistently sending the right user input string as the message each time, it just seems to ignore every other input and duplicate the previously received one.

And if I inspect the history, it looks like the correct sequence.

Are there any JSON columns in play here? Specifically, JSON Object or JSON Template.

Not for me. I’m just appending to a simple string array. I’m thinking it is an issue with the openai api requests returning dups, but I might be misunderstanding the OP. To be clear, I know nothing about Glide or the table aspects of what Bio_Sam is donig, I just pulled this up in a google search while trying to sort out why the openai api is giving me weird dup responses.

What programming language are you using to talk to OpenAI’s API? I have seen this on the OpenAI forum like 2-3 times, maybe sharing your code would help.

1 Like

I figured a workaround to force the data to refresh. You have to be creative and set a condition on the screen which is sourced from the response.

What I did is pass the users input through a SHA-256 column to give me a unique ID. Then I told the AI action to return that unique ID in its response.

Finally I put a visibility condition on the submit button which is only visible when the SHA-256 column is equal to the unique ID in the response from the AI or is empty.

1 Like

I’m using C# in Unity, but I think Eric just gave me a solution to try.

Ahh… interesting. Thanks @Eric_Penn – I’ll try something along those lines and see if that works for me!

1 Like