How to stop chatgpt using place holders when creating code?

I’ve been working all day on this because in the long run it would be a time saver. But I’m about to give up. No matter how I word it , CI and default ChatGpt4 are unable to refrain from adding in some extra syntax or using place holders:

This is my prompt, any ideas?

  1. Create ten html pages with the script below,. corresponding to the names of the text files you just created.
  2. You need to replace this https://raw.githubusercontent.com/xxxxxxxxxxxxxxx_1.txt" with the name of the file you created. E.g " const response = await fetch(‘useful_verbs_1.txt’);"
  3. Change the page heading, (

    Level 1

    ) to the name of the txt file (capitalised and without underscore). Provide the first one “Useful Verbs 1” as a sample
  4. Ensure you add the complete script (as provided above, but with modifications) to each text file. “rest of script” placeholders are not acceptable.

Here is the script to be used:
!DOCTYPE html>

Listening Pyramid #pyramid-select { appearance: none; padding: 10px; font-size: 16px; etc....

Not sure if I was off much help in the other thread but until today if I have to come up with x webpages that all follow a very specific and well defined template then I do it in good old fashioned code or in PHP.
I don’t see the need to involve a language model in this context unless it’s for content generation.

1 Like

Thanks for the help on the other thread vb. I hardly anything about coding, but I’ve been able to create a lot of useful resources with chat. The problems seem to come when I try to save time with what I assume will be a basic task for AI. But yes, if I had the coding skills I’m sure there’d be better alternatives.

Refer to your content as files or specific filenames, ask it to output an update in it’s entirety, do not generate any stubs. This works well with 3.5-turbo-16k.

If you want multiple files as output, just ask it to format it as a list of filename and content pairs.

Being too specific chews up tokens. Be concise.

1 Like

Something else you might try is to learn in to what it’s doing.

Have it create one template with placeholders… Then ask it to write a script which takes an array of values and the template and outputs a file with the values substituted for the placeholders.

2 Likes

@elmstedt is pretty much saying what I wanted to say. Let me rephrase.
If your goal is to create 10 pages that all are pretty much identical but you just want to replace the content, in this case the category and sentences in English and Spanish, then you create one page that looks just like you want it.
With this example page you create a template where you replace the headline with a variable and the sentences alike.
Then you write a little script to replace the contents with elements from your 10 files
Chat GPT will be able to help you do it.

That should do the trick. Ask ChatGPT what other ways there are and you are ready to learn about all the ways that exist to simplify the task and how they relate to your needs.

1 Like