Documentation ¶
Index ¶
- Constants
- func AIContext(_ context.Context, memories []string, history []api.Message, model string, ...) ([]api.Message, int, error)
- func Completion(ctx context.Context, manager *plugin.Manager, name string) (api.Completion, func() error, error)
- func Executor(ctx context.Context, completion api.Completion, memory api.Memory) func(string, string) error
- func InitChatCmd(app *LazyGPTApp)
- func InitServeCmd(app *LazyGPTApp)
- func Memorize(msg *api.Message, result string, feedback string) string
- func Memory(ctx context.Context, manager *plugin.Manager, name string) (api.Memory, func() error, error)
- func Prompt() string
- func Recollection(ctx context.Context, memory api.Memory, memories []string) ([]string, error)
- type LazyGPTApp
Constants ¶
View Source
const ( MaxMemory = 10 MemoryCount = 10 MaxTokens = 4096 ResponseTokens = 1024 SendTokens = MaxTokens - ResponseTokens // NOTE(jkoelker) Allow 80% of the tokens to be used for the memory. // Perform this calculation in integer space to avoid // floating point errors. MemoryTokens = SendTokens * 80 / 100 HistoryTokens = SendTokens - MemoryTokens )
Variables ¶
This section is empty.
Functions ¶
func Completion ¶
func InitChatCmd ¶
func InitChatCmd(app *LazyGPTApp)
func InitServeCmd ¶
func InitServeCmd(app *LazyGPTApp)
Types ¶
type LazyGPTApp ¶
func NewLazyGPTApp ¶
func NewLazyGPTApp() *LazyGPTApp
func (*LazyGPTApp) Execute ¶
func (app *LazyGPTApp) Execute()
func (*LazyGPTApp) InitConfig ¶
func (app *LazyGPTApp) InitConfig() context.Context
Click to show internal directories.
Click to hide internal directories.