@llumiverse/common 0.22.1 → 0.23.0-dev-20251118
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/package.json +4 -4
- package/src/options/vertexai.ts +44 -0
- package/src/types.ts +17 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llumiverse/common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0-dev-20251118",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Public types, enums and options used by Llumiverse API.",
|
|
6
6
|
"files": [
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
"url": "git+ssh://git@github.com/vertesia/llumiverse.git"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"rimraf": "^6.0
|
|
71
|
+
"rimraf": "^6.1.0",
|
|
72
72
|
"ts-dual-module": "^0.6.3",
|
|
73
|
-
"typescript": "^5.9.
|
|
73
|
+
"typescript": "^5.9.3",
|
|
74
74
|
"vitest": "^3.2.4",
|
|
75
|
-
"@types/node": "^22.
|
|
75
|
+
"@types/node": "^22.19.0"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {},
|
|
78
78
|
"ts_dual_module": {
|
package/src/options/vertexai.ts
CHANGED
|
@@ -246,6 +246,50 @@ function getImagenOptions(model: string, option?: ModelOptions): ModelOptionsInf
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
function getGeminiOptions(model: string, _option?: ModelOptions): ModelOptionsInfo {
|
|
249
|
+
// Special handling for gemini-2.5-flash-image
|
|
250
|
+
if (model.includes("gemini-2.5-flash-image")) {
|
|
251
|
+
const options: ModelOptionInfoItem[] = [
|
|
252
|
+
{
|
|
253
|
+
name: SharedOptions.temperature,
|
|
254
|
+
type: OptionType.numeric,
|
|
255
|
+
min: 0.0,
|
|
256
|
+
max: 2.0,
|
|
257
|
+
default: 0.7,
|
|
258
|
+
step: 0.01,
|
|
259
|
+
description: "Sampling temperature"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: SharedOptions.top_p,
|
|
263
|
+
type: OptionType.numeric,
|
|
264
|
+
min: 0.0,
|
|
265
|
+
max: 1.0,
|
|
266
|
+
step: 0.01,
|
|
267
|
+
description: "Nucleus sampling probability"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
name: "candidate_count",
|
|
271
|
+
type: OptionType.numeric,
|
|
272
|
+
min: 1,
|
|
273
|
+
max: 8,
|
|
274
|
+
default: 1,
|
|
275
|
+
integer: true,
|
|
276
|
+
description: "Number of candidates to generate"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
name: SharedOptions.max_tokens,
|
|
280
|
+
type: OptionType.numeric,
|
|
281
|
+
min: 1,
|
|
282
|
+
max: 32768,
|
|
283
|
+
integer: true,
|
|
284
|
+
step: 200,
|
|
285
|
+
description: "Maximum output tokens"
|
|
286
|
+
}
|
|
287
|
+
];
|
|
288
|
+
return {
|
|
289
|
+
_option_id: "vertexai-gemini",
|
|
290
|
+
options
|
|
291
|
+
};
|
|
292
|
+
}
|
|
249
293
|
// Special handling for gemini-2.5-flash-image
|
|
250
294
|
if (model.includes("gemini-2.5-flash-image")) {
|
|
251
295
|
const max_tokens_limit = 32768;
|
package/src/types.ts
CHANGED
|
@@ -252,11 +252,24 @@ export interface CompletionStream<PromptT = any> extends AsyncIterable<string> {
|
|
|
252
252
|
completion: ExecutionResponse<PromptT> | undefined;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
+
/**
|
|
256
|
+
* Minimal logger interface for LLM drivers.
|
|
257
|
+
* Follows pino v10 signature: supports message-only or object-first (never message-first).
|
|
258
|
+
* - Message-only: logger.info("message")
|
|
259
|
+
* - Object-first: logger.info({ data }, "message")
|
|
260
|
+
* - PREVENTS: logger.info("message", { data }) - compile error (objects not allowed in ...args)
|
|
261
|
+
*
|
|
262
|
+
* Additional args must be primitives (string | number | boolean) for string interpolation.
|
|
263
|
+
*/
|
|
255
264
|
export interface Logger {
|
|
256
|
-
debug:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
265
|
+
debug(msg: string, ...args: (string | number | boolean)[]): void;
|
|
266
|
+
debug<T>(obj: T, msg?: T extends string ? never : string, ...args: (string | number | boolean)[]): void;
|
|
267
|
+
info(msg: string, ...args: (string | number | boolean)[]): void;
|
|
268
|
+
info<T>(obj: T, msg?: T extends string ? never : string, ...args: (string | number | boolean)[]): void;
|
|
269
|
+
warn(msg: string, ...args: (string | number | boolean)[]): void;
|
|
270
|
+
warn<T>(obj: T, msg?: T extends string ? never : string, ...args: (string | number | boolean)[]): void;
|
|
271
|
+
error(msg: string, ...args: (string | number | boolean)[]): void;
|
|
272
|
+
error<T>(obj: T, msg?: T extends string ? never : string, ...args: (string | number | boolean)[]): void;
|
|
260
273
|
}
|
|
261
274
|
|
|
262
275
|
export interface DriverOptions {
|