Skip to content

Commit

Permalink
handle remote prompt for prodia v2 image
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-sandrk committed Jan 9, 2025
1 parent d50a0a4 commit 03e3055
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion proxy-router/internal/proxyapi/proxy_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,15 @@ func (p *ProxyServiceSender) rpcRequestStreamV2(
responses = append(responses, videoGenerationResult)
chunk = gcs.NewChunkVideo(&videoGenerationResult)
} else {
return nil, ttftMs, totalTokens, lib.WrapError(ErrInvalidResponse, err)
var imageGenerationResult gcs.ImageRawContentResult
err = json.Unmarshal(aiResponse, &imageGenerationResult)
if err == nil && imageGenerationResult.ImageRawContent != "" {
totalTokens += 1
responses = append(responses, imageGenerationResult)
chunk = gcs.NewChunkImageRawContent(&imageGenerationResult)
} else {
return nil, ttftMs, totalTokens, lib.WrapError(ErrInvalidResponse, err)
}
}
}
}
Expand Down

0 comments on commit 03e3055

Please sign in to comment.