@sprucelabs/sprucebot-llm 18.1.3 → 18.1.5
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/build/esm/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export { default as SprucebotLlmFactory } from './bots/SprucebotLlmFactory';
|
|
|
2
2
|
export { default as SprucebotLlmBotImpl } from './bots/SprucebotLlmBotImpl';
|
|
3
3
|
export { default as SprucebotLlmSkillImpl } from './bots/SprucebotLlmSkillImpl';
|
|
4
4
|
export { default as OpenAiAdapter } from './bots/adapters/OpenAiAdapter';
|
|
5
|
+
export { default as MessageBuilder } from './bots/adapters/MessageBuilder';
|
|
6
|
+
export * from './bots/adapters/MessageBuilder';
|
|
5
7
|
export * from './llm.types';
|
|
6
8
|
export { default as SprucebotLlmError } from './errors/SpruceError';
|
|
7
9
|
export { default as MockLlmSkill } from './tests/MockLlmSkill';
|
package/build/esm/index.js
CHANGED
|
@@ -2,6 +2,8 @@ export { default as SprucebotLlmFactory } from './bots/SprucebotLlmFactory.js';
|
|
|
2
2
|
export { default as SprucebotLlmBotImpl } from './bots/SprucebotLlmBotImpl.js';
|
|
3
3
|
export { default as SprucebotLlmSkillImpl } from './bots/SprucebotLlmSkillImpl.js';
|
|
4
4
|
export { default as OpenAiAdapter } from './bots/adapters/OpenAiAdapter.js';
|
|
5
|
+
export { default as MessageBuilder } from './bots/adapters/MessageBuilder.js';
|
|
6
|
+
export * from './bots/adapters/MessageBuilder.js';
|
|
5
7
|
export * from './llm.types.js';
|
|
6
8
|
export { default as SprucebotLlmError } from './errors/SpruceError.js';
|
|
7
9
|
export { default as MockLlmSkill } from './tests/MockLlmSkill.js';
|
|
@@ -136,8 +136,12 @@ function extractCallbackSpans(message) {
|
|
|
136
136
|
closeParen = j;
|
|
137
137
|
}
|
|
138
138
|
else {
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
closeParen = message.indexOf(')', i);
|
|
140
|
+
if (closeParen === -1) {
|
|
141
|
+
re.lastIndex = openParen + 1;
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
argsJson = message.slice(i, closeParen);
|
|
141
145
|
}
|
|
142
146
|
let end = closeParen + 1;
|
|
143
147
|
// Include trailing newline after the call when present (common LLM layout)
|
|
@@ -247,6 +251,16 @@ export default class ResponseParserV2 {
|
|
|
247
251
|
});
|
|
248
252
|
continue;
|
|
249
253
|
}
|
|
254
|
+
if (options !== undefined &&
|
|
255
|
+
(options === null ||
|
|
256
|
+
Array.isArray(options) ||
|
|
257
|
+
typeof options !== 'object')) {
|
|
258
|
+
callbackResults += this.renderCallbackResults({
|
|
259
|
+
name,
|
|
260
|
+
error: 'Arguments not valid JSON',
|
|
261
|
+
});
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
250
264
|
const callback = callbacks === null || callbacks === void 0 ? void 0 : callbacks[name];
|
|
251
265
|
if (!callback) {
|
|
252
266
|
callbackResults += this.renderCallbackResults({
|
package/build/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export { default as SprucebotLlmFactory } from './bots/SprucebotLlmFactory';
|
|
|
2
2
|
export { default as SprucebotLlmBotImpl } from './bots/SprucebotLlmBotImpl';
|
|
3
3
|
export { default as SprucebotLlmSkillImpl } from './bots/SprucebotLlmSkillImpl';
|
|
4
4
|
export { default as OpenAiAdapter } from './bots/adapters/OpenAiAdapter';
|
|
5
|
+
export { default as MessageBuilder } from './bots/adapters/MessageBuilder';
|
|
6
|
+
export * from './bots/adapters/MessageBuilder';
|
|
5
7
|
export * from './llm.types';
|
|
6
8
|
export { default as SprucebotLlmError } from './errors/SpruceError';
|
|
7
9
|
export { default as MockLlmSkill } from './tests/MockLlmSkill';
|
package/build/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.MockAdapterLoader = exports.LlmAdapterLoader = exports.AnthropicAdapter = exports.OllamaAdapter = exports.SpyOpenAiApi = exports.SpyLlmAdapter = exports.SpyLllmBot = exports.MockLlmSkill = exports.SprucebotLlmError = exports.OpenAiAdapter = exports.SprucebotLlmSkillImpl = exports.SprucebotLlmBotImpl = exports.SprucebotLlmFactory = void 0;
|
|
20
|
+
exports.MockAdapterLoader = exports.LlmAdapterLoader = exports.AnthropicAdapter = exports.OllamaAdapter = exports.SpyOpenAiApi = exports.SpyLlmAdapter = exports.SpyLllmBot = exports.MockLlmSkill = exports.SprucebotLlmError = exports.MessageBuilder = exports.OpenAiAdapter = exports.SprucebotLlmSkillImpl = exports.SprucebotLlmBotImpl = exports.SprucebotLlmFactory = void 0;
|
|
21
21
|
var SprucebotLlmFactory_1 = require("./bots/SprucebotLlmFactory");
|
|
22
22
|
Object.defineProperty(exports, "SprucebotLlmFactory", { enumerable: true, get: function () { return __importDefault(SprucebotLlmFactory_1).default; } });
|
|
23
23
|
var SprucebotLlmBotImpl_1 = require("./bots/SprucebotLlmBotImpl");
|
|
@@ -26,6 +26,9 @@ var SprucebotLlmSkillImpl_1 = require("./bots/SprucebotLlmSkillImpl");
|
|
|
26
26
|
Object.defineProperty(exports, "SprucebotLlmSkillImpl", { enumerable: true, get: function () { return __importDefault(SprucebotLlmSkillImpl_1).default; } });
|
|
27
27
|
var OpenAiAdapter_1 = require("./bots/adapters/OpenAiAdapter");
|
|
28
28
|
Object.defineProperty(exports, "OpenAiAdapter", { enumerable: true, get: function () { return __importDefault(OpenAiAdapter_1).default; } });
|
|
29
|
+
var MessageBuilder_1 = require("./bots/adapters/MessageBuilder");
|
|
30
|
+
Object.defineProperty(exports, "MessageBuilder", { enumerable: true, get: function () { return __importDefault(MessageBuilder_1).default; } });
|
|
31
|
+
__exportStar(require("./bots/adapters/MessageBuilder"), exports);
|
|
29
32
|
__exportStar(require("./llm.types"), exports);
|
|
30
33
|
var SpruceError_1 = require("./errors/SpruceError");
|
|
31
34
|
Object.defineProperty(exports, "SprucebotLlmError", { enumerable: true, get: function () { return __importDefault(SpruceError_1).default; } });
|
|
@@ -133,8 +133,12 @@ function extractCallbackSpans(message) {
|
|
|
133
133
|
closeParen = j;
|
|
134
134
|
}
|
|
135
135
|
else {
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
closeParen = message.indexOf(')', i);
|
|
137
|
+
if (closeParen === -1) {
|
|
138
|
+
re.lastIndex = openParen + 1;
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
argsJson = message.slice(i, closeParen);
|
|
138
142
|
}
|
|
139
143
|
let end = closeParen + 1;
|
|
140
144
|
// Include trailing newline after the call when present (common LLM layout)
|
|
@@ -240,6 +244,16 @@ class ResponseParserV2 {
|
|
|
240
244
|
});
|
|
241
245
|
continue;
|
|
242
246
|
}
|
|
247
|
+
if (options !== undefined &&
|
|
248
|
+
(options === null ||
|
|
249
|
+
Array.isArray(options) ||
|
|
250
|
+
typeof options !== 'object')) {
|
|
251
|
+
callbackResults += this.renderCallbackResults({
|
|
252
|
+
name,
|
|
253
|
+
error: 'Arguments not valid JSON',
|
|
254
|
+
});
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
243
257
|
const callback = callbacks?.[name];
|
|
244
258
|
if (!callback) {
|
|
245
259
|
callbackResults += this.renderCallbackResults({
|