module

package
v0.0.0-...-2144169 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLoaded

func IsLoaded(id string) bool

func Load

func Load(cfg config.Config, client *openai.Client, modules ...Module) error

func LoadCompiledPlugins

func LoadCompiledPlugins() error

func LoadPlugin

func LoadPlugin(m Module) error

func UpdateConfig

func UpdateConfig(cfg config.Config)

Types

type CommandResult

type CommandResult struct {
	Error  error
	Prompt string
}

func ExecuteCommand

func ExecuteCommand(command, args, body string) (bool, *CommandResult)

func HelpCommand

func HelpCommand() (bool, *CommandResult)

type IntervalPrompt

type IntervalPrompt interface {
	IntervalPrompt() string
}

IntervalPrompt allows a module to inject a prompt into the interval prompt

type Module

type Module interface {
	Load(config.Config, *openai.Client) error
	UpdateConfig(config.Config)
	ID() string
	Prompt() string
	Execute(args, body string) (string, error)
}

func GetModuleForPlugin

func GetModuleForPlugin(p Plugin) Module

type Plugin

type Plugin interface {
	ID() string
	Example() string
	Execute(map[string]any) (map[string]any, error)
}

func OpenPlugin

func OpenPlugin(path string) (Plugin, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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