UNPKG

@openai/agents-core

Version:

The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows.

34 lines (33 loc) • 1.3 kB
import type { AgentInputItem } from '../../types'; import { Capability } from './base'; export declare abstract class CompactionPolicy { abstract compactThreshold(model?: string): number; } export declare class StaticCompactionPolicy extends CompactionPolicy { readonly threshold: number; constructor(threshold?: number); compactThreshold(): number; } export declare class DynamicCompactionPolicy extends CompactionPolicy { readonly thresholdRatio: number; readonly fallbackThreshold: number; constructor(thresholdRatio?: number, fallbackThreshold?: number); compactThreshold(model?: string): number; } export declare class CompactionModelInfo { readonly contextWindow: number; constructor(contextWindow: number); static forModel(model: string): CompactionModelInfo | undefined; } declare class CompactionCapability extends Capability { readonly type = "compaction"; readonly policy: CompactionPolicy; constructor(policy?: CompactionPolicy); samplingParams(samplingParams: Record<string, unknown>): Record<string, unknown>; processContext(context: AgentInputItem[]): AgentInputItem[]; } export type Compaction = CompactionCapability; export declare function compaction(args?: { policy?: CompactionPolicy; }): Compaction; export {};