brainlocal

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrainLocal

type BrainLocal struct {

	// brain memories
	BrainMemory
	BrainMaintainer
	// contains filtered or unexported fields
}

func BuildBrain

func BuildBrain(blueprint core.Blueprint, withOpts ...Option) *BrainLocal

func (*BrainLocal) ClearMemory

func (b *BrainLocal) ClearMemory()

func (*BrainLocal) DeleteMemory

func (b *BrainLocal) DeleteMemory(key any)

func (*BrainLocal) Entry

func (b *BrainLocal) Entry() error

func (*BrainLocal) EntryWithMemory

func (b *BrainLocal) EntryWithMemory(keysAndValues ...interface{}) error

func (*BrainLocal) ExistMemory

func (b *BrainLocal) ExistMemory(key any) bool

func (*BrainLocal) ForceSleep

func (b *BrainLocal) ForceSleep()

func (*BrainLocal) GetMemory

func (b *BrainLocal) GetMemory(key any) any

func (*BrainLocal) GetState

func (b *BrainLocal) GetState() core.BrainState

func (*BrainLocal) SetMemory

func (b *BrainLocal) SetMemory(keysAndValues ...interface{}) error

func (*BrainLocal) Shutdown

func (b *BrainLocal) Shutdown()
func (b *BrainLocal) TrigLinks(links ...core.Link) error

func (*BrainLocal) Wait

func (b *BrainLocal) Wait()

type BrainMaintainer

type BrainMaintainer struct {
	NeuronRunner
	// contains filtered or unexported fields
}

type BrainMemory

type BrainMemory struct {
	// contains filtered or unexported fields
}

type NeuronRunner

type NeuronRunner struct {
	// contains filtered or unexported fields
}

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures a BrainLocal in build.

func WithID

func WithID(brainID string) Option

WithID sets the specific brain ID

func WithLogger

func WithLogger(logger zerolog.Logger) Option

WithLogger sets the specific logger

func WithLoggerLevel

func WithLoggerLevel(level zerolog.Level) Option

WithLoggerLevel sets the default logger with specific level

func WithMemorySetting

func WithMemorySetting(memoryNumCounters, memoryMaxCost int64) Option

WithMemorySetting sets the memory setting

func WithNeuronQueueLen

func WithNeuronQueueLen(nQueueLen int) Option

WithNeuronQueueLen sets the neuron process queue length

func WithNeuronWorkerNum

func WithNeuronWorkerNum(workerNun int) Option

WithNeuronWorkerNum sets the neuron process worker number

Jump to

Keyboard shortcuts

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