• Summarizes the token information for a user question and repository context.

    Parameters

    • dir: string

      The directory containing the repository files.

    • user_query: string

      The user's question.

    • OptionalgitignorePath: string

      Optional path to the .gitignore file.

    • OptionaladditionalIgnorePath: string[]

    Returns {
        combined_prompt_tokens: number;
        directory_tokens: number;
        remaining_tokens: number;
        user_prompt_tokens: number;
    }

    An object summarizing the number of tokens for the directory, user prompt, combined generated prompt, and remaining tokens.

    • combined_prompt_tokens: number
    • directory_tokens: number
    • remaining_tokens: number
    • user_prompt_tokens: number

    Error if the token limit is exceeded.