Documentation
¶
Index ¶
- type Brain
- func (br *Brain) Forget(ctx context.Context, tag, id string) error
- func (br *Brain) Learn(ctx context.Context, tag string, msg *brain.Message, tuples []brain.Tuple) error
- func (br *Brain) Recall(ctx context.Context, tag string, page string, out []brain.Message) (n int, next string, err error)
- func (br *Brain) Speak(ctx context.Context, tag string, prompt []string, w *brain.Builder) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Brain ¶
type Brain struct {
// contains filtered or unexported fields
}
func (*Brain) Forget ¶
Forget forgets everything learned from a single given message. If nothing has been learned from the message, it should be ignored.
func (*Brain) Learn ¶
func (br *Brain) Learn(ctx context.Context, tag string, msg *brain.Message, tuples []brain.Tuple) error
Learn records a set of tuples. Each tuple prefix has length equal to the result of Order. The tuples begin with empty strings in the prefix to denote the start of the message and end with one empty suffix to denote the end; all other tokens are non-empty. Each tuple's prefix has entropy reduction transformations applied.
Click to show internal directories.
Click to hide internal directories.