AutoBE
    Preparing search index...

    Class AutoBeTokenUsageComponent

    Token usage component for individual AI agents in the vibe coding pipeline.

    Represents detailed token consumption statistics for a specific processing phase (facade, analyze, prisma, interface, test, or realize). This class tracks both input and output token usage with granular breakdowns, enabling precise cost analysis and performance optimization for each agent.

    The component structure includes:

    • Total token count for quick cost calculations
    • Input token breakdown with cache efficiency metrics
    • Output token categorization by generation type

    This granular tracking helps identify optimization opportunities and understand the computational characteristics of each agent phase.

    SunRabbit123

    Implements

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    input: IInput

    Detailed breakdown of input token consumption.

    Tracks how many tokens were processed as input to the AI agent, including:

    • Total input tokens processed
    • Cached tokens that were reused from previous operations

    The cache efficiency (cached/total ratio) indicates how well the system is reusing context across multiple invocations.

    output: IOutput

    Detailed breakdown of output token generation.

    Categorizes generated tokens by their purpose and acceptance status:

    • Total output tokens generated
    • Reasoning tokens (internal processing)
    • Accepted prediction tokens (efficient generation)
    • Rejected prediction tokens (quality control overhead)

    These metrics help understand the AI's generation efficiency and the effectiveness of its predictive mechanisms.

    Accessors

    • get total(): number

      Total token count combining all input and output tokens.

      Represents the complete token consumption for this component, providing a single metric for overall resource utilization. This value is critical for cost calculations and comparing efficiency across different agents or processing phases.

      Returns number

    Methods

    • Add token usage data to current statistics.

      Increments all token counters in this component by the corresponding values from the provided component data. This method performs in-place updates, modifying the current instance rather than creating a new one.

      Updates include:

      • Total token count
      • Input tokens (both total and cached)
      • Output tokens (reasoning, accepted/rejected predictions)

      Parameters

      Returns void