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
27
31
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
27
31
MetaDescription: Common capabilities that Visual Studio Code extensions (plug-ins) can take advantage of
@@ -61,6 +65,7 @@ An extension can register custom Context Menu items that will be displayed in di
61
65
<<<<<<< HEAD
62
66
<<<<<<< HEAD
63
67
<<<<<<< HEAD
68
+
<<<<<<< HEAD
64
69
There are four options for storing data:
65
70
=======
66
71
There are five options for storing data:
@@ -77,6 +82,9 @@ There are five options for storing data:
77
82
=======
78
83
There are five options for storing data:
79
84
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
85
+
=======
86
+
There are five options for storing data:
87
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
80
88
81
89
-[`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.
82
90
-[`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`.
@@ -87,6 +95,10 @@ There are five options for storing data:
87
95
<<<<<<< HEAD
88
96
<<<<<<< HEAD
89
97
<<<<<<< HEAD
98
+
<<<<<<< HEAD
99
+
=======
100
+
-[`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.
101
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
90
102
=======
91
103
-[`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
27
31
MetaDescription: Tutorial that walks you through creating a GitHub Copilot chat participant in VS Code by using the Chat API.
@@ -103,6 +107,7 @@ Finally, setting `isSticky: true` will automatically prepend the participant nam
103
107
<<<<<<< HEAD
104
108
<<<<<<< HEAD
105
109
<<<<<<< HEAD
110
+
<<<<<<< HEAD
106
111
## Step 3: Craft the prompt and select the model
107
112
108
113
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.
@@ -129,6 +134,11 @@ Now that the participant is registered, you can start implementing the logic for
129
134
=======
130
135
## Step 3: Craft the prompt
131
136
137
+
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.
138
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
139
+
=======
140
+
## Step 3: Craft the prompt
141
+
132
142
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.
133
143
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
134
144
@@ -152,6 +162,7 @@ const BASE_PROMPT = 'You are a helpful code tutor. Your job is to teach the user
152
162
<<<<<<< HEAD
153
163
<<<<<<< HEAD
154
164
<<<<<<< HEAD
165
+
<<<<<<< HEAD
155
166
You also need to select the model for the requests. gpt-4o is recommended since it is fast and high quality.
156
167
157
168
```ts
@@ -184,6 +195,11 @@ Now that the prompt is selected, you need to implement the request handler. This
184
195
=======
185
196
## Step 4: Implement the request handler
186
197
198
+
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.
199
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
200
+
=======
201
+
## Step 4: Implement the request handler
202
+
187
203
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.
206
223
=======
207
224
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`.
@@ -226,6 +243,11 @@ Send the request using `request.model.sendRequest`, which will send the request
226
243
=======
227
244
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
245
246
+
Send the request using `request.model.sendRequest`, which will send the request using the currently selected model. Finally, stream the response to the user.
247
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
248
+
=======
249
+
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
+
229
251
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