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 LoadConfig() (*settings.StepSettings, error)
- func LoadConfigFromSettings(settings_ cli.GlazedCommandSettings) (*settings.StepSettings, error)
- func NewHelpersParameterLayer() (layers.ParameterLayer, error)
- type GeppettoCommand
- func (g *GeppettoCommand) InitializeContextManager(contextManager conversation.Manager, helperSettings *HelpersSettings, ...) 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 CreateGeppettoLayers ¶
func CreateGeppettoLayers(stepSettings *settings.StepSettings) ([]layers.ParameterLayer, error)
func GetCobraCommandGeppettoMiddlewares ¶
func GetCobraCommandGeppettoMiddlewares( commandSettings *cli.GlazedCommandSettings, cmd *cobra.Command, args []string, ) ([]middlewares.Middleware, error)
func LoadConfig ¶
func LoadConfig() (*settings.StepSettings, error)
func LoadConfigFromSettings ¶
func LoadConfigFromSettings(settings_ cli.GlazedCommandSettings) (*settings.StepSettings, error)
LoadConfigFromSettings loads the geppetto step settings from the given profile and config file.
func NewHelpersParameterLayer ¶
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 ¶
func NewGeppettoCommand( description *glazedcmds.CommandDescription, settings *settings.StepSettings, options ...GeppettoCommandOption, ) (*GeppettoCommand, error)
func (*GeppettoCommand) InitializeContextManager ¶
func (g *GeppettoCommand) InitializeContextManager( contextManager conversation.Manager, helperSettings *HelpersSettings, 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 ¶
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 ¶
func (g *GeppettoCommandLoader) IsFileSupported(f fs.FS, fileName string) bool
func (*GeppettoCommandLoader) LoadCommands ¶
type GeppettoCommandOption ¶
type GeppettoCommandOption func(*GeppettoCommand)
func WithMessages ¶
func WithMessages(messages []*conversation.Message) GeppettoCommandOption
func WithPrompt ¶
func WithPrompt(prompt string) GeppettoCommandOption
func WithSystemPrompt ¶
func WithSystemPrompt(systemPrompt string) GeppettoCommandOption
type HelpersSettings ¶
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"` AutomaticallyContinueInChat bool `glazed.parameter:"chat"` Interactive bool `glazed.parameter:"interactive"` ForceInteractive bool `glazed.parameter:"force-interactive"` Images []*parameters.FileData `glazed.parameter:"images"` }
Click to show internal directories.
Click to hide internal directories.