Can GPT get input and act on it as kind of a variable?

Is it possible at all to build a GPT programmed with prompt that has some variable, like:

When new conversation starts, ask "Enter a language: "
Record response as {language}.
And then act as language translator and translate everything you receive in chat to {language}.

What happens is, conversation starts but it waits for user to write something and then responds with ‘Enter a language:’.
And then it doesn’t do anything about it.

I guess what I am imagining is too fantastic of a future? It surely feels like too good to be true, and if that was possible the AI would take over the world.

@romanr - I guess not, having a dynamic system prompt with Assistants is not supported yet. But you can still solve this problem using chat completions, tool_calls and simple logic.

  1. You can have your assistant prompt the user to specify a desired language.
  2. Setup a tool_call named translate which takes in user_prompt and language and returns context saying “Translate the given content to {language}: \n {content}”.
  3. You can setup tool_choice as required and seed (If you need it to generate similar content for each completion)
  4. Re-run the second completions part once the language is set until the user prompts otherwise. You can implement a simple code logic.

As far as my expertise goes this is how I would solve it. Lmk if you any other questions - Cheers!

Thank you! I did not know about the completions method. Will try that. downside being it has to be pre-set and not free input.

1 Like

@romanr - Check this post by out if you need a good prompt. Cheers.