@sprucelabs/sprucebot-llm 0.0.1 → 0.0.3
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/README.md +1 -0
- package/build/bots/templates.d.ts +1 -1
- package/build/bots/templates.js +1 -1
- package/build/chat.js +3 -1
- package/build/esm/bots/templates.d.ts +1 -1
- package/build/esm/bots/templates.js +1 -1
- package/build/esm/chat.js +3 -1
- package/build/esm/examples/buildFileTransformerSkill.d.ts +2 -0
- package/build/esm/examples/buildFileTransformerSkill.js +25 -0
- package/build/examples/buildFileTransformerSkill.d.ts +2 -0
- package/build/examples/buildFileTransformerSkill.js +28 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/build/bots/templates.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.PROMPT_TEMPLATE = exports.CALLBACK_BOUNDARY = exports.DONE_TOKEN = exports.STATE_BOUNDARY = void 0;
|
|
7
7
|
const renderPlaceholder_1 = __importDefault(require("../parsingResponses/renderPlaceholder"));
|
|
8
8
|
exports.STATE_BOUNDARY = '*****';
|
|
9
|
-
exports.DONE_TOKEN = `
|
|
9
|
+
exports.DONE_TOKEN = `DONE_DONE_DONE`;
|
|
10
10
|
exports.CALLBACK_BOUNDARY = 'xxxxx';
|
|
11
11
|
exports.PROMPT_TEMPLATE = `You are <%= it.youAre %>
|
|
12
12
|
|
package/build/chat.js
CHANGED
|
@@ -32,6 +32,7 @@ const dotenv_1 = __importDefault(require("dotenv"));
|
|
|
32
32
|
const OpenAi_1 = require("./bots/adapters/OpenAi");
|
|
33
33
|
const SprucebotLlmFactory_1 = __importDefault(require("./bots/SprucebotLlmFactory"));
|
|
34
34
|
const buildCallbackSkill_1 = __importDefault(require("./examples/buildCallbackSkill"));
|
|
35
|
+
const buildFileTransformerSkill_1 = __importDefault(require("./examples/buildFileTransformerSkill"));
|
|
35
36
|
const buildJokeSkill_1 = __importDefault(require("./examples/buildJokeSkill"));
|
|
36
37
|
const buildProfileSkill_1 = __importDefault(require("./examples/buildProfileSkill"));
|
|
37
38
|
dotenv_1.default.config();
|
|
@@ -44,10 +45,11 @@ const rl = readline.createInterface({ input: node_process_1.stdin, output: node_
|
|
|
44
45
|
jokes: (0, buildJokeSkill_1.default)(bots),
|
|
45
46
|
profile: (0, buildProfileSkill_1.default)(bots),
|
|
46
47
|
callbacks: (0, buildCallbackSkill_1.default)(bots),
|
|
48
|
+
fileTransformer: (0, buildFileTransformerSkill_1.default)(bots),
|
|
47
49
|
};
|
|
48
50
|
const bot = bots.Bot({
|
|
49
51
|
adapter,
|
|
50
|
-
skill: skills.
|
|
52
|
+
skill: skills.fileTransformer,
|
|
51
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'!",
|
|
52
54
|
});
|
|
53
55
|
do {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import renderPlaceholder from '../parsingResponses/renderPlaceholder.js';
|
|
2
2
|
export const STATE_BOUNDARY = '*****';
|
|
3
|
-
export const DONE_TOKEN = `
|
|
3
|
+
export const DONE_TOKEN = `DONE_DONE_DONE`;
|
|
4
4
|
export const CALLBACK_BOUNDARY = 'xxxxx';
|
|
5
5
|
export const PROMPT_TEMPLATE = `You are <%= it.youAre %>
|
|
6
6
|
|
package/build/esm/chat.js
CHANGED
|
@@ -13,6 +13,7 @@ import dotenv from 'dotenv';
|
|
|
13
13
|
import { OpenAi } from './bots/adapters/OpenAi.js';
|
|
14
14
|
import SprucebotLlmFactory from './bots/SprucebotLlmFactory.js';
|
|
15
15
|
import buildCallbackSkill from './examples/buildCallbackSkill.js';
|
|
16
|
+
import buildFileTransformerSkill from './examples/buildFileTransformerSkill.js';
|
|
16
17
|
import buildJokeSkill from './examples/buildJokeSkill.js';
|
|
17
18
|
import buildProfileSkill from './examples/buildProfileSkill.js';
|
|
18
19
|
dotenv.config();
|
|
@@ -25,10 +26,11 @@ const rl = readline.createInterface({ input, output });
|
|
|
25
26
|
jokes: buildJokeSkill(bots),
|
|
26
27
|
profile: buildProfileSkill(bots),
|
|
27
28
|
callbacks: buildCallbackSkill(bots),
|
|
29
|
+
fileTransformer: buildFileTransformerSkill(bots),
|
|
28
30
|
};
|
|
29
31
|
const bot = bots.Bot({
|
|
30
32
|
adapter,
|
|
31
|
-
skill: skills.
|
|
33
|
+
skill: skills.fileTransformer,
|
|
32
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'!",
|
|
33
35
|
});
|
|
34
36
|
do {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import SprucebotLlmFactory from '../bots/SprucebotLlmFactory';
|
|
2
|
+
export default function buildFileTransformerSkill(bots: SprucebotLlmFactory): import("../llm.types").SprucebotLLmSkill<import("@sprucelabs/schema").Schema, import("@sprucelabs/schema").SchemaStaticValues<import("@sprucelabs/schema").Schema, false, never, import("@sprucelabs/schema").StaticSchemaAllValues<import("@sprucelabs/schema").Schema, false>>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { buildSchema } from '@sprucelabs/schema';
|
|
2
|
+
export default function buildFileTransformerSkill(bots) {
|
|
3
|
+
return bots.Skill({
|
|
4
|
+
yourJobIfYouChooseToAcceptItIs: 'is to convert data from one format to another. Since you are a robot, this should be no problem for you! You are going to jump right in by asking me the import and output formats and then the data to convert!',
|
|
5
|
+
pleaseKeepInMindThat: [
|
|
6
|
+
'you will need to ask me the format of the input and the desired format of the output.',
|
|
7
|
+
'last step is to take the data and convert it to the desired format and send it back to me.',
|
|
8
|
+
],
|
|
9
|
+
stateSchema: buildSchema({
|
|
10
|
+
id: 'fileTransformer',
|
|
11
|
+
fields: {
|
|
12
|
+
inputFormat: {
|
|
13
|
+
type: 'text',
|
|
14
|
+
},
|
|
15
|
+
outputFormat: {
|
|
16
|
+
type: 'text',
|
|
17
|
+
},
|
|
18
|
+
dataToConvert: {
|
|
19
|
+
type: 'text',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
}),
|
|
23
|
+
weAreDoneWhen: 'You have converted the input to the desired output format and sent it back to me.',
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import SprucebotLlmFactory from '../bots/SprucebotLlmFactory';
|
|
2
|
+
export default function buildFileTransformerSkill(bots: SprucebotLlmFactory): import("../llm.types").SprucebotLLmSkill<import("@sprucelabs/schema").Schema, import("@sprucelabs/schema").SchemaStaticValues<import("@sprucelabs/schema").Schema, false, never, import("@sprucelabs/schema").StaticSchemaAllValues<import("@sprucelabs/schema").Schema, false>>>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_1 = require("@sprucelabs/schema");
|
|
4
|
+
function buildFileTransformerSkill(bots) {
|
|
5
|
+
return bots.Skill({
|
|
6
|
+
yourJobIfYouChooseToAcceptItIs: 'is to convert data from one format to another. Since you are a robot, this should be no problem for you! You are going to jump right in by asking me the import and output formats and then the data to convert!',
|
|
7
|
+
pleaseKeepInMindThat: [
|
|
8
|
+
'you will need to ask me the format of the input and the desired format of the output.',
|
|
9
|
+
'last step is to take the data and convert it to the desired format and send it back to me.',
|
|
10
|
+
],
|
|
11
|
+
stateSchema: (0, schema_1.buildSchema)({
|
|
12
|
+
id: 'fileTransformer',
|
|
13
|
+
fields: {
|
|
14
|
+
inputFormat: {
|
|
15
|
+
type: 'text',
|
|
16
|
+
},
|
|
17
|
+
outputFormat: {
|
|
18
|
+
type: 'text',
|
|
19
|
+
},
|
|
20
|
+
dataToConvert: {
|
|
21
|
+
type: 'text',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
weAreDoneWhen: 'You have converted the input to the desired output format and sent it back to me.',
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
exports.default = buildFileTransformerSkill;
|