processor

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: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCastGroupName = "__DEFAULT_CAST_GROUP__"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BrainContext

type BrainContext interface {
	// SetMemory set memories for brain, one key value pair is one memory.
	// memory will lazy initial util `SetMemory` or any link trig
	SetMemory(keysAndValues ...interface{}) error
	// GetMemory get memory by key
	GetMemory(key interface{}) interface{}
	// ExistMemory indicates whether there is a memory in the brain
	ExistMemory(key interface{}) bool
	// DeleteMemory delete one memory by key
	DeleteMemory(key interface{})
	// ClearMemory clear all memories
	ClearMemory()
	// GetCurrentNeuronID get current neuron id
	GetCurrentNeuronID() string
	// GetCurrentNeuronLabels get current neuron labels
	GetCurrentNeuronLabels() map[string]string
	// GetBrainID get brain id
	GetBrainID() string
	// GetBrainLabels get brain labels
	GetBrainLabels() map[string]string
	// ContinueCast keep current process running, and continue cast
	ContinueCast()
}

type BrainContextReader

type BrainContextReader interface {
	// GetMemory get memory by key
	GetMemory(key interface{}) interface{}
	// ExistMemory indicates whether there is a memory in the brain
	ExistMemory(key interface{}) bool
	// GetCurrentNeuronID get current neuron id
	GetCurrentNeuronID() string
}

type DefaultSelector

type DefaultSelector struct{}

func (*DefaultSelector) Clone

func (s *DefaultSelector) Clone() Selector

func (*DefaultSelector) Select

func (s *DefaultSelector) Select(ctx BrainContextReader) string

type EmptyProcessor

type EmptyProcessor struct{}

func (*EmptyProcessor) Clone

func (p *EmptyProcessor) Clone() Processor

func (*EmptyProcessor) Process

func (p *EmptyProcessor) Process(ctx BrainContext) error

type FuncProcessor

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

func NewFuncProcessor

func NewFuncProcessor(processFn func(ctx BrainContext) error) *FuncProcessor

func (*FuncProcessor) Clone

func (p *FuncProcessor) Clone() Processor

func (*FuncProcessor) Process

func (p *FuncProcessor) Process(ctx BrainContext) error

type FuncSelector

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

func NewFuncSelector

func NewFuncSelector(selectFn func(ctx BrainContextReader) string) *FuncSelector

func (*FuncSelector) Clone

func (s *FuncSelector) Clone() Selector

func (*FuncSelector) Select

func (s *FuncSelector) Select(ctx BrainContextReader) string

type Processor

type Processor interface {
	Process(ctx BrainContext) error
	Clone() Processor
}

type Selector

type Selector interface {
	Select(ctx BrainContextReader) string
	Clone() Selector
}

Jump to

Keyboard shortcuts

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