utilitas 2001.1.90 → 2001.1.92
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/utilitas.lite.mjs +1 -1
- package/dist/utilitas.lite.mjs.map +1 -1
- package/lib/alan.mjs +17 -12
- package/lib/manifest.mjs +1 -1
- package/package.json +1 -1
package/lib/alan.mjs
CHANGED
|
@@ -152,8 +152,8 @@ const MODELS = {
|
|
|
152
152
|
source: GOOGLE, maxInputTokens: 480,
|
|
153
153
|
image: true, defaultProvider: GOOGLE,
|
|
154
154
|
},
|
|
155
|
-
// [IMAGEN_4_UPSCALE]: {
|
|
156
|
-
// source: GOOGLE, maxInputTokens: 0, image: true,
|
|
155
|
+
// [IMAGEN_4_UPSCALE]: { // only available via Vertex AI
|
|
156
|
+
// source: GOOGLE, maxInputTokens: 0, image: true, vision: true,
|
|
157
157
|
// supportedMimeTypes: [MIME_PNG, MIME_JPEG], defaultProvider: GOOGLE,
|
|
158
158
|
// },
|
|
159
159
|
[VEO_31]: {
|
|
@@ -192,7 +192,7 @@ const MODELS = {
|
|
|
192
192
|
hearing: true, fast: true, hidden: true, defaultProvider: OPENAI,
|
|
193
193
|
},
|
|
194
194
|
// agents with deep-research capabilities
|
|
195
|
-
[DEEP_RESEARCH_PRO]: {
|
|
195
|
+
[DEEP_RESEARCH_PRO]: { // https://ai.google.dev/gemini-api/docs/deep-research
|
|
196
196
|
source: GOOGLE, contextWindow: m(1.05), maxOutputTokens: k(65.5),
|
|
197
197
|
'deep-research': true, reasoning: true, defaultProvider: GOOGLE,
|
|
198
198
|
},
|
|
@@ -987,26 +987,31 @@ const promptGoogle = async (aiId, prompt, options = {}) => {
|
|
|
987
987
|
const target_model = options?.model || model.name;
|
|
988
988
|
const M = MODELS[target_model];
|
|
989
989
|
prompt = ensureString(prompt, { trim: true });
|
|
990
|
-
// M.name ===
|
|
990
|
+
// M.name === IMAGEN_4_UPSCALE ||
|
|
991
991
|
assertPrompt(prompt);
|
|
992
992
|
M.tts && (prompt = `${options?.prompt || TTS_PROMPT}: ${prompt}`);
|
|
993
993
|
prompt = trimText(prompt, { limit: M.maxInputTokens });
|
|
994
994
|
if (M?.image) {
|
|
995
995
|
var resp;
|
|
996
|
-
// if (M.name ===
|
|
996
|
+
// if (M.name === IMAGEN_4_UPSCALE) {
|
|
997
997
|
// resp = await client.models.upscaleImage({
|
|
998
|
-
// model: M.name,
|
|
999
|
-
//
|
|
1000
|
-
//
|
|
1001
|
-
//
|
|
1002
|
-
//
|
|
998
|
+
// model: M.name, image: {
|
|
999
|
+
// bytesBase64Encoded: await convert(
|
|
1000
|
+
// options?.attachments?.[0]?.data
|
|
1001
|
+
// || options?.attachments?.[0],
|
|
1002
|
+
// { ...options || {}, expected: BASE64 },
|
|
1003
|
+
// ),
|
|
1004
|
+
// }, upscaleFactor: options?.upscaleFactor || 'x4',
|
|
1005
|
+
// config: mergeAtoB(options?.config, {
|
|
1006
|
+
// addWatermark: false, includeRaiReason: true,
|
|
1007
|
+
// outputMimeType: MIME_PNG, enhanceInputImage: true,
|
|
1003
1008
|
// }),
|
|
1004
1009
|
// });
|
|
1005
1010
|
// } else {
|
|
1006
1011
|
resp = await client.models.generateImages({
|
|
1007
1012
|
model: M.name, prompt, config: mergeAtoB(options?.config, {
|
|
1008
|
-
numberOfImages: options?.n || 4,
|
|
1009
|
-
includeRaiReason: true,
|
|
1013
|
+
addWatermark: false, numberOfImages: options?.n || 4,
|
|
1014
|
+
sampleImageSize: '2K', includeRaiReason: true,
|
|
1010
1015
|
// "1:1" (default), "3:4", "4:3", "9:16", and "16:9"
|
|
1011
1016
|
aspectRatio: '16:9', personGeneration: 'allow_adult',
|
|
1012
1017
|
}),
|
package/lib/manifest.mjs
CHANGED