add wipe flag for ctx and session

This commit is contained in:
shih 2024-09-27 07:43:08 +08:00
parent 41b711f1ca
commit dd6cd06b5a
3 changed files with 16 additions and 0 deletions

View File

@ -219,6 +219,8 @@ Application Options:
-q, --scrape_question= Search question using Jina AI
-e, --seed= Seed to be used for LMM generation
--dry-run Show what would be sent to the model without actually sending it
-w, --wipecontext= Wipe context
-W, --wipesession= Wipe session
--version Print current version
Help Options:

View File

@ -100,6 +100,18 @@ func Cli(version string) (message string, err error) {
return
}
// if the wipe context flag is set, run the wipe context function
if currentFlags.WipeContext != "" {
err = fabricDb.Contexts.Delete(currentFlags.WipeContext)
return
}
// if the wipe session flag is set, run the wipe session function
if currentFlags.WipeSession != "" {
err = fabricDb.Sessions.Delete(currentFlags.WipeSession)
return
}
// if the interactive flag is set, run the interactive function
// if currentFlags.Interactive {
// interactive.Interactive()

View File

@ -45,6 +45,8 @@ type Flags struct {
ScrapeQuestion string `short:"q" long:"scrape_question" description:"Search question using Jina AI"`
Seed int `short:"e" long:"seed" description:"Seed to be used for LMM generation"`
DryRun bool `long:"dry-run" description:"Show what would be sent to the model without actually sending it"`
WipeContext string `short:"w" long:"wipecontext" description:"Wipe context"`
WipeSession string `short:"W" long:"wipesession" description:"Wipe session"`
Version bool `long:"version" description:"Print current version"`
}