Skip to main content

Sobre a construção de extensões do Copilot

Saiba mais sobre o processo de desenvolvimento para Copilot Extension.

Note

GitHub Copilot Extensions is in beta and subject to change.

About Copilot Extensions

Copilot Extensions are integrations that expand the functionality of Copilot Chat. Copilot Extensions allow developers to integrate external tools, services, and custom behaviors into the Copilot Chat experience across all supported IDEs and GitHub.

Copilot Extensions are built as GitHub Apps with additional capabilities, including:

  • Read-access to your Copilot Chat history
  • Sending responses to users in the Copilot Chat window
  • Execution of GitHub (first party) or functions on external services (third party)

Copilot Extensions can be used with:

  • Copilot Chat in Visual Studio
  • Copilot Chat in Visual Studio Code
  • Copilot Chat in GitHub.com

Visibility of Copilot Extensions

Copilot Extensions can be private, public and shareable, or public and listed on the GitHub Marketplace. Which visibility option you choose will depend on your use case and the audience you are targeting.

  • Private extensions are often preferred by large enterprises or companies that:
    • Want more customization and controls over data access
    • Need to integrate with a large volume of internal documents and databases
    • Have strict security policies making it difficult to authorize permissions for third-parties
  • Public extensions are suitable for:
    • Open-source projects
    • Collaborative development and use across organizations within an enterprise
    • Sharing your tool and getting feedback before publishing to the GitHub Marketplace
  • GitHub Marketplace extensions are ideal for third-parties that want to:
    • Offer their service to a broader audience
    • Integrate their tool into the developer workflow on GitHub and the IDE
    • Leverage the GitHub ecosystem to raise awareness for their product

Use cases

You can use Copilot Extensions to extend the capabilities of Copilot Chat in a variety of ways. For example, you could use them for:

  • Docs querying: A Copilot Extension could allow Copilot Chat to query a third-party documentation service to find information about a specific topic.
  • AI-assisted coding: A Copilot Extension could use a third-party AI model to provide code suggestions.
  • Data retrieval: A Copilot Extension could allow Copilot Chat to query a third-party data service to retrieve information about a specific topic.
  • Action execution: A Copilot Extension could allow Copilot Chat to execute a specific action, such as posting to a message board or updating a tracking item in an external system.

Extensions toolkit, code samples and SDK

GitHub 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 organization on GitHub.

Before creating your own Copilot Extension from scratch, you may want to explore an existing Copilot agent, and integrate it with a GitHub App to see how it works. GitHub provides a few example Copilot agents, that you can clone and use as the basis for your own Copilot Extension, including:

  • Blackbeard: A simple Copilot agent that responds to requests like a pirate, using Copilot's LLM API and special system prompts. It is a good starting point for learning how to build a Copilot Extension. For more information, see the Blackbeard Copilot Extension.

  • GitHub Models: A more complex Copilot agent that lets you ask about and interact with various LLMs listed on the GitHub Marketplace from within Copilot Chat. For more information, see the GitHub Models Copilot Extension.

    Note

    GitHub Models are in beta and subject to change. To request access, join the waitlist.

  • Function calling: an example agent written in Go that demonstrates function calling and confirmation dialogues. For more information, see the Function calling extension.

  • RAG extension: an example agent written in Go that demonstrates a simple implementation of retrieval augmented generation. For more information, see the RAG extension.

  • Preview SDK: An SDK that simplifies the process of building Copilot Extensions 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 Copilot Chat. For more information, see the Preview SDK.

About Copilot-enabled Visual Studio Code extensions

Alternatively, you can build a Copilot Extension that is exclusive and native to Visual Studio Code. These extensions are called Copilot-enabled Visual Studio Code extensions, or Visual Studio Code Chat extensions. VS Code Chat extensions can only be used in Copilot Chat for VS Code, and are a good option for developers who want to build extensions that use specific Visual Studio Code functionality.

There are some key differences from GitHub Copilot Extensions:

  • Visual Studio Code Chat extensions only work within the Visual Studio Code environment.
  • Copilot-enabled Visual Studio Code extensions have more access to Visual Studio Code's features and APIs, allowing for more editor-specific interactions like accessing local workspace data, manipulating Visual Studio Code's interface, and read/write access to local files.
  • Copilot-enabled Visual Studio Code extensions are published to the Visual Studio Code Marketplace, not the GitHub Marketplace.

For more information, see Chat extensions in the Visual Studio Code documentation.

Further reading