cli

package
v1.4.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2024 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cli

func Cli() (message string, err error)

Cli Controls the cli. It takes in the flags and runs the appropriate functions

func Setup

func Setup(db *db.Db, skipUpdatePatterns bool) (ret *core.Fabric, err error)

Types

type Flags

type Flags struct {
	Pattern                 string            `short:"p" long:"pattern" description:"Choose a pattern" default:""`
	PatternVariables        map[string]string `short:"v" long:"variable" description:"Values for pattern variables, e.g. -v=$name:John -v=$age:30"`
	Context                 string            `short:"C" long:"context" description:"Choose a context" default:""`
	Session                 string            `long:"session" description:"Choose a session"`
	Setup                   bool              `short:"S" long:"setup" description:"Run setup"`
	SetupSkipUpdatePatterns bool              `long:"setup-skip-update-patterns" description:"Skip update patterns at setup"`
	Temperature             float64           `short:"t" long:"temperature" description:"Set temperature" default:"0.7"`
	TopP                    float64           `short:"T" long:"topp" description:"Set top P" default:"0.9"`
	Stream                  bool              `short:"s" long:"stream" description:"Stream"`
	PresencePenalty         float64           `short:"P" long:"presencepenalty" description:"Set presence penalty" default:"0.0"`
	FrequencyPenalty        float64           `short:"F" long:"frequencypenalty" description:"Set frequency penalty" default:"0.0"`
	ListPatterns            bool              `short:"l" long:"listpatterns" description:"List all patterns"`
	ListAllModels           bool              `short:"L" long:"listmodels" description:"List all available models"`
	ListAllContexts         bool              `short:"x" long:"listcontexts" description:"List all contexts"`
	ListAllSessions         bool              `short:"X" long:"listsessions" description:"List all sessions"`
	UpdatePatterns          bool              `short:"U" long:"updatepatterns" description:"Update patterns"`
	Message                 string            `hidden:"true" description:"Message to send to chat"`
	Copy                    bool              `short:"c" long:"copy" description:"Copy to clipboard"`
	Model                   string            `short:"m" long:"model" description:"Choose model"`
	Output                  string            `short:"o" long:"output" description:"Output to file" default:""`
	LatestPatterns          string            `short:"n" long:"latest" description:"Number of latest patterns to list" default:"0"`
	ChangeDefaultModel      bool              `short:"d" long:"changeDefaultModel" description:"Change default pattern"`
	YouTube                 string            `short:"y" long:"youtube" description:"YouTube video url to grab transcript, comments from it and send to chat"`
	YouTubeTranscript       bool              `long:"transcript" description:"Grab transcript from YouTube video and send to chat"`
	YouTubeComments         bool              `long:"comments" description:"Grab comments from YouTube video and send to chat"`
	DryRun                  bool              `long:"dry-run" description:"Show what would be sent to the model without actually sending it"`
}

Flags create flags struct. the users flags go into this, this will be passed to the chat struct in cli

func Init

func Init() (ret *Flags, err error)

Init Initialize flags. returns a Flags struct and an error

func (*Flags) BuildChatOptions

func (o *Flags) BuildChatOptions() (ret *common.ChatOptions)

func (*Flags) BuildChatRequest

func (o *Flags) BuildChatRequest() (ret *common.ChatRequest)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL