functai for TypeScript - v0.1.0
    Preparing search index...

    Function compaction

    • Keep a long conversation short: older turns are folded into a summary.

      When a turn ends and more than keep + every turns of its branch are not yet summarized, every turn but the last keep is folded into the summary (the earlier summary and those turns, given to summarize). The summary is kept in the conversation (an entry at that turn, so each branch has its own), and the next turns are shown it, as a section of the instruction, with only the turns after it. The call that wrote it is in the call log; what a turn was shown is in its record, so a rated turn is asked again with the same summary.

      summarize(earlierSummary, newTurns) gives the summary (default: an AI function of FunctAI's, on lm or the configured model). name: two compactions with different settings on one conversation need two names.

      Parameters

      • opts: {
            every?: number;
            keep?: number;
            lm?: string;
            name?: string;
            summarize?: (
                earlierSummary: string,
                newTurns: Rec[],
            ) => string | Promise<string>;
        } = {}

      Returns Plugin