mempkg

package
v0.0.0-...-4f317ca Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conversation

type Conversation struct {
	ID       string            `json:"id"`
	Messages []*schema.Message `json:"messages"`
	// contains filtered or unexported fields
}

func (*Conversation) Append

func (c *Conversation) Append(msg *schema.Message)

func (*Conversation) GetFullMessages

func (c *Conversation) GetFullMessages() []*schema.Message

func (*Conversation) GetMessages

func (c *Conversation) GetMessages() []*schema.Message

get messages with max window size

type SimpleMemory

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

simple memory can store messages of each conversation

func GetDefaultMemory

func GetDefaultMemory() *SimpleMemory

func NewSimpleMemory

func NewSimpleMemory(cfg SimpleMemoryConfig) *SimpleMemory

func (*SimpleMemory) DeleteConversation

func (m *SimpleMemory) DeleteConversation(id string) error

func (*SimpleMemory) GetConversation

func (m *SimpleMemory) GetConversation(id string, createIfNotExist bool) *Conversation

func (*SimpleMemory) ListConversations

func (m *SimpleMemory) ListConversations() []string

type SimpleMemoryConfig

type SimpleMemoryConfig struct {
	Dir           string
	MaxWindowSize int
}

Jump to

Keyboard shortcuts

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