memory

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func ConversationIDFromContext

func ConversationIDFromContext(ctx context.Context) string

ConversationIDFromContext return conversation id from context

func ModelMessageIDFromContext added in v0.2.0

func ModelMessageIDFromContext(ctx context.Context) string

func WithConversationID added in v0.2.1

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

WithConversationID create context with conversation id

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 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