@atjsh/llmlingua-2
    Preparing search index...

    Interface CompressPromptOptionsSnakeCase

    Options for compressing prompts.

    interface CompressPromptOptionsSnakeCase {
        chunk_end_tokens?: string[];
        drop_consecutive?: boolean;
        force_reserve_digit?: boolean;
        force_tokens?: string[];
        rate: number;
        target_token?: number;
        token_to_Word?: "mean" | "first";
    }
    Index

    Properties

    chunk_end_tokens?: string[]

    List of tokens that indicate the end of a chunk. The context will be split into chunks at these tokens.

    [".", "\n"]

    drop_consecutive?: boolean

    If true, drop consecutive tokens that are forced. This is useful to avoid keeping too many forced tokens in a row.

    false

    force_reserve_digit?: boolean

    If true, reserve a digit for forced tokens.

    false

    force_tokens?: string[]

    List of tokens that must be kept in the compressed prompt. These tokens will not be removed regardless of their probability.

    []

    target_token?: number

    Target number of tokens to keep after compression. If set, this will override the rate option.

    -1 (no target)

    token_to_Word?: "mean" | "first"

    How to convert token probabilities to word probabilities. "mean" will average the probabilities of tokens in a word, "first" will take the probability of the first token in a word.

    "mean"

    Events

    rate: number

    Float value between 0 and 1 indicating the rate of compression. 0.1 means 10% of the original tokens will be kept