Skip to content

Commit

Permalink
Add sample responses from Imagen API
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewheard committed Dec 12, 2024
1 parent bb55b27 commit 5506bce
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"predictions": [
{
"raiFilteredReason": "Unable to show generated images. All images were filtered out because they violated Vertex AI's usage guidelines. You will not be charged for blocked images. Try rephrasing the prompt. If you think this was an error, send feedback. Support codes: 39322892, 29310472"
}
]
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"predictions": [
{
"mimeType": "image/jpeg",
"gcsUri": "gs://test-project-id-1234.firebasestorage.app/images/1234567890123/sample_0.jpg"
},
{
"mimeType": "image/jpeg",
"gcsUri": "gs://test-project-id-1234.firebasestorage.app/images/1234567890123/sample_1.jpg"
},
{
"raiFilteredReason": "Your current safety filter threshold filtered out 2 generated images. You will not be charged for blocked images. Try rephrasing the prompt. If you think this was an error, send feedback."
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"error": {
"code": 400,
"message": "Image generation failed with the following error: The prompt could not be submitted. This prompt contains sensitive words that violate Google's Responsible AI practices. Try rephrasing the prompt. If you think this was an error, send feedback. Support codes: 42876398",
"status": "INVALID_ARGUMENT"
}
}
20 changes: 20 additions & 0 deletions mock-responses/imagen/unary-success-generate-images-base64.json

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions mock-responses/imagen/unary-success-generate-images-gcs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"predictions": [
{
"mimeType": "image/jpeg",
"gcsUri": "gs://test-project-id-1234.firebasestorage.app/images/1234567890123/sample_0.jpg"
},
{
"mimeType": "image/jpeg",
"gcsUri": "gs://test-project-id-1234.firebasestorage.app/images/1234567890123/sample_1.jpg"
},
{
"mimeType": "image/jpeg",
"gcsUri": "gs://test-project-id-1234.firebasestorage.app/images/1234567890123/sample_2.jpg"
},
{
"mimeType": "image/jpeg",
"gcsUri": "gs://test-project-id-1234.firebasestorage.app/images/1234567890123/sample_3.jpg"
}
]
}

0 comments on commit 5506bce

Please sign in to comment.