memory

package
v0.0.69 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package memory contains implementations for managing conversation data and facilitating the persistence of state between chain or agent calls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Combined added in v0.0.5

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

func NewCombined added in v0.0.5

func NewCombined(memories ...schema.Memory) (*Combined, error)

func (*Combined) Clear added in v0.0.5

func (m *Combined) Clear(ctx context.Context) error

func (*Combined) LoadMemoryVariables added in v0.0.5

func (m *Combined) LoadMemoryVariables(ctx context.Context, inputs map[string]any) (map[string]any, error)

func (*Combined) MemoryKeys added in v0.0.21

func (m *Combined) MemoryKeys() []string

func (*Combined) SaveContext added in v0.0.5

func (m *Combined) SaveContext(ctx context.Context, inputs map[string]any, outputs map[string]any) error

type ConversationBuffer added in v0.0.6

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

func NewConversationBuffer added in v0.0.6

func NewConversationBuffer(optFns ...func(o *ConversationBufferOptions)) *ConversationBuffer

func (*ConversationBuffer) Clear added in v0.0.6

func (m *ConversationBuffer) Clear(ctx context.Context) error

func (*ConversationBuffer) LoadMemoryVariables added in v0.0.6

func (m *ConversationBuffer) LoadMemoryVariables(ctx context.Context, inputs map[string]any) (map[string]any, error)

func (*ConversationBuffer) MemoryKeys added in v0.0.21

func (m *ConversationBuffer) MemoryKeys() []string

func (*ConversationBuffer) SaveContext added in v0.0.6

func (m *ConversationBuffer) SaveContext(ctx context.Context, inputs map[string]any, outputs map[string]any) error

type ConversationBufferOptions added in v0.0.6

type ConversationBufferOptions struct {
	HumanPrefix        string
	AIPrefix           string
	MemoryKey          string
	InputKey           string
	OutputKey          string
	ReturnMessages     bool
	ChatMessageHistory schema.ChatMessageHistory

	// Size of the interactions window
	K uint
}

type Readonly added in v0.0.5

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

func NewReadonly added in v0.0.5

func NewReadonly(memory schema.Memory) Readonly

func (*Readonly) Clear added in v0.0.5

func (m *Readonly) Clear(ctx context.Context) error

func (*Readonly) LoadMemoryVariables added in v0.0.5

func (m *Readonly) LoadMemoryVariables(ctx context.Context, inputs map[string]any) (map[string]any, error)

func (*Readonly) MemoryKeys added in v0.0.21

func (m *Readonly) MemoryKeys() []string

func (*Readonly) SaveContext added in v0.0.5

func (m *Readonly) SaveContext(ctx context.Context, inputs map[string]any, outputs map[string]any) error

type Simple

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

func NewSimple

func NewSimple() Simple

func (*Simple) Clear

func (m *Simple) Clear(ctx context.Context) error

func (*Simple) LoadMemoryVariables

func (m *Simple) LoadMemoryVariables(ctx context.Context, inputs map[string]any) (map[string]any, error)

func (*Simple) MemoryKeys added in v0.0.21

func (m *Simple) MemoryKeys() []string

func (*Simple) SaveContext

func (m *Simple) SaveContext(ctx context.Context, inputs map[string]any, outputs map[string]any) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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