|
| 1 | +--- |
| 2 | +title: Chatbot initialization |
| 3 | +sidebar_position: 3 |
| 4 | +--- |
| 5 | + |
| 6 | +import Tabs from '@theme/Tabs' |
| 7 | +import TabItem from '@theme/TabItem' |
| 8 | + |
| 9 | +Code with your favorite chatbot without tedious copy-pasting and apply responses with a single click. |
| 10 | + |
| 11 | +## Prompts in modes of operation |
| 12 | + |
| 13 | +<Tabs groupId="mode"> |
| 14 | + <TabItem value="general" label="General"> |
| 15 | + |
| 16 | +``` |
| 17 | +[INSTRUCTIONS] |
| 18 | +<files> |
| 19 | + <text title="...">...</text> // selected websites |
| 20 | + ... |
| 21 | + <file path="...">...</file> // selected workspace files |
| 22 | + ... |
| 23 | +</files> |
| 24 | +[INSTRUCTIONS] |
| 25 | +``` |
| 26 | + |
| 27 | + </TabItem> |
| 28 | + <TabItem value="code completions" label="Code completions"> |
| 29 | + |
| 30 | +``` |
| 31 | +Find correct replacement text for the <missing text> symbol. Correctly formatted response begins with a code block containing replacement text end then proceeds with explanation. Always refer to symbol "<missing_text>" as "cursor position" and "replacement" as "completion". |
| 32 | +<files> |
| 33 | + <text title="...">...</text> // selected websites |
| 34 | + ... |
| 35 | + <file path="...">...</file> // selected workspace files excluding current editor |
| 36 | + ... |
| 37 | + <file path="..."> // current editor |
| 38 | + ... |
| 39 | + <missing text> // cursor position |
| 40 | + ... |
| 41 | + </file> |
| 42 | +</files> |
| 43 | +Find correct replacement text for the <missing text> symbol. Correctly formatted response begins with a code block containing replacement text end then proceeds with explanation. Always refer to symbol "<missing_text>" as "cursor position" and "replacement" as "completion". |
| 44 | +``` |
| 45 | + |
| 46 | + </TabItem> |
| 47 | +</Tabs> |
| 48 | + |
| 49 | +<hr /> |
| 50 | + |
| 51 | +For model's better adherence to instructions, they're palced at both ends of the prompt.<br /> |
| 52 | +[OpenAI Cookbook/Prompt Organization](https://cookbook.openai.com/examples/gpt4-1_prompting_guide#prompt-organization) |
| 53 | + |
| 54 | +:::tip Practice single-turns |
| 55 | + |
| 56 | +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 reponse, **the best practice is to alawys refine your initial instructions and re-initialize a chat**. |
| 57 | + |
| 58 | +::: |
| 59 | + |
| 60 | +## Edit formats |
| 61 | + |
| 62 | +Additional instructions are appended to your prompt in "General" mode, instructing the model to response in an appropriate format. They can be customized in your `settings.json` file. |
| 63 | + |
| 64 | +### Truncated |
| 65 | + |
| 66 | +`codeWebChat.editFormatInstructionsTruncated` |
| 67 | + |
| 68 | +> 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. |
| 69 | +
|
| 70 | +### Whole |
| 71 | + |
| 72 | +`codeWebChat.editFormatInstructionsWhole` |
| 73 | + |
| 74 | +> 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. |
| 75 | +
|
| 76 | +### Diff |
| 77 | + |
| 78 | +`codeWebChat.editFormatInstructionsDiff` |
| 79 | + |
| 80 | +> Whenever proposing a file use the markdown code block syntax. Each code block should be a diff patch. |
| 81 | +
|
| 82 | +## Presets |
| 83 | + |
| 84 | +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. |
| 85 | + |
| 86 | +## Applying chat responses |
| 87 | + |
| 88 | +With CWC, you can automatically integrate multi-file changes with the codebase. |
| 89 | + |
| 90 | +Strategy depends on detected edit format: |
| 91 | + |
| 92 | +- **truncated:** Uses Intelligent Update API tool placing the original file before changes which serve as instructions for a full file rewrite. |
| 93 | +- **whole:** Simply replaces original files in place. |
| 94 | +- **diff:** Uses the `git apply` utility before falling back to a custom diff processor. |
| 95 | + |
| 96 | +## Available commands |
| 97 | + |
| 98 | +##### `Code Web Chat: Web Chat` |
| 99 | + |
| 100 | +Opens a chat session in your browser with the current context and prompt. |
| 101 | + |
| 102 | +##### `Code Web Chat: Web Chat with...` |
| 103 | + |
| 104 | +Lets you select which AI platform to use for your chat session. |
| 105 | + |
| 106 | +##### `Code Web Chat: Chat to Clipboard` |
| 107 | + |
| 108 | +Instead of opening a chat directly, copies the context and prompt to your clipboard for manual pasting. |
| 109 | + |
| 110 | +##### `Code Web Chat: Apply Chat Response` |
| 111 | + |
| 112 | +Applies changes to the current file using the default model. |
| 113 | + |
| 114 | +##### `Code Web Chat: Revert Last Applied Changes` |
| 115 | + |
| 116 | +Reverts files to their state before the last application of changes. |
| 117 | + |
| 118 | +## Settings |
| 119 | + |
| 120 | +##### `Code Web Chat: Edit Format Instructions Truncated` |
| 121 | + |
| 122 | +Style instructions for chat responses when using truncated format. |
| 123 | + |
| 124 | +##### `Code Web Chat: Edit Format Instructions Whole` |
| 125 | + |
| 126 | +Style instructions for chat responses when showing complete files. |
| 127 | + |
| 128 | +##### `Code Web Chat: Edit Format Instructions Diff` |
| 129 | + |
| 130 | +Whenever proposing a file use the markdown code block syntax. Each code block should be a diff patch. |
0 commit comments