Skip to content

Commit 8f00e33

Browse files
chore: move image part before text part in vertex requests (#3595)
1 parent ebc7aca commit 8f00e33

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

generative-ai/snippets/nonStreamingMultipartContent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async function createNonStreamingMultipartContent(
5252
};
5353

5454
const request = {
55-
contents: [{role: 'user', parts: [textPart, filePart]}],
55+
contents: [{role: 'user', parts: [filePart, textPart]}],
5656
};
5757

5858
console.log('Prompt Text:');

generative-ai/snippets/sendMultiModalPromptWithVideo.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ async function sendMultiModalPromptWithVideo(
4040
{
4141
role: 'user',
4242
parts: [
43-
{
44-
text: 'What is in the video?',
45-
},
4643
{
4744
fileData: {
4845
fileUri: 'gs://cloud-samples-data/video/animals.mp4',
4946
mimeType: 'video/mp4',
5047
},
5148
},
49+
{
50+
text: 'What is in the video?',
51+
},
5252
],
5353
},
5454
],

generative-ai/snippets/streamMultipartContent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async function createStreamMultipartContent(
5353
};
5454

5555
const request = {
56-
contents: [{role: 'user', parts: [textPart, filePart]}],
56+
contents: [{role: 'user', parts: [filePart, textPart]}],
5757
};
5858

5959
console.log('Prompt Text:');

0 commit comments

Comments
 (0)