Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ Use agents instead if you need:

## Example Implementation

This extension showcases the skillset approach by providing three simple endpoints that generate random development data:
This extension showcases the skillset approach by providing four simple endpoints that generate random development data:
- Random commit messages
- Lorem ipsum text generation
- Random user data
- Poetry about "blitterblatter"

## Getting Started
1. Clone the repository:
Expand Down Expand Up @@ -96,6 +97,12 @@ Inference description: Generates data for a random user
URL: https://<your ngrok domain>/random-user
Parameters: { "type": "object" }
Return type: String
---
Name: random_poem
Inference description: Generates a poem about blitterblatter
URL: https://<your ngrok domain>/random-poem
Parameters: { "type": "object" }
Return type: String
```

2. In the `General` tab of your application settings (`https://github.com/settings/apps/<app_name>`)
Expand All @@ -114,6 +121,7 @@ Here's some example things:
* `@skillset-example generate a lorem ipsum`
* `@skillset-example generate a short lorem ipsum with 3 paragraphs`
* `@skillset-example generate random user data`
* `@skillset-example write a poem about blitterblatter`

## Implementation

Expand All @@ -122,6 +130,7 @@ 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/
* Poems about blitterblatter are generated locally

## Documentation
- [Using Copilot Extensions](https://docs.github.com/en/copilot/using-github-copilot/using-extensions-to-integrate-external-tools-with-copilot-chat)
Expand Down
29 changes: 29 additions & 0 deletions handlers/poem.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package handlers

import (
"fmt"
"net/http"
)

// Poem returns a poem about blitterblatter
func Poem(w http.ResponseWriter, r *http.Request) {
fmt.Println("Poem Called")

poem := `Blitterblatter, whimsical word,
Dancing on the tongue, quite absurd.
A sound that splashes, a rhythmic patter,
In a world of nonsense, what does it matter?

Blitterblatter through puddles of rain,
Echoing laughter, soothing the pain.
A made-up term with magical power,
Blooming like an imaginary flower.

Blitterblatter in dreams and in play,
A fantastical concept that's here to stay.
Neither thing nor thought but somewhere between,
The most curious word you've ever seen.`

w.Header().Set("Content-Type", "text/plain")
w.Write([]byte(poem))
}
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func run() error {
http.HandleFunc("/random-commit-message", handlers.CommitMessage)
http.HandleFunc("/random-lorem-ipsum", handlers.Loripsum)
http.HandleFunc("/random-user", handlers.User)
http.HandleFunc("/random-poem", handlers.Poem)
http.HandleFunc("/_ping", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("OK"))
})
Expand Down
Binary file added testdatabot
Binary file not shown.