Skip to content

Commit

Permalink
Copilot Extensions - 3P Skillsets (public preview) (#53141)
Browse files Browse the repository at this point in the history
Co-authored-by: Dimitrios Philliou <[email protected]>
Co-authored-by: hubwriter <[email protected]>
  • Loading branch information
3 people authored Nov 19, 2024
1 parent 0e2ccc3 commit 0ff4b8c
Show file tree
Hide file tree
Showing 33 changed files with 355 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ If you're interested in creating an app for {% data variables.product.prodname_m

### {% data variables.product.prodname_copilot_extensions %}

{% data reusables.copilot.copilot-extensions.beta-note %}
{% data reusables.copilot.copilot-extensions.public-preview-note %}

{% data reusables.copilot.copilot-extensions.copilot-extensions-intro %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ shortTitle: About building Extensions
type: overview
---

{% data reusables.copilot.copilot-extensions.beta-note %}
{% data reusables.copilot.copilot-extensions.public-preview-note %}

## About {% data variables.product.prodname_copilot_extensions_short %}

Expand Down Expand Up @@ -45,6 +45,12 @@ type: overview
* Integrate their tool into the developer workflow on {% data variables.product.company_short %} and the IDE
* Leverage the {% data variables.product.company_short %} ecosystem to raise awareness for their product

### About skillsets and agents

{% data reusables.copilot.copilot-extensions.differences-between-agents-and-skillsets-1 %}
For more information about skillsets, see "[AUTOTITLE](/copilot/building-copilot-extensions/building-a-copilot-skillset-for-your-copilot-extension/about-copilot-skillsets)."
{% data reusables.copilot.copilot-extensions.differences-between-agents-and-skillsets-2 %}

### Resources for building {% data variables.product.prodname_copilot_extensions %}

{% 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 %}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ shortTitle: About Copilot agents
type: overview
---

{% data reusables.copilot.copilot-extensions.beta-note %}
{% data reusables.copilot.copilot-extensions.public-preview-note %}

{% 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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ shortTitle: Communicate with GitHub
type: reference
---

{% data reusables.copilot.copilot-extensions.beta-note %}
{% data reusables.copilot.copilot-extensions.public-preview-note %}

## Prerequisites

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type: reference
layout: inline
---

{% data reusables.copilot.copilot-extensions.beta-note %}
{% data reusables.copilot.copilot-extensions.public-preview-note %}

{% data variables.product.prodname_copilot_agents_short %} communicate with the {% data variables.product.prodname_copilot_short %} platform in the form of server-sent events (SSEs). Rather than waiting for the {% data variables.product.prodname_copilot_short %} platform to request an update from your agent, or vice versa, you can use SSEs to send and receive updates to and from the platform in real time.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type: reference
allowTitleToDifferFromFilename: true
---

{% data reusables.copilot.copilot-extensions.beta-note %}
{% data reusables.copilot.copilot-extensions.public-preview-note %}

## About {% data variables.product.prodname_copilot_short %}'s Language Learning Model (LLM)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: About Copilot skillsets
intro: 'Learn what {% data variables.product.prodname_copilot_skillsets %} are and how they simplify integrating third-party tools and functions into your {% data variables.product.prodname_copilot_short %} experience.'
versions:
feature: copilot-extensions
topics:
- Copilot
shortTitle: About {% data variables.product.prodname_copilot_skillsets_short %}
type: overview
---

{% data reusables.copilot.copilot-extensions.public-preview-note %}

A skill within {% data variables.product.prodname_copilot %} is a tool that the model calls to perform a specific task in response to a user query. A skillset is a collection of these skills (up to five per skillset). {% data variables.product.prodname_copilot_skillsets %} provide a streamlined way to extend {% data variables.product.prodname_copilot_short %}’s functionality, allowing builders to integrate external services or custom API endpoints into their {% data variables.product.prodname_copilot_short %} workflow. With skillsets, builders can enable {% data variables.product.prodname_copilot_short %} to perform tasks—such as retrieving data or executing actions in third-party services—without needing to manage complex workflows or architecture.

For a quickstart example of a skillset, see the "[skillset-example](https://github.com/copilot-extensions/skillset-example)" repository. For information on building a skillset, see "[AUTOTITLE](/copilot/building-copilot-extensions/building-a-copilot-skillset-for-your-copilot-extension/building-copilot-skillsets)."

## How skillsets and agents differ

{% data reusables.copilot.copilot-extensions.differences-between-agents-and-skillsets-1 %}
{% data reusables.copilot.copilot-extensions.differences-between-agents-and-skillsets-2 %}

## The extensibility platform

Skillsets and agents both operate on the {% data variables.product.prodname_copilot_extensibility_platform %}, which manages the flow of user requests and function evaluations. With {% data variables.product.prodname_copilot_skillsets_short %}, the platform handles routing, prompt crafting, function calls and prompt generation.

### Workflow overview

The extensibility platform follows a structured workflow to process user requests and generate responses:

1. **User request**
A user issues a request in the {% data variables.product.prodname_copilot_chat_short %} interface, such as asking for data or executing a specific action.

1. **Routing**
The request is routed to the appropriate extension. For skillsets, this means the platform agent identifies and invokes the corresponding skillset based on the user’s intent. Each skill’s inference description helps the platform determine which skill to call.

1. **Dynamic Prompt Crafting**
{% data variables.product.prodname_copilot %} generates a prompt using:
* The user’s query.
* Relevant thread history.
* Available functions within the skillset.
* Results from any prior function calls.

1. **LLM Completion**
The language model (LLM) processes the prompt and determines:
* Whether the user’s intent matches a skillset function.
* Which function(s) to call and with what arguments.
* If required, the LLM may send additional function calls to gather more context.

1. **Function Evaluation**
The extension invokes the selected function(s), which may involve:
* Gathering relevant context, such as {% data variables.product.prodname_copilot_skillsets_short %} repository or user metadata.
* Making an API call to an external service to retrieve data or execute an action.

1. **Response generation**
The platform iteratively refines the output, looping through prompt crafting, LLM completion, and function evaluation as needed. Once the process is complete, {% data variables.product.prodname_copilot_short %} streams a final response back to the user in the chat interface.
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
title: Building Copilot skillsets
intro: 'Learn the steps to build {% data variables.product.prodname_copilot_skillsets %} and integrate custom tools and functions into your Copilot environment.'
versions:
feature: copilot-extensions
topics:
- Copilot
shortTitle: Build {% data variables.product.prodname_copilot_skillsets_short %}
type: how_to
---

{% data reusables.copilot.copilot-extensions.public-preview-note %}

## Introduction

{% data variables.product.prodname_copilot_skillsets %} are a streamlined way to extend {% data variables.product.prodname_copilot %}'s functionality by defining API endpoints that {% data variables.product.prodname_copilot_short %} can call. When you create a skillset, {% data variables.product.prodname_copilot_short %} handles all the AI interactions while your endpoints provide the data or functionality. This guide walks you through configuring and deploying a skillset within your {% data variables.product.prodname_github_app %}.

## Prerequisites

Before you begin, make sure you have the following:

1. **A configured {% data variables.product.prodname_github_app %}**: You’ll need a {% data variables.product.prodname_github_app %} to act as the container for your skillset. If you haven’t already set one up, refer to "[AUTOTITLE](/copilot/building-copilot-extensions/creating-a-copilot-extension/creating-a-github-app-for-your-copilot-extension)" and "[AUTOTITLE](/copilot/building-copilot-extensions/creating-a-copilot-extension/configuring-your-github-app-for-your-copilot-extension)".
1. **API endpoints**: You need one endpoint per skill. Each endpoint must:
* Accept POST requests with the `application/json` MIME type
* Be able to verify the signature of requests from {% data variables.product.github %} to authenticate their origin and prevent unauthorized access
* Be publicly accessible via HTTPS

For more information about signature verification, see "[Verifying that payloads are coming from Github](/copilot/building-copilot-extensions/building-a-copilot-agent-for-your-copilot-extension/configuring-your-copilot-agent-to-communicate-with-github#verifying-that-payloads-are-coming-from-github)".

## Configuration requirements

Each skillset is defined within a {% data variables.product.prodname_github_app %}. A single{% data variables.product.prodname_github_app %} can contain up to five skills. Each individual skill needs:
* **Name**: A clear and descriptive name (for example, "Get Issues").
* **Inference description**: A detailed explanation of what the skill does and when to use it (for example, "Searches for external issues matching specific criteria like status and labels").
* **API endpoint**: A POST endpoint that accepts JSON requests.
* **JSON schema**: The structure of data your endpoint expects.

### Example JSON schema

This example demonstrates a skill that requires two parameters: a status string and a label string. If no parameters are provided, an empty object with the type 'object' must be passed in as the request body.

```json
{
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "filter issues by status (open, closed)",
"enum": ["open", "closed"]
},
"label": {
"type": "string",
"description": "filter issues by label"
}
}
}
```

This format lets users make natural-language requests like `find open security issues` and {% data variables.product.prodname_copilot_short %} will structure the appropriate API call.

## Using your skillset

To use your skillset:
1. Type `@` followed by your extension's name.
1. Type your prompt in natural language.

For example:
* `@skillset-example generate a lorem ipsum`
* `@skillset-example give me sample data with 100 words`

Copilot interprets your request and calls the appropriate skill with the right parameters. There's no need to specify which skill to use—{% data variables.product.prodname_copilot_short %} determines this from your natural-language request and the inference descriptions provided.

## Setting up a skillset

{% data reusables.apps.settings-step-personal-orgs %}
{% data reusables.user-settings.developer_settings %}
{% data reusables.user-settings.github_apps %}
1. In the list of {% data variables.product.prodname_github_apps %}, click the {% data variables.product.prodname_github_app %} you want to configure for your skillset.
1. In the navigation menu on the left, select **{% data variables.product.prodname_copilot_short %}**.
1. Under **App Type**, select **Skillset** from the dropdown menu.
1. Optionally, in the **Pre-authorization URL** field, enter the URL where users will be redirected to start the authentication process. This step is necessary if your API requires users to connect their GitHub account to access certain features or data.
{% data reusables.copilot.copilot-extensions.skillsets-configuration-steps %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Building a Copilot skillset for your Copilot Extension
shortTitle: Build a Copilot skillset
intro: 'Learn how to build a custom {% data variables.product.prodname_copilot_skillset_short %} to combine custom skills and extend the capabilities of {% data variables.product.prodname_copilot_short %}.'
versions:
feature: copilot
topics:
- Copilot
children:
- /about-copilot-skillsets
- /building-copilot-skillsets
---

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ shortTitle: Extensions Glossary
type: reference
---

{% data reusables.copilot.copilot-extensions.beta-note %}
{% data reusables.copilot.copilot-extensions.public-preview-note %}

The following terms are used in the context of {% data variables.product.prodname_copilot_extensions_short %}, and are defined here for clarity.

Expand Down Expand Up @@ -55,7 +55,11 @@ An extension that is visible and installable by any {% data variables.product.co

#### Skill

A piece of code that retrieves context or executes an action in response to a user’s prompt (e.g., "findIssueByID(id: number)").
A piece of code that retrieves context or executes an action in response to a user’s prompt (for example, "findIssueByID(id: number)"). For a list of a skills, see "[Currently available skills](/copilot/using-github-copilot/asking-github-copilot-questions-in-your-ide#currently-available-skills)".

#### Skillset

A collection of skills in the form of an implementation in {% data variables.product.prodname_copilot_extensions %} that allows developers to connect external services or custom API endpoints to Copilot with minimal complexity. The {% data variables.product.prodname_copilot_extensibility_platform_short %} handles prompt crafting, function evaluation, and response generation. The developer handles only the API call.

#### Tool/Function Calling

Expand Down

This file was deleted.

Loading

0 comments on commit 0ff4b8c

Please sign in to comment.