Documentation
¶
Index ¶
- func RecommendedPrep(conn *sqlite.Conn) error
- type Brain
- func (br *Brain) Close() error
- func (br *Brain) Forget(ctx context.Context, tag, id string) (err error)
- func (br *Brain) Learn(ctx context.Context, tag string, msg *brain.Message, tuples []brain.Tuple) (err 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 ¶
func RecommendedPrep ¶
RecommendedPrep is an sqlitex.ConnPrepareFunc that sets options recommended for a brain.
Types ¶
type Brain ¶
type Brain struct {
// contains filtered or unexported fields
}
Brain is an implementation of knowledge using an SQLite database.
func Open ¶
Open returns a brain within the given database. The db must remain open for the lifetime of the brain.
func (*Brain) Forget ¶
Forget forgets everything learned from a single given message. If nothing has been learned from the message, a message with that ID cannot be learned in the future.
func (*Brain) Learn ¶
func (br *Brain) Learn(ctx context.Context, tag string, msg *brain.Message, tuples []brain.Tuple) (err error)
Learn records a set of tuples.
Click to show internal directories.
Click to hide internal directories.