Documentation
¶
Index ¶
Constants ¶
View Source
const ( CollectionName = "chat_memories" MaxMemoriesPerUser = 50 )
Variables ¶
View Source
var ( ErrMemoryDisabled = errors.New("Chat memory is disabled in Settings") ErrAutoCaptureOff = errors.New("automatic memory capture is disabled in Settings") ErrMemoryLimit = errors.New("you can save at most 50 memories") ErrMemoryNotFound = errors.New("memory not found") ErrInvalidCategory = errors.New("unsupported memory category") ErrInvalidOrigin = errors.New("unsupported memory origin") ErrInvalidContent = errors.New("memory content must be between 1 and 500 characters") ErrMemoryChanged = errors.New("memory changed after the original Chat action") ErrUndoUnsupported = errors.New("this memory action cannot be undone") )
Functions ¶
Types ¶
type EditableSnapshot ¶
type Memory ¶
type Memory struct {
ID string `json:"id"`
Owner string `json:"owner"`
Category string `json:"category"`
Content string `json:"content"`
Active bool `json:"active"`
Origin string `json:"origin"`
SourceConversation string `json:"source_conversation,omitempty"`
SourceMessage string `json:"source_message,omitempty"`
Created string `json:"created"`
Updated string `json:"updated"`
}
type UpsertInput ¶
type UpsertResult ¶
type UpsertResult struct {
Action string `json:"action"`
OriginalAction string `json:"original_action,omitempty"`
Memory Memory `json:"memory"`
Previous *EditableSnapshot `json:"previous,omitempty"`
UndoneAt string `json:"undone_at,omitempty"`
}
func UndoUpsert ¶
func UndoUpsert(app core.App, ownerID string, result UpsertResult) (UpsertResult, error)
UndoUpsert reverses a completed Chat memory create or update when the underlying record still matches the tool result. Callers should run it in the same transaction that marks the persisted tool output as undone.
func Upsert ¶
func Upsert(app core.App, ownerID, conversationID, messageID string, input UpsertInput) (UpsertResult, error)
Click to show internal directories.
Click to hide internal directories.