Skip to content

Commit a3d94bd

Browse files
authored
Fix some content → value usages
These were missed in d44020d.
1 parent b1deb6e commit a3d94bd

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ const userDrawnImage = document.querySelector("canvas");
205205
const response1 = await session.prompt([{
206206
role: "user",
207207
content: [
208-
{ type: "text", content: "Give a helpful artistic critique of how well the second image matches the first:" },
209-
{ type: "image", content: referenceImage },
210-
{ type: "image", content: userDrawnImage }
208+
{ type: "text", value: "Give a helpful artistic critique of how well the second image matches the first:" },
209+
{ type: "image", value: referenceImage },
210+
{ type: "image", value: userDrawnImage }
211211
]
212212
}]);
213213

@@ -218,8 +218,8 @@ const audioBlob = await captureMicrophoneInput({ seconds: 10 });
218218
const response2 = await session.prompt([{
219219
role: "user",
220220
content: [
221-
{ type: "text", content: "My response to your critique:" },
222-
{ type: "audio", content: audioBlob }
221+
{ type: "text", value: "My response to your critique:" },
222+
{ type: "audio", value: audioBlob }
223223
]
224224
}]);
225225
```
@@ -242,11 +242,11 @@ const response = await session.prompt([
242242
},
243243
{
244244
role: "user",
245-
content: [{ type: "image", content: brochureFromTheMarketingDepartment }]
245+
content: [{ type: "image", value: brochureFromTheMarketingDepartment }]
246246
},
247247
{
248248
role: "user",
249-
content: [{ type: "image", content: brochureFromTheFinanceDepartment }]
249+
content: [{ type: "image", value: brochureFromTheFinanceDepartment }]
250250
}
251251
]);
252252
```
@@ -261,7 +261,7 @@ Details:
261261

262262
* For `HTMLVideoElement`, even a single frame might not yet be downloaded when the prompt API is called. In such cases, calling into the prompt API will force at least a single frame's worth of video to download. (The intent is to behave the same as `createImageBitmap(videoEl)`.)
263263

264-
* Attempting to supply an invalid combination, e.g. `{ type: "audio", content: anImageBitmap }`, `{ type: "image", content: anAudioBuffer }`, or `{ type: "text", content: anArrayBuffer }`, will reject with a `TypeError`.
264+
* Attempting to supply an invalid combination, e.g. `{ type: "audio", value: anImageBitmap }`, `{ type: "image", value: anAudioBuffer }`, or `{ type: "text", value: anArrayBuffer }`, will reject with a `TypeError`.
265265

266266
* For now, using the `"assistant"` role with an image or audio prompt will reject with a `"NotSupportedError"` `DOMException`. (As we explore multimodal outputs, this restriction might be lifted in the future.)
267267

@@ -335,8 +335,8 @@ fileUpload.onchange = async (e) => {
335335
await session.append([{
336336
role: "user",
337337
content: [
338-
{ type: "text", content: `Here's one image. Notes: ${fileNotesInput.value}` },
339-
{ type: "image", content: fileUpload.files[0] }
338+
{ type: "text", value: `Here's one image. Notes: ${fileNotesInput.value}` },
339+
{ type: "image", value: fileUpload.files[0] }
340340
]
341341
}]);
342342
};

0 commit comments

Comments
 (0)