mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-08-31 01:13:06 +08:00
Merge pull request #5654 from zninggo/fix/composite-video-generation
fix(gateway): Composite 分组放行视频生成端点
This commit is contained in:
@@ -95,7 +95,10 @@ func RegisterGatewayRoutes(
|
||||
}
|
||||
}
|
||||
videoGenerationHandler := func(c *gin.Context) {
|
||||
if getGroupPlatform(c) == service.PlatformGrok {
|
||||
// Video status/content lookups below already allow Composite groups; keep
|
||||
// task creation aligned so composite keys that route to Grok accounts can
|
||||
// submit video generation jobs.
|
||||
if platform := getGroupPlatform(c); platform == service.PlatformGrok || platform == service.PlatformComposite {
|
||||
h.OpenAIGateway.GrokVideoGeneration(c)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -345,6 +345,18 @@ func TestGatewayRoutesNonGrokVideosAreRejectedAtPlatformGate(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestGatewayRoutesCompositeVideoGenerationAllowed(t *testing.T) {
|
||||
router := newGatewayRoutesTestRouter(service.PlatformComposite)
|
||||
|
||||
req := httptest.NewRequest(http.MethodPost, "/v1/videos/generations", strings.NewReader(`{"model":"grok-imagine-video-1.5","prompt":"waves"}`))
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
w := httptest.NewRecorder()
|
||||
|
||||
router.ServeHTTP(w, req)
|
||||
require.NotEqual(t, http.StatusNotFound, w.Code)
|
||||
require.NotContains(t, w.Body.String(), "not supported")
|
||||
}
|
||||
|
||||
func TestGatewayRoutesCompositeOpenAIOnlyEndpointsRequireOpenAITarget(t *testing.T) {
|
||||
router := newGatewayRoutesTestRouter(service.PlatformComposite)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user