grok修复
This commit is contained in:
@@ -458,7 +458,7 @@ func (h *UserGenerationHandler) catalogEntries(c *gin.Context) ([]gin.H, error)
|
|||||||
"type": "video",
|
"type": "video",
|
||||||
"ratios": []string{"2:3", "3:2", "1:1", "9:16", "16:9"},
|
"ratios": []string{"2:3", "3:2", "1:1", "9:16", "16:9"},
|
||||||
"resolutions": []string{"720p"},
|
"resolutions": []string{"720p"},
|
||||||
"durations": []string{"6s", "10s", "15s"},
|
"durations": []string{"6s", "10s"},
|
||||||
"max_reference_images": 6,
|
"max_reference_images": 6,
|
||||||
"reference_mode": "asset",
|
"reference_mode": "asset",
|
||||||
"description": "Grok Imagine video (文/图生视频)",
|
"description": "Grok Imagine video (文/图生视频)",
|
||||||
|
|||||||
@@ -140,7 +140,14 @@ func (c *Client) GenerateVideo(ctx context.Context, token, prompt, aspectRatio,
|
|||||||
if artifact != "" {
|
if artifact != "" {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// No artifact: grok closed the stream early. Retry.
|
// A fatal stream error means grok definitively rejected this generation
|
||||||
|
// (content moderation, an unsupported parameter, etc.). Retrying — on this
|
||||||
|
// or any other account — fails identically and only burns the pool, so fail
|
||||||
|
// fast with a non-temporary error the pool won't fail over on.
|
||||||
|
if strings.Contains(body, "STREAM_ERROR_SEVERITY_FATAL") {
|
||||||
|
return nil, nil, fmt.Errorf("grok: video generation rejected by upstream (fatal stream error): %s", clip([]byte(body), 200))
|
||||||
|
}
|
||||||
|
// No artifact and no fatal error: grok closed the stream early. Retry.
|
||||||
lastErr = nil
|
lastErr = nil
|
||||||
}
|
}
|
||||||
if artifact == "" {
|
if artifact == "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user