This code sample demonstrates building a Copilot Extension using the skillsets approach rather than a traditional agent. This extension is designed to generate random test and example data for a number of development purposes, by calling publicly available APIs.
Skillsets are ideal when you want to:
Use agents instead if you need:
This extension showcases the skillset approach by providing three simple endpoints that generate random development data:
git clone git@github.com:copilot-extensions/skillset-example.git
cd skillset-example
ngrok http http://localhost:8080
FDQN
)Copilot
tab of your Application settings (https://github.com/settings/apps/<app_name>/agent
)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
General
tab of your application settings (https://github.com/settings/apps/<app_name>
)Callback URL
to anything (https://github.com
works well for testing, in a real environment, this would be a URL you control)Homepage URL
to anything as abovePermissions & events
>Account Permissions
> Copilot Chat
> Access: Read Only
https://github.com/apps/<app_name>
)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:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4