This article is designed to help you build an entirely new Extensão do GitHub Copilot. To instead learn how to quickly build and test a demo Extensão do Copilot created by GitHub, see Quickstart for GitHub Copilot Extensions using agents.
Conjuntos de habilidades e agentes são as duas maneiras de estender as funcionalidades e o contexto do Copilotpor meio do Plataforma de Extensibilidade do Copilot. Eles permitem que você integre serviços externos e APIs ao Copilot Chat, mas cada um deles atende a diferentes casos de uso e oferece diferentes níveis de controle e complexidade:
- Conjuntos de habilidades são leves e simplificados, projetados para desenvolvedores que precisam do Copilot para executar tarefas específicas (por exemplo, recuperação de dados ou operações simples) com configuração mínima. Eles lidam com roteamento, criação de prompts, avaliação de função e geração de resposta automaticamente, tornando-os ideais para integrações rápidas e simples. For more information about skillsets, see About skillsets for Copilot Extensions.
- Agentes são para integrações complexas que precisam de controle total sobre como as solicitações são processadas e as respostas são geradas. Eles permitem que você implemente a lógica personalizada, integre-se a outras LLMs e/ou à API do Copilot, gerencie o contexto da conversa e lide com todos os aspectos da interação do usuário. Embora os Agentes exijam mais engenharia e manutenção, eles oferecem flexibilidade máxima para fluxos de trabalho sofisticados. Para saber mais sobre agentes, confira About agents for Copilot Extensions.
1. Learn about Agentes do Copilot
Agentes do Copilot contain the custom code for your Extensão do Copilot, and integrate with a GitHub App to form the Extensão do Copilot itself. For more information, see About agents for Copilot Extensions.
To successfully build a Agente do Copilot, you need to understand how the agent communicates with:
- The Copilot platform using server-sent events. See Configuring your Copilot agent to communicate with the Copilot platform.
- The GitHub API. See Configuring your Copilot agent to communicate with GitHub.
2. Review example Agentes do Copilot and the Extensões do Copilot SDK
To see the previous concepts in practice and learn about agent implementations, review the following example agents and software development kit (SDK), all of which are available in the copilot-extensions
organization:
- Blackbeard (best starting point): A simple agent that responds to requests like a pirate using Copilot's large language model (LLM) API and special system prompts.
- GitHub Models: A more complex agent that lets you ask about and interact with various LLMs listed on the GitHub Marketplace through Copilot Chat. The GitHub Models agent makes use of function calling.
- Function Calling: An example agent written in Go that demonstrates function calling and confirmation dialogs.
- RAG Extension: An example agent written in Go that demonstrates a simple implementation of retrieval augmented generation.
- Preview SDK: An SDK that streamlines the development of Extensões do Copilot by handling request verification, payload parsing, and response formatting automatically. This SDK allows extension builders to focus more on creating core functionality and less on boilerplate code.
3. Build a Agente do Copilot
Using the reference material from the previous steps, plan and build your Agente do Copilot. You can choose to implement any of the following options:
- To avoid building and managing your own LLM deployment, your agent can call the Copilot LLM deployment. See Using Copilot's LLM for your agent.
- To quickly interpret user input and choose from a variety of predefined functions to execute, you can implement function calling in your agent. To learn more, see How to use function calling with Azure OpenAI Service in the Azure OpenAI documentation and Function calling in the OpenAI documentation.
4. Deploy your Agente do Copilot
To make your Agente do Copilot accessible to the Copilot platform and GitHub, you need to deploy it to a server that is reachable by HTTP request. See Configuring your server to host your Copilot extension.
5. Create a GitHub App and integrate it with your Agente do Copilot
To create a Extensão do Copilot, you need to create and configure a GitHub App, then integrate it with your Agente do Copilot. See Creating a GitHub App for your Copilot Extension and Configuring your GitHub App for your Copilot extension.
6. Choose the availability of your Extensão do Copilot
Choose one of two visibility levels for your Extensão do Copilot:
- Public: Any user or organization account with the installation page link for the extension can install it.
- Private: Only the user or organization account that created the extension can install it.
If you make your Extensão do Copilot public, you can then choose to list it on the GitHub Marketplace.
To learn how to change the visibility of your Extensão do Copilot and list it on the GitHub Marketplace, see Managing the availability of your Copilot Extension.
Next steps
To learn how to use your Extensão do Copilot, see Using extensions to integrate external tools with Copilot Chat.
1. Learn about Conjuntos de habilidades do Github Copilot
Conjuntos de habilidades do Github Copilot contain the custom code for your Extensão do Copilot, and integrate with a GitHub App to form the Extensão do Copilot itself.
Unlike Agentes do Copilot, Conjuntos de habilidades do Copilot handle the logic behind prompt crafting, function evaluation, and response generation, making them an ideal choice for developers seeking quick and effective integrations with minimal effort. For more information, see About skillsets for Copilot Extensions.
2. Build a Conjunto de habilidades do Copilot
To explore an example of a skillset implementation, see the skillset-example repository in the copilot-extensions
organization.
To build a skillset, see Building Copilot skillsets.
3. Deploy your Conjunto de habilidades do Copilot
To make your Conjunto de habilidades do Copilot accessible to the Copilot platform and GitHub, you need to deploy it to a server that is reachable by HTTP request. See Configuring your server to host your Copilot extension.
4. Create a GitHub App and integrate it with your Conjunto de habilidades do Copilot
To create a Extensão do Copilot, you need to create and configure a GitHub App, then integrate it with your Conjunto de habilidades do Copilot. See Creating a GitHub App for your Copilot Extension and Configuring your GitHub App for your Copilot extension.
5. Choose the availability of your Conjunto de habilidades do Copilot
Choose one of two visibility levels for your Extensão do Copilot:
- Public: Any user or organization account with the installation page link for the extension can install it.
- Private: Only the user or organization account that created the extension can install it.
If you make your Extensão do Copilot public, you can then choose to list it on the GitHub Marketplace.
To learn how to change the visibility of your Extensão do Copilot and list it on the GitHub Marketplace, see Managing the availability of your Copilot Extension.
Next steps
To learn how to use your Extensão do Copilot, see Using extensions to integrate external tools with Copilot Chat.