GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • ADK for TypeScript: API Reference

This view

  • Original page
  • New address

GeezerVison is showing adk.dev — TokenBasedContextCompactor | ADK for TypeScript: API Reference - v2.5.0

  • TokenBasedContextCompactor

Class TokenBasedContextCompactor

A context compactor that uses token count to determine when to compact events. Oldest events are summarized into a CompactedEvent when the session history exceeds the token threshold.

Implements

  • BaseContextCompactor
  • Defined in core/src/context/token_based_context_compactor.ts:43

Constructors

constructor

  • new TokenBasedContextCompactor(
        options: TokenBasedContextCompactorOptions,
    ): TokenBasedContextCompactor

    Parameters

    • options: TokenBasedContextCompactorOptions

    Returns TokenBasedContextCompactor

    • Defined in core/src/context/token_based_context_compactor.ts:48

Methods

compact

  • compact(invocationContext: InvocationContext): Promise<void>

    Compacts the context in place.

    Parameters

    • invocationContext: InvocationContext

      The current invocation context.

    Returns Promise<void>

    Implementation of BaseContextCompactor.compact

    • Defined in core/src/context/token_based_context_compactor.ts:87

shouldCompact

  • shouldCompact(invocationContext: InvocationContext): boolean | Promise<boolean>

    Determines whether the context should be compacted.

    Parameters

    • invocationContext: InvocationContext

      The current invocation context.

    Returns boolean | Promise<boolean>

    A boolean or a promise resolving to a boolean indicating if compaction should occur.

    Implementation of BaseContextCompactor.shouldCompact

    • Defined in core/src/context/token_based_context_compactor.ts:54
Constructors
constructor
Methods
compactshouldCompact
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.