Files
Atlas/internal/api/gateway.go
T
renjue f26f334a2d
CI / docker (push) Failing after 2m7s
实现 Atlas AI 平台一期能力并完成品牌化改造。
引入用户端对话/生图与管理端 Provider 配置,统一 invoke 编排、Gateway、请求日志与模型管理;前端按设计规范拆分布局,Go module 更名为 github.com/rose_cat707/Atlas;生图长任务进度改为 SSE 推送,后端仍轮询上游。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 20:18:37 +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)
}
}