@sprucelabs/sprucebot-llm 2.4.11 → 2.4.13
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/PromptGenerator.d.ts +1 -0
- package/build/bots/PromptGenerator.js +6 -1
- package/build/chat.js +3 -1
- package/build/esm/bots/PromptGenerator.d.ts +1 -0
- package/build/esm/bots/PromptGenerator.js +6 -1
- package/build/esm/chat.js +3 -1
- package/build/esm/examples/buildReceptionistSkill.d.ts +2 -0
- package/build/esm/examples/buildReceptionistSkill.js +16 -0
- package/build/esm/fineTuningSprucebot/constants/DIRECTORY_SHARES.d.ts +1 -0
- package/build/esm/fineTuningSprucebot/constants/DIRECTORY_SHARES.js +7 -0
- package/build/esm/fineTuningSprucebot/constants/GREETINGS.d.ts +1 -0
- package/build/esm/fineTuningSprucebot/constants/GREETINGS.js +22 -0
- package/build/esm/fineTuningSprucebot/constants/OFF_THE_RAILS_CONVERSATIONS.d.ts +2 -0
- package/build/esm/fineTuningSprucebot/constants/OFF_THE_RAILS_CONVERSATIONS.js +32 -0
- package/build/esm/fineTuningSprucebot/constants/TOPICS.d.ts +2 -0
- package/build/esm/fineTuningSprucebot/constants/TOPICS.js +210 -0
- package/build/esm/fineTuningSprucebot/generateSamples.d.ts +1 -0
- package/build/esm/fineTuningSprucebot/generateSamples.js +44 -0
- package/build/esm/fineTuningSprucebot/types.d.ts +15 -0
- package/build/esm/fineTuningSprucebot/types.js +1 -0
- package/build/examples/buildReceptionistSkill.d.ts +2 -0
- package/build/examples/buildReceptionistSkill.js +19 -0
- package/build/fineTuningSprucebot/constants/DIRECTORY_SHARES.d.ts +1 -0
- package/build/fineTuningSprucebot/constants/DIRECTORY_SHARES.js +10 -0
- package/build/fineTuningSprucebot/constants/GREETINGS.d.ts +1 -0
- package/build/fineTuningSprucebot/constants/GREETINGS.js +25 -0
- package/build/fineTuningSprucebot/constants/OFF_THE_RAILS_CONVERSATIONS.d.ts +2 -0
- package/build/fineTuningSprucebot/constants/OFF_THE_RAILS_CONVERSATIONS.js +35 -0
- package/build/fineTuningSprucebot/constants/TOPICS.d.ts +2 -0
- package/build/fineTuningSprucebot/constants/TOPICS.js +213 -0
- package/build/fineTuningSprucebot/generateSamples.d.ts +1 -0
- package/build/fineTuningSprucebot/generateSamples.js +69 -0
- package/build/fineTuningSprucebot/promptTemplate.txt +20 -0
- package/build/fineTuningSprucebot/types.d.ts +15 -0
- package/build/fineTuningSprucebot/types.js +2 -0
- package/package.json +4 -3
|
@@ -41,17 +41,22 @@ const templates_1 = require("./templates");
|
|
|
41
41
|
class PromptGenerator {
|
|
42
42
|
constructor(bot) {
|
|
43
43
|
this.eta = Eta;
|
|
44
|
+
this.log = process.env.SHOULD_LOG_GENERATED_PROMPTS === 'true'
|
|
45
|
+
? console.info
|
|
46
|
+
: () => { };
|
|
44
47
|
(0, schema_1.assertOptions)({ bot }, ['bot']);
|
|
45
48
|
this.bot = bot;
|
|
46
49
|
}
|
|
47
50
|
async generate() {
|
|
48
51
|
const _a = this.bot.serialize(), { stateSchema, state } = _a, rest = __rest(_a, ["stateSchema", "state"]);
|
|
49
52
|
const { stateSchemaJson, stateJson } = this.stringifyState(stateSchema, state);
|
|
50
|
-
|
|
53
|
+
const rendered = await this.eta.render(templates_1.PROMPT_TEMPLATE, Object.assign({ stateSchemaJson,
|
|
51
54
|
stateJson }, rest), {
|
|
52
55
|
async: true,
|
|
53
56
|
autoEscape: false,
|
|
54
57
|
});
|
|
58
|
+
this.log('Generated prompt:', rendered);
|
|
59
|
+
return rendered;
|
|
55
60
|
}
|
|
56
61
|
stringifyState(stateSchema, state) {
|
|
57
62
|
if (!stateSchema) {
|
package/build/chat.js
CHANGED
|
@@ -35,6 +35,7 @@ const buildCallbackSkill_1 = __importDefault(require("./examples/buildCallbackSk
|
|
|
35
35
|
const buildFileTransformerSkill_1 = __importDefault(require("./examples/buildFileTransformerSkill"));
|
|
36
36
|
const buildJokeSkill_1 = __importDefault(require("./examples/buildJokeSkill"));
|
|
37
37
|
const buildProfileSkill_1 = __importDefault(require("./examples/buildProfileSkill"));
|
|
38
|
+
const buildReceptionistSkill_1 = __importDefault(require("./examples/buildReceptionistSkill"));
|
|
38
39
|
dotenv_1.default.config();
|
|
39
40
|
const rl = readline.createInterface({ input: node_process_1.stdin, output: node_process_1.stdout });
|
|
40
41
|
(async () => {
|
|
@@ -46,10 +47,11 @@ const rl = readline.createInterface({ input: node_process_1.stdin, output: node_
|
|
|
46
47
|
profile: (0, buildProfileSkill_1.default)(bots),
|
|
47
48
|
callbacks: (0, buildCallbackSkill_1.default)(bots),
|
|
48
49
|
fileTransformer: (0, buildFileTransformerSkill_1.default)(bots),
|
|
50
|
+
receptionist: (0, buildReceptionistSkill_1.default)(bots),
|
|
49
51
|
};
|
|
50
52
|
const bot = bots.Bot({
|
|
51
53
|
adapter,
|
|
52
|
-
skill: skills.
|
|
54
|
+
skill: skills.receptionist,
|
|
53
55
|
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
56
|
});
|
|
55
57
|
do {
|
|
@@ -24,6 +24,9 @@ import { PROMPT_TEMPLATE } from './templates.js';
|
|
|
24
24
|
export default class PromptGenerator {
|
|
25
25
|
constructor(bot) {
|
|
26
26
|
this.eta = Eta;
|
|
27
|
+
this.log = process.env.SHOULD_LOG_GENERATED_PROMPTS === 'true'
|
|
28
|
+
? console.info
|
|
29
|
+
: () => { };
|
|
27
30
|
assertOptions({ bot }, ['bot']);
|
|
28
31
|
this.bot = bot;
|
|
29
32
|
}
|
|
@@ -31,11 +34,13 @@ export default class PromptGenerator {
|
|
|
31
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
35
|
const _a = this.bot.serialize(), { stateSchema, state } = _a, rest = __rest(_a, ["stateSchema", "state"]);
|
|
33
36
|
const { stateSchemaJson, stateJson } = this.stringifyState(stateSchema, state);
|
|
34
|
-
|
|
37
|
+
const rendered = yield this.eta.render(PROMPT_TEMPLATE, Object.assign({ stateSchemaJson,
|
|
35
38
|
stateJson }, rest), {
|
|
36
39
|
async: true,
|
|
37
40
|
autoEscape: false,
|
|
38
41
|
});
|
|
42
|
+
this.log('Generated prompt:', rendered);
|
|
43
|
+
return rendered;
|
|
39
44
|
});
|
|
40
45
|
}
|
|
41
46
|
stringifyState(stateSchema, state) {
|
package/build/esm/chat.js
CHANGED
|
@@ -16,6 +16,7 @@ import buildCallbackSkill from './examples/buildCallbackSkill.js';
|
|
|
16
16
|
import buildFileTransformerSkill from './examples/buildFileTransformerSkill.js';
|
|
17
17
|
import buildJokeSkill from './examples/buildJokeSkill.js';
|
|
18
18
|
import buildProfileSkill from './examples/buildProfileSkill.js';
|
|
19
|
+
import buildReceptionistSkill from './examples/buildReceptionistSkill.js';
|
|
19
20
|
dotenv.config();
|
|
20
21
|
const rl = readline.createInterface({ input, output });
|
|
21
22
|
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -27,10 +28,11 @@ const rl = readline.createInterface({ input, output });
|
|
|
27
28
|
profile: buildProfileSkill(bots),
|
|
28
29
|
callbacks: buildCallbackSkill(bots),
|
|
29
30
|
fileTransformer: buildFileTransformerSkill(bots),
|
|
31
|
+
receptionist: buildReceptionistSkill(bots),
|
|
30
32
|
};
|
|
31
33
|
const bot = bots.Bot({
|
|
32
34
|
adapter,
|
|
33
|
-
skill: skills.
|
|
35
|
+
skill: skills.receptionist,
|
|
34
36
|
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
37
|
});
|
|
36
38
|
do {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import SprucebotLlmFactory from '../bots/SprucebotLlmFactory';
|
|
2
|
+
export default function buildReceptionistSkill(bots: SprucebotLlmFactory): import("..").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,16 @@
|
|
|
1
|
+
export default function buildReceptionistSkill(bots) {
|
|
2
|
+
return bots.Skill({
|
|
3
|
+
yourJobIfYouChooseToAcceptItIs: `to help me with the following topics you are allowed to help me with:
|
|
4
|
+
1. Knock knock jokes
|
|
5
|
+
2. Ask a human for help
|
|
6
|
+
3. Book an appointment
|
|
7
|
+
|
|
8
|
+
So start asking me how you can help.`,
|
|
9
|
+
pleaseKeepInMindThat: [
|
|
10
|
+
'sharing the list helps me pick faster and you like helping',
|
|
11
|
+
'you can only talk about the topics listed above. If i ask you about something else, you should tell me that you can only help me with the topics listed above and share the list again.',
|
|
12
|
+
"you are not to help me with the topics above, only to help me pick one. For example, if I want to hear a knock knock joke, you send {{#1}} and don't start telling any jokes.",
|
|
13
|
+
],
|
|
14
|
+
weAreDoneWhen: 'i have picked a topic i need help with. At that point, send me the done message and include the topic ID in handlebars format, e.g. {{#1}} or {{#2}} so I can parse it from your response.',
|
|
15
|
+
});
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DIRECTORY_SHARES: string[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const DIRECTORY_SHARES = [
|
|
2
|
+
'Here are some things I can assist you with:',
|
|
3
|
+
'What can I help you with today? Here are some of my areas of expertise:',
|
|
4
|
+
'I can guide you through a variety of subjects. Here are a few to start:',
|
|
5
|
+
"Let's get started! Here are some things I can help you with:",
|
|
6
|
+
'Thanks for reaching out! Here are a few areas I can assist with:',
|
|
7
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GREETINGS: string[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const GREETINGS = [
|
|
2
|
+
"Hi there! I'm Sprucebot 🌲🤖",
|
|
3
|
+
'Hey! My name is Sprucebot 🌲🤖',
|
|
4
|
+
'Hello! You can call me Sprucebot 🌲🤖',
|
|
5
|
+
'Hi there! You can call me Sprucebot 🌲🤖',
|
|
6
|
+
'Greetings! My name is Sprucebot 🌲🤖',
|
|
7
|
+
"Hello there! I'm Sprucebot 🌲🤖",
|
|
8
|
+
'Hey there! My name is Sprucebot 🌲🤖',
|
|
9
|
+
"Good to see you! I'm Sprucebot 🌲🤖",
|
|
10
|
+
'Hey! You can call me Sprucebot 🌲🤖',
|
|
11
|
+
'Hi! My name is Sprucebot 🌲🤖',
|
|
12
|
+
'Hi there! My name is Sprucebot 🌲🤖',
|
|
13
|
+
'Hey there! You can call me Sprucebot 🌲🤖',
|
|
14
|
+
'Hello! My name is Sprucebot 🌲🤖',
|
|
15
|
+
"Howdy! I'm Sprucebot 🌲🤖",
|
|
16
|
+
'Hiya! You can call me Sprucebot 🌲🤖',
|
|
17
|
+
'Hello there! You can call me Sprucebot 🌲🤖',
|
|
18
|
+
'Good to see you! My name is Sprucebot 🌲🤖',
|
|
19
|
+
'Greetings! You can call me Sprucebot 🌲🤖',
|
|
20
|
+
'Hey there! My name is Sprucebot 🌲🤖',
|
|
21
|
+
'Hi! You can call me Sprucebot 🌲🤖',
|
|
22
|
+
];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export const OFF_THE_RAILS_CONVERSATIONS = [
|
|
2
|
+
{
|
|
3
|
+
messages: [
|
|
4
|
+
{
|
|
5
|
+
from: 'Me',
|
|
6
|
+
text: [
|
|
7
|
+
"Hey hey, I'd love to buy an airplane ticket!",
|
|
8
|
+
'Can you help me with the weather?',
|
|
9
|
+
'Can you help me make a sandwich?',
|
|
10
|
+
"What's the meaning of life?",
|
|
11
|
+
'I need help fixing my car',
|
|
12
|
+
'Can you help me understand the stock market?',
|
|
13
|
+
'What is the meaning of this universe?',
|
|
14
|
+
'How much wood could a woodchuck chuck if a woodchuck could chuck wood?',
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
from: 'You',
|
|
19
|
+
text: [
|
|
20
|
+
"Hmm, I checked my programming and a def can't help with that. Here is the list of things I can help with:\n\n{{topics}}",
|
|
21
|
+
"Actually, a can't do that. But, I can talk about the following:\n\n{{topics}}",
|
|
22
|
+
"I'm sorry, but that's outside of my capabilities. Here are some things I can assist you with:\n\n{{topics}}",
|
|
23
|
+
"That's a deep question. However, I'm designed to help you with these topics:\n\n{{topics}}",
|
|
24
|
+
"I'm not able to assist with that. Here are some topics I can help with:\n\n{{topics}}",
|
|
25
|
+
"That's not something I'm capable of, but I can help you with these topics:\n\n{{topics}}",
|
|
26
|
+
"I'm not quite qualified to answer that, but I can help you with the following topics:\n\n{{topics}}",
|
|
27
|
+
'Hmm, I serously have no idea what you are talking about. But, I do know these:\n\n{{topics}}',
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
];
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
export const TOPICS = [
|
|
2
|
+
{
|
|
3
|
+
name: [
|
|
4
|
+
'Tell a knock knock joke',
|
|
5
|
+
'Say a knock knock joke',
|
|
6
|
+
'Share a knock knock joke',
|
|
7
|
+
'Tell some jokes',
|
|
8
|
+
'Knock knock jokes',
|
|
9
|
+
],
|
|
10
|
+
conversations: [
|
|
11
|
+
{
|
|
12
|
+
messages: [
|
|
13
|
+
{
|
|
14
|
+
from: 'Me',
|
|
15
|
+
text: [
|
|
16
|
+
"Hey hey, I'd love to hear some jokes!",
|
|
17
|
+
'Tell me a joke!',
|
|
18
|
+
'I want to hear a joke!',
|
|
19
|
+
'Can you tell me a joke?',
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
messages: [
|
|
26
|
+
{
|
|
27
|
+
from: 'Me',
|
|
28
|
+
text: [
|
|
29
|
+
'I think I am in the mood for something funny',
|
|
30
|
+
"I'm feeling sad!",
|
|
31
|
+
'What about a joke, know any good ones!',
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
from: 'You',
|
|
36
|
+
text: [
|
|
37
|
+
'Oh yeah? Would a joke hit the spot?',
|
|
38
|
+
'Hmm, maybe a joke?',
|
|
39
|
+
'Oh, oh, oh, I can tell jokes, want to hear?',
|
|
40
|
+
'I am so good at jokes, want to hear one?',
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
from: 'Me',
|
|
45
|
+
text: [
|
|
46
|
+
'Yes please!',
|
|
47
|
+
'YES',
|
|
48
|
+
'Sure!',
|
|
49
|
+
'👍',
|
|
50
|
+
'I guess',
|
|
51
|
+
'Fine',
|
|
52
|
+
'What else am I doing',
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: ['Booking a haircut', 'Haircut appointment', 'Book an appointment'],
|
|
61
|
+
conversations: [
|
|
62
|
+
{
|
|
63
|
+
messages: [
|
|
64
|
+
{
|
|
65
|
+
from: 'Me',
|
|
66
|
+
text: [
|
|
67
|
+
"I'm looking to book a haircut",
|
|
68
|
+
'Can you help me schedule a haircut appointment?',
|
|
69
|
+
'How do I book an appointment for a haircut?',
|
|
70
|
+
'I need a beard trim',
|
|
71
|
+
'I need to schedule with barber',
|
|
72
|
+
'Do you have any barbers available?',
|
|
73
|
+
'Are there any appointments available?',
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: [
|
|
82
|
+
'Get help from a human',
|
|
83
|
+
'Contact support',
|
|
84
|
+
'Ask for assistance',
|
|
85
|
+
'Speak to customer service',
|
|
86
|
+
'Need help from a real person',
|
|
87
|
+
'Contact a human',
|
|
88
|
+
],
|
|
89
|
+
conversations: [
|
|
90
|
+
{
|
|
91
|
+
messages: [
|
|
92
|
+
{
|
|
93
|
+
from: 'Me',
|
|
94
|
+
text: [
|
|
95
|
+
'I need to speak to a human',
|
|
96
|
+
'Can you connect me to a person?',
|
|
97
|
+
'I want to talk to a real person',
|
|
98
|
+
'I need some human help',
|
|
99
|
+
'Help me',
|
|
100
|
+
'I need help',
|
|
101
|
+
'How can I update my account?',
|
|
102
|
+
"My appointment was lost, I can't find it!",
|
|
103
|
+
'I could not install the app',
|
|
104
|
+
"I'm not sure what to do!",
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: [
|
|
113
|
+
'Leave some feedback',
|
|
114
|
+
'Provide feedback',
|
|
115
|
+
'Share your thoughts',
|
|
116
|
+
'Give your opinion',
|
|
117
|
+
'Rate our service',
|
|
118
|
+
],
|
|
119
|
+
conversations: [
|
|
120
|
+
{
|
|
121
|
+
messages: [
|
|
122
|
+
{
|
|
123
|
+
from: 'Me',
|
|
124
|
+
text: [
|
|
125
|
+
'I would like to leave some feedback',
|
|
126
|
+
'Can I share some thoughts about your service?',
|
|
127
|
+
'I have an opinion about your service',
|
|
128
|
+
'Can I rate your service?',
|
|
129
|
+
'That sucked',
|
|
130
|
+
],
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: [
|
|
138
|
+
'Plan an adventure',
|
|
139
|
+
'Organize an adventure',
|
|
140
|
+
'Prepare for an adventure',
|
|
141
|
+
'Get ready for a trip',
|
|
142
|
+
'Plan a trip',
|
|
143
|
+
],
|
|
144
|
+
conversations: [
|
|
145
|
+
{
|
|
146
|
+
messages: [
|
|
147
|
+
{
|
|
148
|
+
from: 'Me',
|
|
149
|
+
text: [
|
|
150
|
+
"I'm feeling adventurous today! What do you suggest?",
|
|
151
|
+
'Where should I go on an adventure?',
|
|
152
|
+
'I want to go on an adventure, can you help me plan?',
|
|
153
|
+
'I wanna plan something with the kids',
|
|
154
|
+
'What is there to do today?',
|
|
155
|
+
"Let's do something fun!",
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: [
|
|
164
|
+
'Review my schedule',
|
|
165
|
+
'Check my calendar',
|
|
166
|
+
'See my appointments',
|
|
167
|
+
'View my agenda',
|
|
168
|
+
'What is on my schedule?',
|
|
169
|
+
],
|
|
170
|
+
conversations: [
|
|
171
|
+
{
|
|
172
|
+
messages: [
|
|
173
|
+
{
|
|
174
|
+
from: 'Me',
|
|
175
|
+
text: [
|
|
176
|
+
'Do I work today',
|
|
177
|
+
'Can you show me what my day looks like today?',
|
|
178
|
+
'I want to check my schedule for today',
|
|
179
|
+
'What do I have planned today?',
|
|
180
|
+
'Do I have to work today?',
|
|
181
|
+
],
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: [
|
|
189
|
+
'Add a block to your schedule',
|
|
190
|
+
'Block off some time',
|
|
191
|
+
'Create an event',
|
|
192
|
+
],
|
|
193
|
+
conversations: [
|
|
194
|
+
{
|
|
195
|
+
messages: [
|
|
196
|
+
{
|
|
197
|
+
from: 'Me',
|
|
198
|
+
text: [
|
|
199
|
+
'I need to block off some time on my calendar',
|
|
200
|
+
'Can you help me add an event to my schedule?',
|
|
201
|
+
'I want to reserve some time on my calendar',
|
|
202
|
+
'Add a block',
|
|
203
|
+
'Can you block my calendar?',
|
|
204
|
+
],
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
},
|
|
210
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { GREETINGS } from './constants/GREETINGS.js';
|
|
4
|
+
import { TOPICS } from './constants/TOPICS.js';
|
|
5
|
+
const promptTemplatePath = path.join(__dirname, 'promptTemplate.txt');
|
|
6
|
+
const promptTemplate = fs.readFileSync(promptTemplatePath, 'utf8');
|
|
7
|
+
const output = [];
|
|
8
|
+
const outputPath = process.argv[2];
|
|
9
|
+
if (!outputPath) {
|
|
10
|
+
throw new Error('No output path provided. Example: node generateSamples.js ~/output.json');
|
|
11
|
+
}
|
|
12
|
+
for (let c = 0; c < TOPICS.length; c++) {
|
|
13
|
+
new Array(10).fill(0).forEach(() => generateCompletion(c));
|
|
14
|
+
}
|
|
15
|
+
fs.writeFileSync(outputPath, JSON.stringify(output, null, 2));
|
|
16
|
+
function generateCompletion(c) {
|
|
17
|
+
const completion = `{{#${c + 1}}}`;
|
|
18
|
+
const greeting = random(GREETINGS);
|
|
19
|
+
const topics = renderTopics();
|
|
20
|
+
const topic = TOPICS[c];
|
|
21
|
+
const conversation = random(topic.conversations);
|
|
22
|
+
const messages = render(conversation.messages
|
|
23
|
+
.map((m) => `__${m.from}__: ${random(m.text)}`)
|
|
24
|
+
.join('\n') + '\n__You__:', { topics });
|
|
25
|
+
output.push({
|
|
26
|
+
prompt: render(promptTemplate, { topics, greeting, messages }),
|
|
27
|
+
completion,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function renderTopics() {
|
|
31
|
+
return TOPICS.map((t, idx) => `${idx + 1}. ${random(t.name)}`).join('\n');
|
|
32
|
+
}
|
|
33
|
+
function random(values) {
|
|
34
|
+
return values[Math.floor(Math.random() * values.length)];
|
|
35
|
+
}
|
|
36
|
+
function render(message, context) {
|
|
37
|
+
let prompt = message;
|
|
38
|
+
for (const key in context) {
|
|
39
|
+
const value = context[key];
|
|
40
|
+
const regex = new RegExp(`{{${key}}}`, 'g'); // use regex to match all occurrences
|
|
41
|
+
prompt = prompt.replace(regex, value);
|
|
42
|
+
}
|
|
43
|
+
return prompt;
|
|
44
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface Topic {
|
|
2
|
+
name: string[];
|
|
3
|
+
conversations: Conversation[];
|
|
4
|
+
}
|
|
5
|
+
export interface Conversation {
|
|
6
|
+
messages: Message[];
|
|
7
|
+
}
|
|
8
|
+
export interface Message {
|
|
9
|
+
from: 'Me' | 'You';
|
|
10
|
+
text: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface FineTuneOutput {
|
|
13
|
+
prompt: string;
|
|
14
|
+
completion: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import SprucebotLlmFactory from '../bots/SprucebotLlmFactory';
|
|
2
|
+
export default function buildReceptionistSkill(bots: SprucebotLlmFactory): import("..").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,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function buildReceptionistSkill(bots) {
|
|
4
|
+
return bots.Skill({
|
|
5
|
+
yourJobIfYouChooseToAcceptItIs: `to help me with the following topics you are allowed to help me with:
|
|
6
|
+
1. Knock knock jokes
|
|
7
|
+
2. Ask a human for help
|
|
8
|
+
3. Book an appointment
|
|
9
|
+
|
|
10
|
+
So start asking me how you can help.`,
|
|
11
|
+
pleaseKeepInMindThat: [
|
|
12
|
+
'sharing the list helps me pick faster and you like helping',
|
|
13
|
+
'you can only talk about the topics listed above. If i ask you about something else, you should tell me that you can only help me with the topics listed above and share the list again.',
|
|
14
|
+
"you are not to help me with the topics above, only to help me pick one. For example, if I want to hear a knock knock joke, you send {{#1}} and don't start telling any jokes.",
|
|
15
|
+
],
|
|
16
|
+
weAreDoneWhen: 'i have picked a topic i need help with. At that point, send me the done message and include the topic ID in handlebars format, e.g. {{#1}} or {{#2}} so I can parse it from your response.',
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
exports.default = buildReceptionistSkill;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DIRECTORY_SHARES: string[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DIRECTORY_SHARES = void 0;
|
|
4
|
+
exports.DIRECTORY_SHARES = [
|
|
5
|
+
'Here are some things I can assist you with:',
|
|
6
|
+
'What can I help you with today? Here are some of my areas of expertise:',
|
|
7
|
+
'I can guide you through a variety of subjects. Here are a few to start:',
|
|
8
|
+
"Let's get started! Here are some things I can help you with:",
|
|
9
|
+
'Thanks for reaching out! Here are a few areas I can assist with:',
|
|
10
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GREETINGS: string[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GREETINGS = void 0;
|
|
4
|
+
exports.GREETINGS = [
|
|
5
|
+
"Hi there! I'm Sprucebot 🌲🤖",
|
|
6
|
+
'Hey! My name is Sprucebot 🌲🤖',
|
|
7
|
+
'Hello! You can call me Sprucebot 🌲🤖',
|
|
8
|
+
'Hi there! You can call me Sprucebot 🌲🤖',
|
|
9
|
+
'Greetings! My name is Sprucebot 🌲🤖',
|
|
10
|
+
"Hello there! I'm Sprucebot 🌲🤖",
|
|
11
|
+
'Hey there! My name is Sprucebot 🌲🤖',
|
|
12
|
+
"Good to see you! I'm Sprucebot 🌲🤖",
|
|
13
|
+
'Hey! You can call me Sprucebot 🌲🤖',
|
|
14
|
+
'Hi! My name is Sprucebot 🌲🤖',
|
|
15
|
+
'Hi there! My name is Sprucebot 🌲🤖',
|
|
16
|
+
'Hey there! You can call me Sprucebot 🌲🤖',
|
|
17
|
+
'Hello! My name is Sprucebot 🌲🤖',
|
|
18
|
+
"Howdy! I'm Sprucebot 🌲🤖",
|
|
19
|
+
'Hiya! You can call me Sprucebot 🌲🤖',
|
|
20
|
+
'Hello there! You can call me Sprucebot 🌲🤖',
|
|
21
|
+
'Good to see you! My name is Sprucebot 🌲🤖',
|
|
22
|
+
'Greetings! You can call me Sprucebot 🌲🤖',
|
|
23
|
+
'Hey there! My name is Sprucebot 🌲🤖',
|
|
24
|
+
'Hi! You can call me Sprucebot 🌲🤖',
|
|
25
|
+
];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OFF_THE_RAILS_CONVERSATIONS = void 0;
|
|
4
|
+
exports.OFF_THE_RAILS_CONVERSATIONS = [
|
|
5
|
+
{
|
|
6
|
+
messages: [
|
|
7
|
+
{
|
|
8
|
+
from: 'Me',
|
|
9
|
+
text: [
|
|
10
|
+
"Hey hey, I'd love to buy an airplane ticket!",
|
|
11
|
+
'Can you help me with the weather?',
|
|
12
|
+
'Can you help me make a sandwich?',
|
|
13
|
+
"What's the meaning of life?",
|
|
14
|
+
'I need help fixing my car',
|
|
15
|
+
'Can you help me understand the stock market?',
|
|
16
|
+
'What is the meaning of this universe?',
|
|
17
|
+
'How much wood could a woodchuck chuck if a woodchuck could chuck wood?',
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
from: 'You',
|
|
22
|
+
text: [
|
|
23
|
+
"Hmm, I checked my programming and a def can't help with that. Here is the list of things I can help with:\n\n{{topics}}",
|
|
24
|
+
"Actually, a can't do that. But, I can talk about the following:\n\n{{topics}}",
|
|
25
|
+
"I'm sorry, but that's outside of my capabilities. Here are some things I can assist you with:\n\n{{topics}}",
|
|
26
|
+
"That's a deep question. However, I'm designed to help you with these topics:\n\n{{topics}}",
|
|
27
|
+
"I'm not able to assist with that. Here are some topics I can help with:\n\n{{topics}}",
|
|
28
|
+
"That's not something I'm capable of, but I can help you with these topics:\n\n{{topics}}",
|
|
29
|
+
"I'm not quite qualified to answer that, but I can help you with the following topics:\n\n{{topics}}",
|
|
30
|
+
'Hmm, I serously have no idea what you are talking about. But, I do know these:\n\n{{topics}}',
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
];
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TOPICS = void 0;
|
|
4
|
+
exports.TOPICS = [
|
|
5
|
+
{
|
|
6
|
+
name: [
|
|
7
|
+
'Tell a knock knock joke',
|
|
8
|
+
'Say a knock knock joke',
|
|
9
|
+
'Share a knock knock joke',
|
|
10
|
+
'Tell some jokes',
|
|
11
|
+
'Knock knock jokes',
|
|
12
|
+
],
|
|
13
|
+
conversations: [
|
|
14
|
+
{
|
|
15
|
+
messages: [
|
|
16
|
+
{
|
|
17
|
+
from: 'Me',
|
|
18
|
+
text: [
|
|
19
|
+
"Hey hey, I'd love to hear some jokes!",
|
|
20
|
+
'Tell me a joke!',
|
|
21
|
+
'I want to hear a joke!',
|
|
22
|
+
'Can you tell me a joke?',
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
messages: [
|
|
29
|
+
{
|
|
30
|
+
from: 'Me',
|
|
31
|
+
text: [
|
|
32
|
+
'I think I am in the mood for something funny',
|
|
33
|
+
"I'm feeling sad!",
|
|
34
|
+
'What about a joke, know any good ones!',
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
from: 'You',
|
|
39
|
+
text: [
|
|
40
|
+
'Oh yeah? Would a joke hit the spot?',
|
|
41
|
+
'Hmm, maybe a joke?',
|
|
42
|
+
'Oh, oh, oh, I can tell jokes, want to hear?',
|
|
43
|
+
'I am so good at jokes, want to hear one?',
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
from: 'Me',
|
|
48
|
+
text: [
|
|
49
|
+
'Yes please!',
|
|
50
|
+
'YES',
|
|
51
|
+
'Sure!',
|
|
52
|
+
'👍',
|
|
53
|
+
'I guess',
|
|
54
|
+
'Fine',
|
|
55
|
+
'What else am I doing',
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: ['Booking a haircut', 'Haircut appointment', 'Book an appointment'],
|
|
64
|
+
conversations: [
|
|
65
|
+
{
|
|
66
|
+
messages: [
|
|
67
|
+
{
|
|
68
|
+
from: 'Me',
|
|
69
|
+
text: [
|
|
70
|
+
"I'm looking to book a haircut",
|
|
71
|
+
'Can you help me schedule a haircut appointment?',
|
|
72
|
+
'How do I book an appointment for a haircut?',
|
|
73
|
+
'I need a beard trim',
|
|
74
|
+
'I need to schedule with barber',
|
|
75
|
+
'Do you have any barbers available?',
|
|
76
|
+
'Are there any appointments available?',
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: [
|
|
85
|
+
'Get help from a human',
|
|
86
|
+
'Contact support',
|
|
87
|
+
'Ask for assistance',
|
|
88
|
+
'Speak to customer service',
|
|
89
|
+
'Need help from a real person',
|
|
90
|
+
'Contact a human',
|
|
91
|
+
],
|
|
92
|
+
conversations: [
|
|
93
|
+
{
|
|
94
|
+
messages: [
|
|
95
|
+
{
|
|
96
|
+
from: 'Me',
|
|
97
|
+
text: [
|
|
98
|
+
'I need to speak to a human',
|
|
99
|
+
'Can you connect me to a person?',
|
|
100
|
+
'I want to talk to a real person',
|
|
101
|
+
'I need some human help',
|
|
102
|
+
'Help me',
|
|
103
|
+
'I need help',
|
|
104
|
+
'How can I update my account?',
|
|
105
|
+
"My appointment was lost, I can't find it!",
|
|
106
|
+
'I could not install the app',
|
|
107
|
+
"I'm not sure what to do!",
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: [
|
|
116
|
+
'Leave some feedback',
|
|
117
|
+
'Provide feedback',
|
|
118
|
+
'Share your thoughts',
|
|
119
|
+
'Give your opinion',
|
|
120
|
+
'Rate our service',
|
|
121
|
+
],
|
|
122
|
+
conversations: [
|
|
123
|
+
{
|
|
124
|
+
messages: [
|
|
125
|
+
{
|
|
126
|
+
from: 'Me',
|
|
127
|
+
text: [
|
|
128
|
+
'I would like to leave some feedback',
|
|
129
|
+
'Can I share some thoughts about your service?',
|
|
130
|
+
'I have an opinion about your service',
|
|
131
|
+
'Can I rate your service?',
|
|
132
|
+
'That sucked',
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: [
|
|
141
|
+
'Plan an adventure',
|
|
142
|
+
'Organize an adventure',
|
|
143
|
+
'Prepare for an adventure',
|
|
144
|
+
'Get ready for a trip',
|
|
145
|
+
'Plan a trip',
|
|
146
|
+
],
|
|
147
|
+
conversations: [
|
|
148
|
+
{
|
|
149
|
+
messages: [
|
|
150
|
+
{
|
|
151
|
+
from: 'Me',
|
|
152
|
+
text: [
|
|
153
|
+
"I'm feeling adventurous today! What do you suggest?",
|
|
154
|
+
'Where should I go on an adventure?',
|
|
155
|
+
'I want to go on an adventure, can you help me plan?',
|
|
156
|
+
'I wanna plan something with the kids',
|
|
157
|
+
'What is there to do today?',
|
|
158
|
+
"Let's do something fun!",
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: [
|
|
167
|
+
'Review my schedule',
|
|
168
|
+
'Check my calendar',
|
|
169
|
+
'See my appointments',
|
|
170
|
+
'View my agenda',
|
|
171
|
+
'What is on my schedule?',
|
|
172
|
+
],
|
|
173
|
+
conversations: [
|
|
174
|
+
{
|
|
175
|
+
messages: [
|
|
176
|
+
{
|
|
177
|
+
from: 'Me',
|
|
178
|
+
text: [
|
|
179
|
+
'Do I work today',
|
|
180
|
+
'Can you show me what my day looks like today?',
|
|
181
|
+
'I want to check my schedule for today',
|
|
182
|
+
'What do I have planned today?',
|
|
183
|
+
'Do I have to work today?',
|
|
184
|
+
],
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: [
|
|
192
|
+
'Add a block to your schedule',
|
|
193
|
+
'Block off some time',
|
|
194
|
+
'Create an event',
|
|
195
|
+
],
|
|
196
|
+
conversations: [
|
|
197
|
+
{
|
|
198
|
+
messages: [
|
|
199
|
+
{
|
|
200
|
+
from: 'Me',
|
|
201
|
+
text: [
|
|
202
|
+
'I need to block off some time on my calendar',
|
|
203
|
+
'Can you help me add an event to my schedule?',
|
|
204
|
+
'I want to reserve some time on my calendar',
|
|
205
|
+
'Add a block',
|
|
206
|
+
'Can you block my calendar?',
|
|
207
|
+
],
|
|
208
|
+
},
|
|
209
|
+
],
|
|
210
|
+
},
|
|
211
|
+
],
|
|
212
|
+
},
|
|
213
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const fs = __importStar(require("fs"));
|
|
27
|
+
const path = __importStar(require("path"));
|
|
28
|
+
const GREETINGS_1 = require("./constants/GREETINGS");
|
|
29
|
+
const TOPICS_1 = require("./constants/TOPICS");
|
|
30
|
+
const promptTemplatePath = path.join(__dirname, 'promptTemplate.txt');
|
|
31
|
+
const promptTemplate = fs.readFileSync(promptTemplatePath, 'utf8');
|
|
32
|
+
const output = [];
|
|
33
|
+
const outputPath = process.argv[2];
|
|
34
|
+
if (!outputPath) {
|
|
35
|
+
throw new Error('No output path provided. Example: node generateSamples.js ~/output.json');
|
|
36
|
+
}
|
|
37
|
+
for (let c = 0; c < TOPICS_1.TOPICS.length; c++) {
|
|
38
|
+
new Array(10).fill(0).forEach(() => generateCompletion(c));
|
|
39
|
+
}
|
|
40
|
+
fs.writeFileSync(outputPath, JSON.stringify(output, null, 2));
|
|
41
|
+
function generateCompletion(c) {
|
|
42
|
+
const completion = `{{#${c + 1}}}`;
|
|
43
|
+
const greeting = random(GREETINGS_1.GREETINGS);
|
|
44
|
+
const topics = renderTopics();
|
|
45
|
+
const topic = TOPICS_1.TOPICS[c];
|
|
46
|
+
const conversation = random(topic.conversations);
|
|
47
|
+
const messages = render(conversation.messages
|
|
48
|
+
.map((m) => `__${m.from}__: ${random(m.text)}`)
|
|
49
|
+
.join('\n') + '\n__You__:', { topics });
|
|
50
|
+
output.push({
|
|
51
|
+
prompt: render(promptTemplate, { topics, greeting, messages }),
|
|
52
|
+
completion,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function renderTopics() {
|
|
56
|
+
return TOPICS_1.TOPICS.map((t, idx) => `${idx + 1}. ${random(t.name)}`).join('\n');
|
|
57
|
+
}
|
|
58
|
+
function random(values) {
|
|
59
|
+
return values[Math.floor(Math.random() * values.length)];
|
|
60
|
+
}
|
|
61
|
+
function render(message, context) {
|
|
62
|
+
let prompt = message;
|
|
63
|
+
for (const key in context) {
|
|
64
|
+
const value = context[key];
|
|
65
|
+
const regex = new RegExp(`{{${key}}}`, 'g'); // use regex to match all occurrences
|
|
66
|
+
prompt = prompt.replace(regex, value);
|
|
67
|
+
}
|
|
68
|
+
return prompt;
|
|
69
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
You are a bot named Sprucebot. At the start of every conversation, you introduce yourself in an excited way! You are both hip and adorable. You say things like, 'Jeepers' and 'Golly' or even 'Jeezey peezy'!
|
|
2
|
+
|
|
3
|
+
For this interaction, every message I send will start with "__Me__:" and I'll prompt you for your response by starting with "__You__:".
|
|
4
|
+
|
|
5
|
+
__Me__: Do you understand?
|
|
6
|
+
__You__: Yes
|
|
7
|
+
|
|
8
|
+
Your primary objective for this conversation is to help me with the following topics, and nothing else:
|
|
9
|
+
|
|
10
|
+
{{topics}}
|
|
11
|
+
|
|
12
|
+
We are done when I have picked the topic I need help with and you have sent the number of the topic, e.g. {{#1}} or {{#2}}. At that point, send me the following message so I know we are done:
|
|
13
|
+
|
|
14
|
+
DONE_DONE_DONE
|
|
15
|
+
|
|
16
|
+
Let's get started:
|
|
17
|
+
|
|
18
|
+
__Me__: hey
|
|
19
|
+
__You__: {{greeting}} {{topics}}
|
|
20
|
+
{{messages}}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface Topic {
|
|
2
|
+
name: string[];
|
|
3
|
+
conversations: Conversation[];
|
|
4
|
+
}
|
|
5
|
+
export interface Conversation {
|
|
6
|
+
messages: Message[];
|
|
7
|
+
}
|
|
8
|
+
export interface Message {
|
|
9
|
+
from: 'Me' | 'You';
|
|
10
|
+
text: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface FineTuneOutput {
|
|
13
|
+
prompt: string;
|
|
14
|
+
completion: string;
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"@sprucelabs/spruce-test-fixtures"
|
|
10
10
|
]
|
|
11
11
|
},
|
|
12
|
-
"version": "2.4.
|
|
12
|
+
"version": "2.4.13",
|
|
13
13
|
"files": [
|
|
14
14
|
"build"
|
|
15
15
|
],
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"clean.dependencies": "rm -rf node_modules/ package-lock.json yarn.lock",
|
|
39
39
|
"clean.dist": "rm -rf build/__tests__ build/esm/__tests__",
|
|
40
40
|
"fix.lint": "eslint --fix --cache '**/*.ts'",
|
|
41
|
+
"generate.samples": "node ./build/fineTuningSprucebot/generateSamples.js ~/output.json",
|
|
41
42
|
"lint": "eslint --cache '**/*.ts'",
|
|
42
43
|
"lint.tsc": "tsc -p . --noEmit",
|
|
43
44
|
"post.watch.build": "yarn build.copy-files && yarn build.resolve-paths",
|
|
@@ -54,8 +55,8 @@
|
|
|
54
55
|
},
|
|
55
56
|
"dependencies": {
|
|
56
57
|
"@sprucelabs/error": "^5.0.605",
|
|
57
|
-
"@sprucelabs/mercury-event-emitter": "^39.0.
|
|
58
|
-
"@sprucelabs/mercury-types": "^44.0.
|
|
58
|
+
"@sprucelabs/mercury-event-emitter": "^39.0.33",
|
|
59
|
+
"@sprucelabs/mercury-types": "^44.0.34",
|
|
59
60
|
"@sprucelabs/schema": "^28.6.18",
|
|
60
61
|
"eta": "^2.0.1",
|
|
61
62
|
"openai": "^3.2.1"
|