conversation

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSize = 20

DefaultSize is the default max messages fetched for LLM context.

Variables

This section is empty.

Functions

func ValidateDistributed

func ValidateDistributed(conv interfaces.Conversation, remoteWorkers bool) error

ValidateDistributed returns an error when conv is not distributed but remote workers require it.

Types

type Config

type Config struct {
	// Conversation is the conversation backend implementation. Required.
	Conversation interfaces.Conversation

	// Size is the maximum number of messages to fetch for LLM context.
	// Zero or negative defaults to [DefaultSize].
	Size int

	// SaveOnIteration persists messages after each tool round instead of batching at run end.
	SaveOnIteration bool
}

Config wires conversation history for the agent SDK.

func DefaultConfig

func DefaultConfig(conv interfaces.Conversation) Config

DefaultConfig returns a Config with SDK defaults for size and save behavior.

func (Config) ListOptions

func (c Config) ListOptions() []interfaces.ListMessagesOption

ListOptions builds interfaces.ListMessagesOption values from this config.

func (Config) Validate

func (c Config) Validate() error

Validate checks the config. Call [WithDefaults] first.

func (Config) WithDefaults

func (c Config) WithDefaults() Config

WithDefaults fills zero fields with SDK defaults. Conversation must be set separately.

Directories

Path Synopsis
Package inmem provides in-memory conversation storage.
Package inmem provides in-memory conversation storage.
Package redis provides Redis-backed conversation storage.
Package redis provides Redis-backed conversation storage.

Jump to

Keyboard shortcuts

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