-
Refactor API handlers organization and simplify error response handling
released this
2025-08-05 15:11:31 +00:00 | 2052 commits to main since this release- Modularized handlers into dedicated packages (
gemini,claude,cli) for better structure. - Centralized
ErrorResponseandErrorDetailtypes underhandlerspackage for reuse. - Updated all handlers to utilize the shared
ErrorResponsemodel. - Introduced specialization of handler structs (
GeminiAPIHandlers,ClaudeCodeAPIHandlers,GeminiCLIAPIHandlers) for improved clarity and separation of concerns. - Refactored
getClientlogic with additional properties and better state management.
Refactor
translatorpackage by modularizing code forclaudeandgemini- Moved Claude-specific logic (
PrepareClaudeRequest,ConvertCliToClaude) totranslator/claude/code. - Moved Gemini-specific logic (
FixCLIToolResponse) totranslator/gemini/clifor better package structure. - Updated affected handler imports and method references.
Add comprehensive package-level documentation across key modules
- Introduced detailed package-level documentation for core modules:
auth,client,cmd,handlers,util,watcher,config,translator, andapi. - Enhanced code readability and maintainability by clarifying the purpose and functionality of each package.
- Aligned documentation style and tone with existing codebase conventions.
Refactor API handlers and translator modules for improved clarity and consistency
- Standardized handler struct names (
GeminiAPIHandlers,ClaudeCodeAPIHandlers,GeminiCLIAPIHandlers,OpenAIAPIHandlers) and updated related comments. - Fixed unnecessary
elseblocks in streaming logic for cleaner error handling. - Renamed variables for better readability (
responseIdResulttoresponseIDResult,activationUrltoactivationURL, etc.). - Addressed minor inconsistencies in API handler comments and SSE header initialization.
- Improved modularization of
claudeandgeminitranslator components.
Standardize configuration field naming for consistency across modules
- Renamed
ProxyUrltoProxyURL,ApiKeystoAPIKeys, andConfigQuotaExceededtoQuotaExceeded. - Updated all relevant references and comments in
config,auth,api,util, andwatcher. - Ensured consistent casing for
GlAPIKeydebug logs.
Downloads
- Modularized handlers into dedicated packages (