🔹Problem: The OpenAI API always returns the same embedding, regardless of the value of `Last Question`. It seems that the variable is not being correctly passed into the request body.
The variable Last Question variable is updating correctly (I displayed it on the page to verify).
How should I properly bind the `Last Question` variable to the JSON body in WeWeb so that its value is correctly passed to OpenAI? Is there an issue with the syntax, or how WeWeb handles variable injection in API requests?
Thanks in advance for your help!
I take it you are running a REST API request from weweb? I don’t know where the “configure as follows” is getting set up. That’s not parallel to what the nocode setup looks like. If you share screenshots or a video, might be easier for you to get help from the very nice people on this forum.
Thank you for your feedback. To further explain my issue, here are some additional details.
I am working on creating a legal chatbot that uses RAG technology.
I use Supabase to host my legal documentation and WeWeb for the user interface.
On WeWeb, I have a very simple front end with a question form that triggers a workflow when the user submits a question by clicking the validation button.
The first step of my workflow is saving the user’s question in a variable called Last Question.
The second step is making an API call to OpenAI via a REST API request. I want to retrieve the embedding vector of the user’s question. Here’s how I have configured my REST API request:
I think there is a problem with my formula because the API request always returns the same vector, regardless of the question asked.
In the video, I can see that my question is correctly saved in Supabase, and I do get an embedding vector, but it does not change when a user asks a new question.