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
31
35
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
31
35
MetaDescription: Common capabilities that Visual Studio Code extensions (plug-ins) can take advantage of
@@ -66,6 +70,7 @@ An extension can register custom Context Menu items that will be displayed in di
66
70
<<<<<<< HEAD
67
71
<<<<<<< HEAD
68
72
<<<<<<< HEAD
73
+
<<<<<<< HEAD
69
74
There are four options for storing data:
70
75
=======
71
76
There are five options for storing data:
@@ -85,6 +90,9 @@ There are five options for storing data:
85
90
=======
86
91
There are five options for storing data:
87
92
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
93
+
=======
94
+
There are five options for storing data:
95
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
88
96
89
97
-[`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.
90
98
-[`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`.
@@ -96,6 +104,10 @@ There are five options for storing data:
96
104
<<<<<<< HEAD
97
105
<<<<<<< HEAD
98
106
<<<<<<< HEAD
107
+
<<<<<<< HEAD
108
+
=======
109
+
-[`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.
110
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
99
111
=======
100
112
-[`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
31
35
MetaDescription: Tutorial that walks you through creating a GitHub Copilot chat participant in VS Code by using the Chat API.
@@ -108,6 +112,7 @@ Finally, setting `isSticky: true` will automatically prepend the participant nam
108
112
<<<<<<< HEAD
109
113
<<<<<<< HEAD
110
114
<<<<<<< HEAD
115
+
<<<<<<< HEAD
111
116
## Step 3: Craft the prompt and select the model
112
117
113
118
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.
@@ -139,6 +144,11 @@ Now that the participant is registered, you can start implementing the logic for
139
144
=======
140
145
## Step 3: Craft the prompt
141
146
147
+
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.
148
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
149
+
=======
150
+
## Step 3: Craft the prompt
151
+
142
152
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.
143
153
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
144
154
@@ -163,6 +173,7 @@ const BASE_PROMPT = 'You are a helpful code tutor. Your job is to teach the user
163
173
<<<<<<< HEAD
164
174
<<<<<<< HEAD
165
175
<<<<<<< HEAD
176
+
<<<<<<< HEAD
166
177
You also need to select the model for the requests. gpt-4o is recommended since it is fast and high quality.
167
178
168
179
```ts
@@ -200,6 +211,11 @@ Now that the prompt is selected, you need to implement the request handler. This
200
211
=======
201
212
## Step 4: Implement the request handler
202
213
214
+
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.
215
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
216
+
=======
217
+
## Step 4: Implement the request handler
218
+
203
219
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.
223
240
=======
224
241
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`.
@@ -248,6 +265,11 @@ Send the request using `request.model.sendRequest`, which will send the request
248
265
=======
249
266
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`.
250
267
268
+
Send the request using `request.model.sendRequest`, which will send the request using the currently selected model. Finally, stream the response to the user.
269
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
270
+
=======
271
+
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
+
251
273
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