Add TokenCalculator with LLM Gateway integration for accurate token counting with in-memory caching and fallback character-based estimation. Implement TokenBudget for tracking allocations per context type with budget enforcement, and BudgetAllocator for creating budgets based on model context window sizes. - TokenCalculator: MCP integration, caching, model-specific ratios - TokenBudget: allocation tracking, can_fit/allocate/deallocate/reset - BudgetAllocator: model context sizes, budget creation and adjustment - 35 comprehensive tests covering all budget functionality Part of #61 - Context Management Engine 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
15 lines
261 B
Python
15 lines
261 B
Python
"""
|
|
Token Budget Management Module.
|
|
|
|
Provides token counting and budget allocation.
|
|
"""
|
|
|
|
from .allocator import BudgetAllocator, TokenBudget
|
|
from .calculator import TokenCalculator
|
|
|
|
__all__ = [
|
|
"BudgetAllocator",
|
|
"TokenBudget",
|
|
"TokenCalculator",
|
|
]
|