diff --git a/README.md b/README.md index ab16992..3e87a35 100644 --- a/README.md +++ b/README.md @@ -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: @@ -96,6 +97,12 @@ Inference description: Generates data for a random user URL: https:///random-user Parameters: { "type": "object" } Return type: String +--- +Name: random_poem +Inference description: Generates a poem about blitterblatter +URL: https:///random-poem +Parameters: { "type": "object" } +Return type: String ``` 2. In the `General` tab of your application settings (`https://github.com/settings/apps/`) @@ -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 @@ -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) diff --git a/handlers/poem.go b/handlers/poem.go new file mode 100644 index 0000000..5a01f8b --- /dev/null +++ b/handlers/poem.go @@ -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)) +} \ No newline at end of file diff --git a/main.go b/main.go index 80c60f8..4603e9a 100644 --- a/main.go +++ b/main.go @@ -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")) }) diff --git a/testdatabot b/testdatabot new file mode 100755 index 0000000..6094d3d Binary files /dev/null and b/testdatabot differ