Skip to main content

Chatbot initialization

Code with your favorite chatbot without tedious copy-pasting and apply responses with a single click.

Generated prompt depends on mode:

[INSTRUCTIONS]
<files>
<text title="...">...</text> // selected websites
...
<file path="...">...</file> // selected workspace files
...
</files>
[INSTRUCTIONS]

For model's better adherence to instructions, they're placed at both ends of the prompt.
OpenAI Cookbook/Prompt Organization

Practice single-turns

Chat conversations are only a construct of product interfaces, they hurt the quality of responses from the model and once your context is "poisoned" it will not recover. Whenever you're not satisfied with a response, the best practice is to always refine your initial instructions and re-initialize a chat.

Edit formats

Additional instructions are appended to your prompt in "General" mode, instructing the model to respond in an appropriate format. They can be customized in your settings.json file.

Truncated

codeWebChat.editFormatInstructionsTruncated

Whenever proposing a file use the markdown code block syntax and always add file path in the first line comment. Use ellipsis comments, e.g. "// ...", when appropriate.

Whole

codeWebChat.editFormatInstructionsWhole

Whenever proposing a file use the markdown code block syntax and always add file path in the first line comment. Please show me the full code of the changed files, I have a disability which means I can't type and need to be able to copy and paste the full code.

Diff

codeWebChat.editFormatInstructionsDiff

Whenever proposing a file use the markdown code block syntax. Each code block should be a diff patch.

Presets

Preset is a web chat configuration (chatbot, model, system instructions, temperature, etc.). With the use of prefixes and suffixes, they can serve specific purpose in your workflow.

Applying chat responses

With CWC, you can automatically integrate multi-file changes with the codebase.

Strategy depends on detected edit format:

  • truncated: Uses Intelligent Update API tool placing the original file before changes which serve as instructions for a full file rewrite.
  • whole: Simply replaces original files in place.
  • diff: Uses the git apply utility before falling back to a custom diff processor.