Files
Atlas/internal/api/gateway.go
T
renjue f920f465ed
CI / docker (push) Successful in 2m28s
实现 Atlas AI 平台一期能力并完成品牌化改造。
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 23:22:19 +08:00

26 lines
783 B
Go

package api
import (
"github.com/gin-gonic/gin"
)
func (s *Server) registerGatewayRoutes(r *gin.Engine) {
v1 := r.Group("/v1")
v1.Use(s.sessionMiddleware())
{
v1.GET("/models", s.gatewayModels)
v1.POST("/chat/completions", s.gatewayChatCompletions)
v1.POST("/responses", s.gatewayResponses)
v1.POST("/completions", s.gatewayProxyOpenAI("/v1/completions"))
v1.POST("/embeddings", s.gatewayProxyOpenAI("/v1/embeddings"))
v1.POST("/rerank", s.gatewayProxyOpenAI("/v1/rerank"))
v1.POST("/predictions", s.gatewayCreatePrediction)
v1.GET("/predictions", s.gatewayListPredictions)
v1.GET("/predictions/:id", s.gatewayGetPrediction)
v1.POST("/predictions/:id/cancel", s.gatewayCancelPrediction)
v1.GET("/predictions/:id/stream", s.gatewayStreamPrediction)
}
}