mirror of
https://github.com/danielmiessler/fabric
synced 2024-11-08 07:11:06 +00:00
Merge branch 'main' of github.com:danielmiessler/fabric
This commit is contained in:
commit
2eed7ec935
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
@ -2,7 +2,6 @@ name: Go Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
@ -64,7 +63,7 @@ jobs:
|
||||
GOOS: ${{ env.OS }}
|
||||
GOARCH: ${{ matrix.arch }}
|
||||
run: |
|
||||
go build -ldflags "-X main.version=$(git describe --tags --abbrev=0)" -o fabric-${OS}-${{ matrix.arch }} .
|
||||
go build -o fabric-${OS}-${{ matrix.arch }} .
|
||||
|
||||
- name: Build binary on Windows
|
||||
if: matrix.os == 'windows-latest'
|
||||
@ -72,7 +71,7 @@ jobs:
|
||||
GOOS: windows
|
||||
GOARCH: ${{ matrix.arch }}
|
||||
run: |
|
||||
go build -ldflags "-X main.version=$(git describe --tags --abbrev=0)" -o fabric-windows-${{ matrix.arch }}.exe .
|
||||
go build -o fabric-windows-${{ matrix.arch }}.exe .
|
||||
|
||||
- name: Upload build artifact
|
||||
if: matrix.os != 'windows-latest'
|
||||
|
67
.github/workflows/update-version-and-create-tag.yml
vendored
Normal file
67
.github/workflows/update-version-and-create-tag.yml
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
name: Update Version File and Create Tag
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main # Monitor the main branch
|
||||
|
||||
permissions:
|
||||
contents: write # Ensure the workflow has write permissions
|
||||
|
||||
jobs:
|
||||
update-version:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Fetch all history to include tags
|
||||
|
||||
- name: Set up Git
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Get the latest tag
|
||||
id: get_latest_tag
|
||||
run: |
|
||||
latest_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
|
||||
echo "Latest tag is: $latest_tag"
|
||||
echo "tag=$latest_tag" >> $GITHUB_ENV # Save the latest tag to environment file
|
||||
|
||||
- name: Increment patch version
|
||||
id: increment_version
|
||||
run: |
|
||||
latest_tag=${{ env.tag }}
|
||||
major=$(echo "$latest_tag" | cut -d. -f1 | sed 's/v//')
|
||||
minor=$(echo "$latest_tag" | cut -d. -f2)
|
||||
patch=$(echo "$latest_tag" | cut -d. -f3)
|
||||
new_patch=$((patch + 1))
|
||||
new_tag="v${major}.${minor}.${new_patch}"
|
||||
echo "New tag is: $new_tag"
|
||||
echo "new_tag=$new_tag" >> $GITHUB_ENV # Save the new tag to environment file
|
||||
|
||||
- name: Update version.go file
|
||||
run: |
|
||||
echo "package main" > version.go
|
||||
echo "" >> version.go
|
||||
echo "var version = \"${{ env.new_tag }}\"" >> version.go
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git add version.go
|
||||
git commit -m "Update version to ${{ env.new_tag }} and commit $commit_hash"
|
||||
|
||||
- name: Push changes
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Use GITHUB_TOKEN to authenticate the push
|
||||
run: |
|
||||
git push origin main # Push changes to the main branch
|
||||
|
||||
- name: Create a new tag
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
git tag ${{ env.new_tag }}
|
||||
git push origin ${{ env.new_tag }} # Push the new tag
|
59
.github/workflows/update-version.yml
vendored
59
.github/workflows/update-version.yml
vendored
@ -1,59 +0,0 @@
|
||||
name: Update Version File
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main # Or whichever branch you want to monitor
|
||||
tags:
|
||||
- '*' # Trigger on any new tag
|
||||
|
||||
permissions:
|
||||
contents: write # Ensure the workflow has write permissions
|
||||
|
||||
jobs:
|
||||
update-version:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Fetch all history to include tags
|
||||
|
||||
- name: Set up Git
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Get the latest tag
|
||||
id: get_latest_tag
|
||||
run: |
|
||||
latest_tag=$(git describe --tags --abbrev=0)
|
||||
echo "Latest tag is: $latest_tag"
|
||||
echo "::set-output name=tag::$latest_tag"
|
||||
|
||||
- name: Get the latest commit hash
|
||||
id: get_commit_hash
|
||||
run: |
|
||||
commit_hash=$(git rev-parse --short HEAD)
|
||||
echo "Commit hash is: $commit_hash"
|
||||
echo "::set-output name=commit_hash::$commit_hash"
|
||||
|
||||
- name: Update version.go file
|
||||
run: |
|
||||
latest_tag=${{ steps.get_latest_tag.outputs.tag }}
|
||||
commit_hash=${{ steps.get_commit_hash.outputs.commit_hash }}
|
||||
echo "package main" > version.go
|
||||
echo "" >> version.go
|
||||
echo "var version = \"${latest_tag}-${commit_hash}\"" >> version.go
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git add version.go
|
||||
git commit -m "Update version to ${{ steps.get_latest_tag.outputs.tag }} and commit ${{ steps.get_commit_hash.outputs.commit_hash }}"
|
||||
|
||||
- name: Push changes
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Use GITHUB_TOKEN to authenticate the push
|
||||
run: |
|
||||
git push origin main # Or the relevant branch
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,6 +11,7 @@ __pycache__/
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
.idea
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
|
@ -243,6 +243,7 @@ Application Options:
|
||||
-e, --seed= Seed to be used for LMM generation
|
||||
-w, --wipecontext= Wipe context
|
||||
-W, --wipesession= Wipe session
|
||||
--readability Convert HTML input into a clean, readable view
|
||||
--dry-run Show what would be sent to the model without actually sending it
|
||||
--version Print current version
|
||||
|
||||
|
@ -2,6 +2,7 @@ package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/danielmiessler/fabric/converter"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
@ -110,6 +111,14 @@ func Cli(version string) (message string, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
if currentFlags.HtmlReadability {
|
||||
if msg, cleanErr := converter.HtmlReadability(currentFlags.Message); cleanErr != nil {
|
||||
fmt.Println("use original input, because can't apply html readability", err)
|
||||
} else {
|
||||
currentFlags.Message = msg
|
||||
}
|
||||
}
|
||||
|
||||
// if the interactive flag is set, run the interactive function
|
||||
// if currentFlags.Interactive {
|
||||
// interactive.Interactive()
|
||||
|
@ -46,6 +46,7 @@ type Flags struct {
|
||||
Seed int `short:"e" long:"seed" description:"Seed to be used for LMM generation"`
|
||||
WipeContext string `short:"w" long:"wipecontext" description:"Wipe context"`
|
||||
WipeSession string `short:"W" long:"wipesession" description:"Wipe session"`
|
||||
HtmlReadability bool `long:"readability" description:"Convert HTML input into a clean, readable view"`
|
||||
DryRun bool `long:"dry-run" description:"Show what would be sent to the model without actually sending it"`
|
||||
Version bool `long:"version" description:"Print current version"`
|
||||
}
|
||||
|
25
converter/html_readability.go
Normal file
25
converter/html_readability.go
Normal file
@ -0,0 +1,25 @@
|
||||
package converter
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/go-shiori/go-readability"
|
||||
)
|
||||
|
||||
// HtmlReadability Convert HTML input into a clean, readable view
|
||||
// args:
|
||||
//
|
||||
// html (string): full data of web page
|
||||
//
|
||||
// return:
|
||||
//
|
||||
// viewContent (string): html main content
|
||||
// err (error): parser error
|
||||
func HtmlReadability(html string) (ret string, err error) {
|
||||
buf := bytes.NewBufferString(html)
|
||||
var article readability.Article
|
||||
if article, err = readability.FromReader(buf, nil); err != nil {
|
||||
return
|
||||
}
|
||||
ret = article.TextContent
|
||||
return
|
||||
}
|
46
converter/html_readability_test.go
Normal file
46
converter/html_readability_test.go
Normal file
@ -0,0 +1,46 @@
|
||||
package converter
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestHtmlReadability(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
html string
|
||||
expected string
|
||||
}{
|
||||
{
|
||||
name: "Empty HTML",
|
||||
html: "",
|
||||
expected: "",
|
||||
},
|
||||
{
|
||||
name: "HTML with text",
|
||||
html: "<p>Hello World</p>",
|
||||
expected: "Hello World",
|
||||
},
|
||||
{
|
||||
name: "HTML with nested tags",
|
||||
html: "<div><p>Hello</p><p>World</p></div>",
|
||||
expected: "HelloWorld",
|
||||
},
|
||||
{
|
||||
name: "HTML missing tags",
|
||||
html: "<div><p>Hello</p><p>World</div>",
|
||||
expected: "HelloWorld",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
result, err := HtmlReadability(tc.html)
|
||||
|
||||
// 验证结果
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, tc.expected, result)
|
||||
})
|
||||
}
|
||||
}
|
5
go.mod
5
go.mod
@ -6,6 +6,7 @@ require (
|
||||
github.com/anaskhan96/soup v1.2.5
|
||||
github.com/atotto/clipboard v0.1.4
|
||||
github.com/go-git/go-git/v5 v5.12.0
|
||||
github.com/go-shiori/go-readability v0.0.0-20240923125239-59a7bd165825
|
||||
github.com/google/generative-ai-go v0.18.0
|
||||
github.com/jessevdk/go-flags v1.6.1
|
||||
github.com/joho/godotenv v1.5.1
|
||||
@ -30,6 +31,8 @@ require (
|
||||
dario.cat/mergo v1.0.1 // indirect
|
||||
github.com/Microsoft/go-winio v0.6.2 // indirect
|
||||
github.com/ProtonMail/go-crypto v1.0.0 // indirect
|
||||
github.com/andybalholm/cascadia v1.3.2 // indirect
|
||||
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de // indirect
|
||||
github.com/cloudflare/circl v1.4.0 // indirect
|
||||
github.com/cyphar/filepath-securejoin v0.3.2 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
@ -39,6 +42,8 @@ require (
|
||||
github.com/go-git/go-billy/v5 v5.5.0 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-shiori/dom v0.0.0-20230515143342-73569d674e1c // indirect
|
||||
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/google/s2a-go v0.1.8 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
|
18
go.sum
18
go.sum
@ -21,8 +21,12 @@ github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0k
|
||||
github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
|
||||
github.com/anaskhan96/soup v1.2.5 h1:V/FHiusdTrPrdF4iA1YkVxsOpdNcgvqT1hG+YtcZ5hM=
|
||||
github.com/anaskhan96/soup v1.2.5/go.mod h1:6YnEp9A2yywlYdM4EgDz9NEHclocMepEtku7wg6Cq3s=
|
||||
github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss=
|
||||
github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
|
||||
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de h1:FxWPpzIjnTlhPwqqXc4/vE0f7GvRjuAsbW+HOIe8KnA=
|
||||
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de/go.mod h1:DCaWoUhZrYW9p1lxo/cm8EmUOOzAPSEZNGF2DK1dJgw=
|
||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
|
||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
|
||||
github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=
|
||||
@ -64,6 +68,12 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/go-shiori/dom v0.0.0-20230515143342-73569d674e1c h1:wpkoddUomPfHiOziHZixGO5ZBS73cKqVzZipfrLmO1w=
|
||||
github.com/go-shiori/dom v0.0.0-20230515143342-73569d674e1c/go.mod h1:oVDCh3qjJMLVUSILBRwrm+Bc6RNXGZYtoh9xdvf1ffM=
|
||||
github.com/go-shiori/go-readability v0.0.0-20240923125239-59a7bd165825 h1:CpSi7xiWqGaAqVn/2MsbRoDmPwXMvvQUu3hLjX1QrOM=
|
||||
github.com/go-shiori/go-readability v0.0.0-20240923125239-59a7bd165825/go.mod h1:YWa00ashoPZMAOElrSn4E1cJErhDVU6PWAll4Hxzn+w=
|
||||
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f h1:3BSP1Tbs2djlpprl7wCLuiqMaUh5SJkkzI2gDs+FgLs=
|
||||
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
|
||||
@ -116,6 +126,7 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/liushuangls/go-anthropic/v2 v2.8.0 h1:0zH2jDNycbrlszxnLrG+Gx8vVT0yJAPWU4s3ZTkWzgI=
|
||||
github.com/liushuangls/go-anthropic/v2 v2.8.0/go.mod h1:8BKv/fkeTaL5R9R9bGkaknYBueyw2WxY20o7bImbOek=
|
||||
github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
|
||||
github.com/ollama/ollama v0.3.11 h1:Fs1B5WjXYUvr5bkMZZpUJfiqIAxrymujRidFABwMeV8=
|
||||
github.com/ollama/ollama v0.3.11/go.mod h1:YrWoNkFnPOYsnDvsf/Ztb1wxU9/IXrNsQHqcxbY2r94=
|
||||
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
|
||||
@ -131,12 +142,14 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
|
||||
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
|
||||
github.com/samber/lo v1.47.0 h1:z7RynLwP5nbyRscyvcD043DWYoOcYRv3mV8lBeqOCLc=
|
||||
github.com/samber/lo v1.47.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU=
|
||||
github.com/sashabaranov/go-openai v1.30.0 h1:fHv9urGxABfm885xGWsXFSk5cksa+8dJ4jGli/UQQcI=
|
||||
github.com/sashabaranov/go-openai v1.30.0/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
|
||||
github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4/go.mod h1:C1a7PQSMz9NShzorzCiG2fk9+xuCgLkPeCvMHYR2OWg=
|
||||
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
|
||||
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
|
||||
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||
@ -148,6 +161,7 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
@ -196,6 +210,7 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
|
||||
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
|
||||
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
|
||||
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
@ -224,6 +239,7 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
|
||||
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
@ -231,6 +247,7 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX
|
||||
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
|
||||
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
|
||||
golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM=
|
||||
golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@ -240,6 +257,7 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
|
||||
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||
golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U=
|
||||
|
@ -11,11 +11,11 @@ Please write a user story and acceptance criteria for the requested topic.
|
||||
Output the results in JSON format as defined in this example:
|
||||
|
||||
{
|
||||
"Topic": "Automating data quality automation",
|
||||
"Topic": "Authentication and User Management",
|
||||
"Story": "As a user, I want to be able to create a new user account so that I can access the system.",
|
||||
"Criteria": "Given that I am a user, when I click the 'Create Account' button, then I should be prompted to enter my email address, password, and confirm password. When I click the 'Submit' button, then I should be redirected to the login page."
|
||||
}
|
||||
|
||||
# INPUT:
|
||||
|
||||
INPUT:
|
||||
INPUT:
|
||||
|
29
patterns/analyze_military_strategy/system.md
Normal file
29
patterns/analyze_military_strategy/system.md
Normal file
@ -0,0 +1,29 @@
|
||||
# IDENTITY and PURPOSE
|
||||
You are a military historian and strategic analyst specializing in dissecting historical battles. Your purpose is to provide comprehensive, insightful analysis of military engagements, focusing on the strategies employed by opposing forces. You excel at comparing and contrasting tactical approaches, identifying key strengths and weaknesses, and presenting this information in a clear, structured format.
|
||||
|
||||
# STEPS
|
||||
- Summarize the battle in 50 words or less, including the date, location, and main combatants in a section called BATTLE OVERVIEW.
|
||||
- Identify and list the primary commanders for each side in a section called COMMANDERS.
|
||||
- Analyze and list 10-20 key strategic decisions made by each side in a section called STRATEGIC DECISIONS.
|
||||
- Extract 15-30 of the most crucial strengths and weaknesses for each opposing force into a section called STRENGTHS AND WEAKNESSES.
|
||||
- Identify and list 10-20 pivotal moments or turning points in the battle in a section called PIVOTAL MOMENTS.
|
||||
- Compare and contrast 15-30 tactical approaches used by both sides in a section called TACTICAL COMPARISON.
|
||||
- Analyze and list 10-20 logistical factors that influenced the battle's outcome in a section called LOGISTICAL FACTORS.
|
||||
- Evaluate the battle's immediate and long-term consequences in 100-150 words in a section called BATTLE CONSEQUENCES.
|
||||
- Summarize the most crucial strategic lesson from this battle in a 20-word sentence in a section called KEY STRATEGIC LESSON.
|
||||
|
||||
# OUTPUT INSTRUCTIONS
|
||||
- Only output in Markdown format.
|
||||
- Present the STRENGTHS AND WEAKNESSES and TACTICAL COMPARISON sections in a two-column format, with one side on the left and the other on the right.
|
||||
- Write the STRATEGIC DECISIONS bullets as exactly 20 words each.
|
||||
- Write the PIVOTAL MOMENTS bullets as exactly 15 words each.
|
||||
- Write the LOGISTICAL FACTORS bullets as exactly 15 words each.
|
||||
- Extract at least 15 items for each output section unless otherwise specified.
|
||||
- Do not give warnings or notes; only output the requested sections.
|
||||
- Use bulleted lists for output, not numbered lists.
|
||||
- Do not repeat information across different sections.
|
||||
- Ensure variety in how bullet points begin; avoid repetitive phrasing.
|
||||
- Follow ALL these instructions meticulously when creating your output.
|
||||
|
||||
# INPUT
|
||||
INPUT:
|
31
patterns/extract_product_features/system.md
Normal file
31
patterns/extract_product_features/system.md
Normal file
@ -0,0 +1,31 @@
|
||||
# IDENTITY and PURPOSE
|
||||
|
||||
You extract the list of product features from the input.
|
||||
|
||||
Take a step back and think step-by-step about how to achieve the best possible results by following the steps below.
|
||||
|
||||
# STEPS
|
||||
|
||||
- Consume the whole input as a whole and think about the type of announcement or content it is.
|
||||
|
||||
- Figure out which parts were talking about features of a product or service.
|
||||
|
||||
- Output the list of features as a bulleted list of 15 words per bullet.
|
||||
|
||||
# OUTPUT INSTRUCTIONS
|
||||
|
||||
- Only output Markdown.
|
||||
|
||||
- Do not give warnings or notes; only output the requested sections.
|
||||
|
||||
- You use bulleted lists for output, not numbered lists.
|
||||
|
||||
- Do not repeat ideas, quotes, facts, or resources.
|
||||
|
||||
- Do not start items with the same opening words.
|
||||
|
||||
- Ensure you follow ALL these instructions when creating your output.
|
||||
|
||||
# INPUT
|
||||
|
||||
INPUT:
|
@ -1,24 +1,35 @@
|
||||
# IDENTITY
|
||||
|
||||
You are an AI assistant designed to provide detailed, step-by-step responses.
|
||||
You are an AI assistant designed to provide detailed, step-by-step responses. Your outputs should follow this structure:
|
||||
|
||||
# STEPS
|
||||
|
||||
1. Begin with a <thinking> section.
|
||||
|
||||
2. Inside the thinking section:
|
||||
a. Briefly analyze the question and outline your approach.
|
||||
b. Present a clear plan of steps to solve the problem.
|
||||
c. Use a "Chain of Thought" reasoning process if necessary, breaking down y
|
||||
3. Include a reflection> section for each idea where you:
|
||||
a. Review your reasoning.
|
||||
b. Check for potential errors or oversights.
|
||||
c. Confirm or adjust your conclusion if necessary.
|
||||
4. Be sure to close all reflection sections.
|
||||
5. Close the thinking section with </thinking>.
|
||||
6. Provide your final answer in an ‹output> section.
|
||||
Always use these tags in your responses. Be thorough in your explanations, sho
|
||||
Remember: Both <thinking> and < reflection> MUST be tags and must be closed at
|
||||
Make sure all ‹tags> are on separate lines with no other text.
|
||||
|
||||
- a. Briefly analyze the question and outline your approach.
|
||||
|
||||
- b. Present a clear plan of steps to solve the problem.
|
||||
|
||||
- c. Use a "Chain of Thought" reasoning process if necessary, breaking down your thought process into numbered steps.
|
||||
|
||||
3. Include a <reflection> section for each idea where you:
|
||||
|
||||
- a. Review your reasoning.
|
||||
|
||||
- b. Check for potential errors or oversights.
|
||||
|
||||
- c. Confirm or adjust your conclusion if necessary.
|
||||
- Be sure to close all reflection sections.
|
||||
- Close the thinking section with </thinking>.
|
||||
- Provide your final answer in an <output> section.
|
||||
|
||||
Always use these tags in your responses. Be thorough in your explanations, showing each step of your reasoning process.
|
||||
Aim to be precise and logical in your approach, and don't hesitate to break down complex problems into simpler components.
|
||||
Your tone should be analytical and slightly formal, focusing on clear communication of your thought process.
|
||||
Remember: Both <thinking> and <reflection> MUST be tags and must be closed at their conclusion.
|
||||
Make sure all <tags> are on separate lines with no other text.
|
||||
|
||||
# INPUT
|
||||
|
||||
|
@ -16,24 +16,24 @@ Take a step back and think step-by-step about how to achieve the best possible r
|
||||
|
||||
- In a section called MAIN IDEA, write a 15-word sentence that captures the main idea.
|
||||
|
||||
- In a section called MINUTES, 20 to 50 bullet points, tracking the conversation, highliting of the most surprising, insightful, and/or interesting ideas that come up. If there are less than 50 then collect all of them. Make sure you extract at least 20.
|
||||
- In a section called MINUTES, write 20 to 50 bullet points, highliting of the most surprising, insightful, and/or interesting ideas that come up in the conversation. If there are less than 50 then collect all of them. Make sure you extract at least 20.
|
||||
|
||||
- In a section called ACTIONABLES, write bullet points for ALL agreed actionable details. This includes and case where a speaker agrees to do, or look into something. If there is a deadline mentioned, include it here.
|
||||
- In a section called ACTIONABLES, write bullet points for ALL agreed actionable details. This includes cases where a speaker agrees to do or look into something. If there is a deadline mentioned, include it here.
|
||||
|
||||
- In a section called DECISIONS: In bullet points, include all decisions made during the meeting, including the rationale behind each decision.
|
||||
- In a section called DECISIONS, include all decisions made during the meeting, including the rationale behind each decision. Present them as bullet points.
|
||||
|
||||
- In a section called CHALLENGES: Identify and document any challenges or issues discussed during the meeting. Note any potential solutions or strategies proposed to address these challenges
|
||||
- In a section called CHALLENGES, identify and document any challenges or issues discussed during the meeting. Note any potential solutions or strategies proposed to address these challenges.
|
||||
|
||||
- In a section caled NEXT STEPS, Outline the next steps and action plan to be taken after the meeting
|
||||
- In a section caled NEXT STEPS, outline the next steps and actions to be taken after the meeting
|
||||
|
||||
# OUTPUT INSTRUCTIONS
|
||||
|
||||
- Only output Markdown.
|
||||
- Write MINUTE bullets as exxactly 15 words
|
||||
- Write ACTIONABLES as exactly 15 words
|
||||
- Write DECISIONS as exactly 15 words
|
||||
- Write CHALLENFE as 2-3 sentences.
|
||||
- Write NEXT STEP a 2-3 sentences
|
||||
- Write MINUTES as exxactly 15 words.
|
||||
- Write ACTIONABLES as exactly 15 words.
|
||||
- Write DECISIONS as exactly 15 words.
|
||||
- Write CHALLENGES as 2-3 sentences.
|
||||
- Write NEXT STEPS a 2-3 sentences.
|
||||
- Do not give warnings or notes; only output the requested sections.
|
||||
- Do not repeat ideas, quotes, facts, or resources.
|
||||
- You use bulleted lists for output, not numbered lists.
|
||||
@ -42,4 +42,4 @@ Take a step back and think step-by-step about how to achieve the best possible r
|
||||
|
||||
# INPUT
|
||||
|
||||
INPUT:
|
||||
INPUT:
|
||||
|
@ -1,3 +1,3 @@
|
||||
package main
|
||||
|
||||
var version = "v1.4.32-7b8ea76"
|
||||
var version = "v1.4.35"
|
||||
|
Loading…
Reference in New Issue
Block a user