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
23
27
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
23
27
MetaDescription: Common capabilities that Visual Studio Code extensions (plug-ins) can take advantage of
@@ -56,6 +60,7 @@ An extension can register custom Context Menu items that will be displayed in di
56
60
<<<<<<< HEAD
57
61
<<<<<<< HEAD
58
62
<<<<<<< HEAD
63
+
<<<<<<< HEAD
59
64
There are four options for storing data:
60
65
=======
61
66
There are five options for storing data:
@@ -69,6 +74,9 @@ There are five options for storing data:
69
74
=======
70
75
There are five options for storing data:
71
76
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
77
+
=======
78
+
There are five options for storing data:
79
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
72
80
73
81
-[`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.
74
82
-[`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`.
@@ -78,6 +86,10 @@ There are five options for storing data:
78
86
<<<<<<< HEAD
79
87
<<<<<<< HEAD
80
88
<<<<<<< HEAD
89
+
<<<<<<< HEAD
90
+
=======
91
+
-[`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.
92
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
81
93
=======
82
94
-[`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
23
27
MetaDescription: Tutorial that walks you through creating a GitHub Copilot chat participant in VS Code by using the Chat API.
@@ -98,6 +102,7 @@ Finally, setting `isSticky: true` will automatically prepend the participant nam
98
102
<<<<<<< HEAD
99
103
<<<<<<< HEAD
100
104
<<<<<<< HEAD
105
+
<<<<<<< HEAD
101
106
## Step 3: Craft the prompt and select the model
102
107
103
108
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.
@@ -119,6 +124,11 @@ Now that the participant is registered, you can start implementing the logic for
119
124
=======
120
125
## Step 3: Craft the prompt
121
126
127
+
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.
128
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
129
+
=======
130
+
## Step 3: Craft the prompt
131
+
122
132
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.
123
133
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
124
134
@@ -141,6 +151,7 @@ const BASE_PROMPT = 'You are a helpful code tutor. Your job is to teach the user
141
151
<<<<<<< HEAD
142
152
<<<<<<< HEAD
143
153
<<<<<<< HEAD
154
+
<<<<<<< HEAD
144
155
You also need to select the model for the requests. gpt-4o is recommended since it is fast and high quality.
145
156
146
157
```ts
@@ -168,6 +179,11 @@ Now that the prompt is selected, you need to implement the request handler. This
168
179
=======
169
180
## Step 4: Implement the request handler
170
181
182
+
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.
183
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
184
+
=======
185
+
## Step 4: Implement the request handler
186
+
171
187
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.
189
206
=======
190
207
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`.
@@ -204,6 +221,11 @@ Send the request using `request.model.sendRequest`, which will send the request
204
221
=======
205
222
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`.
206
223
224
+
Send the request using `request.model.sendRequest`, which will send the request using the currently selected model. Finally, stream the response to the user.
225
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
226
+
=======
227
+
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`.
228
+
207
229
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