Compare commits

...

4 Commits

Author SHA1 Message Date
github-actions[bot]
5373345a3c Update version to v1.4.85 and commit 2024-10-30 12:51:09 +00:00
Eugen Eisler
e17b96d864 feat: write tools output also to output file if defined; fix XouTube transcript ' character 2024-10-30 13:50:52 +01:00
github-actions[bot]
3ec4d274c4 Update version to v1.4.84 and commit 2024-10-30 12:07:37 +00:00
Eugen Eisler
611f8789da ci: deactivate build triggering at changes of patterns or docu 2024-10-30 13:07:23 +01:00
8 changed files with 25 additions and 8 deletions

View File

@@ -3,8 +3,14 @@ name: Go Build
on:
push:
branches: ["main"]
paths-ignore:
- 'patterns/**'
- '**/*.md'
pull_request:
branches: ["main"]
paths-ignore:
- 'patterns/**'
- '**/*.md'
jobs:
test:

View File

@@ -4,6 +4,9 @@ on:
push:
branches:
- main # Monitor the main branch
paths-ignore:
- 'patterns/**'
- '**/*.md'
permissions:
contents: write # Ensure the workflow has write permissions

View File

@@ -197,7 +197,7 @@ Then [set your environmental variables](#environmental-variables) as shown above
The great thing about Go is that it's super easy to upgrade. Just run the same command you used to install it in the first place and you'll always get the latest version.
```bash
go install -ldflags "-X main.version=$(git describe --tags --always)" github.com/danielmiessler/fabric@latest
go install github.com/danielmiessler/fabric@latest
```
## Usage
@@ -217,7 +217,7 @@ Application Options:
-v, --variable= Values for pattern variables, e.g. -v=#role:expert -v=#points:30"
-C, --context= Choose a context from the available contexts
--session= Choose a session from the available sessions
-a, --attachment= Attachment path or URL (e.g. for OpenAI image recognition messages)
-a, --attachment= Attachment path or URL (e.g. for OpenAI image recognition messages)
-S, --setup Run setup for all reconfigurable parts of fabric
-t, --temperature= Set temperature (default: 0.7)
-T, --topp= Set top P (default: 0.9)

View File

@@ -175,8 +175,7 @@ func Cli(version string) (err error) {
}
if !currentFlags.IsChatRequest() {
// if the pattern flag is not set, we wanted only to grab the transcript or comments
fmt.Println(messageTools)
err = currentFlags.WriteOutput(messageTools)
return
}
}
@@ -202,8 +201,7 @@ func Cli(version string) (err error) {
}
if !currentFlags.IsChatRequest() {
// if the pattern flag is not set, we wanted only to grab the url or get the answer to the question
fmt.Println(messageTools)
err = currentFlags.WriteOutput(messageTools)
return
}
}

View File

@@ -191,6 +191,14 @@ func (o *Flags) IsChatRequest() (ret bool) {
return
}
func (o *Flags) WriteOutput(message string) (err error) {
fmt.Println(message)
if o.Output != "" {
err = CreateOutputFile(message, o.Output)
}
return
}
func AppendMessage(message string, newMessage string) (ret string) {
if message != "" {
ret = message + "\n" + newMessage

View File

@@ -22,6 +22,8 @@ func CreateOutputFile(message string, fileName string) (err error) {
defer file.Close()
if _, err = file.WriteString(message); err != nil {
err = fmt.Errorf("error writing to file: %v", err)
} else {
fmt.Printf("\n\n... written to %s\n", fileName)
}
return
}

View File

@@ -85,7 +85,7 @@ func (o *YouTube) GrabTranscript(videoId string, language string) (ret string, e
textTags := doc.FindAll("text")
var textBuilder strings.Builder
for _, textTag := range textTags {
textBuilder.WriteString(textTag.Text())
textBuilder.WriteString(strings.ReplaceAll(textTag.Text(), "'", "'"))
textBuilder.WriteString(" ")
ret = textBuilder.String()
}

View File

@@ -1,3 +1,3 @@
package main
var version = "v1.4.83"
var version = "v1.4.85"