Merge pull request #1007 from hallelujah-shih/feature/html-readability

support turn any web page into clean view content
This commit is contained in:
Eugen Eisler
2024-10-02 22:10:02 +02:00
committed by GitHub
7 changed files with 106 additions and 0 deletions

View File

@@ -193,6 +193,14 @@ func Cli(version string) (message string, err error) {
}
}
if currentFlags.HtmlReadability {
if msg, err := core.HtmlReadability(currentFlags.Message); err != nil {
fmt.Println("use readability parser msg err:", err)
} else {
currentFlags.Message = msg
}
}
var chatter *core.Chatter
if chatter, err = fabric.GetChatter(currentFlags.Model, currentFlags.Stream, currentFlags.DryRun); err != nil {
return

View File

@@ -47,6 +47,7 @@ type Flags struct {
WipeContext string `short:"w" long:"wipecontext" description:"Wipe context"`
WipeSession string `short:"W" long:"wipesession" description:"Wipe session"`
DryRun bool `long:"dry-run" description:"Show what would be sent to the model without actually sending it"`
HtmlReadability bool `long:"readability" description:"Turn web page into a clean view"`
Version bool `long:"version" description:"Print current version"`
}