@drawbridge/drawbridge-utils 0.0.56 → 0.0.57
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/dist/ai.cjs +4 -2
- package/dist/ai.d.cts +6 -2
- package/dist/ai.d.ts +6 -2
- package/dist/ai.js +4 -2
- package/package.json +1 -1
package/dist/ai.cjs
CHANGED
|
@@ -270,15 +270,17 @@ var google = {
|
|
|
270
270
|
image: async ({
|
|
271
271
|
config = {},
|
|
272
272
|
prompt = [],
|
|
273
|
-
reference = null
|
|
273
|
+
reference = null,
|
|
274
|
+
references = []
|
|
274
275
|
}, {
|
|
275
276
|
db,
|
|
276
277
|
user
|
|
277
278
|
}) => {
|
|
278
279
|
var _a, _b, _c, _d, _e, _f;
|
|
279
280
|
const model = models.image;
|
|
281
|
+
const refs = references.length ? references : reference ? [reference] : [];
|
|
280
282
|
const parts = [
|
|
281
|
-
...
|
|
283
|
+
...refs.map((ref) => ({ inlineData: { data: ref.data, mimeType: ref.mimeType } })),
|
|
282
284
|
{ text: prompt.join("\n") }
|
|
283
285
|
];
|
|
284
286
|
const response = await googleCircuit(() => google_client.models.generateContent({
|
package/dist/ai.d.cts
CHANGED
|
@@ -215,7 +215,8 @@ const google = {
|
|
|
215
215
|
{
|
|
216
216
|
config = {},
|
|
217
217
|
prompt = [],
|
|
218
|
-
reference = null
|
|
218
|
+
reference = null,
|
|
219
|
+
references = []
|
|
219
220
|
},
|
|
220
221
|
{
|
|
221
222
|
db,
|
|
@@ -225,8 +226,11 @@ const google = {
|
|
|
225
226
|
|
|
226
227
|
const model = models.image;
|
|
227
228
|
|
|
229
|
+
// Prefer the `references` array (multi-image conditioning); fall back to
|
|
230
|
+
// a single `reference` for backward compatibility with older callers.
|
|
231
|
+
const refs = references.length ? references : ( reference ? [ reference ] : [] );
|
|
228
232
|
const parts = [
|
|
229
|
-
...(
|
|
233
|
+
...refs.map( ( ref ) => ({ inlineData : { data : ref.data, mimeType : ref.mimeType } }) ),
|
|
230
234
|
{ text : prompt.join( '\n' ) }
|
|
231
235
|
];
|
|
232
236
|
|
package/dist/ai.d.ts
CHANGED
|
@@ -215,7 +215,8 @@ const google = {
|
|
|
215
215
|
{
|
|
216
216
|
config = {},
|
|
217
217
|
prompt = [],
|
|
218
|
-
reference = null
|
|
218
|
+
reference = null,
|
|
219
|
+
references = []
|
|
219
220
|
},
|
|
220
221
|
{
|
|
221
222
|
db,
|
|
@@ -225,8 +226,11 @@ const google = {
|
|
|
225
226
|
|
|
226
227
|
const model = models.image;
|
|
227
228
|
|
|
229
|
+
// Prefer the `references` array (multi-image conditioning); fall back to
|
|
230
|
+
// a single `reference` for backward compatibility with older callers.
|
|
231
|
+
const refs = references.length ? references : ( reference ? [ reference ] : [] );
|
|
228
232
|
const parts = [
|
|
229
|
-
...(
|
|
233
|
+
...refs.map( ( ref ) => ({ inlineData : { data : ref.data, mimeType : ref.mimeType } }) ),
|
|
230
234
|
{ text : prompt.join( '\n' ) }
|
|
231
235
|
];
|
|
232
236
|
|
package/dist/ai.js
CHANGED
|
@@ -240,15 +240,17 @@ var google = {
|
|
|
240
240
|
image: async ({
|
|
241
241
|
config = {},
|
|
242
242
|
prompt = [],
|
|
243
|
-
reference = null
|
|
243
|
+
reference = null,
|
|
244
|
+
references = []
|
|
244
245
|
}, {
|
|
245
246
|
db,
|
|
246
247
|
user
|
|
247
248
|
}) => {
|
|
248
249
|
var _a, _b, _c, _d, _e, _f;
|
|
249
250
|
const model = models.image;
|
|
251
|
+
const refs = references.length ? references : reference ? [reference] : [];
|
|
250
252
|
const parts = [
|
|
251
|
-
...
|
|
253
|
+
...refs.map((ref) => ({ inlineData: { data: ref.data, mimeType: ref.mimeType } })),
|
|
252
254
|
{ text: prompt.join("\n") }
|
|
253
255
|
];
|
|
254
256
|
const response = await googleCircuit(() => google_client.models.generateContent({
|
package/package.json
CHANGED