Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 1.13 KB

File metadata and controls

43 lines (34 loc) · 1.13 KB
title MessagePruningEvent
description MessagePruningEvent Schema Reference
category ai
zodFile conversation
**Source:** `packages/spec/src/ai/conversation.zod.ts`

Properties

Property Type Required Description
timestamp string ISO 8601 timestamp
strategy Enum<'fifo' | 'importance' | 'semantic' | 'sliding_window' | 'summary'>
reason string Reason for pruning
prunedMessages object[]
tokensFreed integer
messagesRemoved integer
remainingTokens integer
remainingMessages integer

TypeScript Usage

import { MessagePruningEventSchema } from '@objectstack/spec/ai';
import type { MessagePruningEvent } from '@objectstack/spec/ai';

// Validate data
const result = MessagePruningEventSchema.parse(data);

// Type-safe usage
const myMessagePruningEvent: MessagePruningEvent = {
  timestamp: 'example',
  strategy: 'fifo',
  reason: 'example',
  // ... other required fields
};