Commit Graph

2 Commits

  • Implements unified model routing
    Migrates the AMP module to a new unified routing system, replacing the fallback handler with a router-based approach.
    
    This change introduces a `ModelRoutingWrapper` that handles model extraction, routing decisions, and proxying based on provider availability and model mappings.
    It provides a more flexible and maintainable routing mechanism by centralizing routing logic.
    
    The changes include:
    - Introducing new `routing` package with core routing logic.
    - Creating characterization tests to capture existing behavior.
    - Implementing model extraction and rewriting.
    - Updating AMP module routes to utilize the new routing wrapper.
    - Deprecating `FallbackHandler` in favor of the new `ModelRoutingWrapper`.
  • feat(routing): implement unified model routing with OAuth and API key providers
    - Added a new routing package to manage provider registration and model resolution.
    - Introduced Router, Executor, and Provider interfaces to handle different provider types.
    - Implemented OAuthProvider and APIKeyProvider to support OAuth and API key authentication.
    - Enhanced DefaultModelMapper to include OAuth model alias handling and fallback mechanisms.
    - Updated context management in API handlers to preserve fallback models.
    - Added tests for routing logic and provider selection.
    - Enhanced Claude request conversion to handle reasoning content based on thinking mode.