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
@@ -11,7 +11,6 @@ MetaDescription: A guide to creating an AI extension in Visual Studio Code
11
11
12
12
Visual Studio Code's Copilot Chat architecture enables extension authors to integrate with the [GitHub Copilot Chat](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat) experience. A chat extension is a VS Code extension that uses the Chat extension API by contributing a *Chat participant*.
13
13
14
-
15
14
Chat participants are domain experts that can answer user queries within a specific domain. Participants can use different approaches to process a user query:
16
15
17
16
- Use AI to interpret the request and generate a response, for example by using the [Language Model API](/api/extension-guides/language-model)
@@ -20,13 +19,7 @@ Chat participants are domain experts that can answer user queries within a speci
20
19
21
20
Participants can use the language model in a wide range of ways. Some participants only make use of the language model to get answers to custom prompts, for example the [sample chat participant](https://github.com/microsoft/vscode-extension-samples/tree/main/chat-sample). Other participants are more advanced and act like [autonomous agents](https://learn.microsoft.com/semantic-kernel/agents/) that invoke multiple tools with the help of the language model. An example of such an advanced participant is the built-in `@workspace` that knows about your workspace and can answer questions about it. Internally, `@workspace` is powered by multiple tools: GitHub's knowledge graph, combined with semantic search, local code indexes, and VS Code's language services.
22
21
23
-
When a user explicitly mentions a `@participant` in their chat prompt, that prompt is forwarded to the extension that contributed that specific chat participant. The participant then uses a `ResponseStream` to respond to the request. To provide a smooth user experience, the Chat API is streaming-based. A `ResponseStream` can include:
24
-
25
-
- Markdown for simple text and image responses
26
-
- Buttons that invoke VS Code commands
27
-
- Progress for longer running operations
28
-
- References to URIs or editor locations
29
-
- File trees (for example, to show a workspace preview when a chat participant proposes to create a new workspace)
22
+
When a user explicitly mentions a `@participant` in their chat prompt, that prompt is forwarded to the extension that contributed that specific chat participant. The participant then uses a `ResponseStream` to respond to the request. To provide a smooth user experience, the Chat API is streaming-based. A chat response can contain rich content, such as Markdown, file trees, command buttons, and more. Get more info about the [supported response output types](#supported-chat-response-output-types).
30
23
31
24
To help the user take the conversation further, participants can provide *follow-ups* for each response. Follow-up questions are suggestions that are presented in the chat user interface and might give the user inspiration about the chat extension's capabilities.
32
25
@@ -36,7 +29,6 @@ Participants can also contribute *commands*, which are a shorthand notation for
36
29
37
30
Alternatively, it is possible to extend GitHub Copilot by creating a GitHub App that contributes a chat participant in the Chat view. A GitHub App is backed by a service and works across all GitHub Copilot surfaces, such as github.com, Visual Studio, or VS Code. On the other hand, GitHub Apps do not have full access to the VS Code API. To learn more about extending GitHub Copilot through a GitHub App see the [GitHub documentation](https://docs.github.com/en/copilot/building-copilot-extensions/about-building-copilot-extensions).
@@ -96,7 +88,7 @@ The first step to create a chat extension is to register it in your `package.jso
96
88
}
97
89
```
98
90
99
-
We suggest to use a lowercase `name` to align with existing chat participants. `name` can not contain spaces. Users can then reference the chat participant in the Chat view by using the `@` symbol and the `name` you provided. We suggest to use title case for the `fullName`, which is shown in the title area of a response from your participant. Some participant names are reserved, and in case you use a reserved name VS Code will display the fully qualified name of your participant (including the extension id). The `description` is shown in the chat input field as a placeholder text.
91
+
We suggest using a lowercase `name` to align with existing chat participants. `name` can not contain spaces. Users can then reference the chat participant in the Chat view by using the `@` symbol and the `name` you provided. We suggest using title case for the `fullName`, which is shown in the title area of a response from your participant. Some participant names are reserved, and in case you use a reserved name VS Code will display the fully qualified name of your participant (including the extension ID). The `description` is shown in the chat input field as a placeholder text.
100
92
101
93
The `isSticky` property controls whether the chat participant is persistent, which means that the participant name is automatically prepended in the chat input field after the user has started interacting with the participant.
102
94
@@ -202,6 +194,8 @@ stream.button({
202
194
});
203
195
```
204
196
197
+
Get more info about the [supported chat response output types](#supported-chat-response-output-types).
198
+
205
199
In practice, extensions typically send a request to the language model. Once they get a response from the language model, they might further process it, and decide if they should stream anything back to the user. The VS Code Chat API is streaming-based, and is compatible with the streaming [Language Model API](/api/extension-guides/language-model). This allows extensions to report progress and results continuously with the goal of having a smooth user experience. Learn how you can use the [Language Model API](/api/extension-guides/language-model).
206
200
207
201
#### Use the chat message history
@@ -269,11 +263,154 @@ cat.followupProvider = {
269
263
270
264
> **Tip:** Follow-ups should be written as questions or directions, not just concise commands.
271
265
266
+
## Supported chat response output types
267
+
268
+
To return a response to a chat request, you use the [`ChatResponseStream`](/api/references/vscode-api#ChatResponseStream) parameter on the [`ChatRequestHandler`](/api/references/vscode-api#ChatRequestHandler).
269
+
270
+
The following list provides the output types for a chat response in the Chat view. A chat response can combine multiple different output types.
271
+
272
+
-**Markdown**
273
+
274
+
Render a fragment of Markdown text simple text or images. You can use any Markdown syntax that is part of the [CommonMark](https://commonmark.org/) specification. Use the [`ChatResponseStream.markdown`](/api/references/vscode-api#ChatResponseStream.markdown) method and provide the Markdown text.
275
+
276
+
Example code snippet:
277
+
278
+
```typescript
279
+
// Render Markdown text
280
+
stream.markdown('# This is a title \n');
281
+
stream.markdown('This is stylized text that uses _italics_ and **bold**. ');
282
+
stream.markdown('This is a [link](https://code.visualstudio.com).\n\n');
const fileUri: vscode.Uri = vscode.Uri.file('/path/to/workspace/app.js'); // On Windows, the path should be in the format of 'c:\\path\\to\\workspace\\app.js'
381
+
const fileRange: vscode.Range = new vscode.Range(0, 0, 3, 0);
Chat extensions can also contribute chat *variables*, which provide context about the extension's domain. For example, a C++ extension might contribute a variable `#cpp` that would get resolved based on the state of the language service - what C++ version is being used and what C++ programming approach is preferred.
Copy file name to clipboardExpand all lines: api/references/theme-color.md
-3Lines changed: 0 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -318,7 +318,6 @@ Editor Groups are the containers of editors. There can be many editor groups. A
318
318
-`tab.unfocusedActiveBorder`: Bottom border for the active tab in an inactive editor group.
319
319
-`tab.activeBorderTop`: Top border for the active tab.
320
320
-`tab.unfocusedActiveBorderTop`: Top border for the active tab in an inactive editor group
321
-
-`tab.dragAndDropBorder`: Border between tabs to indicate that a tab can be inserted between two tabs. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.
322
321
-`tab.lastPinnedBorder`: Border on the right of the last pinned editor to separate from unpinned editors.
Copy file name to clipboardExpand all lines: docs/azure/deployment.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
Order: 2
2
+
Order: 3
3
3
Area: azure
4
4
TOCTitle: Deployment
5
5
PageTitle: Visual Studio Code Azure Tutorials
@@ -9,9 +9,9 @@ DateApproved: 02/1/2024
9
9
---
10
10
# Deploying Applications to Azure
11
11
12
-
Visual Studio Code makes it easy to deploy your applications to the cloud with [Azure](https://azure.microsoft.com) and we've created walkthroughs to help you get started.
12
+
Visual Studio Code makes it easy to deploy your applications to the cloud with Azure and we've created walkthroughs to help you get started.
13
13
14
-
Whether your workflow is through the [Azure CLI](https://learn.microsoft.com/cli/azure) or [Azure App Service](https://azure.microsoft.com/services/app-service), using a Docker container, or creating serverless [Azure Functions](https://azure.microsoft.com/services/functions/), you'll find the deployment steps you need.
14
+
Whether you're a fullstack, backend, API developer, or DevOps engineer, you'll find the deployment steps you need.
15
15
16
16
## Deployment tutorials
17
17
@@ -29,7 +29,6 @@ You can find additional tutorials and walkthroughs on the
29
29
30
30
## Next steps
31
31
32
+
*[Deploy to Azure Container Apps](https://learn.microsoft.com/en-us/azure/container-apps/deploy-visual-studio-code) - Run microservices and containerized applications on a serverless platform.
33
+
*[Visual Studio Code Azure Extensions](/docs/azure/overview.md) - The Azure Tools extension pack is designed to deploy your application to Azure within minutes.
32
34
*[Working with Docker](/docs/azure/docker.md) - Put your application in a Docker container for easy reuse and deployment.
33
-
*[Azure Extensions](/docs/azure/extensions.md) - The VS Code Marketplace has hundreds of extensions for Azure and the cloud.
34
-
*[Working with MongoDB](/docs/azure/mongodb.md) - Create, manage and query MongoDB databases from within VS Code.
35
-
*[Working with Kubernetes](/docs/azure/kubernetes.md) - for automating deployment, scaling, and management of application.
0 commit comments