inmem

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package inmem provides in-memory conversation storage. Use when the agent and worker run in the same process. For remote workers, use redis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryConversation

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

func NewConversation added in v0.2.5

func NewConversation(opts ...Option) *InMemoryConversation

NewConversation creates a new in-memory conversation store.

func (*InMemoryConversation) AddMessage

func (c *InMemoryConversation) AddMessage(ctx context.Context, id string, msg interfaces.Message) error

func (*InMemoryConversation) Clear

func (c *InMemoryConversation) Clear(ctx context.Context, id string) error

func (*InMemoryConversation) IsDistributed

func (c *InMemoryConversation) IsDistributed() bool

func (*InMemoryConversation) ListMessages

type Option

type Option func(*InMemoryConversation)

func WithMaxSize

func WithMaxSize(size int) Option

WithMaxSize sets the maximum number of messages to store per conversation.

Jump to

Keyboard shortcuts

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