You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Summarize the whole topic in less than 300 characters for SEO purpose
35
39
MetaDescription: The Visual Studio Code Extension Host is responsible for managing extensions and ensuring the stability and performance of Visual Studio Code.
# Summarize the whole topic in less than 300 characters for SEO purpose
35
39
MetaDescription: Common capabilities that Visual Studio Code extensions (plug-ins) can take advantage of
@@ -71,6 +75,7 @@ An extension can register custom Context Menu items that will be displayed in di
71
75
<<<<<<< HEAD
72
76
<<<<<<< HEAD
73
77
<<<<<<< HEAD
78
+
<<<<<<< HEAD
74
79
There are four options for storing data:
75
80
=======
76
81
There are five options for storing data:
@@ -93,6 +98,9 @@ There are five options for storing data:
93
98
=======
94
99
There are five options for storing data:
95
100
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
101
+
=======
102
+
There are five options for storing data:
103
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
96
104
97
105
-[`ExtensionContext.workspaceState`](/api/references/vscode-api#ExtensionContext.workspaceState): A workspace storage where you can write key/value pairs. VS Code manages the storage and will restore it when the same workspace is opened again.
98
106
-[`ExtensionContext.globalState`](/api/references/vscode-api#ExtensionContext.globalState): A global storage where you can write key/value pairs. VS Code manages the storage and will restore it for each extension activation. You can selectively synchronize key/value pairs in global storage by setting the keys for sync using `setKeysForSync` method on `globalState`.
@@ -105,6 +113,10 @@ There are five options for storing data:
105
113
<<<<<<< HEAD
106
114
<<<<<<< HEAD
107
115
<<<<<<< HEAD
116
+
<<<<<<< HEAD
117
+
=======
118
+
-[`ExtensionContext.secrets`](/api/references/vscode-api#ExtensionContext.secrets): A global storage for secrets (or any information that is sensitive) that will be encrypted. These are not synced across machines. For VS Code desktop, this leverages Electron's [safeStorage API](https://www.electronjs.org/docs/latest/api/safe-storage). For VS Code for the Web, this uses a Double Key Encryption (DKE) implementation.
119
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
108
120
=======
109
121
-[`ExtensionContext.secrets`](/api/references/vscode-api#ExtensionContext.secrets): A global storage for secrets (or any information that is sensitive) that will be encrypted. These are not synced across machines. For VS Code desktop, this leverages Electron's [safeStorage API](https://www.electronjs.org/docs/latest/api/safe-storage). For VS Code for the Web, this uses a Double Key Encryption (DKE) implementation.
# Summarize the whole topic in less than 300 characters for SEO purpose
35
39
MetaDescription: Tutorial that walks you through creating a GitHub Copilot chat participant in VS Code by using the Chat API.
@@ -113,6 +117,7 @@ Finally, setting `isSticky: true` will automatically prepend the participant nam
113
117
<<<<<<< HEAD
114
118
<<<<<<< HEAD
115
119
<<<<<<< HEAD
120
+
<<<<<<< HEAD
116
121
## Step 3: Craft the prompt and select the model
117
122
118
123
Now that the participant is registered, you can start implementing the logic for the code tutor. In the `extension.ts` file, you will define a prompt and select the model for the requests.
@@ -149,6 +154,11 @@ Now that the participant is registered, you can start implementing the logic for
149
154
=======
150
155
## Step 3: Craft the prompt
151
156
157
+
Now that the participant is registered, you can start implementing the logic for the code tutor. In the `extension.ts` file, you will define a prompt for the requests.
158
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
159
+
=======
160
+
## Step 3: Craft the prompt
161
+
152
162
Now that the participant is registered, you can start implementing the logic for the code tutor. In the `extension.ts` file, you will define a prompt for the requests.
153
163
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
154
164
@@ -174,6 +184,7 @@ const BASE_PROMPT = 'You are a helpful code tutor. Your job is to teach the user
174
184
<<<<<<< HEAD
175
185
<<<<<<< HEAD
176
186
<<<<<<< HEAD
187
+
<<<<<<< HEAD
177
188
You also need to select the model for the requests. gpt-4o is recommended since it is fast and high quality.
178
189
179
190
```ts
@@ -216,6 +227,11 @@ Now that the prompt is selected, you need to implement the request handler. This
216
227
=======
217
228
## Step 4: Implement the request handler
218
229
230
+
Now that the prompt is selected, you need to implement the request handler. This is what will process the user's chat request. You will define the request handler, perform logic for processing the request, and return a response to the user.
231
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
232
+
=======
233
+
## Step 4: Implement the request handler
234
+
219
235
Now that the prompt is selected, you need to implement the request handler. This is what will process the user's chat request. You will define the request handler, perform logic for processing the request, and return a response to the user.
Within the body of this handler, initialize the prompt and model. Check that the model returned successfully.
240
257
=======
241
258
Within the body of this handler, initialize the prompt and a `messages` array with the prompt. Then, send in what the user typed in the chat box. You can access this through `request.prompt`.
@@ -270,6 +287,11 @@ Send the request using `request.model.sendRequest`, which will send the request
270
287
=======
271
288
Within the body of this handler, initialize the prompt and a `messages` array with the prompt. Then, send in what the user typed in the chat box. You can access this through `request.prompt`.
272
289
290
+
Send the request using `request.model.sendRequest`, which will send the request using the currently selected model. Finally, stream the response to the user.
291
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
292
+
=======
293
+
Within the body of this handler, initialize the prompt and a `messages` array with the prompt. Then, send in what the user typed in the chat box. You can access this through `request.prompt`.
294
+
273
295
Send the request using `request.model.sendRequest`, which will send the request using the currently selected model. Finally, stream the response to the user.
0 commit comments