memory

package
v0.2.58 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContextRecoveryCompact      = "compact"
	ContextRecoveryPruneCompact = "pruneCompact"
)

Variables

View Source
var ConversationIDKey = "conversationID"
View Source
var ModelMessageIDKey = modelMessageIDKey("modelMessageID")

Functions

func ContextRecoveryModeFromContext added in v0.2.40

func ContextRecoveryModeFromContext(ctx context.Context) (string, bool)

func ConversationIDFromContext

func ConversationIDFromContext(ctx context.Context) string

ConversationIDFromContext return conversation id from context

func MergeDiscoveryMode added in v0.2.58

func MergeDiscoveryMode(ctx context.Context, update DiscoveryMode) context.Context

MergeDiscoveryMode merges an update into existing discovery mode and stores the resulting value in context.

func ModelMessageIDFromContext added in v0.2.0

func ModelMessageIDFromContext(ctx context.Context) string

func SetTurnTrace added in v0.2.17

func SetTurnTrace(turnID, traceID string)

SetTurnTrace stores a provider trace/anchor id for the given turn id.

func TurnTrace added in v0.2.17

func TurnTrace(turnID string) string

TurnTrace returns a previously stored provider trace/anchor id for this turn.

func WithContextRecoveryMode added in v0.2.40

func WithContextRecoveryMode(ctx context.Context, mode string) context.Context

func WithConversationID added in v0.2.1

func WithConversationID(ctx context.Context, conversationID string) context.Context

WithConversationID create context with conversation id

func WithDiscoveryMode added in v0.2.58

func WithDiscoveryMode(ctx context.Context, mode DiscoveryMode) context.Context

WithDiscoveryMode stores discovery mode in context.

func WithTurnMeta added in v0.2.0

func WithTurnMeta(ctx context.Context, meta TurnMeta) context.Context

WithTurnMeta stores TurnMeta on the context and also seeds individual keys for backward compatibility with existing readers.

Types

type DiscoveryMode added in v0.2.58

type DiscoveryMode struct {
	Scheduler     bool
	Strict        bool
	ScheduleID    string
	ScheduleRunID string
}

DiscoveryMode controls how tool discovery behaves for the current request.

func DiscoveryModeFromContext added in v0.2.58

func DiscoveryModeFromContext(ctx context.Context) (DiscoveryMode, bool)

DiscoveryModeFromContext returns discovery mode when set.

type EmbedFunc

type EmbedFunc func(ctx context.Context, texts []string) ([][]float32, error)

EmbedFunc defines a function that creates embeddings for given texts. It should return one embedding per input text.

type TurnMeta added in v0.2.0

type TurnMeta struct {
	TurnID          string
	Assistant       string
	ConversationID  string
	ParentMessageID string // last user message id (or tool message when parenting final)
}

TurnMeta captures minimal per-turn context for downstream persistence. Prefer passing a single TurnMeta instead of scattering separate keys.

func TurnMetaFromContext added in v0.2.0

func TurnMetaFromContext(ctx context.Context) (TurnMeta, bool)

TurnMetaFromContext returns a stored TurnMeta when present.

Jump to

Keyboard shortcuts

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