4bc1b8d2e3
CI / docker (push) Has been cancelled
引入用户端对话/生图与管理端 Provider 配置,统一 invoke 编排、Gateway、请求日志与模型管理;前端按设计规范拆分布局,Go module 更名为 github.com/rose_cat707/Atlas;生图长任务 SSE 推送;管理端登录防爆破;协议与服务类型联动;Replicate 模型同步修复;用户端创作台 UI 重构;管理端创作历史替代请求日志。 Co-authored-by: Cursor <cursoragent@cursor.com>
26 lines
783 B
Go
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)
|
|
}
|
|
}
|