Invisible inaccesible text prompt

Hi!

I’m trying to develop a Saas platform with Openai’s API. I’m using a FindReplace operator on a text element for a prompt.

Question: How can I ensure that the prompt text remains inaccessible or invisible to a user (including through the ‘view source’ option in Chrome), while still utilizing the FindReplace operator?

Thanks in advance!

To make it a bit more visible what im building. On the left side you see inputs. On the right side there’s going to be the output (: prompttext + findreplace inputs = Text → OpenAI → output from OpenAI API)

example prompt: Create a story about an {animal}. Target audience: {audience_age}.

The dynamic values between de brackets will be replaced (findReplace operator) with the inputs from the user.

Schermafbeelding 2024-01-10 163026

Everything in the browser is accessible using developer’s tools. If there is something that you want to hide from the user you need to do it in the backend and send only the public part to the client.

@dorilama Thanks for your reply!

Do you know if its possible to use the findreplace operator in the backend?

Or what would you do to make the text (prompt) with a findreplace inaccesible? Maybe I’m thinking way to difficult, but I did not find any other solution yet… It took me days to find an answer or a workaround.

Assuming that you inserted and processed the prompt text on the server side not the client side. I would avoid sending the prompt in HTML comments if you are doing that, and handle much of the processing on the server to keep the prompt hidden.

@Hashlogics Thanks for your input! Appreciated.

The prompt text itself is pulled from the database. The inputs from the user is client side.

I just don’t have a clue how to adjust/use the findreplace operators without placing the prompt text in a text element.

Any ideas?
Ps: I attached a screenshot of my client side setup.

find-replace is an operator that can be used in dynamic expressions, wether in the frontend or in the backend. A basic thing you can do is send a request to a backend endpoint with the input, then in the workflow of the endpoint you can build the final prompt and send the request, then you can return the response to the client.

@dorilama Ah, okay. I didn’t know it was possible to use the find-and-replace function in the backend as well. Not sure yet how to do this, but it’s great to know that this is an option.

If you come across a video or explanation about this, I would appreciate it. Thanks for now!

This topic was automatically closed after 70 days. New replies are no longer allowed.