@blinkdotnew/sdk 0.17.2 → 0.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -23
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -279,13 +279,15 @@ const { text } = await blink.ai.generateText({
|
|
|
279
279
|
})
|
|
280
280
|
|
|
281
281
|
// Text generation with image content
|
|
282
|
+
// ⚠️ IMPORTANT: Images must be HTTPS URLs with file extensions (.jpg, .jpeg, .png, .gif, .webp)
|
|
283
|
+
// For file uploads, use blink.storage.upload() first to get public HTTPS URLs
|
|
282
284
|
const { text } = await blink.ai.generateText({
|
|
283
285
|
messages: [
|
|
284
286
|
{
|
|
285
287
|
role: "user",
|
|
286
288
|
content: [
|
|
287
289
|
{ type: "text", text: "What do you see in this image?" },
|
|
288
|
-
{ type: "image", image: "https://
|
|
290
|
+
{ type: "image", image: "https://storage.googleapis.com/.../.../photo.jpg" }
|
|
289
291
|
]
|
|
290
292
|
}
|
|
291
293
|
]
|
|
@@ -298,8 +300,8 @@ const { text } = await blink.ai.generateText({
|
|
|
298
300
|
role: "user",
|
|
299
301
|
content: [
|
|
300
302
|
{ type: "text", text: "Compare these two images:" },
|
|
301
|
-
{ type: "image", image: "https://
|
|
302
|
-
{ type: "image", image: "https://example.com/image2.
|
|
303
|
+
{ type: "image", image: "https://storage.googleapis.com/.../.../image1.jpg" },
|
|
304
|
+
{ type: "image", image: "https://cdn.example.com/image2.png" }
|
|
303
305
|
]
|
|
304
306
|
}
|
|
305
307
|
]
|
|
@@ -1192,26 +1194,6 @@ try {
|
|
|
1192
1194
|
console.error('Auth error:', error.message)
|
|
1193
1195
|
}
|
|
1194
1196
|
}
|
|
1195
|
-
|
|
1196
|
-
// Image validation error handling
|
|
1197
|
-
try {
|
|
1198
|
-
const { text } = await blink.ai.generateText({
|
|
1199
|
-
messages: [
|
|
1200
|
-
{
|
|
1201
|
-
role: "user",
|
|
1202
|
-
content: [
|
|
1203
|
-
{ type: "text", text: "What's in this image?" },
|
|
1204
|
-
{ type: "image", image: "http://example.com/image.jpg" } // Invalid: not HTTPS
|
|
1205
|
-
]
|
|
1206
|
-
}
|
|
1207
|
-
]
|
|
1208
|
-
})
|
|
1209
|
-
} catch (error) {
|
|
1210
|
-
if (error instanceof BlinkAIError) {
|
|
1211
|
-
console.error('AI validation error:', error.message)
|
|
1212
|
-
// Example: "Message validation failed: Image URLs must use HTTPS protocol"
|
|
1213
|
-
}
|
|
1214
|
-
}
|
|
1215
1197
|
```
|
|
1216
1198
|
|
|
1217
1199
|
### Custom Configuration
|
package/package.json
CHANGED