llmz 0.0.24 → 0.0.26
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-FZJHYLM2.cjs → chunk-45GKLDDR.cjs} +2 -2
- package/dist/{chunk-LUX4X7XO.js → chunk-7G5QAIUX.js} +2 -2
- package/dist/{chunk-XGJOEQMW.cjs → chunk-A63TROZX.cjs} +2 -2
- package/dist/{chunk-A7QHWVD7.js → chunk-CARJB3HP.js} +1 -1
- package/dist/{chunk-2D2DE7CD.js → chunk-EDVD6GWH.js} +1 -1
- package/dist/chunk-KIN7Y247.cjs +32 -0
- package/dist/{chunk-BNDY7RGX.cjs → chunk-M3LCKL55.cjs} +20 -20
- package/dist/{chunk-JKVVQN2P.js → chunk-MYLTD5WT.js} +15 -2
- package/dist/{chunk-EE6NVDID.js → chunk-PBTEQAZK.js} +1 -1
- package/dist/{chunk-2NU62OI4.cjs → chunk-PQILLTEM.cjs} +33 -20
- package/dist/{chunk-PIDLNYIP.cjs → chunk-Q2O6MYES.cjs} +4 -4
- package/dist/{chunk-QIZBF7A5.js → chunk-SHC22IAH.js} +25 -12
- package/dist/{chunk-JDABP4SD.cjs → chunk-T63Y6GTW.cjs} +17 -4
- package/dist/chunk-YEAWWJSJ.js +32 -0
- package/dist/context.d.ts +15 -11
- package/dist/{dual-modes-7FI4T35O.js → dual-modes-7FEESYXQ.js} +2 -2
- package/dist/{dual-modes-OFHV2C3X.cjs → dual-modes-F2HJJY2Z.cjs} +3 -3
- package/dist/errors.d.ts +3 -0
- package/dist/index.cjs +19 -19
- package/dist/index.d.ts +6 -2
- package/dist/index.js +12 -12
- package/dist/{llmz-IUGXC4SH.js → llmz-VGZUUM3U.js} +17 -16
- package/dist/{llmz-UUZTBIF3.cjs → llmz-Z5ULKYGZ.cjs} +41 -40
- package/dist/llmz.d.ts +15 -2
- package/dist/result.d.ts +6 -6
- package/dist/tool-4J4JNDNV.cjs +11 -0
- package/dist/tool-SFRUHH7M.js +11 -0
- package/dist/typings-2WTRKHEH.cjs +10 -0
- package/dist/{typings-WYHEFCYB.js → typings-AYAZ5YA3.js} +3 -3
- package/dist/{vm-CYC5RLKU.js → vm-I4G4IH7T.js} +3 -3
- package/dist/vm-YJX6M4NJ.cjs +12 -0
- package/package.json +6 -3
- package/dist/chunk-IKSIOIIP.cjs +0 -28
- package/dist/chunk-JQBT7UWN.js +0 -28
- package/dist/tool-O4SFRIE4.cjs +0 -11
- package/dist/tool-PCOYOCRH.js +0 -11
- package/dist/typings-Y45GMPZT.cjs +0 -10
- package/dist/vm-PRZ5GEM2.cjs +0 -12
|
@@ -1,16 +1,16 @@
|
|
|
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 _chunkM3LCKL55cjs = require('./chunk-M3LCKL55.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
require('./chunk-
|
|
12
|
-
require('./chunk-
|
|
13
|
-
require('./chunk-
|
|
10
|
+
var _chunkPQILLTEMcjs = require('./chunk-PQILLTEM.cjs');
|
|
11
|
+
require('./chunk-Q2O6MYES.cjs');
|
|
12
|
+
require('./chunk-A63TROZX.cjs');
|
|
13
|
+
require('./chunk-45GKLDDR.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -20,10 +20,11 @@ require('./chunk-FZJHYLM2.cjs');
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var _chunkJDABP4SDcjs = require('./chunk-JDABP4SD.cjs');
|
|
24
23
|
|
|
24
|
+
var _chunkT63Y6GTWcjs = require('./chunk-T63Y6GTW.cjs');
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
|
|
27
|
+
var _chunkKIN7Y247cjs = require('./chunk-KIN7Y247.cjs');
|
|
27
28
|
require('./chunk-3G3BS5IA.cjs');
|
|
28
29
|
require('./chunk-ZRCU35UV.cjs');
|
|
29
30
|
require('./chunk-KMZDFWYZ.cjs');
|
|
@@ -100,27 +101,27 @@ var executeContext = async (props) => {
|
|
|
100
101
|
return result;
|
|
101
102
|
};
|
|
102
103
|
var _executeContext = async (props) => {
|
|
103
|
-
var _a, _b
|
|
104
|
+
var _a, _b;
|
|
104
105
|
const controller = createJoinedAbortController([props.signal]);
|
|
105
106
|
const { onIterationEnd, onTrace, onExit, onBeforeExecution, onAfterTool, onBeforeTool } = props;
|
|
106
107
|
const cognitive = _cognitive.Cognitive.isCognitiveClient(props.client) ? props.client : new (0, _cognitive.Cognitive)({ client: props.client });
|
|
107
108
|
const cleanups = [];
|
|
108
|
-
const ctx = new (0,
|
|
109
|
+
const ctx = new (0, _chunkPQILLTEMcjs.Context)({
|
|
109
110
|
chat: props.chat,
|
|
110
111
|
instructions: props.instructions,
|
|
111
112
|
objects: props.objects,
|
|
112
113
|
tools: props.tools,
|
|
113
114
|
loop: (_a = props.options) == null ? void 0 : _a.loop,
|
|
114
|
-
|
|
115
|
-
model: (_c = props.options) == null ? void 0 : _c.model,
|
|
116
|
-
timeout: (_d = props.options) == null ? void 0 : _d.timeout,
|
|
115
|
+
timeout: (_b = props.options) == null ? void 0 : _b.timeout,
|
|
117
116
|
exits: props.exits,
|
|
118
|
-
snapshot: props.snapshot
|
|
117
|
+
snapshot: props.snapshot,
|
|
118
|
+
model: props.model,
|
|
119
|
+
temperature: props.temperature
|
|
119
120
|
});
|
|
120
121
|
try {
|
|
121
122
|
while (true) {
|
|
122
123
|
if (ctx.iterations.length >= ctx.loop) {
|
|
123
|
-
return new (0,
|
|
124
|
+
return new (0, _chunkPQILLTEMcjs.ErrorExecutionResult)(ctx, new (0, _chunkT63Y6GTWcjs.LoopExceededError)());
|
|
124
125
|
}
|
|
125
126
|
const iteration = await ctx.nextIteration();
|
|
126
127
|
if (controller.signal.aborted) {
|
|
@@ -130,7 +131,7 @@ var _executeContext = async (props) => {
|
|
|
130
131
|
reason: _nullishCoalesce(controller.signal.reason, () => ( "The operation was aborted"))
|
|
131
132
|
}
|
|
132
133
|
});
|
|
133
|
-
return new (0,
|
|
134
|
+
return new (0, _chunkPQILLTEMcjs.ErrorExecutionResult)(ctx, _nullishCoalesce(controller.signal.reason, () => ( "The operation was aborted")));
|
|
134
135
|
}
|
|
135
136
|
cleanups.push(
|
|
136
137
|
iteration.traces.onPush((traces) => {
|
|
@@ -155,7 +156,7 @@ var _executeContext = async (props) => {
|
|
|
155
156
|
type: "execution_error",
|
|
156
157
|
execution_error: {
|
|
157
158
|
message: "An unexpected error occurred: " + getErrorMessage(err),
|
|
158
|
-
stack:
|
|
159
|
+
stack: _chunkKIN7Y247cjs.cleanStackTrace.call(void 0, _nullishCoalesce(err.stack, () => ( "No stack trace available")))
|
|
159
160
|
}
|
|
160
161
|
});
|
|
161
162
|
}
|
|
@@ -166,25 +167,25 @@ var _executeContext = async (props) => {
|
|
|
166
167
|
}
|
|
167
168
|
if (iteration.status.type === "exit_success") {
|
|
168
169
|
const exitName = iteration.status.exit_success.exit_name;
|
|
169
|
-
return new (0,
|
|
170
|
+
return new (0, _chunkPQILLTEMcjs.SuccessExecutionResult)(ctx, {
|
|
170
171
|
exit: iteration.exits.find((x) => x.name === exitName),
|
|
171
172
|
result: iteration.status.exit_success.return_value
|
|
172
173
|
});
|
|
173
174
|
}
|
|
174
175
|
if (iteration.status.type === "callback_requested") {
|
|
175
|
-
return new (0,
|
|
176
|
+
return new (0, _chunkPQILLTEMcjs.PartialExecutionResult)(
|
|
176
177
|
ctx,
|
|
177
178
|
iteration.status.callback_requested.signal,
|
|
178
|
-
|
|
179
|
+
_chunkPQILLTEMcjs.Snapshot.fromSignal(iteration.status.callback_requested.signal)
|
|
179
180
|
);
|
|
180
181
|
}
|
|
181
182
|
if (iteration.status.type === "thinking_requested" || iteration.status.type === "exit_error" || iteration.status.type === "execution_error" || iteration.status.type === "invalid_code_error") {
|
|
182
183
|
continue;
|
|
183
184
|
}
|
|
184
|
-
return new (0,
|
|
185
|
+
return new (0, _chunkPQILLTEMcjs.ErrorExecutionResult)(ctx, _nullishCoalesce(iteration.error, () => ( `Unknown error. Status: ${iteration.status.type}`)));
|
|
185
186
|
}
|
|
186
187
|
} catch (error) {
|
|
187
|
-
return new (0,
|
|
188
|
+
return new (0, _chunkPQILLTEMcjs.ErrorExecutionResult)(ctx, _nullishCoalesce(error, () => ( "Unknown error")));
|
|
188
189
|
} finally {
|
|
189
190
|
for (const cleanup of cleanups) {
|
|
190
191
|
try {
|
|
@@ -207,8 +208,8 @@ var executeIteration = async ({
|
|
|
207
208
|
var _a, _b, _c, _d, _e;
|
|
208
209
|
let startedAt = Date.now();
|
|
209
210
|
const traces = iteration.traces;
|
|
210
|
-
const model = await cognitive.getModelDetails(
|
|
211
|
-
const modelLimit = model.input.maxTokens;
|
|
211
|
+
const model = await cognitive.getModelDetails(Array.isArray(iteration.model) ? iteration.model[0] : iteration.model);
|
|
212
|
+
const modelLimit = Math.max(model.input.maxTokens, 8e3);
|
|
212
213
|
const responseLengthBuffer = getModelOutputLimit(modelLimit);
|
|
213
214
|
const messages = _chunkGZPN7RGHcjs.truncateWrappedContent.call(void 0, {
|
|
214
215
|
messages: iteration.messages,
|
|
@@ -231,14 +232,14 @@ var executeIteration = async ({
|
|
|
231
232
|
signal: controller.signal,
|
|
232
233
|
systemPrompt: (_a = messages.find((x) => x.role === "system")) == null ? void 0 : _a.content,
|
|
233
234
|
model: model.ref,
|
|
234
|
-
temperature:
|
|
235
|
+
temperature: iteration.temperature,
|
|
235
236
|
responseFormat: "text",
|
|
236
237
|
messages: messages.filter((x) => x.role !== "system"),
|
|
237
238
|
stopSequences: ctx.version.getStopTokens()
|
|
238
239
|
});
|
|
239
240
|
const out = ((_c = (_b = output.output.choices) == null ? void 0 : _b[0]) == null ? void 0 : _c.type) === "text" && typeof ((_d = output.output.choices) == null ? void 0 : _d[0].content) === "string" ? output.output.choices[0].content : null;
|
|
240
241
|
if (!out) {
|
|
241
|
-
throw new
|
|
242
|
+
throw new (0, _chunkT63Y6GTWcjs.CognitiveError)("LLM did not return any text output");
|
|
242
243
|
}
|
|
243
244
|
const assistantResponse = ctx.version.parseAssistantResponse(out);
|
|
244
245
|
iteration.code = assistantResponse.code.trim();
|
|
@@ -249,7 +250,7 @@ var executeIteration = async ({
|
|
|
249
250
|
iteration.code = hookRes.code.trim();
|
|
250
251
|
}
|
|
251
252
|
} catch (err) {
|
|
252
|
-
if (err instanceof
|
|
253
|
+
if (err instanceof _chunkT63Y6GTWcjs.ThinkSignal) {
|
|
253
254
|
return iteration.end({
|
|
254
255
|
type: "thinking_requested",
|
|
255
256
|
thinking_requested: {
|
|
@@ -262,7 +263,7 @@ var executeIteration = async ({
|
|
|
262
263
|
type: "execution_error",
|
|
263
264
|
execution_error: {
|
|
264
265
|
message: `Error in onBeforeExecution hook: ${getErrorMessage(err)}`,
|
|
265
|
-
stack:
|
|
266
|
+
stack: _chunkKIN7Y247cjs.cleanStackTrace.call(void 0, _nullishCoalesce(err.stack, () => ( "No stack trace available")))
|
|
266
267
|
}
|
|
267
268
|
});
|
|
268
269
|
}
|
|
@@ -303,14 +304,14 @@ var executeIteration = async ({
|
|
|
303
304
|
return;
|
|
304
305
|
}
|
|
305
306
|
if (!writable) {
|
|
306
|
-
throw new (0,
|
|
307
|
+
throw new (0, _chunkT63Y6GTWcjs.AssignmentError)(`Property ${obj.name}.${name} is read-only and cannot be modified`);
|
|
307
308
|
}
|
|
308
309
|
if (value2 === internalValues[name]) {
|
|
309
310
|
return;
|
|
310
311
|
}
|
|
311
312
|
const parsed = schema.safeParse(value2);
|
|
312
313
|
if (!parsed.success) {
|
|
313
|
-
throw new (0,
|
|
314
|
+
throw new (0, _chunkT63Y6GTWcjs.AssignmentError)(
|
|
314
315
|
`Invalid value for Object property ${obj.name}.${name}: ${getErrorMessage(parsed.error)}`
|
|
315
316
|
);
|
|
316
317
|
}
|
|
@@ -361,7 +362,7 @@ var executeIteration = async ({
|
|
|
361
362
|
});
|
|
362
363
|
}
|
|
363
364
|
startedAt = Date.now();
|
|
364
|
-
const result = await
|
|
365
|
+
const result = await _chunkM3LCKL55cjs.runAsyncFunction.call(void 0,
|
|
365
366
|
vmContext,
|
|
366
367
|
iteration.code,
|
|
367
368
|
traces,
|
|
@@ -376,7 +377,7 @@ var executeIteration = async ({
|
|
|
376
377
|
variables: {}
|
|
377
378
|
};
|
|
378
379
|
});
|
|
379
|
-
if (result.error && result.error instanceof
|
|
380
|
+
if (result.error && result.error instanceof _chunkT63Y6GTWcjs.InvalidCodeError) {
|
|
380
381
|
return iteration.end({
|
|
381
382
|
type: "invalid_code_error",
|
|
382
383
|
invalid_code_error: {
|
|
@@ -390,12 +391,12 @@ var executeIteration = async ({
|
|
|
390
391
|
started_at: startedAt,
|
|
391
392
|
ended_at: Date.now()
|
|
392
393
|
});
|
|
393
|
-
if (result.error && result.error instanceof
|
|
394
|
+
if (result.error && result.error instanceof _chunkT63Y6GTWcjs.CodeExecutionError) {
|
|
394
395
|
return iteration.end({
|
|
395
396
|
type: "execution_error",
|
|
396
397
|
execution_error: {
|
|
397
398
|
message: result.error.message,
|
|
398
|
-
stack:
|
|
399
|
+
stack: _chunkKIN7Y247cjs.cleanStackTrace.call(void 0, _nullishCoalesce(_nullishCoalesce(result.error.stacktrace, () => ( result.error.stack)), () => ( "No stack trace available")))
|
|
399
400
|
}
|
|
400
401
|
});
|
|
401
402
|
}
|
|
@@ -412,11 +413,11 @@ var executeIteration = async ({
|
|
|
412
413
|
type: "execution_error",
|
|
413
414
|
execution_error: {
|
|
414
415
|
message: _nullishCoalesce(((_e = result == null ? void 0 : result.error) == null ? void 0 : _e.message), () => ( "Unknown error occurred")),
|
|
415
|
-
stack:
|
|
416
|
+
stack: _chunkKIN7Y247cjs.cleanStackTrace.call(void 0, _nullishCoalesce(result.error.stack, () => ( "No stack trace available")))
|
|
416
417
|
}
|
|
417
418
|
});
|
|
418
419
|
}
|
|
419
|
-
if (result.signal instanceof
|
|
420
|
+
if (result.signal instanceof _chunkT63Y6GTWcjs.ThinkSignal) {
|
|
420
421
|
return iteration.end({
|
|
421
422
|
type: "thinking_requested",
|
|
422
423
|
thinking_requested: {
|
|
@@ -425,7 +426,7 @@ var executeIteration = async ({
|
|
|
425
426
|
}
|
|
426
427
|
});
|
|
427
428
|
}
|
|
428
|
-
if (result.signal instanceof
|
|
429
|
+
if (result.signal instanceof _chunkT63Y6GTWcjs.SnapshotSignal) {
|
|
429
430
|
return iteration.end({
|
|
430
431
|
type: "callback_requested",
|
|
431
432
|
callback_requested: {
|
|
@@ -538,16 +539,16 @@ function wrapTool({ tool, traces, object, iteration, beforeHook, afterHook, cont
|
|
|
538
539
|
if (output === error2) {
|
|
539
540
|
return true;
|
|
540
541
|
}
|
|
541
|
-
if (error2 instanceof
|
|
542
|
+
if (error2 instanceof _chunkT63Y6GTWcjs.SnapshotSignal) {
|
|
542
543
|
error2.toolCall = {
|
|
543
544
|
name: tool.name,
|
|
544
545
|
inputSchema: tool.input,
|
|
545
546
|
outputSchema: tool.output,
|
|
546
547
|
input
|
|
547
548
|
};
|
|
548
|
-
error2.message =
|
|
549
|
+
error2.message = _chunkT63Y6GTWcjs.Signals.serializeError(error2);
|
|
549
550
|
}
|
|
550
|
-
if (error2 instanceof
|
|
551
|
+
if (error2 instanceof _chunkT63Y6GTWcjs.ThinkSignal) {
|
|
551
552
|
traces.push({
|
|
552
553
|
type: "think_signal",
|
|
553
554
|
started_at: Date.now(),
|
|
@@ -638,7 +639,7 @@ function wrapTool({ tool, traces, object, iteration, beforeHook, afterHook, cont
|
|
|
638
639
|
if (!success) {
|
|
639
640
|
throw error;
|
|
640
641
|
}
|
|
641
|
-
if (output instanceof
|
|
642
|
+
if (output instanceof _chunkT63Y6GTWcjs.VMSignal) {
|
|
642
643
|
throw output;
|
|
643
644
|
}
|
|
644
645
|
return output;
|
package/dist/llmz.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Cognitive, type BotpressClientLike } from '@botpress/cognitive';
|
|
1
|
+
import { Cognitive, Models, type BotpressClientLike } from '@botpress/cognitive';
|
|
2
2
|
import { Chat } from './chat.js';
|
|
3
3
|
import { Context, Iteration } from './context.js';
|
|
4
4
|
import { Exit, ExitResult } from './exit.js';
|
|
@@ -92,7 +92,7 @@ export type ExecutionHooks = {
|
|
|
92
92
|
output?: any;
|
|
93
93
|
} | void>;
|
|
94
94
|
};
|
|
95
|
-
type Options = Partial<Pick<Context, 'loop' | '
|
|
95
|
+
type Options = Partial<Pick<Context, 'loop' | 'timeout'>>;
|
|
96
96
|
export type ExecutionProps = {
|
|
97
97
|
/**
|
|
98
98
|
* If provided, the execution will be run in "Chat Mode".
|
|
@@ -171,6 +171,19 @@ export type ExecutionProps = {
|
|
|
171
171
|
* Providing an unsettled snapshot will throw an error.
|
|
172
172
|
*/
|
|
173
173
|
snapshot?: Snapshot;
|
|
174
|
+
/**
|
|
175
|
+
* The model to use for the LLM.
|
|
176
|
+
* This can be a static model name or a function that returns a model name based on the current context.
|
|
177
|
+
*/
|
|
178
|
+
model?: ValueOrGetter<Models | Models[], Context>;
|
|
179
|
+
/**
|
|
180
|
+
* The temperature to use for the LLM.
|
|
181
|
+
* This can be a static temperature or a function that returns a temperature based on the current context.
|
|
182
|
+
* The temperature must be between 0 and 2.
|
|
183
|
+
* If the temperature is outside this range, it will be clamped to the nearest valid value.
|
|
184
|
+
* If no temperature is provided, the default temperature of 0.7 will be used.
|
|
185
|
+
*/
|
|
186
|
+
temperature?: ValueOrGetter<number, Context>;
|
|
174
187
|
} & ExecutionHooks;
|
|
175
188
|
export declare const executeContext: (props: ExecutionProps) => Promise<ExecutionResult>;
|
|
176
189
|
export declare const _executeContext: (props: ExecutionProps) => Promise<ExecutionResult>;
|
package/dist/result.d.ts
CHANGED
|
@@ -388,6 +388,8 @@ export declare class SuccessExecutionResult<TOutput = unknown> extends Execution
|
|
|
388
388
|
id: string;
|
|
389
389
|
messages: import("./index.js").LLMzPrompts.Message[];
|
|
390
390
|
code: string | undefined;
|
|
391
|
+
model: import("@botpress/cognitive").Models | import("@botpress/cognitive").Models[];
|
|
392
|
+
temperature: number;
|
|
391
393
|
traces: import("./types.js").Traces.Trace[];
|
|
392
394
|
variables: Record<string, any>;
|
|
393
395
|
started_ts: number;
|
|
@@ -448,8 +450,6 @@ export declare class SuccessExecutionResult<TOutput = unknown> extends Execution
|
|
|
448
450
|
iteration: number;
|
|
449
451
|
timeout: number;
|
|
450
452
|
loop: number;
|
|
451
|
-
temperature: number;
|
|
452
|
-
model: "best" | "fast" | `${string}:${string}` | undefined;
|
|
453
453
|
metadata: Record<string, any>;
|
|
454
454
|
snapshot: {
|
|
455
455
|
id: string;
|
|
@@ -543,6 +543,8 @@ export declare class ErrorExecutionResult extends ExecutionResult implements Ser
|
|
|
543
543
|
id: string;
|
|
544
544
|
messages: import("./index.js").LLMzPrompts.Message[];
|
|
545
545
|
code: string | undefined;
|
|
546
|
+
model: import("@botpress/cognitive").Models | import("@botpress/cognitive").Models[];
|
|
547
|
+
temperature: number;
|
|
546
548
|
traces: import("./types.js").Traces.Trace[];
|
|
547
549
|
variables: Record<string, any>;
|
|
548
550
|
started_ts: number;
|
|
@@ -603,8 +605,6 @@ export declare class ErrorExecutionResult extends ExecutionResult implements Ser
|
|
|
603
605
|
iteration: number;
|
|
604
606
|
timeout: number;
|
|
605
607
|
loop: number;
|
|
606
|
-
temperature: number;
|
|
607
|
-
model: "best" | "fast" | `${string}:${string}` | undefined;
|
|
608
608
|
metadata: Record<string, any>;
|
|
609
609
|
snapshot: {
|
|
610
610
|
id: string;
|
|
@@ -718,6 +718,8 @@ export declare class PartialExecutionResult extends ExecutionResult implements S
|
|
|
718
718
|
id: string;
|
|
719
719
|
messages: import("./index.js").LLMzPrompts.Message[];
|
|
720
720
|
code: string | undefined;
|
|
721
|
+
model: import("@botpress/cognitive").Models | import("@botpress/cognitive").Models[];
|
|
722
|
+
temperature: number;
|
|
721
723
|
traces: import("./types.js").Traces.Trace[];
|
|
722
724
|
variables: Record<string, any>;
|
|
723
725
|
started_ts: number;
|
|
@@ -778,8 +780,6 @@ export declare class PartialExecutionResult extends ExecutionResult implements S
|
|
|
778
780
|
iteration: number;
|
|
779
781
|
timeout: number;
|
|
780
782
|
loop: number;
|
|
781
|
-
temperature: number;
|
|
782
|
-
model: "best" | "fast" | `${string}:${string}` | undefined;
|
|
783
783
|
metadata: Record<string, any>;
|
|
784
784
|
snapshot: {
|
|
785
785
|
id: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkA63TROZXcjs = require('./chunk-A63TROZX.cjs');
|
|
4
|
+
require('./chunk-45GKLDDR.cjs');
|
|
5
|
+
require('./chunk-T63Y6GTW.cjs');
|
|
6
|
+
require('./chunk-KIN7Y247.cjs');
|
|
7
|
+
require('./chunk-WHNOR4ZU.cjs');
|
|
8
|
+
require('./chunk-UQOBUJIQ.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.Tool = _chunkA63TROZXcjs.Tool;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk45GKLDDRcjs = require('./chunk-45GKLDDR.cjs');
|
|
4
|
+
require('./chunk-T63Y6GTW.cjs');
|
|
5
|
+
require('./chunk-KIN7Y247.cjs');
|
|
6
|
+
require('./chunk-WHNOR4ZU.cjs');
|
|
7
|
+
require('./chunk-UQOBUJIQ.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.getTypings = _chunk45GKLDDRcjs.getTypings;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getTypings
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-PBTEQAZK.js";
|
|
4
|
+
import "./chunk-MYLTD5WT.js";
|
|
5
|
+
import "./chunk-YEAWWJSJ.js";
|
|
6
6
|
import "./chunk-ZORRILUV.js";
|
|
7
7
|
import "./chunk-7WRN4E42.js";
|
|
8
8
|
export {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CAN_USE_ISOLATED_VM,
|
|
3
3
|
runAsyncFunction
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-7G5QAIUX.js";
|
|
5
|
+
import "./chunk-MYLTD5WT.js";
|
|
6
|
+
import "./chunk-YEAWWJSJ.js";
|
|
7
7
|
import "./chunk-ORQP26SZ.js";
|
|
8
8
|
import "./chunk-7WRN4E42.js";
|
|
9
9
|
export {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkM3LCKL55cjs = require('./chunk-M3LCKL55.cjs');
|
|
5
|
+
require('./chunk-T63Y6GTW.cjs');
|
|
6
|
+
require('./chunk-KIN7Y247.cjs');
|
|
7
|
+
require('./chunk-KMZDFWYZ.cjs');
|
|
8
|
+
require('./chunk-UQOBUJIQ.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.CAN_USE_ISOLATED_VM = _chunkM3LCKL55cjs.CAN_USE_ISOLATED_VM; exports.runAsyncFunction = _chunkM3LCKL55cjs.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.26",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"main": "./dist/index.cjs",
|
|
8
8
|
"module": "./dist/index.js",
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"@babel/standalone": "^7.26.4",
|
|
35
35
|
"@babel/traverse": "^7.26.4",
|
|
36
36
|
"@babel/types": "^7.26.3",
|
|
37
|
-
"@botpress/client": "1.25.0",
|
|
38
37
|
"bytes": "^3.1.2",
|
|
39
38
|
"exponential-backoff": "^3.1.1",
|
|
40
39
|
"handlebars": "^4.7.8",
|
|
@@ -67,7 +66,8 @@
|
|
|
67
66
|
"tsx": "^4.19.2"
|
|
68
67
|
},
|
|
69
68
|
"peerDependencies": {
|
|
70
|
-
"@botpress/
|
|
69
|
+
"@botpress/client": "^1.25.0",
|
|
70
|
+
"@botpress/cognitive": "^0.1.45",
|
|
71
71
|
"@bpinternal/thicktoken": "^1.0.5",
|
|
72
72
|
"@bpinternal/zui": "^1.0.1"
|
|
73
73
|
},
|
|
@@ -77,6 +77,9 @@
|
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
79
|
"peerDependenciesMeta": {
|
|
80
|
+
"@botpress/client": {
|
|
81
|
+
"optional": true
|
|
82
|
+
},
|
|
80
83
|
"@botpress/cognitive": {
|
|
81
84
|
"optional": false
|
|
82
85
|
},
|
package/dist/chunk-IKSIOIIP.cjs
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/stack-traces.ts
|
|
2
|
-
var isInternalLine = (line) => {
|
|
3
|
-
return line.includes("/llmz/") || line.includes("\\llmz\\src\\") || line.includes("node_modules");
|
|
4
|
-
};
|
|
5
|
-
function cleanStackTrace(stack, cleanInternal = true) {
|
|
6
|
-
const lines = stack.split("\n");
|
|
7
|
-
for (let i = 0; i < lines.length; i++) {
|
|
8
|
-
const line = lines[i];
|
|
9
|
-
let llmzIndex = line.indexOf("/llmz/");
|
|
10
|
-
if (llmzIndex === -1) {
|
|
11
|
-
llmzIndex = line.indexOf("\\llmz\\");
|
|
12
|
-
}
|
|
13
|
-
if (llmzIndex === -1) {
|
|
14
|
-
continue;
|
|
15
|
-
}
|
|
16
|
-
let lastSpaceIndex = line.lastIndexOf(" ", llmzIndex);
|
|
17
|
-
if (lastSpaceIndex === -1) {
|
|
18
|
-
lastSpaceIndex = 0;
|
|
19
|
-
}
|
|
20
|
-
const maybeParen = line[lastSpaceIndex + 1] === "(" ? "(" : "";
|
|
21
|
-
lines[i] = line.slice(0, lastSpaceIndex + 1) + maybeParen + line.slice(llmzIndex);
|
|
22
|
-
}
|
|
23
|
-
return lines.filter((x) => !cleanInternal || !isInternalLine(x)).join("\n");
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
exports.cleanStackTrace = cleanStackTrace;
|
package/dist/chunk-JQBT7UWN.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// src/stack-traces.ts
|
|
2
|
-
var isInternalLine = (line) => {
|
|
3
|
-
return line.includes("/llmz/") || line.includes("\\llmz\\src\\") || line.includes("node_modules");
|
|
4
|
-
};
|
|
5
|
-
function cleanStackTrace(stack, cleanInternal = true) {
|
|
6
|
-
const lines = stack.split("\n");
|
|
7
|
-
for (let i = 0; i < lines.length; i++) {
|
|
8
|
-
const line = lines[i];
|
|
9
|
-
let llmzIndex = line.indexOf("/llmz/");
|
|
10
|
-
if (llmzIndex === -1) {
|
|
11
|
-
llmzIndex = line.indexOf("\\llmz\\");
|
|
12
|
-
}
|
|
13
|
-
if (llmzIndex === -1) {
|
|
14
|
-
continue;
|
|
15
|
-
}
|
|
16
|
-
let lastSpaceIndex = line.lastIndexOf(" ", llmzIndex);
|
|
17
|
-
if (lastSpaceIndex === -1) {
|
|
18
|
-
lastSpaceIndex = 0;
|
|
19
|
-
}
|
|
20
|
-
const maybeParen = line[lastSpaceIndex + 1] === "(" ? "(" : "";
|
|
21
|
-
lines[i] = line.slice(0, lastSpaceIndex + 1) + maybeParen + line.slice(llmzIndex);
|
|
22
|
-
}
|
|
23
|
-
return lines.filter((x) => !cleanInternal || !isInternalLine(x)).join("\n");
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export {
|
|
27
|
-
cleanStackTrace
|
|
28
|
-
};
|
package/dist/tool-O4SFRIE4.cjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkXGJOEQMWcjs = require('./chunk-XGJOEQMW.cjs');
|
|
4
|
-
require('./chunk-FZJHYLM2.cjs');
|
|
5
|
-
require('./chunk-JDABP4SD.cjs');
|
|
6
|
-
require('./chunk-IKSIOIIP.cjs');
|
|
7
|
-
require('./chunk-WHNOR4ZU.cjs');
|
|
8
|
-
require('./chunk-UQOBUJIQ.cjs');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
exports.Tool = _chunkXGJOEQMWcjs.Tool;
|
package/dist/tool-PCOYOCRH.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkFZJHYLM2cjs = require('./chunk-FZJHYLM2.cjs');
|
|
4
|
-
require('./chunk-JDABP4SD.cjs');
|
|
5
|
-
require('./chunk-IKSIOIIP.cjs');
|
|
6
|
-
require('./chunk-WHNOR4ZU.cjs');
|
|
7
|
-
require('./chunk-UQOBUJIQ.cjs');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.getTypings = _chunkFZJHYLM2cjs.getTypings;
|
package/dist/vm-PRZ5GEM2.cjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkBNDY7RGXcjs = require('./chunk-BNDY7RGX.cjs');
|
|
5
|
-
require('./chunk-JDABP4SD.cjs');
|
|
6
|
-
require('./chunk-IKSIOIIP.cjs');
|
|
7
|
-
require('./chunk-KMZDFWYZ.cjs');
|
|
8
|
-
require('./chunk-UQOBUJIQ.cjs');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
exports.CAN_USE_ISOLATED_VM = _chunkBNDY7RGXcjs.CAN_USE_ISOLATED_VM; exports.runAsyncFunction = _chunkBNDY7RGXcjs.runAsyncFunction;
|