Documentation ¶
Index ¶
- Constants
- func BuildCobraCommandWithGeppettoMiddlewares(cmd cmds.Command, options ...cli.CobraParserOption) (*cobra.Command, error)
- func CreateGeppettoLayers(stepSettings *settings.StepSettings) ([]layers.ParameterLayer, error)
- func GetCobraCommandGeppettoMiddlewares(commandSettings *cli.GlazedCommandSettings, cmd *cobra.Command, args []string) ([]middlewares.Middleware, error)
- func NewHelpersParameterLayer() (layers.ParameterLayer, error)
- type GeppettoCommand
- func (g *GeppettoCommand) InitializeContextManager(contextManager conversation.Manager, ps map[string]interface{}) error
- func (g *GeppettoCommand) Run(ctx context.Context, step steps.Step[conversation.Conversation, string], ...) (steps.StepResult[string], error)
- func (g *GeppettoCommand) RunIntoWriter(ctx context.Context, parsedLayers *layers.ParsedLayers, w io.Writer) error
- type GeppettoCommandDescription
- type GeppettoCommandLoader
- type GeppettoCommandOption
- type HelpersSettings
Constants ¶
View Source
const GeppettoHelpersSlug = "geppetto-helpers"
Variables ¶
This section is empty.
Functions ¶
func BuildCobraCommandWithGeppettoMiddlewares ¶ added in v0.4.0
func CreateGeppettoLayers ¶ added in v0.4.0
func CreateGeppettoLayers(stepSettings *settings.StepSettings) ([]layers.ParameterLayer, error)
func GetCobraCommandGeppettoMiddlewares ¶ added in v0.4.0
func GetCobraCommandGeppettoMiddlewares( commandSettings *cli.GlazedCommandSettings, cmd *cobra.Command, args []string, ) ([]middlewares.Middleware, error)
func NewHelpersParameterLayer ¶ added in v0.2.15
func NewHelpersParameterLayer() (layers.ParameterLayer, error)
Types ¶
type GeppettoCommand ¶
type GeppettoCommand struct { *glazedcmds.CommandDescription `yaml:",inline"` StepSettings *settings.StepSettings `yaml:"stepSettings,omitempty"` Prompt string `yaml:"prompt,omitempty"` Messages []*conversation.Message `yaml:"messages,omitempty"` SystemPrompt string `yaml:"system-prompt,omitempty"` }
func NewGeppettoCommand ¶ added in v0.1.4
func NewGeppettoCommand( description *glazedcmds.CommandDescription, settings *settings.StepSettings, options ...GeppettoCommandOption, ) (*GeppettoCommand, error)
func (*GeppettoCommand) InitializeContextManager ¶ added in v0.2.24
func (g *GeppettoCommand) InitializeContextManager( contextManager conversation.Manager, ps map[string]interface{}, ) error
func (*GeppettoCommand) Run ¶
func (g *GeppettoCommand) Run( ctx context.Context, step steps.Step[conversation.Conversation, string], contextManager conversation.Manager, helpersSettings *HelpersSettings, ps map[string]interface{}, ) (steps.StepResult[string], error)
func (*GeppettoCommand) RunIntoWriter ¶ added in v0.2.4
func (g *GeppettoCommand) RunIntoWriter( ctx context.Context, parsedLayers *layers.ParsedLayers, w io.Writer, ) error
RunIntoWriter runs the command and writes the output into the given writer.
type GeppettoCommandDescription ¶
type GeppettoCommandDescription struct { Name string `yaml:"name"` Short string `yaml:"short"` Long string `yaml:"long,omitempty"` Flags []*parameters.ParameterDefinition `yaml:"flags,omitempty"` Arguments []*parameters.ParameterDefinition `yaml:"arguments,omitempty"` Layers []layers.ParameterLayer `yaml:"layers,omitempty"` Prompt string `yaml:"prompt,omitempty"` Messages []*conversation.Message `yaml:"messages,omitempty"` SystemPrompt string `yaml:"system-prompt,omitempty"` }
type GeppettoCommandLoader ¶
type GeppettoCommandLoader struct { }
func (*GeppettoCommandLoader) IsFileSupported ¶ added in v0.2.26
func (g *GeppettoCommandLoader) IsFileSupported(f fs.FS, fileName string) bool
func (*GeppettoCommandLoader) LoadCommands ¶ added in v0.2.26
type GeppettoCommandOption ¶ added in v0.2.0
type GeppettoCommandOption func(*GeppettoCommand)
func WithMessages ¶ added in v0.2.0
func WithMessages(messages []*conversation.Message) GeppettoCommandOption
func WithPrompt ¶ added in v0.2.0
func WithPrompt(prompt string) GeppettoCommandOption
func WithSystemPrompt ¶ added in v0.2.0
func WithSystemPrompt(systemPrompt string) GeppettoCommandOption
type HelpersSettings ¶ added in v0.3.0
type HelpersSettings struct { PrintPrompt bool `glazed.parameter:"print-prompt"` System string `glazed.parameter:"system"` AppendMessageFile string `glazed.parameter:"append-message-file"` MessageFile string `glazed.parameter:"message-file"` Chat bool `glazed.parameter:"chat"` Interactive bool `glazed.parameter:"interactive"` }
Click to show internal directories.
Click to hide internal directories.