llmz 0.0.53 → 0.0.55
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/{chunk-RMIS25AA.cjs → chunk-5CXOW4DC.cjs} +12 -15
- package/dist/{chunk-MDMLCSOZ.cjs → chunk-FMEOHU4O.cjs} +9 -1
- package/dist/{chunk-GPXZL4YV.js → chunk-V7Z5YK5C.js} +9 -1
- package/dist/{chunk-5YXGNMER.js → chunk-W4HLZNF4.js} +12 -15
- package/dist/context.d.ts +7 -0
- package/dist/index.cjs +6 -6
- package/dist/index.js +5 -5
- package/dist/{llmz-OJCGD4CI.cjs → llmz-75TGKZJL.cjs} +16 -14
- package/dist/{llmz-566HNZLM.js → llmz-QQULWMOC.js} +5 -3
- package/dist/llmz.d.ts +8 -0
- package/dist/result.d.ts +3 -0
- package/dist/{vm-VYYSPUQ5.cjs → vm-CR5NE6NS.cjs} +2 -2
- package/dist/{vm-5IM44JHK.js → vm-GDB4GW4S.js} +1 -1
- package/package.json +3 -3
|
@@ -3121,15 +3121,18 @@ async function runAsyncFunction(context, code, traces = [], signal = null, timeo
|
|
|
3121
3121
|
if (typeof v !== "function") {
|
|
3122
3122
|
const propHandle = toVmValue(v);
|
|
3123
3123
|
vm.setProp(obj, k, propHandle);
|
|
3124
|
-
|
|
3125
|
-
propHandle.dispose();
|
|
3126
|
-
}
|
|
3124
|
+
disposeIfNeeded(propHandle);
|
|
3127
3125
|
}
|
|
3128
3126
|
}
|
|
3129
3127
|
return obj;
|
|
3130
3128
|
}
|
|
3131
3129
|
return vm.undefined;
|
|
3132
3130
|
};
|
|
3131
|
+
const disposeIfNeeded = (handle) => {
|
|
3132
|
+
if (handle !== vm.true && handle !== vm.false && handle !== vm.null && handle !== vm.undefined) {
|
|
3133
|
+
handle.dispose();
|
|
3134
|
+
}
|
|
3135
|
+
};
|
|
3133
3136
|
const bridgeFunction = (fn, _fnName = "anonymous") => {
|
|
3134
3137
|
return (...argHandles) => {
|
|
3135
3138
|
const args = argHandles.map((h) => vm.dump(h));
|
|
@@ -3218,10 +3221,7 @@ async function runAsyncFunction(context, code, traces = [], signal = null, timeo
|
|
|
3218
3221
|
trackedProperties.add(key);
|
|
3219
3222
|
const arrayHandle = toVmValue(value);
|
|
3220
3223
|
vm.setProp(vm.global, key, arrayHandle);
|
|
3221
|
-
|
|
3222
|
-
if (shouldDispose) {
|
|
3223
|
-
arrayHandle.dispose();
|
|
3224
|
-
}
|
|
3224
|
+
disposeIfNeeded(arrayHandle);
|
|
3225
3225
|
} else if (typeof value === "object" && value !== null) {
|
|
3226
3226
|
trackedProperties.add(key);
|
|
3227
3227
|
const objHandle = vm.newObject();
|
|
@@ -3239,10 +3239,7 @@ async function runAsyncFunction(context, code, traces = [], signal = null, timeo
|
|
|
3239
3239
|
} else {
|
|
3240
3240
|
const propHandle = toVmValue(value[prop]);
|
|
3241
3241
|
vm.setProp(objHandle, prop, propHandle);
|
|
3242
|
-
|
|
3243
|
-
if (shouldDispose) {
|
|
3244
|
-
propHandle.dispose();
|
|
3245
|
-
}
|
|
3242
|
+
disposeIfNeeded(propHandle);
|
|
3246
3243
|
}
|
|
3247
3244
|
}
|
|
3248
3245
|
vm.setProp(vm.global, key, objHandle);
|
|
@@ -3316,10 +3313,7 @@ async function runAsyncFunction(context, code, traces = [], signal = null, timeo
|
|
|
3316
3313
|
trackedProperties.add(key);
|
|
3317
3314
|
const valueHandle = toVmValue(value);
|
|
3318
3315
|
vm.setProp(vm.global, key, valueHandle);
|
|
3319
|
-
|
|
3320
|
-
if (shouldDispose) {
|
|
3321
|
-
valueHandle.dispose();
|
|
3322
|
-
}
|
|
3316
|
+
disposeIfNeeded(valueHandle);
|
|
3323
3317
|
}
|
|
3324
3318
|
}
|
|
3325
3319
|
const varTrackFnHandle = vm.newFunction(
|
|
@@ -3481,6 +3475,7 @@ ${transformed.code}
|
|
|
3481
3475
|
}
|
|
3482
3476
|
const vmValue = toVmValue(value);
|
|
3483
3477
|
deferredPromise.resolve(vmValue);
|
|
3478
|
+
disposeIfNeeded(vmValue);
|
|
3484
3479
|
} catch (err) {
|
|
3485
3480
|
if (signal == null ? void 0 : signal.aborted) {
|
|
3486
3481
|
return;
|
|
@@ -3583,10 +3578,12 @@ ${transformed.code}
|
|
|
3583
3578
|
const value = await hostPromise;
|
|
3584
3579
|
const vmValue = toVmValue(value);
|
|
3585
3580
|
deferredPromise.resolve(vmValue);
|
|
3581
|
+
disposeIfNeeded(vmValue);
|
|
3586
3582
|
} catch (err2) {
|
|
3587
3583
|
const serialized = err2 instanceof Error ? err2.message : String(err2);
|
|
3588
3584
|
const errValue = vm.newString(serialized);
|
|
3589
3585
|
deferredPromise.reject(errValue);
|
|
3586
|
+
errValue.dispose();
|
|
3590
3587
|
}
|
|
3591
3588
|
})
|
|
3592
3589
|
).catch(() => {
|
|
@@ -990,6 +990,9 @@ var Iteration = class {
|
|
|
990
990
|
get temperature() {
|
|
991
991
|
return this._parameters.temperature;
|
|
992
992
|
}
|
|
993
|
+
get reasoningEffort() {
|
|
994
|
+
return this._parameters.reasoningEffort;
|
|
995
|
+
}
|
|
993
996
|
get exits() {
|
|
994
997
|
const exits = [...this._parameters.exits, ThinkExit];
|
|
995
998
|
if (this.isChatEnabled) {
|
|
@@ -1071,6 +1074,7 @@ var Iteration = class {
|
|
|
1071
1074
|
code: this.code,
|
|
1072
1075
|
model: this.model,
|
|
1073
1076
|
temperature: this.temperature,
|
|
1077
|
+
reasoningEffort: this.reasoningEffort,
|
|
1074
1078
|
traces: [...this.traces],
|
|
1075
1079
|
variables: this.variables,
|
|
1076
1080
|
started_ts: this.started_ts,
|
|
@@ -1098,6 +1102,7 @@ var Context = (_class2 = class {
|
|
|
1098
1102
|
|
|
1099
1103
|
|
|
1100
1104
|
|
|
1105
|
+
|
|
1101
1106
|
__init3() {this.version = _chunkD3JSHTIKcjs.DualModePrompt}
|
|
1102
1107
|
__init4() {this.timeout = 6e4}
|
|
1103
1108
|
// Default timeout of 60 seconds
|
|
@@ -1280,6 +1285,7 @@ var Context = (_class2 = class {
|
|
|
1280
1285
|
const components = await getValue(_nullishCoalesce(((_b = this.chat) == null ? void 0 : _b.components), () => ( [])), this);
|
|
1281
1286
|
const model = await _asyncNullishCoalesce(await getValue(this.model, this), async () => ( "best"));
|
|
1282
1287
|
const temperature = await getValue(this.temperature, this);
|
|
1288
|
+
const reasoningEffort = await getValue(this.reasoningEffort, this);
|
|
1283
1289
|
if (objects && objects.length > 100) {
|
|
1284
1290
|
throw new Error("Too many objects. Expected at most 100 objects.");
|
|
1285
1291
|
}
|
|
@@ -1373,7 +1379,8 @@ var Context = (_class2 = class {
|
|
|
1373
1379
|
instructions,
|
|
1374
1380
|
components,
|
|
1375
1381
|
model,
|
|
1376
|
-
temperature
|
|
1382
|
+
temperature,
|
|
1383
|
+
reasoningEffort
|
|
1377
1384
|
};
|
|
1378
1385
|
}
|
|
1379
1386
|
constructor(props) {;_class2.prototype.__init3.call(this);_class2.prototype.__init4.call(this);_class2.prototype.__init5.call(this);
|
|
@@ -1386,6 +1393,7 @@ var Context = (_class2 = class {
|
|
|
1386
1393
|
this.timeout = Math.min(999999999, Math.max(0, _nullishCoalesce(props.timeout, () => ( 6e4))));
|
|
1387
1394
|
this.loop = _nullishCoalesce(props.loop, () => ( 3));
|
|
1388
1395
|
this.temperature = _nullishCoalesce(props.temperature, () => ( 0.7));
|
|
1396
|
+
this.reasoningEffort = props.reasoningEffort;
|
|
1389
1397
|
this.model = _nullishCoalesce(props.model, () => ( "best"));
|
|
1390
1398
|
this.iterations = [];
|
|
1391
1399
|
this.metadata = _nullishCoalesce(props.metadata, () => ( {}));
|
|
@@ -990,6 +990,9 @@ var Iteration = class {
|
|
|
990
990
|
get temperature() {
|
|
991
991
|
return this._parameters.temperature;
|
|
992
992
|
}
|
|
993
|
+
get reasoningEffort() {
|
|
994
|
+
return this._parameters.reasoningEffort;
|
|
995
|
+
}
|
|
993
996
|
get exits() {
|
|
994
997
|
const exits = [...this._parameters.exits, ThinkExit];
|
|
995
998
|
if (this.isChatEnabled) {
|
|
@@ -1071,6 +1074,7 @@ var Iteration = class {
|
|
|
1071
1074
|
code: this.code,
|
|
1072
1075
|
model: this.model,
|
|
1073
1076
|
temperature: this.temperature,
|
|
1077
|
+
reasoningEffort: this.reasoningEffort,
|
|
1074
1078
|
traces: [...this.traces],
|
|
1075
1079
|
variables: this.variables,
|
|
1076
1080
|
started_ts: this.started_ts,
|
|
@@ -1098,6 +1102,7 @@ var Context = class {
|
|
|
1098
1102
|
exits;
|
|
1099
1103
|
model;
|
|
1100
1104
|
temperature;
|
|
1105
|
+
reasoningEffort;
|
|
1101
1106
|
version = DualModePrompt;
|
|
1102
1107
|
timeout = 6e4;
|
|
1103
1108
|
// Default timeout of 60 seconds
|
|
@@ -1280,6 +1285,7 @@ var Context = class {
|
|
|
1280
1285
|
const components = await getValue(((_b = this.chat) == null ? void 0 : _b.components) ?? [], this);
|
|
1281
1286
|
const model = await getValue(this.model, this) ?? "best";
|
|
1282
1287
|
const temperature = await getValue(this.temperature, this);
|
|
1288
|
+
const reasoningEffort = await getValue(this.reasoningEffort, this);
|
|
1283
1289
|
if (objects && objects.length > 100) {
|
|
1284
1290
|
throw new Error("Too many objects. Expected at most 100 objects.");
|
|
1285
1291
|
}
|
|
@@ -1373,7 +1379,8 @@ var Context = class {
|
|
|
1373
1379
|
instructions,
|
|
1374
1380
|
components,
|
|
1375
1381
|
model,
|
|
1376
|
-
temperature
|
|
1382
|
+
temperature,
|
|
1383
|
+
reasoningEffort
|
|
1377
1384
|
};
|
|
1378
1385
|
}
|
|
1379
1386
|
constructor(props) {
|
|
@@ -1386,6 +1393,7 @@ var Context = class {
|
|
|
1386
1393
|
this.timeout = Math.min(999999999, Math.max(0, props.timeout ?? 6e4));
|
|
1387
1394
|
this.loop = props.loop ?? 3;
|
|
1388
1395
|
this.temperature = props.temperature ?? 0.7;
|
|
1396
|
+
this.reasoningEffort = props.reasoningEffort;
|
|
1389
1397
|
this.model = props.model ?? "best";
|
|
1390
1398
|
this.iterations = [];
|
|
1391
1399
|
this.metadata = props.metadata ?? {};
|
|
@@ -3121,15 +3121,18 @@ async function runAsyncFunction(context, code, traces = [], signal = null, timeo
|
|
|
3121
3121
|
if (typeof v !== "function") {
|
|
3122
3122
|
const propHandle = toVmValue(v);
|
|
3123
3123
|
vm.setProp(obj, k, propHandle);
|
|
3124
|
-
|
|
3125
|
-
propHandle.dispose();
|
|
3126
|
-
}
|
|
3124
|
+
disposeIfNeeded(propHandle);
|
|
3127
3125
|
}
|
|
3128
3126
|
}
|
|
3129
3127
|
return obj;
|
|
3130
3128
|
}
|
|
3131
3129
|
return vm.undefined;
|
|
3132
3130
|
};
|
|
3131
|
+
const disposeIfNeeded = (handle) => {
|
|
3132
|
+
if (handle !== vm.true && handle !== vm.false && handle !== vm.null && handle !== vm.undefined) {
|
|
3133
|
+
handle.dispose();
|
|
3134
|
+
}
|
|
3135
|
+
};
|
|
3133
3136
|
const bridgeFunction = (fn, _fnName = "anonymous") => {
|
|
3134
3137
|
return (...argHandles) => {
|
|
3135
3138
|
const args = argHandles.map((h) => vm.dump(h));
|
|
@@ -3218,10 +3221,7 @@ async function runAsyncFunction(context, code, traces = [], signal = null, timeo
|
|
|
3218
3221
|
trackedProperties.add(key);
|
|
3219
3222
|
const arrayHandle = toVmValue(value);
|
|
3220
3223
|
vm.setProp(vm.global, key, arrayHandle);
|
|
3221
|
-
|
|
3222
|
-
if (shouldDispose) {
|
|
3223
|
-
arrayHandle.dispose();
|
|
3224
|
-
}
|
|
3224
|
+
disposeIfNeeded(arrayHandle);
|
|
3225
3225
|
} else if (typeof value === "object" && value !== null) {
|
|
3226
3226
|
trackedProperties.add(key);
|
|
3227
3227
|
const objHandle = vm.newObject();
|
|
@@ -3239,10 +3239,7 @@ async function runAsyncFunction(context, code, traces = [], signal = null, timeo
|
|
|
3239
3239
|
} else {
|
|
3240
3240
|
const propHandle = toVmValue(value[prop]);
|
|
3241
3241
|
vm.setProp(objHandle, prop, propHandle);
|
|
3242
|
-
|
|
3243
|
-
if (shouldDispose) {
|
|
3244
|
-
propHandle.dispose();
|
|
3245
|
-
}
|
|
3242
|
+
disposeIfNeeded(propHandle);
|
|
3246
3243
|
}
|
|
3247
3244
|
}
|
|
3248
3245
|
vm.setProp(vm.global, key, objHandle);
|
|
@@ -3316,10 +3313,7 @@ async function runAsyncFunction(context, code, traces = [], signal = null, timeo
|
|
|
3316
3313
|
trackedProperties.add(key);
|
|
3317
3314
|
const valueHandle = toVmValue(value);
|
|
3318
3315
|
vm.setProp(vm.global, key, valueHandle);
|
|
3319
|
-
|
|
3320
|
-
if (shouldDispose) {
|
|
3321
|
-
valueHandle.dispose();
|
|
3322
|
-
}
|
|
3316
|
+
disposeIfNeeded(valueHandle);
|
|
3323
3317
|
}
|
|
3324
3318
|
}
|
|
3325
3319
|
const varTrackFnHandle = vm.newFunction(
|
|
@@ -3481,6 +3475,7 @@ ${transformed.code}
|
|
|
3481
3475
|
}
|
|
3482
3476
|
const vmValue = toVmValue(value);
|
|
3483
3477
|
deferredPromise.resolve(vmValue);
|
|
3478
|
+
disposeIfNeeded(vmValue);
|
|
3484
3479
|
} catch (err) {
|
|
3485
3480
|
if (signal == null ? void 0 : signal.aborted) {
|
|
3486
3481
|
return;
|
|
@@ -3583,10 +3578,12 @@ ${transformed.code}
|
|
|
3583
3578
|
const value = await hostPromise;
|
|
3584
3579
|
const vmValue = toVmValue(value);
|
|
3585
3580
|
deferredPromise.resolve(vmValue);
|
|
3581
|
+
disposeIfNeeded(vmValue);
|
|
3586
3582
|
} catch (err2) {
|
|
3587
3583
|
const serialized = err2 instanceof Error ? err2.message : String(err2);
|
|
3588
3584
|
const errValue = vm.newString(serialized);
|
|
3589
3585
|
deferredPromise.reject(errValue);
|
|
3586
|
+
errValue.dispose();
|
|
3590
3587
|
}
|
|
3591
3588
|
})
|
|
3592
3589
|
).catch(() => {
|
package/dist/context.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export type IterationParameters = {
|
|
|
20
20
|
components: Component[];
|
|
21
21
|
model: Models | Models[];
|
|
22
22
|
temperature: number;
|
|
23
|
+
reasoningEffort?: 'low' | 'medium' | 'high' | 'dynamic' | 'none';
|
|
23
24
|
};
|
|
24
25
|
export type IterationStatus = IterationStatuses.Pending | IterationStatuses.GenerationError | IterationStatuses.ExecutionError | IterationStatuses.InvalidCodeError | IterationStatuses.Thinking | IterationStatuses.Callback | IterationStatuses.ExitSuccess | IterationStatuses.ExitError | IterationStatuses.Aborted;
|
|
25
26
|
export declare namespace IterationStatuses {
|
|
@@ -310,6 +311,7 @@ export declare namespace Iteration {
|
|
|
310
311
|
traces: Trace[];
|
|
311
312
|
model: Models | Models[];
|
|
312
313
|
temperature: number;
|
|
314
|
+
reasoningEffort?: 'low' | 'medium' | 'high' | 'dynamic' | 'none';
|
|
313
315
|
variables: Record<string, any>;
|
|
314
316
|
started_ts: number;
|
|
315
317
|
ended_ts?: number;
|
|
@@ -354,6 +356,7 @@ export declare class Iteration implements Serializable<Iteration.JSON> {
|
|
|
354
356
|
get model(): Models | Models[];
|
|
355
357
|
set model(value: Models | Models[]);
|
|
356
358
|
get temperature(): number;
|
|
359
|
+
get reasoningEffort(): "low" | "medium" | "high" | "dynamic" | "none" | undefined;
|
|
357
360
|
get exits(): Exit<unknown>[];
|
|
358
361
|
get instructions(): string | undefined;
|
|
359
362
|
llm?: {
|
|
@@ -400,6 +403,7 @@ export declare class Iteration implements Serializable<Iteration.JSON> {
|
|
|
400
403
|
code: string | undefined;
|
|
401
404
|
model: Models | Models[];
|
|
402
405
|
temperature: number;
|
|
406
|
+
reasoningEffort: "low" | "medium" | "high" | "dynamic" | "none" | undefined;
|
|
403
407
|
traces: import("./types.js").Traces.Trace[];
|
|
404
408
|
variables: Record<string, any>;
|
|
405
409
|
started_ts: number;
|
|
@@ -484,6 +488,7 @@ export declare class Context implements Serializable<Context.JSON> {
|
|
|
484
488
|
exits?: ValueOrGetter<Exit[], Context>;
|
|
485
489
|
model?: ValueOrGetter<Models | Models[], Context>;
|
|
486
490
|
temperature: ValueOrGetter<number, Context>;
|
|
491
|
+
reasoningEffort?: ValueOrGetter<'low' | 'medium' | 'high' | 'dynamic' | 'none', Context>;
|
|
487
492
|
version: Prompt;
|
|
488
493
|
timeout: number;
|
|
489
494
|
loop: number;
|
|
@@ -503,6 +508,7 @@ export declare class Context implements Serializable<Context.JSON> {
|
|
|
503
508
|
exits?: ValueOrGetter<Exit[], Context>;
|
|
504
509
|
loop?: number;
|
|
505
510
|
temperature?: ValueOrGetter<number, Context>;
|
|
511
|
+
reasoningEffort?: ValueOrGetter<'low' | 'medium' | 'high' | 'dynamic' | 'none', Context>;
|
|
506
512
|
model?: ValueOrGetter<Models | Models[], Context>;
|
|
507
513
|
metadata?: Record<string, any>;
|
|
508
514
|
snapshot?: Snapshot;
|
|
@@ -516,6 +522,7 @@ export declare class Context implements Serializable<Context.JSON> {
|
|
|
516
522
|
code: string | undefined;
|
|
517
523
|
model: Models | Models[];
|
|
518
524
|
temperature: number;
|
|
525
|
+
reasoningEffort: "low" | "medium" | "high" | "dynamic" | "none" | undefined;
|
|
519
526
|
traces: import("./types.js").Traces.Trace[];
|
|
520
527
|
variables: Record<string, any>;
|
|
521
528
|
started_ts: number;
|
package/dist/index.cjs
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkFMEOHU4Ocjs = require('./chunk-FMEOHU4O.cjs');
|
|
13
13
|
require('./chunk-D3JSHTIK.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
@@ -53,7 +53,7 @@ var _chunk4VYDQ3VFcjs = require('./chunk-4VYDQ3VF.cjs');
|
|
|
53
53
|
var _chunkRKKRSBX3cjs = require('./chunk-RKKRSBX3.cjs');
|
|
54
54
|
|
|
55
55
|
// package.json
|
|
56
|
-
var version = "0.0.
|
|
56
|
+
var version = "0.0.55";
|
|
57
57
|
|
|
58
58
|
// src/objects.ts
|
|
59
59
|
var _zui = require('@bpinternal/zui');
|
|
@@ -1115,16 +1115,16 @@ var utils = {
|
|
|
1115
1115
|
truncateWrappedContent: _chunkUCXQ4U7Pcjs.truncateWrappedContent
|
|
1116
1116
|
};
|
|
1117
1117
|
var execute = async (props) => {
|
|
1118
|
-
const { executeContext } = await Promise.resolve().then(() => _interopRequireWildcard(require("./llmz-
|
|
1118
|
+
const { executeContext } = await Promise.resolve().then(() => _interopRequireWildcard(require("./llmz-75TGKZJL.cjs")));
|
|
1119
1119
|
return executeContext(props);
|
|
1120
1120
|
};
|
|
1121
1121
|
var init = async () => {
|
|
1122
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require("./llmz-
|
|
1122
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./llmz-75TGKZJL.cjs")));
|
|
1123
1123
|
await Promise.resolve().then(() => _interopRequireWildcard(require("./component-J72CVOKY.cjs")));
|
|
1124
1124
|
await Promise.resolve().then(() => _interopRequireWildcard(require("./tool-NAGC3ZMN.cjs")));
|
|
1125
1125
|
await Promise.resolve().then(() => _interopRequireWildcard(require("./exit-OOGJ3TAS.cjs")));
|
|
1126
1126
|
await Promise.resolve().then(() => _interopRequireWildcard(require("./jsx-ENFGHP6S.cjs")));
|
|
1127
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require("./vm-
|
|
1127
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./vm-CR5NE6NS.cjs")));
|
|
1128
1128
|
await Promise.resolve().then(() => _interopRequireWildcard(require("./utils-BZUEJT4W.cjs")));
|
|
1129
1129
|
await Promise.resolve().then(() => _interopRequireWildcard(require("./truncator-6M2EP2NZ.cjs")));
|
|
1130
1130
|
await Promise.resolve().then(() => _interopRequireWildcard(require("./typings-SNGR4WYT.cjs")));
|
|
@@ -1159,4 +1159,4 @@ var init = async () => {
|
|
|
1159
1159
|
|
|
1160
1160
|
|
|
1161
1161
|
|
|
1162
|
-
exports.Chat = Chat; exports.CitationsManager = CitationsManager; exports.Component = _chunkTLOQBZKWcjs.Component; exports.DefaultComponents = DefaultComponents; exports.DefaultExit =
|
|
1162
|
+
exports.Chat = Chat; exports.CitationsManager = CitationsManager; exports.Component = _chunkTLOQBZKWcjs.Component; exports.DefaultComponents = DefaultComponents; exports.DefaultExit = _chunkFMEOHU4Ocjs.DefaultExit; exports.ErrorExecutionResult = _chunkFMEOHU4Ocjs.ErrorExecutionResult; exports.ExecutionResult = _chunkFMEOHU4Ocjs.ExecutionResult; exports.Exit = _chunkF4OZHUMScjs.Exit; exports.ListenExit = _chunkFMEOHU4Ocjs.ListenExit; exports.LoopExceededError = _chunkPK72FAKDcjs.LoopExceededError; exports.ObjectInstance = ObjectInstance; exports.PartialExecutionResult = _chunkFMEOHU4Ocjs.PartialExecutionResult; exports.Snapshot = _chunkFMEOHU4Ocjs.Snapshot; exports.SnapshotSignal = _chunkPK72FAKDcjs.SnapshotSignal; exports.SuccessExecutionResult = _chunkFMEOHU4Ocjs.SuccessExecutionResult; exports.ThinkExit = _chunkFMEOHU4Ocjs.ThinkExit; exports.ThinkSignal = _chunkPK72FAKDcjs.ThinkSignal; exports.Tool = _chunkSZLX27VXcjs.Tool; exports.assertValidComponent = _chunkTLOQBZKWcjs.assertValidComponent; exports.execute = execute; exports.getValue = _chunkFMEOHU4Ocjs.getValue; exports.init = init; exports.isAnyComponent = _chunkTLOQBZKWcjs.isAnyComponent; exports.isComponent = _chunkTLOQBZKWcjs.isComponent; exports.parseExit = _chunkFMEOHU4Ocjs.parseExit; exports.renderToTsx = _chunkTLOQBZKWcjs.renderToTsx; exports.utils = utils; exports.version = version;
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
ThinkExit,
|
|
10
10
|
getValue,
|
|
11
11
|
parseExit
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-V7Z5YK5C.js";
|
|
13
13
|
import "./chunk-WTWIJ2LI.js";
|
|
14
14
|
import {
|
|
15
15
|
Tool
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
} from "./chunk-5XC6ZMS5.js";
|
|
54
54
|
|
|
55
55
|
// package.json
|
|
56
|
-
var version = "0.0.
|
|
56
|
+
var version = "0.0.55";
|
|
57
57
|
|
|
58
58
|
// src/objects.ts
|
|
59
59
|
import { z } from "@bpinternal/zui";
|
|
@@ -1115,16 +1115,16 @@ var utils = {
|
|
|
1115
1115
|
truncateWrappedContent
|
|
1116
1116
|
};
|
|
1117
1117
|
var execute = async (props) => {
|
|
1118
|
-
const { executeContext } = await import("./llmz-
|
|
1118
|
+
const { executeContext } = await import("./llmz-QQULWMOC.js");
|
|
1119
1119
|
return executeContext(props);
|
|
1120
1120
|
};
|
|
1121
1121
|
var init = async () => {
|
|
1122
|
-
await import("./llmz-
|
|
1122
|
+
await import("./llmz-QQULWMOC.js");
|
|
1123
1123
|
await import("./component-GNYIA77X.js");
|
|
1124
1124
|
await import("./tool-5JXTEQNW.js");
|
|
1125
1125
|
await import("./exit-56DISPLS.js");
|
|
1126
1126
|
await import("./jsx-PCXQVMLU.js");
|
|
1127
|
-
await import("./vm-
|
|
1127
|
+
await import("./vm-GDB4GW4S.js");
|
|
1128
1128
|
await import("./utils-D3J443FA.js");
|
|
1129
1129
|
await import("./truncator-2FSONJM2.js");
|
|
1130
1130
|
await import("./typings-ZO63Z4TF.js");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk5CXOW4DCcjs = require('./chunk-5CXOW4DC.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ var _chunkRMIS25AAcjs = require('./chunk-RMIS25AA.cjs');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkFMEOHU4Ocjs = require('./chunk-FMEOHU4O.cjs');
|
|
12
12
|
require('./chunk-D3JSHTIK.cjs');
|
|
13
13
|
require('./chunk-SZLX27VX.cjs');
|
|
14
14
|
require('./chunk-2NEOPXCS.cjs');
|
|
@@ -109,7 +109,7 @@ var _executeContext = async (props) => {
|
|
|
109
109
|
const client = _nullishCoalesce(props.client, () => ( new (0, _client.Client)()));
|
|
110
110
|
const cognitive = _cognitive.Cognitive.isCognitiveClient(client) ? client : new (0, _cognitive.Cognitive)({ client, __experimental_beta: true });
|
|
111
111
|
const cleanups = [];
|
|
112
|
-
const ctx = new (0,
|
|
112
|
+
const ctx = new (0, _chunkFMEOHU4Ocjs.Context)({
|
|
113
113
|
chat: props.chat,
|
|
114
114
|
instructions: props.instructions,
|
|
115
115
|
objects: props.objects,
|
|
@@ -119,12 +119,13 @@ var _executeContext = async (props) => {
|
|
|
119
119
|
exits: props.exits,
|
|
120
120
|
snapshot: props.snapshot,
|
|
121
121
|
model: props.model,
|
|
122
|
-
temperature: props.temperature
|
|
122
|
+
temperature: props.temperature,
|
|
123
|
+
reasoningEffort: props.reasoningEffort
|
|
123
124
|
});
|
|
124
125
|
try {
|
|
125
126
|
while (true) {
|
|
126
127
|
if (ctx.iterations.length >= ctx.loop) {
|
|
127
|
-
return new (0,
|
|
128
|
+
return new (0, _chunkFMEOHU4Ocjs.ErrorExecutionResult)(ctx, new (0, _chunkPK72FAKDcjs.LoopExceededError)());
|
|
128
129
|
}
|
|
129
130
|
const iteration = await ctx.nextIteration();
|
|
130
131
|
try {
|
|
@@ -147,7 +148,7 @@ var _executeContext = async (props) => {
|
|
|
147
148
|
reason: _nullishCoalesce(controller.signal.reason, () => ( "The operation was aborted"))
|
|
148
149
|
}
|
|
149
150
|
});
|
|
150
|
-
return new (0,
|
|
151
|
+
return new (0, _chunkFMEOHU4Ocjs.ErrorExecutionResult)(ctx, _nullishCoalesce(controller.signal.reason, () => ( "The operation was aborted")));
|
|
151
152
|
}
|
|
152
153
|
cleanups.push(
|
|
153
154
|
iteration.traces.onPush((traces) => {
|
|
@@ -169,7 +170,7 @@ var _executeContext = async (props) => {
|
|
|
169
170
|
});
|
|
170
171
|
} catch (err) {
|
|
171
172
|
if (err instanceof _chunkPK72FAKDcjs.CognitiveError) {
|
|
172
|
-
return new (0,
|
|
173
|
+
return new (0, _chunkFMEOHU4Ocjs.ErrorExecutionResult)(ctx, err);
|
|
173
174
|
}
|
|
174
175
|
iteration.end({
|
|
175
176
|
type: "execution_error",
|
|
@@ -186,25 +187,25 @@ var _executeContext = async (props) => {
|
|
|
186
187
|
}
|
|
187
188
|
if (iteration.status.type === "exit_success") {
|
|
188
189
|
const exitName = iteration.status.exit_success.exit_name;
|
|
189
|
-
return new (0,
|
|
190
|
+
return new (0, _chunkFMEOHU4Ocjs.SuccessExecutionResult)(ctx, {
|
|
190
191
|
exit: iteration.exits.find((x) => x.name === exitName),
|
|
191
192
|
result: iteration.status.exit_success.return_value
|
|
192
193
|
});
|
|
193
194
|
}
|
|
194
195
|
if (iteration.status.type === "callback_requested") {
|
|
195
|
-
return new (0,
|
|
196
|
+
return new (0, _chunkFMEOHU4Ocjs.PartialExecutionResult)(
|
|
196
197
|
ctx,
|
|
197
198
|
iteration.status.callback_requested.signal,
|
|
198
|
-
|
|
199
|
+
_chunkFMEOHU4Ocjs.Snapshot.fromSignal(iteration.status.callback_requested.signal)
|
|
199
200
|
);
|
|
200
201
|
}
|
|
201
202
|
if (iteration.status.type === "thinking_requested" || iteration.status.type === "exit_error" || iteration.status.type === "execution_error" || iteration.status.type === "invalid_code_error") {
|
|
202
203
|
continue;
|
|
203
204
|
}
|
|
204
|
-
return new (0,
|
|
205
|
+
return new (0, _chunkFMEOHU4Ocjs.ErrorExecutionResult)(ctx, _nullishCoalesce(iteration.error, () => ( `Unknown error. Status: ${iteration.status.type}`)));
|
|
205
206
|
}
|
|
206
207
|
} catch (error) {
|
|
207
|
-
return new (0,
|
|
208
|
+
return new (0, _chunkFMEOHU4Ocjs.ErrorExecutionResult)(ctx, _nullishCoalesce(error, () => ( "Unknown error")));
|
|
208
209
|
} finally {
|
|
209
210
|
for (const cleanup of cleanups) {
|
|
210
211
|
try {
|
|
@@ -257,6 +258,7 @@ var executeIteration = async ({
|
|
|
257
258
|
model: model.ref,
|
|
258
259
|
temperature: iteration.temperature,
|
|
259
260
|
responseFormat: "text",
|
|
261
|
+
reasoningEffort: iteration.reasoningEffort,
|
|
260
262
|
messages: messages.filter((x) => x.role !== "system"),
|
|
261
263
|
stopSequences: ctx.version.getStopTokens()
|
|
262
264
|
}).catch((thrown) => {
|
|
@@ -388,7 +390,7 @@ var executeIteration = async ({
|
|
|
388
390
|
});
|
|
389
391
|
}
|
|
390
392
|
startedAt = Date.now();
|
|
391
|
-
const result = await
|
|
393
|
+
const result = await _chunk5CXOW4DCcjs.runAsyncFunction.call(void 0,
|
|
392
394
|
vmContext,
|
|
393
395
|
iteration.code,
|
|
394
396
|
traces,
|
|
@@ -482,7 +484,7 @@ var executeIteration = async ({
|
|
|
482
484
|
}
|
|
483
485
|
});
|
|
484
486
|
}
|
|
485
|
-
const parsedExit =
|
|
487
|
+
const parsedExit = _chunkFMEOHU4Ocjs.parseExit.call(void 0, returnValue, iteration.exits);
|
|
486
488
|
if (!parsedExit.success) {
|
|
487
489
|
return iteration.end({
|
|
488
490
|
type: "exit_error",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runAsyncFunction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-W4HLZNF4.js";
|
|
4
4
|
import {
|
|
5
5
|
Context,
|
|
6
6
|
ErrorExecutionResult,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
Snapshot,
|
|
9
9
|
SuccessExecutionResult,
|
|
10
10
|
parseExit
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-V7Z5YK5C.js";
|
|
12
12
|
import "./chunk-WTWIJ2LI.js";
|
|
13
13
|
import "./chunk-L2ZDZKCB.js";
|
|
14
14
|
import "./chunk-YV5N57D3.js";
|
|
@@ -119,7 +119,8 @@ var _executeContext = async (props) => {
|
|
|
119
119
|
exits: props.exits,
|
|
120
120
|
snapshot: props.snapshot,
|
|
121
121
|
model: props.model,
|
|
122
|
-
temperature: props.temperature
|
|
122
|
+
temperature: props.temperature,
|
|
123
|
+
reasoningEffort: props.reasoningEffort
|
|
123
124
|
});
|
|
124
125
|
try {
|
|
125
126
|
while (true) {
|
|
@@ -257,6 +258,7 @@ var executeIteration = async ({
|
|
|
257
258
|
model: model.ref,
|
|
258
259
|
temperature: iteration.temperature,
|
|
259
260
|
responseFormat: "text",
|
|
261
|
+
reasoningEffort: iteration.reasoningEffort,
|
|
260
262
|
messages: messages.filter((x) => x.role !== "system"),
|
|
261
263
|
stopSequences: ctx.version.getStopTokens()
|
|
262
264
|
}).catch((thrown) => {
|
package/dist/llmz.d.ts
CHANGED
|
@@ -197,6 +197,14 @@ export type ExecutionProps = {
|
|
|
197
197
|
* If no temperature is provided, the default temperature of 0.7 will be used.
|
|
198
198
|
*/
|
|
199
199
|
temperature?: ValueOrGetter<number, Context>;
|
|
200
|
+
/**
|
|
201
|
+
* The reasoning effort to use for models that support reasoning.
|
|
202
|
+
* - "none": Disable reasoning (for models with optional reasoning)
|
|
203
|
+
* - "low" | "medium" | "high": Fixed reasoning effort levels
|
|
204
|
+
* - "dynamic": Let the provider automatically determine the reasoning effort
|
|
205
|
+
* If not provided, the model will not use reasoning for models with optional reasoning.
|
|
206
|
+
*/
|
|
207
|
+
reasoningEffort?: ValueOrGetter<'low' | 'medium' | 'high' | 'dynamic' | 'none', Context>;
|
|
200
208
|
} & ExecutionHooks;
|
|
201
209
|
export declare const executeContext: (props: ExecutionProps) => Promise<ExecutionResult>;
|
|
202
210
|
export declare const _executeContext: (props: ExecutionProps) => Promise<ExecutionResult>;
|
package/dist/result.d.ts
CHANGED
|
@@ -390,6 +390,7 @@ export declare class SuccessExecutionResult<TOutput = unknown> extends Execution
|
|
|
390
390
|
code: string | undefined;
|
|
391
391
|
model: import("@botpress/cognitive").Models | import("@botpress/cognitive").Models[];
|
|
392
392
|
temperature: number;
|
|
393
|
+
reasoningEffort: "low" | "medium" | "high" | "dynamic" | "none" | undefined;
|
|
393
394
|
traces: import("./types.js").Traces.Trace[];
|
|
394
395
|
variables: Record<string, any>;
|
|
395
396
|
started_ts: number;
|
|
@@ -551,6 +552,7 @@ export declare class ErrorExecutionResult extends ExecutionResult implements Ser
|
|
|
551
552
|
code: string | undefined;
|
|
552
553
|
model: import("@botpress/cognitive").Models | import("@botpress/cognitive").Models[];
|
|
553
554
|
temperature: number;
|
|
555
|
+
reasoningEffort: "low" | "medium" | "high" | "dynamic" | "none" | undefined;
|
|
554
556
|
traces: import("./types.js").Traces.Trace[];
|
|
555
557
|
variables: Record<string, any>;
|
|
556
558
|
started_ts: number;
|
|
@@ -732,6 +734,7 @@ export declare class PartialExecutionResult extends ExecutionResult implements S
|
|
|
732
734
|
code: string | undefined;
|
|
733
735
|
model: import("@botpress/cognitive").Models | import("@botpress/cognitive").Models[];
|
|
734
736
|
temperature: number;
|
|
737
|
+
reasoningEffort: "low" | "medium" | "high" | "dynamic" | "none" | undefined;
|
|
735
738
|
traces: import("./types.js").Traces.Trace[];
|
|
736
739
|
variables: Record<string, any>;
|
|
737
740
|
started_ts: number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk5CXOW4DCcjs = require('./chunk-5CXOW4DC.cjs');
|
|
4
4
|
require('./chunk-PK72FAKD.cjs');
|
|
5
5
|
require('./chunk-KIN7Y247.cjs');
|
|
6
6
|
require('./chunk-54G63644.cjs');
|
|
7
7
|
require('./chunk-RKKRSBX3.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.runAsyncFunction =
|
|
10
|
+
exports.runAsyncFunction = _chunk5CXOW4DCcjs.runAsyncFunction;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "llmz",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "LLMz - An LLM-native Typescript VM built on top of Zui",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.55",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"main": "./dist/index.cjs",
|
|
8
8
|
"module": "./dist/index.js",
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"tsx": "^4.19.2"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@botpress/client": "1.
|
|
75
|
-
"@botpress/cognitive": "0.3.
|
|
74
|
+
"@botpress/client": "1.36.0",
|
|
75
|
+
"@botpress/cognitive": "0.3.15",
|
|
76
76
|
"@bpinternal/thicktoken": "^2.0.0",
|
|
77
77
|
"@bpinternal/zui": "^1.3.3"
|
|
78
78
|
},
|