Skip to main content

About building GitHub Copilot Extensions

Learn about developing Extensiones de Copilot.

¿Quién puede utilizar esta característica?

Cualquiera con un plan de , o puede usar .

En el caso de las organizaciones o empresas con un plan de o , los propietarios de las organizaciones y los administradores de las empresas pueden conceder acceso a .

no está disponible para GitHub Enterprise Server.

About building Extensiones de Copilot

Extensiones de Copilot are integrations that expand the functionality of Copilot Chat, allowing developers to bring external tools, services, and custom behaviors into the Chat experience. You can use Extensiones de Copilot to extend the capabilities of Copilot Chat in a variety of ways, including:

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

Extensión de GitHub Copilot are built with GitHub Apps. They are best suited for developers who want cross-platform compatibility and app management and support from GitHub.

About skillsets and agents

Los conjuntos de aptitudes y los agentes son las dos maneras de ampliar las capacidades de Copilot y el contexto mediante la . Permiten integrar servicios externos y API en , pero cada uno atiende diferentes casos de uso y ofrece distintos niveles de control y complejidad:

  • Los conjuntos de aptitudes son ligeros y funcionales y están diseñados para desarrolladores que necesitan que Copilot lleve a cabo tareas específicas (por ejemplo, recuperación de datos u operaciones simples) con una configuración mínima. Controlan el enrutamiento, la creación de indicaciones, la evaluación de funciones y la generación de respuestas automáticamente, lo que hace que sean perfectos para integraciones rápidas y sencillas. For more information about skillsets, see Acerca de los conjuntos de aptitudes para Extensiones de Copilot.
  • Los agentes son para integraciones complejas que necesitan un control total sobre cómo se procesan las solicitudes y se generan respuestas. Permiten implementar lógica personalizada, integrarla con otros modelos LLM o la API de Copilot, administrar el contexto de conversación y controlar todos los aspectos de la interacción del usuario. Aunque los agentes requieren más tareas de ingeniería y mantenimiento, ofrecen máxima flexibilidad para flujos de trabajo sofisticados. Para más información sobre los agentes, consulta Acerca de los agentes para Extensiones de Copilot.

About context passing

You can allow your Extensión de Copilot to receive context from the editor, such as the currently opened file, by enabling the Read-only access level for the "Copilot Editor Context" permission in your GitHub App settings. See step 10 of Configuring your GitHub App.

The Plataforma de extensibilidad de GitHub Copilot automatically handles messaging when implicit and explicit context is unavailable or unauthorized. To enable context passing, you are required to request permissions from users. To enable context passing, you are required to:

  • Update your APIs to handle new reference types.
  • Request permissions from users. When requesting permissions, follow these best practices:
    • Clearly communicate what context you need and what you need it for.
    • Implement appropriate error handling for unavailable context that your own application logic and API calls.
    • If context is unavailable, provide value where possible without this data.
    • Request only the minimum required permissions for your extension.

Context passing respects content exclusions, which refers to any files listed in your context exclusion settings, including files that begin with ..

For more information about context passing, see Paso de contexto para el agente.

Using APIs in Extensión de GitHub Copilot

Building Extensión de GitHub Copilot requires using the GitHub API. Optionally, the Copilot API can be used for additional capabilities. For details on request and response formatting, see the OpenAI API documentation.

Nota:

The Copilot API is available for Extensión de Copilot builders, but only GitHub Apps and VS Code Chat extensions can be used to access these endpoints.

Resources for building Extensión de GitHub Copilot

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 Extensión de GitHub Copilot from scratch, you may want to explore an existing Agente de Copilot, then integrate it with a GitHub App to see how it works. GitHub provides a few example Agentes de Copilot that you can clone and use as the basis for your own Extensión de GitHub Copilot:

  • Blackbeard: A simple Agente de Copilot 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 Extensión de GitHub Copilot. For more information, see the Blackbeard Extensión de Copilot.

  • GitHub Models: A more complex Agente de Copilot 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 Extensión de Copilot.

    Nota:

    GitHub Models are in versión preliminar pública and subject to change.

  • 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 Extensión de GitHub Copilot 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 building Participantes de chat de VS Code habilitados para Copilot

Nota:

The GitHub documentation focuses on building Extensión de GitHub Copilot, not Participantes de chat de VS Code habilitados para Copilot.

You can build a Extensión de Copilot that is exclusive and native to Visual Studio Code, called a Participante de chat de VS Code habilitado para Copilot.

Extensión de GitHub Copilot and Participantes de chat de VS Code habilitados para Copilot use the same backend platform to route requests to extensions. Both provide similar end-user experiences, integrate with Copilot Chat, and can leverage the Copilot API or other LLMs.

While they share similarities, below are several key differences:

  • Extensión de GitHub Copilot can be used in any editor where extensions are supported, while Participantes de chat de VS Code habilitados para Copilot are only available in Visual Studio Code.
  • Extensión de GitHub Copilot are server-side extensions, requiring server infrastructure to build. These extensions provide a built-in connection to your GitHub workspaces, as set by your organization administrator.
  • Participantes de chat de VS Code habilitados para Copilot are client-side extensions that have more access to VS Code's features and APIs, allowing more editor-specific interactions like accessing local workspace data, manipulating Visual Studio Code's interface, and read/write access to local files. They do not require server infrastructure.
  • Because Participantes de chat de VS Code habilitados para Copilot are local to the user's machine, they cannot be controlled by the Copilot policies of an organization or enterprise on GitHub.com.
  • Participantes de chat de VS Code habilitados para Copilot are published to the VS Code Marketplace, not the GitHub Marketplace.

Participantes de chat de VS Code habilitados para Copilot are best suited for developers who want to build extensions that use VS Code-specific APIs and functionality, or extend existing VS Code extensions.

For more information on Participantes de chat de VS Code habilitados para Copilot, see Chat extensions in the Visual Studio Code documentation.

Indemnity for Extensiones de Copilot

Extensiones de Copilot are not covered by GitHub Copilot’s indemnity policy. However, this exclusion applies only to issues that arise within extension chat threads.

Installing and using extensions does not affect indemnity coverage for any issues that occur while using other Copilot features such as code completion and chat.

Further reading