Contains the token usage details for LLM interactions, including tokens used in requests (prompt_tokens), tokens used in responses (completion_tokens), and the total number of tokens (total_tokens).

TokenCounts

interface TokenCounts {
    completionTokens: number;
    promptTokens: number;
    totalTokens: number;
}

Properties

completionTokens: number

The number of tokens used in two responses from the LLM. The first response contains the generated facts, and the second response contains the evaluation metrics.

TokenCounts

promptTokens: number

The number of tokens used in two requests to the LLM. The first request includes the question, generated answer, and ground truth answer. The second request includes these details plus the generated facts from the first response.

TokenCounts

totalTokens: number

The total number of tokens used across both requests and responses. This value equals the sum of prompt_tokens and completion_tokens.

TokenCounts