Documentation
¶
Overview ¶
Package claude provides HTTP handlers for constant.Claude API code-related functionality. This package implements constant.Claude-compatible streaming chat completions with sophisticated client rotation and quota management systems to ensure high availability and optimal resource utilization across multiple backend clients. It handles request translation between constant.Claude API format and the underlying constant.Gemini backend, providing seamless API compatibility while maintaining robust error handling and connection management.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodeAPIHandler ¶
type CodeAPIHandler struct {
*handlers.BaseAPIHandler
}
CodeAPIHandler contains the handlers for constant.Claude API endpoints. It holds a pool of clients to interact with the backend service.
func NewCodeAPIHandler ¶
func NewCodeAPIHandler(apiHandlers *handlers.BaseAPIHandler) *CodeAPIHandler
NewCodeAPIHandler creates a new constant.Claude API handlers instance. It takes an BaseAPIHandler instance as input and returns a CodeAPIHandler.
Parameters:
- apiHandlers: The base API handler instance.
Returns:
- *CodeAPIHandler: A new constant.Claude code API handler instance.
func (*CodeAPIHandler) ClaudeCountTokens ¶
func (h *CodeAPIHandler) ClaudeCountTokens(c *gin.Context)
ClaudeCountTokens handles constant.Claude-compatible streaming chat completions. This function implements a sophisticated client rotation and quota management system to ensure high availability and optimal resource utilization across multiple backend clients.
Parameters:
- c: The Gin context for the request.
func (*CodeAPIHandler) ClaudeMessages ¶
func (h *CodeAPIHandler) ClaudeMessages(c *gin.Context)
ClaudeMessages handles constant.Claude-compatible streaming chat completions. This function implements a sophisticated client rotation and quota management system to ensure high availability and optimal resource utilization across multiple backend clients.
Parameters:
- c: The Gin context for the request.
func (*CodeAPIHandler) ClaudeModels ¶
func (h *CodeAPIHandler) ClaudeModels(c *gin.Context)
ClaudeModels handles the constant.Claude models listing endpoint. It returns a JSON response containing available constant.Claude models and their specifications.
Parameters:
- c: The Gin context for the request.
func (*CodeAPIHandler) HandlerType ¶
func (h *CodeAPIHandler) HandlerType() string
HandlerType returns the identifier for this handler implementation.
func (*CodeAPIHandler) Models ¶
func (h *CodeAPIHandler) Models() []map[string]any
Models returns a list of models supported by this handler.