@sprucelabs/sprucebot-llm 2.0.32 → 2.1.0
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/bots/SprucebotLlmFactory.d.ts +2 -0
- package/build/bots/SprucebotLlmFactory.js +4 -2
- package/build/chat.js +1 -1
- package/build/esm/bots/SprucebotLlmFactory.d.ts +2 -0
- package/build/esm/bots/SprucebotLlmFactory.js +4 -2
- package/build/esm/chat.js +1 -1
- package/build/esm/examples/buildCallbackSkill.js +1 -0
- package/build/examples/buildCallbackSkill.js +1 -0
- package/package.json +2 -2
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BotOptions, SkillOptions, SprucebotLlmBot, SprucebotLLmSkill } from '../llm.types';
|
|
2
2
|
export default class SprucebotLlmFactory {
|
|
3
3
|
private instance?;
|
|
4
|
+
static FactoryClass?: typeof SprucebotLlmFactory;
|
|
5
|
+
static BotClass?: new (options: any) => SprucebotLlmBot;
|
|
4
6
|
Bot(options: BotOptions): SprucebotLlmBot;
|
|
5
7
|
Skill(options: SkillOptions): SprucebotLLmSkill;
|
|
6
8
|
getBotInstance(): SprucebotLlmBot<import("@sprucelabs/schema").Schema, import("@sprucelabs/schema").SchemaStaticValues<import("@sprucelabs/schema").Schema, false, never, import("@sprucelabs/schema").StaticSchemaAllValues<import("@sprucelabs/schema").Schema, false>>>;
|
|
@@ -9,9 +9,10 @@ const SprucebotLlmBotImpl_1 = __importDefault(require("./SprucebotLlmBotImpl"));
|
|
|
9
9
|
const SprucebotLlmSkillImpl_1 = __importDefault(require("./SprucebotLlmSkillImpl"));
|
|
10
10
|
class SprucebotLlmFactory {
|
|
11
11
|
Bot(options) {
|
|
12
|
+
var _a;
|
|
12
13
|
(0, schema_1.assertOptions)(options, ['youAre', 'adapter']);
|
|
13
14
|
const { Class } = options;
|
|
14
|
-
return Class ?
|
|
15
|
+
return new ((_a = Class !== null && Class !== void 0 ? Class : SprucebotLlmFactory.BotClass) !== null && _a !== void 0 ? _a : SprucebotLlmBotImpl_1.default)(options);
|
|
15
16
|
}
|
|
16
17
|
Skill(options) {
|
|
17
18
|
(0, schema_1.assertOptions)(options, ['yourJobIfYouChooseToAcceptItIs']);
|
|
@@ -29,7 +30,8 @@ class SprucebotLlmFactory {
|
|
|
29
30
|
this.instance = bot;
|
|
30
31
|
}
|
|
31
32
|
static Factory() {
|
|
32
|
-
|
|
33
|
+
var _a;
|
|
34
|
+
return new ((_a = this.FactoryClass) !== null && _a !== void 0 ? _a : this)();
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
exports.default = SprucebotLlmFactory;
|
package/build/chat.js
CHANGED
|
@@ -49,7 +49,7 @@ const rl = readline.createInterface({ input: node_process_1.stdin, output: node_
|
|
|
49
49
|
};
|
|
50
50
|
const bot = bots.Bot({
|
|
51
51
|
adapter,
|
|
52
|
-
skill: skills.
|
|
52
|
+
skill: skills.fileTransformer,
|
|
53
53
|
youAre: "a bot named Sprucebot that is in test mode. At the start of every conversation, you introduce yourself and announce that you are in test mode so I don't get confused! You are both hip and adorable. You say things like, 'Jeepers' and 'Golly' or even 'Jeezey peezy'!",
|
|
54
54
|
});
|
|
55
55
|
do {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BotOptions, SkillOptions, SprucebotLlmBot, SprucebotLLmSkill } from '../llm.types';
|
|
2
2
|
export default class SprucebotLlmFactory {
|
|
3
3
|
private instance?;
|
|
4
|
+
static FactoryClass?: typeof SprucebotLlmFactory;
|
|
5
|
+
static BotClass?: new (options: any) => SprucebotLlmBot;
|
|
4
6
|
Bot(options: BotOptions): SprucebotLlmBot;
|
|
5
7
|
Skill(options: SkillOptions): SprucebotLLmSkill;
|
|
6
8
|
getBotInstance(): SprucebotLlmBot<import("@sprucelabs/schema").Schema, import("@sprucelabs/schema").SchemaStaticValues<import("@sprucelabs/schema").Schema, false, never, import("@sprucelabs/schema").StaticSchemaAllValues<import("@sprucelabs/schema").Schema, false>>>;
|
|
@@ -4,9 +4,10 @@ import SprucebotLlmBotImpl from './SprucebotLlmBotImpl.js';
|
|
|
4
4
|
import SprucebotLlmSkillImpl from './SprucebotLlmSkillImpl.js';
|
|
5
5
|
export default class SprucebotLlmFactory {
|
|
6
6
|
Bot(options) {
|
|
7
|
+
var _a;
|
|
7
8
|
assertOptions(options, ['youAre', 'adapter']);
|
|
8
9
|
const { Class } = options;
|
|
9
|
-
return Class ?
|
|
10
|
+
return new ((_a = Class !== null && Class !== void 0 ? Class : SprucebotLlmFactory.BotClass) !== null && _a !== void 0 ? _a : SprucebotLlmBotImpl)(options);
|
|
10
11
|
}
|
|
11
12
|
Skill(options) {
|
|
12
13
|
assertOptions(options, ['yourJobIfYouChooseToAcceptItIs']);
|
|
@@ -24,6 +25,7 @@ export default class SprucebotLlmFactory {
|
|
|
24
25
|
this.instance = bot;
|
|
25
26
|
}
|
|
26
27
|
static Factory() {
|
|
27
|
-
|
|
28
|
+
var _a;
|
|
29
|
+
return new ((_a = this.FactoryClass) !== null && _a !== void 0 ? _a : this)();
|
|
28
30
|
}
|
|
29
31
|
}
|
package/build/esm/chat.js
CHANGED
|
@@ -30,7 +30,7 @@ const rl = readline.createInterface({ input, output });
|
|
|
30
30
|
};
|
|
31
31
|
const bot = bots.Bot({
|
|
32
32
|
adapter,
|
|
33
|
-
skill: skills.
|
|
33
|
+
skill: skills.fileTransformer,
|
|
34
34
|
youAre: "a bot named Sprucebot that is in test mode. At the start of every conversation, you introduce yourself and announce that you are in test mode so I don't get confused! You are both hip and adorable. You say things like, 'Jeepers' and 'Golly' or even 'Jeezey peezy'!",
|
|
35
35
|
});
|
|
36
36
|
do {
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
export default function buildCallbackSkill(bots) {
|
|
11
11
|
return bots.Skill({
|
|
12
|
+
weAreDoneWhen: 'the appointment is booked!',
|
|
12
13
|
yourJobIfYouChooseToAcceptItIs: "to be be the best appointment taker on the planet. You have a many years of experience. You are going to ask me only 2 questions for this practice run. First, you'll ask me to pick an available time. Then, you'll ask me to pick my favorite color:",
|
|
13
14
|
pleaseKeepInMindThat: [
|
|
14
15
|
"getting a service is really important, so if i don't like any of the time, as to check another day or if i want to see a different provider",
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
function buildCallbackSkill(bots) {
|
|
4
4
|
return bots.Skill({
|
|
5
|
+
weAreDoneWhen: 'the appointment is booked!',
|
|
5
6
|
yourJobIfYouChooseToAcceptItIs: "to be be the best appointment taker on the planet. You have a many years of experience. You are going to ask me only 2 questions for this practice run. First, you'll ask me to pick an available time. Then, you'll ask me to pick my favorite color:",
|
|
6
7
|
pleaseKeepInMindThat: [
|
|
7
8
|
"getting a service is really important, so if i don't like any of the time, as to check another day or if i want to see a different provider",
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"@sprucelabs/spruce-test-fixtures"
|
|
10
10
|
]
|
|
11
11
|
},
|
|
12
|
-
"version": "2.0
|
|
12
|
+
"version": "2.1.0",
|
|
13
13
|
"files": [
|
|
14
14
|
"build"
|
|
15
15
|
],
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@sprucelabs/error": "^5.0.604",
|
|
57
57
|
"@sprucelabs/mercury-event-emitter": "^39.0.25",
|
|
58
|
-
"@sprucelabs/mercury-types": "^44.0.
|
|
58
|
+
"@sprucelabs/mercury-types": "^44.0.28",
|
|
59
59
|
"@sprucelabs/schema": "^28.6.15",
|
|
60
60
|
"eta": "^2.0.1",
|
|
61
61
|
"openai": "^3.2.1"
|