Skip to content

Commit 051d49a

Browse files
sabrowning1jules-pjc-clarkJasonEtcojhosman
authored
[Megabranch, DO NOT MERGE] Create Copilot Extensions builder docs, update user-focused Extensions docs (#51954)
Co-authored-by: Jules Porter <[email protected]> Co-authored-by: Jules <[email protected]> Co-authored-by: Joe Clark <[email protected]> Co-authored-by: Jason Etcovitch <[email protected]> Co-authored-by: Jess Hosman <[email protected]> Co-authored-by: Dimitrios Philliou <[email protected]> Co-authored-by: Sophie <[email protected]> Co-authored-by: hubwriter <[email protected]>
1 parent d6e5ca6 commit 051d49a

27 files changed

+831
-25
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: About building Copilot Extensions
3+
intro: 'Learn about the development process for {% data variables.product.prodname_copilot_extension_short %}.'
4+
versions:
5+
feature: copilot-extensions
6+
topics:
7+
- Copilot
8+
shortTitle: About building Extensions
9+
type: overview
10+
---
11+
12+
{% data reusables.copilot.copilot-extensions.beta-note %}
13+
14+
## About {% data variables.product.prodname_copilot_extensions_short %}
15+
16+
{% data variables.product.prodname_copilot_extensions_short %} are integrations that expand the functionality of {% data variables.product.prodname_copilot_chat_short %}. {% data variables.product.prodname_copilot_extensions_short %} allow developers to integrate external tools, services, and custom behaviours into the {% data variables.product.prodname_copilot_chat_short %} experience across all supported IDEs and {% data variables.product.company_short %}.
17+
18+
{% data variables.product.prodname_copilot_extensions_short %} are built as {% data variables.product.prodname_github_apps %} with additional capabilities, including:
19+
* Read-access to your {% data variables.product.prodname_copilot_chat_short %} history
20+
* Sending responses to users in the {% data variables.product.prodname_copilot_chat_short %} window
21+
* Execution of {% data variables.product.company_short %} (first party) or functions on external services (third party)
22+
23+
## Visibility of {% data variables.product.prodname_copilot_extensions_short %}
24+
25+
{% data variables.product.prodname_copilot_extensions_short %} can be private, public and shareable, or public and listed on the {% data variables.product.prodname_marketplace %}. Which visibility option you choose will depend on your use case and the audience you are targeting.
26+
27+
* Private extensions are often preferred by large enterprises or companies that:
28+
* Want more customization and controls over data access
29+
* Need to integrate with a large volume of internal documents and databases
30+
* Have strict security policies making it difficult to authorize permissions for third-parties
31+
* Public extensions are suitable for:
32+
* Open-source projects
33+
* Collaborative development and use across organizations within an enterprise
34+
* Sharing your tool and getting feedback before publishing to the {% data variables.product.prodname_marketplace %}
35+
* {% data variables.product.prodname_marketplace %} extensions are ideal for third-parties that want to:
36+
* Offer their service to a broader audience
37+
* Integrate their tool into the developer workflow on {% data variables.product.company_short %} and the IDE
38+
* Leverage the {% data variables.product.company_short %} ecosystem to raise awareness for their product
39+
40+
## Use cases
41+
42+
You can use {% data variables.product.prodname_copilot_extensions_short %} to extend the capabilities of {% data variables.product.prodname_copilot_chat_short %} in a variety of ways. For example, you could use them for:
43+
44+
* **Docs querying**: A {% data variables.product.prodname_copilot_extension_short %} could allow {% data variables.product.prodname_copilot_chat_short %} to query a third-party documentation service to find information about a specific topic.
45+
* **AI-assisted coding**: A {% data variables.product.prodname_copilot_extension_short %} could use a third-party AI model to provide code suggestions.
46+
* **Data retrieval**: A {% data variables.product.prodname_copilot_extension_short %} could allow {% data variables.product.prodname_copilot_chat_short %} to query a third-party data service to retrieve information about a specific topic.
47+
* **Action execution**: A {% data variables.product.prodname_copilot_extension_short %} could allow {% data variables.product.prodname_copilot_chat_short %} to execute a specific action, such as posting to a message board or updating a tracking item in an external system.
48+
49+
## Extensions toolkit, code samples and SDK
50+
51+
{% data variables.product.company_short %} provides a comprehensive toolkit for extension builders, with code samples, a CLI debugging tool, quickstart SDKs, and a user feedback repository. For more information, see the [copilot-extensions](https://github.com/orgs/copilot-extensions/) organization on {% data variables.product.company_short %}.
52+
53+
Before creating your own {% data variables.product.prodname_copilot_extension_short %} from scratch, you may want to explore an existing {% data variables.product.prodname_copilot_agent_short %}, and integrate it with a {% data variables.product.prodname_github_app %} to see how it works. {% data variables.product.company_short %} provides a few example {% data variables.product.prodname_copilot_agents_short %}, that you can clone and use as the basis for your own {% data variables.product.prodname_copilot_extension_short %}, including:
54+
55+
* **Blackbeard**: A simple {% data variables.product.prodname_copilot_agent_short %} that responds to requests like a pirate, using {% data variables.product.prodname_copilot_short %}'s LLM API and special system prompts. It is a good starting point for learning how to build a {% data variables.product.prodname_copilot_extension_short %}. For more information, see the [Blackbeard {% data variables.product.prodname_copilot_extension_short %}](https://github.com/copilot-extensions/blackbeard-extension).
56+
* **{% data variables.product.prodname_github_models %}**: A more complex {% data variables.product.prodname_copilot_agent_short %} that let's you ask about and interact with various LLMs listed on the {% data variables.product.prodname_marketplace %} from within {% data variables.product.prodname_copilot_chat_short %}. For more information, see the [{% data variables.product.prodname_github_models %} {% data variables.product.prodname_copilot_extension_short %}](https://github.com/copilot-extensions/github-models-extension).
57+
* **Function calling**: an example agent written in Go that demonstrates function calling and confirmation dialogues. For more information, see the [Function calling extension](https://github.com/copilot-extensions/function-calling-extension).
58+
* **RAG extension**: an example agent written in Go that demonstrates a simple implementation of retrieval augmented generation. For more information, see the [RAG extension](https://github.com/copilot-extensions/rag-extension).
59+
* **Preview SDK**: An SDK that simplifies the process of building {% data variables.product.prodname_copilot_extensions_short %} by handling request verification, response formatting, and API interactions. It allows builders to focus on their extension's core functionality rather than boilerplate, by streamlining the integration of tools, APIs, and data sources into {% data variables.product.prodname_copilot_chat_short %}. For more information, see the [Preview SDK](https://github.com/copilot-extensions/preview-sdk.js).
60+
61+
## About {% data variables.product.prodname_vscode %} Chat extensions
62+
63+
{% data variables.product.prodname_copilot_extensions %} are generally built as {% data variables.product.prodname_github_apps %}. However, there is also an option to build a {% data variables.product.prodname_vscode %} Chat extension that integrates with {% data variables.product.prodname_copilot_chat_short %} and provides a similar end user experience. {% data variables.product.prodname_vscode %} Chat extensions are a good option for developers looking to customize their copilot experience with functionalities specific to {% data variables.product.prodname_vscode %}.
64+
65+
There are some key differences from {% data variables.product.prodname_github_app %} {% data variables.product.prodname_copilot_extensions_short %}:
66+
* {% data variables.product.prodname_vscode %} Specific: Unlike {% data variables.product.prodname_github_app %} {% data variables.product.prodname_copilot_extensions_short %}, which work across all supported IDEs and {% data variables.product.company_short %}, {% data variables.product.prodname_vscode %} Chat extensions only work within the {% data variables.product.prodname_vscode %} environment.
67+
* Capabilities: They have more access to {% data variables.product.prodname_vscode %}'s features and APIs, allowing for more editor-specific interactions, such as accessing local workspace data and manipulating {% data variables.product.prodname_vscode %}'s interface.
68+
* Publishing: They can be published to the {% data variables.product.prodname_vscode %} Marketplace. They cannot be published on the {% data variables.product.prodname_marketplace %}.
69+
70+
For more information, see [{% data variables.product.prodname_vscode %} Chat extensions](https://code.visualstudio.com/api/extension-guides/chat) in the Visual Studio Code documentation.
71+
72+
## Further reading
73+
74+
* For a glossary of terms used in the context of {% data variables.product.prodname_copilot_extensions_short %}, see [Copilot Extensions Glossary](/copilot/building-copilot-extensions/copilot-extensions-glossary)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: About Copilot agents
3+
intro: 'Learn what {% data variables.product.prodname_copilot_agents %} are and how they can enhance your {% data variables.product.prodname_copilot_chat %} experience.'
4+
versions:
5+
feature: copilot-extensions
6+
topics:
7+
- Copilot
8+
shortTitle: About Copilot agents
9+
type: overview
10+
---
11+
12+
{% data reusables.copilot.copilot-extensions.beta-note %}
13+
14+
{% data variables.product.prodname_copilot_agents_short %} are custom tools embedded in {% data variables.product.prodname_copilot_extensions_short %}. They integrate with {% data variables.product.prodname_copilot_chat_short %} to provide additional functionalities tailored to specific needs. {% data variables.product.prodname_copilot_agents_short %} can perform various tasks such as querying documentation, retrieving data, executing specific actions, or providing AI-assisted coding suggestions. They enhance the capabilities of {% data variables.product.prodname_copilot %} by allowing developers to build and integrate custom features directly into the {% data variables.product.prodname_copilot_chat_short %} interface.
15+
16+
To use a {% data variables.product.prodname_copilot_agent_short %} in {% data variables.product.prodname_copilot_chat_short %}, it must be associated with a {% data variables.product.prodname_github_app %}. This combination of a {% data variables.product.prodname_github_app %} and a {% data variables.product.prodname_copilot_agent_short %} is what we refer to as a {% data variables.product.prodname_copilot_extension %}. For more information on {% data variables.product.prodname_copilot_extensions_short %}, see "[AUTOTITLE](/copilot/building-copilot-extensions/about-building-copilot-extensions)."
17+
18+
Any {% data variables.product.company_short %} user can create a {% data variables.product.prodname_copilot_extension_short %} by building a {% data variables.product.prodname_copilot_agent_short %} and associating it with a {% data variables.product.prodname_github_app %}. For more information on creating a {% data variables.product.prodname_copilot_extension_short %}, see "[AUTOTITLE](/copilot/building-copilot-extensions/setting-up-copilot-extensions)."
19+
20+
## Further reading
21+
22+
* "[AUTOTITLE](/copilot/building-copilot-extensions/building-a-copilot-agent-for-your-copilot-extension/configuring-your-copilot-agent-to-communicate-with-the-copilot-platform)"
23+
* "[AUTOTITLE](/copilot/building-copilot-extensions/building-a-copilot-agent-for-your-copilot-extension/configuring-your-copilot-agent-to-communicate-with-github)"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: Configuring your Copilot agent to communicate with GitHub
3+
intro: 'Learn how to verify payloads and get resources from {% data variables.product.github %} with your {% data variables.product.prodname_copilot_agent_short %}.'
4+
versions:
5+
feature: copilot-extensions
6+
topics:
7+
- Copilot
8+
shortTitle: Communicate with GitHub
9+
type: reference
10+
---
11+
12+
{% data reusables.copilot.copilot-extensions.beta-note %}
13+
14+
## Prerequisites
15+
16+
Before you configure your {% data variables.product.prodname_copilot_agent_short %} to communicate with {% data variables.product.github %}, you should understand how your {% data variables.product.prodname_copilot_agent_short %} communicates with the {% data variables.product.prodname_copilot_short %} platform. See "[AUTOTITLE](/copilot/building-copilot-extensions/building-a-copilot-agent-for-your-copilot-extension/configuring-your-copilot-agent-to-communicate-with-the-copilot-platform)."
17+
18+
## Verifying that payloads are coming from {% data variables.product.github %}
19+
20+
Before your {% data variables.product.prodname_copilot_agent_short %} begins processing a request, you should verify that the request came from {% data variables.product.github %}, and that it is intended for your agent. All agent requests contain the `Github-Public-Key-Identifier` and `Github-Public-Key-Signature` headers. To verify the signature for a particular request, compare the signature in the `Github-Public-Key-Signature` header with a signed copy of the request body using the current public key listed at https://api.github.com/meta/public_keys/copilot_api.
21+
22+
For more details and examples of signature verification in specific languages, see the [`github-technology-partners/signature-verification`](https://github.com/github-technology-partners/signature-verification) repository.
23+
24+
## Fetching resources from the {% data variables.product.github %} API
25+
26+
Requests to your {% data variables.product.prodname_copilot_agent_short %} will receive an `X-Github-Token` header. This header contains an API token that can be used to fetch resources from the {% data variables.product.github %} API on behalf of the user interacting with your agent. The permissions of this token are the overlap of the user's own permissions and the permissions granted to your {% data variables.product.prodname_github_app %} installation.
27+
28+
For an example of how you might use `X-Github-Token`, see the following code sample:
29+
30+
```typescript
31+
async function whoami(req) {
32+
const response = await fetch(
33+
// The {% data variables.product.github %} API endpoint for the authenticated user
34+
"https://api.github.com/user",
35+
{
36+
headers: {
37+
"Authorization": `Bearer ${req.headers.get("x-github-token")}`
38+
}
39+
}
40+
)
41+
42+
const user = await response.json()
43+
return user
44+
}
45+
```
46+
47+
To learn more about working with {% data variables.product.github %}'s API and explore official software development kits (SDKs), see the [`octokit`](https://github.com/octokit) organization.

0 commit comments

Comments
 (0)