feat(piagent): batch-generate images in one call when generators share a prompt
When multiple image-generator tasks carry the same brief, request all images from a single GPT Image call with Count=N instead of firing one call per image. Adds directImageBatchCount/Prompt detection, batch (incremental) generation paths, and folds the planned count into the idempotency key. Disables the streaming plan probe for multi-image requests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -136,7 +136,7 @@ func (c *ImageClient) Generate(ctx context.Context, prompt string, opts ImageReq
|
||||
|
||||
idempotencyKey := strings.TrimSpace(opts.IdempotencyKey)
|
||||
streamPlans := []bool{false}
|
||||
if len(images) == 0 {
|
||||
if len(images) == 0 && count == 1 {
|
||||
streamPlans = []bool{true, false}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user