Note
Copilot Extensions are in public preview and may be subject to change. Pre-release terms apply. You must have a GitHub Copilot license of any type to use Copilot Extensions.
This is an example skillset Copilot Extension, designed to create random test and example data for a number of development purposes. The purpose of this to showcase how an extension can be created as a skillset.
- Clone the repository:
git clone [email protected]:copilot-extensions/skillset-example.git
cd skillset-example
- Install dependencies:
go mod tidy
- Start up ngrok with the port provided:
ngrok http http://localhost:8080
- Set the environment variables (use the ngrok generated url for the
FDQN
) - Run the application:
go run .
- In the
Copilot
tab of your Application settings (https://github.com/settings/apps/<app_name>/agent
)
- Set the app type to "Skillset"
- Specify the following skills
Name: random_commit_message
Inference description: Generates a random commit message
URL: https://<your ngrok domain>/random-commit-message
Parameters: { "type": "object" }
Return type: String
---
Name: random_lorem_ipsum
Inference description: Generates a random Lorem Ipsum text. Responses should have html tags present.
URL: https://<your ngrok domain>/random-lorem-ipsum
Parameters:
{
"type": "object",
"properties": {
"number_of_paragraphs": {
"type": "number",
"description": "The number of paragraphs to be generated. Must be between 1 and 10 inclusive"
},
"paragraph_length": {
"type": "string",
"description": "The length of each paragraph. Must be one of \"short\", \"medium\", \"long\", or \"verylong\""
}
}
}
Return type: String
---
Name: random_user
Inference description: Generates data for a random user
URL: https://<your ngrok domain>/random-user
Parameters: { "type": "object" }
Return type: String
- In the
General
tab of your application settings (https://github.com/settings/apps/<app_name>
)
- Set the
Callback URL
to anything (https://github.com
works well for testing, in a real environment, this would be a URL you control) - Set the
Homepage URL
to anything as above
- Ensure your permissions are enabled in
Permissions & events
>
Account Permissions
>Copilot Chat
>Access: Read Only
- Ensure you install your application at (
https://github.com/apps/<app_name>
) - Now if you go to
https://github.com/copilot
you can@
your skillset extension using the name of your app.
Here's some example things:
@skillset-example please create a random commit message
@skillset-example generate a lorem ipsum
@skillset-example generate a short lorem ipsum with 3 paragraphs
@skillset-example generate random user data
This bot provides a passthrough to a couple of other APIs:
- For commit messages, https://whatthecommit.com/
- For Lorem Ipsum, https://loripsum.net/
- For user data, https://randomuser.me/