@sprucelabs/sprucebot-llm 11.1.12 → 11.1.14
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 -1
- package/build/.spruce/errors/errors.types.js +1 -0
- package/build/.spruce/errors/errors.types.js.map +1 -0
- package/build/.spruce/errors/options.types.js +1 -0
- package/build/.spruce/errors/options.types.js.map +1 -0
- package/build/.spruce/errors/sprucebotLlm/callbackError.schema.js +1 -0
- package/build/.spruce/errors/sprucebotLlm/callbackError.schema.js.map +1 -0
- package/build/.spruce/errors/sprucebotLlm/invalidCallback.schema.js +1 -0
- package/build/.spruce/errors/sprucebotLlm/invalidCallback.schema.js.map +1 -0
- package/build/.spruce/errors/sprucebotLlm/noBotInstanceSet.schema.js +1 -0
- package/build/.spruce/errors/sprucebotLlm/noBotInstanceSet.schema.js.map +1 -0
- package/build/.spruce/event-cache.json +1 -0
- package/build/.spruce/schemas/fields/fieldClassMap.js +1 -0
- package/build/.spruce/schemas/fields/fieldClassMap.js.map +1 -0
- package/build/.spruce/schemas/fields/fields.types.js +1 -0
- package/build/.spruce/schemas/fields/fields.types.js.map +1 -0
- package/build/__tests__/behavioral/LlmBot.test.d.ts +55 -0
- package/build/__tests__/behavioral/LlmBot.test.js +607 -0
- package/build/__tests__/behavioral/LlmBot.test.js.map +1 -0
- package/build/__tests__/behavioral/SprucebotLlmFactory.test.d.ts +16 -0
- package/build/__tests__/behavioral/SprucebotLlmFactory.test.js +132 -0
- package/build/__tests__/behavioral/SprucebotLlmFactory.test.js.map +1 -0
- package/build/__tests__/behavioral/adapters/OpenAi.test.d.ts +52 -0
- package/build/__tests__/behavioral/adapters/OpenAi.test.js +699 -0
- package/build/__tests__/behavioral/adapters/OpenAi.test.js.map +1 -0
- package/build/__tests__/behavioral/prompts/PromptGenerator.test.d.ts +20 -0
- package/build/__tests__/behavioral/prompts/PromptGenerator.test.js +211 -0
- package/build/__tests__/behavioral/prompts/PromptGenerator.test.js.map +1 -0
- package/build/__tests__/behavioral/prompts/ResponseParser.test.d.ts +35 -0
- package/build/__tests__/behavioral/prompts/ResponseParser.test.js +312 -0
- package/build/__tests__/behavioral/prompts/ResponseParser.test.js.map +1 -0
- package/build/__tests__/behavioral/skills/Skill.test.d.ts +19 -0
- package/build/__tests__/behavioral/skills/Skill.test.js +188 -0
- package/build/__tests__/behavioral/skills/Skill.test.js.map +1 -0
- package/build/__tests__/behavioral/testing/MockLlmSkill.test.d.ts +37 -0
- package/build/__tests__/behavioral/testing/MockLlmSkill.test.js +340 -0
- package/build/__tests__/behavioral/testing/MockLlmSkill.test.js.map +1 -0
- package/build/__tests__/behavioral/testing/SpyLlmBot.test.d.ts +4 -0
- package/build/__tests__/behavioral/testing/SpyLlmBot.test.js +34 -0
- package/build/__tests__/behavioral/testing/SpyLlmBot.test.js.map +1 -0
- package/build/__tests__/support/AbstractLlmTest.d.ts +14 -0
- package/build/__tests__/support/AbstractLlmTest.js +67 -0
- package/build/__tests__/support/AbstractLlmTest.js.map +1 -0
- package/build/__tests__/support/schemas/carSchema.d.ts +16 -0
- package/build/__tests__/support/schemas/carSchema.js +19 -0
- package/build/__tests__/support/schemas/carSchema.js.map +1 -0
- package/build/__tests__/support/schemas/personSchema.d.ts +23 -0
- package/build/__tests__/support/schemas/personSchema.js +37 -0
- package/build/__tests__/support/schemas/personSchema.js.map +1 -0
- package/build/__tests__/support/schemas/personWithDefaultsSchema.d.ts +13 -0
- package/build/__tests__/support/schemas/personWithDefaultsSchema.js +18 -0
- package/build/__tests__/support/schemas/personWithDefaultsSchema.js.map +1 -0
- package/build/bots/PromptGenerator.js +1 -0
- package/build/bots/PromptGenerator.js.map +1 -0
- package/build/bots/SprucebotLlmBotImpl.js +9 -4
- package/build/bots/SprucebotLlmBotImpl.js.map +1 -0
- package/build/bots/SprucebotLlmFactory.js +1 -0
- package/build/bots/SprucebotLlmFactory.js.map +1 -0
- package/build/bots/SprucebotLlmSkillImpl.js +1 -0
- package/build/bots/SprucebotLlmSkillImpl.js.map +1 -0
- package/build/bots/adapters/OpenAi.js +1 -0
- package/build/bots/adapters/OpenAi.js.map +1 -0
- package/build/bots/adapters/OpenAiMessageBuilder.js +1 -0
- package/build/bots/adapters/OpenAiMessageBuilder.js.map +1 -0
- package/build/bots/adapters/SpyOpenAiApi.js +1 -0
- package/build/bots/adapters/SpyOpenAiApi.js.map +1 -0
- package/build/bots/templates.js +1 -0
- package/build/bots/templates.js.map +1 -0
- package/build/chat.js +1 -0
- package/build/chat.js.map +1 -0
- package/build/chatWithImages.js +1 -0
- package/build/chatWithImages.js.map +1 -0
- package/build/errors/SpruceError.js +1 -0
- package/build/errors/SpruceError.js.map +1 -0
- package/build/errors/callbackError.builder.js +1 -0
- package/build/errors/callbackError.builder.js.map +1 -0
- package/build/errors/invalidCallback.builder.js +1 -0
- package/build/errors/invalidCallback.builder.js.map +1 -0
- package/build/errors/noBotInstanceSet.builder.js +1 -0
- package/build/errors/noBotInstanceSet.builder.js.map +1 -0
- package/build/examples/buildCallbackSkill.js +1 -0
- package/build/examples/buildCallbackSkill.js.map +1 -0
- package/build/examples/buildFileTransformerSkill.js +1 -0
- package/build/examples/buildFileTransformerSkill.js.map +1 -0
- package/build/examples/buildJokeSkill.js +1 -0
- package/build/examples/buildJokeSkill.js.map +1 -0
- package/build/examples/buildProfileSkill.js +1 -0
- package/build/examples/buildProfileSkill.js.map +1 -0
- package/build/examples/buildReceptionistSkill.js +1 -0
- package/build/examples/buildReceptionistSkill.js.map +1 -0
- package/build/fineTuningSprucebot/constants/DIRECTORY_SHARES.js +1 -0
- package/build/fineTuningSprucebot/constants/DIRECTORY_SHARES.js.map +1 -0
- package/build/fineTuningSprucebot/constants/FIRST_MESSAGES.js +1 -0
- package/build/fineTuningSprucebot/constants/FIRST_MESSAGES.js.map +1 -0
- package/build/fineTuningSprucebot/constants/GREETINGS.js +1 -0
- package/build/fineTuningSprucebot/constants/GREETINGS.js.map +1 -0
- package/build/fineTuningSprucebot/constants/OFF_THE_RAILS_CONVERSATIONS.js +1 -0
- package/build/fineTuningSprucebot/constants/OFF_THE_RAILS_CONVERSATIONS.js.map +1 -0
- package/build/fineTuningSprucebot/constants/TOPICS.js +1 -0
- package/build/fineTuningSprucebot/constants/TOPICS.js.map +1 -0
- package/build/fineTuningSprucebot/generateSamples.js +1 -0
- package/build/fineTuningSprucebot/generateSamples.js.map +1 -0
- package/build/fineTuningSprucebot/support.js +1 -0
- package/build/fineTuningSprucebot/support.js.map +1 -0
- package/build/fineTuningSprucebot/types.js +1 -0
- package/build/fineTuningSprucebot/types.js.map +1 -0
- package/build/index.js +1 -0
- package/build/index.js.map +1 -0
- package/build/llm.types.js +1 -0
- package/build/llm.types.js.map +1 -0
- package/build/parsingResponses/ResponseParser.js +1 -0
- package/build/parsingResponses/ResponseParser.js.map +1 -0
- package/build/parsingResponses/renderPlaceholder.js +1 -0
- package/build/parsingResponses/renderPlaceholder.js.map +1 -0
- package/build/tests/MockLlmSkill.js +1 -0
- package/build/tests/MockLlmSkill.js.map +1 -0
- package/build/tests/SpyAdapter.js +1 -0
- package/build/tests/SpyAdapter.js.map +1 -0
- package/build/tests/SpyLlmBot.js +1 -0
- package/build/tests/SpyLlmBot.js.map +1 -0
- package/package.json +14 -14
- package/build/esm/.spruce/errors/errors.types.d.ts +0 -52
- package/build/esm/.spruce/errors/errors.types.js +0 -1
- package/build/esm/.spruce/errors/options.types.d.ts +0 -13
- package/build/esm/.spruce/errors/options.types.js +0 -1
- package/build/esm/bots/PromptGenerator.d.ts +0 -22
- package/build/esm/bots/PromptGenerator.js +0 -74
- package/build/esm/bots/SprucebotLlmBotImpl.d.ts +0 -26
- package/build/esm/bots/SprucebotLlmBotImpl.js +0 -159
- package/build/esm/bots/SprucebotLlmFactory.d.ts +0 -15
- package/build/esm/bots/SprucebotLlmFactory.js +0 -41
- package/build/esm/bots/SprucebotLlmSkillImpl.d.ts +0 -12
- package/build/esm/bots/SprucebotLlmSkillImpl.js +0 -47
- package/build/esm/bots/adapters/OpenAi.d.ts +0 -11
- package/build/esm/bots/adapters/OpenAi.js +0 -46
- package/build/esm/bots/adapters/OpenAiMessageBuilder.d.ts +0 -18
- package/build/esm/bots/adapters/OpenAiMessageBuilder.js +0 -153
- package/build/esm/bots/adapters/SpyOpenAiApi.d.ts +0 -19
- package/build/esm/bots/adapters/SpyOpenAiApi.js +0 -49
- package/build/esm/bots/templates.d.ts +0 -4
- package/build/esm/bots/templates.js +0 -68
- package/build/esm/chat.d.ts +0 -1
- package/build/esm/chat.js +0 -53
- package/build/esm/chatWithImages.d.ts +0 -1
- package/build/esm/chatWithImages.js +0 -46
- package/build/esm/errors/SpruceError.d.ts +0 -6
- package/build/esm/errors/SpruceError.js +0 -25
- package/build/esm/errors/callbackError.builder.d.ts +0 -6
- package/build/esm/errors/callbackError.builder.js +0 -6
- package/build/esm/errors/invalidCallback.builder.d.ts +0 -17
- package/build/esm/errors/invalidCallback.builder.js +0 -17
- package/build/esm/errors/noBotInstanceSet.builder.d.ts +0 -6
- package/build/esm/errors/noBotInstanceSet.builder.js +0 -6
- package/build/esm/examples/buildCallbackSkill.d.ts +0 -2
- package/build/esm/examples/buildCallbackSkill.js +0 -57
- package/build/esm/examples/buildFileTransformerSkill.d.ts +0 -2
- package/build/esm/examples/buildFileTransformerSkill.js +0 -25
- package/build/esm/examples/buildJokeSkill.d.ts +0 -2
- package/build/esm/examples/buildJokeSkill.js +0 -12
- package/build/esm/examples/buildProfileSkill.d.ts +0 -2
- package/build/esm/examples/buildProfileSkill.js +0 -30
- package/build/esm/examples/buildReceptionistSkill.d.ts +0 -2
- package/build/esm/examples/buildReceptionistSkill.js +0 -16
- package/build/esm/fineTuningSprucebot/constants/DIRECTORY_SHARES.d.ts +0 -1
- package/build/esm/fineTuningSprucebot/constants/DIRECTORY_SHARES.js +0 -7
- package/build/esm/fineTuningSprucebot/constants/FIRST_MESSAGES.d.ts +0 -1
- package/build/esm/fineTuningSprucebot/constants/FIRST_MESSAGES.js +0 -17
- package/build/esm/fineTuningSprucebot/constants/GREETINGS.d.ts +0 -1
- package/build/esm/fineTuningSprucebot/constants/GREETINGS.js +0 -22
- package/build/esm/fineTuningSprucebot/constants/OFF_THE_RAILS_CONVERSATIONS.d.ts +0 -2
- package/build/esm/fineTuningSprucebot/constants/OFF_THE_RAILS_CONVERSATIONS.js +0 -32
- package/build/esm/fineTuningSprucebot/constants/TOPICS.d.ts +0 -2
- package/build/esm/fineTuningSprucebot/constants/TOPICS.js +0 -314
- package/build/esm/fineTuningSprucebot/generateSamples.d.ts +0 -1
- package/build/esm/fineTuningSprucebot/generateSamples.js +0 -41
- package/build/esm/fineTuningSprucebot/support.d.ts +0 -12
- package/build/esm/fineTuningSprucebot/support.js +0 -60
- package/build/esm/fineTuningSprucebot/types.d.ts +0 -15
- package/build/esm/fineTuningSprucebot/types.js +0 -1
- package/build/esm/index.d.ts +0 -10
- package/build/esm/index.js +0 -10
- package/build/esm/llm.types.d.ts +0 -84
- package/build/esm/llm.types.js +0 -6
- package/build/esm/parsingResponses/ResponseParser.d.ts +0 -18
- package/build/esm/parsingResponses/ResponseParser.js +0 -115
- package/build/esm/parsingResponses/renderPlaceholder.d.ts +0 -1
- package/build/esm/parsingResponses/renderPlaceholder.js +0 -4
- package/build/esm/tests/MockLlmSkill.d.ts +0 -14
- package/build/esm/tests/MockLlmSkill.js +0 -60
- package/build/esm/tests/SpyAdapter.d.ts +0 -8
- package/build/esm/tests/SpyAdapter.js +0 -21
- package/build/esm/tests/SpyLlmBot.d.ts +0 -12
- package/build/esm/tests/SpyLlmBot.js +0 -20
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ChatCompletionMessageParam } from 'openai/resources';
|
|
2
|
-
import { SprucebotLlmBot } from '../../llm.types';
|
|
3
|
-
export default class OpenAiMessageBuilder {
|
|
4
|
-
private bot;
|
|
5
|
-
protected constructor(bot: SprucebotLlmBot);
|
|
6
|
-
static Builder(bot: SprucebotLlmBot): OpenAiMessageBuilder;
|
|
7
|
-
buildMessages(): ChatCompletionMessageParam[];
|
|
8
|
-
private buildChatHistoryMessages;
|
|
9
|
-
private mapMessageToCompletion;
|
|
10
|
-
private buildFirstMessage;
|
|
11
|
-
private buildSkillMessages;
|
|
12
|
-
private buildCallbacksMessage;
|
|
13
|
-
private buildPleaseKeepInMindMessage;
|
|
14
|
-
private buildStateMessage;
|
|
15
|
-
private buildYourJobMessage;
|
|
16
|
-
private buildWeAreDoneWhenMessage;
|
|
17
|
-
private buildStateSchemaMessage;
|
|
18
|
-
}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { DONE_TOKEN, STATE_BOUNDARY } from '../templates.js';
|
|
2
|
-
export default class OpenAiMessageBuilder {
|
|
3
|
-
constructor(bot) {
|
|
4
|
-
this.bot = bot;
|
|
5
|
-
}
|
|
6
|
-
static Builder(bot) {
|
|
7
|
-
return new this(bot);
|
|
8
|
-
}
|
|
9
|
-
buildMessages() {
|
|
10
|
-
const values = this.bot.serialize();
|
|
11
|
-
const allMessages = [
|
|
12
|
-
this.buildFirstMessage(values.youAre),
|
|
13
|
-
...this.buildSkillMessages(values.skill),
|
|
14
|
-
...this.buildChatHistoryMessages(values.messages),
|
|
15
|
-
];
|
|
16
|
-
return allMessages;
|
|
17
|
-
}
|
|
18
|
-
buildChatHistoryMessages(messages) {
|
|
19
|
-
var _a;
|
|
20
|
-
let messagesBeingConsidered = messages;
|
|
21
|
-
const limit = parseInt((_a = process.env.OPENAI_MESSAGE_MEMORY_LIMIT) !== null && _a !== void 0 ? _a : '0');
|
|
22
|
-
if (limit > 0) {
|
|
23
|
-
messagesBeingConsidered = messages.slice(Math.max(messages.length - limit, 0));
|
|
24
|
-
}
|
|
25
|
-
return messagesBeingConsidered.map((message) => this.mapMessageToCompletion(message));
|
|
26
|
-
}
|
|
27
|
-
mapMessageToCompletion(message) {
|
|
28
|
-
let content = message.message;
|
|
29
|
-
if (message.imageBase64) {
|
|
30
|
-
content = [
|
|
31
|
-
{
|
|
32
|
-
type: 'text',
|
|
33
|
-
text: message.message,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
type: 'image_url',
|
|
37
|
-
image_url: {
|
|
38
|
-
url: `data:image/png;base64,${message.imageBase64}`,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
];
|
|
42
|
-
}
|
|
43
|
-
const role = message.from === 'Me'
|
|
44
|
-
? 'user'
|
|
45
|
-
: message.from === 'You'
|
|
46
|
-
? 'assistant'
|
|
47
|
-
: 'developer';
|
|
48
|
-
return {
|
|
49
|
-
role,
|
|
50
|
-
content,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
buildFirstMessage(youAre) {
|
|
54
|
-
return {
|
|
55
|
-
role: 'developer',
|
|
56
|
-
content: `You are ${youAre}.`,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
buildSkillMessages(skill) {
|
|
60
|
-
if (!skill) {
|
|
61
|
-
return [];
|
|
62
|
-
}
|
|
63
|
-
const messages = [];
|
|
64
|
-
messages.push(this.buildYourJobMessage(skill.yourJobIfYouChooseToAcceptItIs));
|
|
65
|
-
if (skill.stateSchema) {
|
|
66
|
-
messages.push(this.buildStateSchemaMessage(skill.stateSchema));
|
|
67
|
-
}
|
|
68
|
-
if (skill.state) {
|
|
69
|
-
messages.push(this.buildStateMessage(skill.state));
|
|
70
|
-
}
|
|
71
|
-
if (skill.weAreDoneWhen) {
|
|
72
|
-
messages.push(this.buildWeAreDoneWhenMessage(skill.weAreDoneWhen));
|
|
73
|
-
}
|
|
74
|
-
if (skill.callbacks) {
|
|
75
|
-
messages.push(this.buildCallbacksMessage(skill.callbacks));
|
|
76
|
-
}
|
|
77
|
-
if (skill.pleaseKeepInMindThat) {
|
|
78
|
-
messages.push(this.buildPleaseKeepInMindMessage(skill.pleaseKeepInMindThat));
|
|
79
|
-
}
|
|
80
|
-
return messages;
|
|
81
|
-
}
|
|
82
|
-
buildCallbacksMessage(callbacks) {
|
|
83
|
-
const keys = Object.keys(callbacks);
|
|
84
|
-
const descriptions = [];
|
|
85
|
-
for (const key of keys) {
|
|
86
|
-
const callback = callbacks[key];
|
|
87
|
-
let definition = `<Function name="${key}">
|
|
88
|
-
<Description>For use when ${callback.useThisWhenever}</Description>`;
|
|
89
|
-
if (callback.parameters) {
|
|
90
|
-
let params = '<Parameters>';
|
|
91
|
-
for (const param of callback.parameters) {
|
|
92
|
-
let parameterChoices = '';
|
|
93
|
-
if (param.type === 'select') {
|
|
94
|
-
const choices = param.options
|
|
95
|
-
.choices;
|
|
96
|
-
parameterChoices = `<Choices>\n${choices
|
|
97
|
-
.map((c) => `
|
|
98
|
-
<Choice>
|
|
99
|
-
<Label>${c.label}</Label>
|
|
100
|
-
<Value>${c.value}</Value>
|
|
101
|
-
</Choice>`)
|
|
102
|
-
.join('\n')}\n</Choices>`;
|
|
103
|
-
}
|
|
104
|
-
params += `
|
|
105
|
-
<Parameter${param.isRequired ? ' required="true"' : ''}>
|
|
106
|
-
<Name>${param.name}</Name>
|
|
107
|
-
<Type>${param.type}</Type>
|
|
108
|
-
${param.description ? `<Description>${param.description}</Description>` : ''}${parameterChoices}
|
|
109
|
-
</Parameter>`;
|
|
110
|
-
}
|
|
111
|
-
params += '</Parameters>';
|
|
112
|
-
definition += params;
|
|
113
|
-
}
|
|
114
|
-
definition += `</Function>`;
|
|
115
|
-
descriptions.push(definition);
|
|
116
|
-
}
|
|
117
|
-
const api = `<APIReference>\n\n${descriptions.join('\n\n')}</APIReference>`;
|
|
118
|
-
return {
|
|
119
|
-
role: 'developer',
|
|
120
|
-
content: `You have an API available to you to lookup answers. When you need the response of the function call to proceed, you can call a function using a custom markup we created that looks like this: <<FunctionName/>>. The API will respond with the results and then you can continue the conversation with your new knowledge. If the api call has parameters, call it like this: <<FunctionName>>{{parametersJsonEncoded}}<</FunctionName>>. Make sure to json encode the data and drop it between the function tags. Note: You can only make one API call at a time. The API is as follows (in xml format):\n\n${api}`,
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
buildPleaseKeepInMindMessage(pleaseKeepInMindThat) {
|
|
124
|
-
return {
|
|
125
|
-
role: 'developer',
|
|
126
|
-
content: `During this conversation, please keep the following in mind:\n\n${pleaseKeepInMindThat.map((m, idx) => `${idx + 1}. ${m}`).join('\n')}.`,
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
buildStateMessage(state) {
|
|
130
|
-
return {
|
|
131
|
-
role: 'developer',
|
|
132
|
-
content: `The current state of this conversation is:\n\n${JSON.stringify(state)}. As the state is being updated, send it back to me in json format (something in can JSON.parse()) at the end of each response (it's not meant for reading, but for parsing, so don't call it out, but send it as we progress), surrounded by a boundary, like this: ${STATE_BOUNDARY} { "fieldName": "fieldValue" } ${STATE_BOUNDARY}`,
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
buildYourJobMessage(yourJob) {
|
|
136
|
-
return {
|
|
137
|
-
role: 'developer',
|
|
138
|
-
content: `For this interaction, your job is ${yourJob}.`,
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
buildWeAreDoneWhenMessage(weAreDoneWhen) {
|
|
142
|
-
return {
|
|
143
|
-
role: 'developer',
|
|
144
|
-
content: `Our conversation is done when ${weAreDoneWhen}. Once you determine we are done, send me the following message so I know we're done: ${DONE_TOKEN}`,
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
buildStateSchemaMessage(schema) {
|
|
148
|
-
return {
|
|
149
|
-
role: 'developer',
|
|
150
|
-
content: `We will be tracking state for this conversation. The following schema is what we'll use to define the shape of the state:\n\n${JSON.stringify(schema)}`,
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import OpenAI from 'openai';
|
|
2
|
-
import { ChatCompletion, ChatCompletionCreateParamsNonStreaming } from 'openai/resources';
|
|
3
|
-
export default class SpyOpenAiApi extends OpenAI {
|
|
4
|
-
static config?: OpenAiOptions;
|
|
5
|
-
static lastSentCompletion?: ChatCompletionCreateParamsNonStreaming;
|
|
6
|
-
static responseMessage: string | false;
|
|
7
|
-
constructor(config: OpenAiOptions);
|
|
8
|
-
chat: {
|
|
9
|
-
completions: {
|
|
10
|
-
create: (options: ChatCompletionCreateParamsNonStreaming) => Promise<Response>;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
private createCompletion;
|
|
14
|
-
}
|
|
15
|
-
type Response = ChatCompletion;
|
|
16
|
-
interface OpenAiOptions {
|
|
17
|
-
apiKey: string;
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import OpenAI from 'openai';
|
|
11
|
-
class SpyOpenAiApi extends OpenAI {
|
|
12
|
-
constructor(config) {
|
|
13
|
-
super(config);
|
|
14
|
-
//@ts-ignore
|
|
15
|
-
this.chat = {
|
|
16
|
-
completions: {
|
|
17
|
-
create: this.createCompletion.bind(this),
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
SpyOpenAiApi.config = config;
|
|
21
|
-
}
|
|
22
|
-
createCompletion(options) {
|
|
23
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
SpyOpenAiApi.lastSentCompletion = options;
|
|
25
|
-
const choices = [];
|
|
26
|
-
if (SpyOpenAiApi.responseMessage) {
|
|
27
|
-
choices.push({
|
|
28
|
-
finish_reason: 'stop',
|
|
29
|
-
index: 0,
|
|
30
|
-
logprobs: null,
|
|
31
|
-
message: {
|
|
32
|
-
content: SpyOpenAiApi.responseMessage,
|
|
33
|
-
role: 'assistant',
|
|
34
|
-
refusal: null,
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
id: 'cmpl-1',
|
|
40
|
-
model: 'text-davinci-003',
|
|
41
|
-
created: 0,
|
|
42
|
-
choices,
|
|
43
|
-
object: 'chat.completion',
|
|
44
|
-
};
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
SpyOpenAiApi.responseMessage = 'hello!';
|
|
49
|
-
export default SpyOpenAiApi;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import renderPlaceholder from '../parsingResponses/renderPlaceholder.js';
|
|
2
|
-
export const STATE_BOUNDARY = '*****';
|
|
3
|
-
export const DONE_TOKEN = `DONE_DONE_DONE`;
|
|
4
|
-
export const CALLBACK_BOUNDARY = 'xxxxx';
|
|
5
|
-
export const PROMPT_TEMPLATE = `You are <%= it.youAre %>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
For this interaction, every message I send will start with "__Me__:" and I'll prompt you for your response by starting with "__You__:".
|
|
9
|
-
|
|
10
|
-
__Me__: Do you understand?
|
|
11
|
-
__You__: Yes
|
|
12
|
-
|
|
13
|
-
<% if (it.stateSchemaJson) { %>
|
|
14
|
-
|
|
15
|
-
Here is the schema that defines the state for this conversation:
|
|
16
|
-
|
|
17
|
-
<%= it.stateSchemaJson %>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Here is the current state, which is based on the schema above:
|
|
21
|
-
|
|
22
|
-
<%= it.stateJson %>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
After each message, send the state in the form:
|
|
26
|
-
|
|
27
|
-
${STATE_BOUNDARY} <%= it.stateJson %> ${STATE_BOUNDARY}
|
|
28
|
-
|
|
29
|
-
__Me__: Sound good?
|
|
30
|
-
__You__: Yup!
|
|
31
|
-
|
|
32
|
-
${STATE_BOUNDARY} <%= it.stateJson %> ${STATE_BOUNDARY}
|
|
33
|
-
|
|
34
|
-
When asking me about a "select" field, make sure I only pick a valid choice by showing me their labels!<% } %>
|
|
35
|
-
|
|
36
|
-
<% if (it.skill) { %>
|
|
37
|
-
|
|
38
|
-
Your primary objective for this conversation is <%= it.skill.yourJobIfYouChooseToAcceptItIs %>
|
|
39
|
-
<% if (it.skill.callbacks) { %>
|
|
40
|
-
While we are talking, there are going to be things I don't want you to answer, but instead to respond with a placeholder in the form of ${renderPlaceholder('example')}.
|
|
41
|
-
|
|
42
|
-
Here are the placeholders we will be using:
|
|
43
|
-
|
|
44
|
-
<% Object.keys(it.skill.callbacks).forEach((key) => { %>
|
|
45
|
-
Whenever <%= it.skill.callbacks[key].useThisWhenever %>, respond with ${CALLBACK_BOUNDARY} <%= key %> ${CALLBACK_BOUNDARY}
|
|
46
|
-
|
|
47
|
-
<% }) %>
|
|
48
|
-
<% } %>
|
|
49
|
-
<% if (!it.stateSchemaJson && it.skill.weAreDoneWhen) { %>
|
|
50
|
-
We are done when <%= it.skill.weAreDoneWhen %> At that point, send me the following message so I know we are done:
|
|
51
|
-
|
|
52
|
-
${DONE_TOKEN}
|
|
53
|
-
<% } %>
|
|
54
|
-
<% } %>
|
|
55
|
-
<% if (it.stateSchemaJson) { %>
|
|
56
|
-
|
|
57
|
-
Once you have asked about every field in the schema, send me the following message so I know we're done:
|
|
58
|
-
|
|
59
|
-
${DONE_TOKEN}
|
|
60
|
-
<% } %>
|
|
61
|
-
|
|
62
|
-
Let's get started:
|
|
63
|
-
|
|
64
|
-
<% it.messages.forEach((message) => { %>
|
|
65
|
-
__<%= message.from %>__: <%= message.message %>
|
|
66
|
-
|
|
67
|
-
<% }) %>
|
|
68
|
-
__You__:`;
|
package/build/esm/chat.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/build/esm/chat.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { stdin as input, stdout as output } from 'node:process';
|
|
11
|
-
import * as readline from 'node:readline/promises.js';
|
|
12
|
-
import dotenv from 'dotenv';
|
|
13
|
-
import OpenAiAdapter from './bots/adapters/OpenAi.js';
|
|
14
|
-
import SprucebotLlmFactory from './bots/SprucebotLlmFactory.js';
|
|
15
|
-
import buildCallbackSkill from './examples/buildCallbackSkill.js';
|
|
16
|
-
import buildFileTransformerSkill from './examples/buildFileTransformerSkill.js';
|
|
17
|
-
import buildJokeSkill from './examples/buildJokeSkill.js';
|
|
18
|
-
import buildProfileSkill from './examples/buildProfileSkill.js';
|
|
19
|
-
import buildReceptionistSkill from './examples/buildReceptionistSkill.js';
|
|
20
|
-
dotenv.config({ quiet: true });
|
|
21
|
-
const rl = readline.createInterface({ input, output });
|
|
22
|
-
void (() => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
-
console.clear();
|
|
24
|
-
// Create the adapter that handles actually sending the prompt to an LLM
|
|
25
|
-
const adapter = OpenAiAdapter.Adapter(process.env.OPEN_AI_API_KEY);
|
|
26
|
-
// The LLmFactory is a layer of abstraction that simplifies bot creation
|
|
27
|
-
// and enables test doubling (mocks, spies, etc)
|
|
28
|
-
const bots = SprucebotLlmFactory.Factory(adapter);
|
|
29
|
-
// Different examples of things you may want to play with (see line 34)
|
|
30
|
-
const skills = {
|
|
31
|
-
jokes: buildJokeSkill(bots),
|
|
32
|
-
profile: buildProfileSkill(bots),
|
|
33
|
-
callbacks: buildCallbackSkill(bots),
|
|
34
|
-
fileTransformer: buildFileTransformerSkill(bots),
|
|
35
|
-
receptionist: buildReceptionistSkill(bots),
|
|
36
|
-
};
|
|
37
|
-
// Construct a Bot installs and pass the skill of your choice
|
|
38
|
-
const bot = bots.Bot({
|
|
39
|
-
skill: skills.callbacks, //<-- try jokes, profile, etc.
|
|
40
|
-
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'!",
|
|
41
|
-
});
|
|
42
|
-
do {
|
|
43
|
-
// Read from stdin
|
|
44
|
-
const input = yield rl.question('Message > ');
|
|
45
|
-
// Send the message to the bot and log the response
|
|
46
|
-
// We use a callback because one message may trigger a conversation
|
|
47
|
-
// which will include many messages and bot.sendMessage(...) only
|
|
48
|
-
// returns the last message send back from the LLM
|
|
49
|
-
yield bot.sendMessage(input, (message) => console.log('>', message));
|
|
50
|
-
} while (!bot.getIsDone());
|
|
51
|
-
console.log('Signing off...');
|
|
52
|
-
rl.close();
|
|
53
|
-
}))();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import fs from 'fs';
|
|
11
|
-
import dotenv from 'dotenv';
|
|
12
|
-
import OpenAiAdapter from './bots/adapters/OpenAi.js';
|
|
13
|
-
import SprucebotLlmFactory from './bots/SprucebotLlmFactory.js';
|
|
14
|
-
dotenv.config({ quiet: true });
|
|
15
|
-
void (() => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
console.clear();
|
|
17
|
-
const image1 = fs.readFileSync('build/examples/images/image1.png');
|
|
18
|
-
const image2 = fs.readFileSync('build/examples/images/image2.png');
|
|
19
|
-
const base64Image1 = image1.toString('base64');
|
|
20
|
-
const base64Image2 = image2.toString('base64');
|
|
21
|
-
const adapter = OpenAiAdapter.Adapter(process.env.OPEN_AI_API_KEY);
|
|
22
|
-
const bots = SprucebotLlmFactory.Factory(adapter);
|
|
23
|
-
const skill = bots.Skill({
|
|
24
|
-
weAreDoneWhen: 'you have described both images to me',
|
|
25
|
-
yourJobIfYouChooseToAcceptItIs: 'to review the image i send you, invoke the getNextImage function and then describe that image too.',
|
|
26
|
-
callbacks: {
|
|
27
|
-
getNextImage: {
|
|
28
|
-
cb: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
-
return {
|
|
30
|
-
imageBase64: base64Image2,
|
|
31
|
-
imageDescription: 'A beautiful sunset over the mountains.',
|
|
32
|
-
};
|
|
33
|
-
}),
|
|
34
|
-
useThisWhenever: 'you want to get the next image',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
const bot = bots.Bot({
|
|
39
|
-
skill,
|
|
40
|
-
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'!",
|
|
41
|
-
});
|
|
42
|
-
yield bot.sendMessage({
|
|
43
|
-
imageBase64: base64Image1,
|
|
44
|
-
imageDescription: 'The first image',
|
|
45
|
-
}, (message) => console.log('>', message));
|
|
46
|
-
}))();
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import BaseSpruceError from '@sprucelabs/error';
|
|
2
|
-
import ErrorOptions from './../.spruce/errors/options.types';
|
|
3
|
-
export default class SpruceError extends BaseSpruceError<ErrorOptions> {
|
|
4
|
-
/** an easy to understand version of the errors */
|
|
5
|
-
friendlyMessage(): string;
|
|
6
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import BaseSpruceError from '@sprucelabs/error';
|
|
2
|
-
export default class SpruceError extends BaseSpruceError {
|
|
3
|
-
/** an easy to understand version of the errors */
|
|
4
|
-
friendlyMessage() {
|
|
5
|
-
const { options } = this;
|
|
6
|
-
let message;
|
|
7
|
-
switch (options === null || options === void 0 ? void 0 : options.code) {
|
|
8
|
-
case 'NO_BOT_INSTANCE_SET':
|
|
9
|
-
message = `You must create a bot and set it using 'SprucebotLlmFactory.setInstance(bot)' before you can get an instance of it.`;
|
|
10
|
-
break;
|
|
11
|
-
case 'INVALID_CALLBACK':
|
|
12
|
-
message = `The callback you tried to invoke (${options.matchedCallback}) is not valid. Valid callbacks are:\n${options.validCallbacks.map((name, idx) => `${idx + 1}: ${name}`).join('\n')}`;
|
|
13
|
-
break;
|
|
14
|
-
case 'CALLBACK_ERROR':
|
|
15
|
-
message = 'A Callback error just happened!';
|
|
16
|
-
break;
|
|
17
|
-
default:
|
|
18
|
-
message = super.friendlyMessage();
|
|
19
|
-
}
|
|
20
|
-
const fullMessage = options.friendlyMessage
|
|
21
|
-
? options.friendlyMessage
|
|
22
|
-
: message;
|
|
23
|
-
return fullMessage;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
fields: {
|
|
5
|
-
validCallbacks: {
|
|
6
|
-
type: "text";
|
|
7
|
-
isRequired: true;
|
|
8
|
-
isArray: true;
|
|
9
|
-
minArrayLength: number;
|
|
10
|
-
};
|
|
11
|
-
matchedCallback: {
|
|
12
|
-
type: "text";
|
|
13
|
-
isRequired: true;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export default _default;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { buildErrorSchema } from '@sprucelabs/schema';
|
|
2
|
-
export default buildErrorSchema({
|
|
3
|
-
id: 'invalidCallback',
|
|
4
|
-
name: 'Invalid callback',
|
|
5
|
-
fields: {
|
|
6
|
-
validCallbacks: {
|
|
7
|
-
type: 'text',
|
|
8
|
-
isRequired: true,
|
|
9
|
-
isArray: true,
|
|
10
|
-
minArrayLength: 0,
|
|
11
|
-
},
|
|
12
|
-
matchedCallback: {
|
|
13
|
-
type: 'text',
|
|
14
|
-
isRequired: true,
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import SprucebotLlmFactory from '../bots/SprucebotLlmFactory';
|
|
2
|
-
export default function buildCallbackSkill(bots: SprucebotLlmFactory): import("..").SprucebotLLmSkill<import("@sprucelabs/schema").Schema, Pick<import("@sprucelabs/schema").SchemaStaticValues<import("@sprucelabs/schema").Schema, false, never, import("@sprucelabs/schema").StaticSchemaAllValues<import("@sprucelabs/schema").Schema, false>>, never>>;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
export default function buildCallbackSkill(bots) {
|
|
11
|
-
return bots.Skill({
|
|
12
|
-
yourJobIfYouChooseToAcceptItIs: "to 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 (make sure to call the api to see what times and colors i can choose from). After all is said and done, make sure to actually book the appointment!:",
|
|
13
|
-
weAreDoneWhen: 'the appointment is booked!',
|
|
14
|
-
pleaseKeepInMindThat: [],
|
|
15
|
-
callbacks: {
|
|
16
|
-
availableTimes: {
|
|
17
|
-
cb: () => __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
return [
|
|
19
|
-
'9am',
|
|
20
|
-
'10am',
|
|
21
|
-
'11am',
|
|
22
|
-
'1pm',
|
|
23
|
-
'4pm',
|
|
24
|
-
'5pm',
|
|
25
|
-
'12am.',
|
|
26
|
-
].join('\n');
|
|
27
|
-
}),
|
|
28
|
-
useThisWhenever: 'your are showing what times i can pick from.',
|
|
29
|
-
},
|
|
30
|
-
favoriteColor: {
|
|
31
|
-
cb: () => __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
return ['red', 'blue', 'green', 'purple'].join('\n');
|
|
33
|
-
}),
|
|
34
|
-
useThisWhenever: 'your are showing what colors i can pick from.',
|
|
35
|
-
},
|
|
36
|
-
book: {
|
|
37
|
-
cb: (options) => __awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
console.log('BOOKING OPTIONS', options);
|
|
39
|
-
return 'Appointment booked!';
|
|
40
|
-
}),
|
|
41
|
-
useThisWhenever: 'You are ready to book an appointment!',
|
|
42
|
-
parameters: [
|
|
43
|
-
{
|
|
44
|
-
name: 'time',
|
|
45
|
-
isRequired: true,
|
|
46
|
-
type: 'string',
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: 'color',
|
|
50
|
-
isRequired: true,
|
|
51
|
-
type: 'string',
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import SprucebotLlmFactory from '../bots/SprucebotLlmFactory';
|
|
2
|
-
export default function buildFileTransformerSkill(bots: SprucebotLlmFactory): import("..").SprucebotLLmSkill<import("@sprucelabs/schema").Schema, Pick<import("@sprucelabs/schema").SchemaStaticValues<import("@sprucelabs/schema").Schema, false, never, import("@sprucelabs/schema").StaticSchemaAllValues<import("@sprucelabs/schema").Schema, false>>, never>>;
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import SprucebotLlmFactory from '../bots/SprucebotLlmFactory';
|
|
2
|
-
export default function buildJokeSkill(bots: SprucebotLlmFactory): import("..").SprucebotLLmSkill<import("@sprucelabs/schema").Schema, Pick<import("@sprucelabs/schema").SchemaStaticValues<import("@sprucelabs/schema").Schema, false, never, import("@sprucelabs/schema").StaticSchemaAllValues<import("@sprucelabs/schema").Schema, false>>, never>>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export default function buildJokeSkill(bots) {
|
|
2
|
-
return bots.Skill({
|
|
3
|
-
yourJobIfYouChooseToAcceptItIs: 'to tell knock knock jokes!',
|
|
4
|
-
pleaseKeepInMindThat: [
|
|
5
|
-
'our audience is younger, so keep it PG!',
|
|
6
|
-
'you should never laugh when someone does not get the joke.',
|
|
7
|
-
"after each joke, you should tell me how many jokes you have left to tell before we're done.",
|
|
8
|
-
'you should acknowledge if someone laughs at your joke by saying "Thanks!" or "Glad you thought that was funny"!',
|
|
9
|
-
],
|
|
10
|
-
weAreDoneWhen: 'you have told 3 jokes!',
|
|
11
|
-
});
|
|
12
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import SprucebotLlmFactory from '../bots/SprucebotLlmFactory';
|
|
2
|
-
export default function buildProfileSkill(bots: SprucebotLlmFactory): import("..").SprucebotLLmSkill<import("@sprucelabs/schema").Schema, Pick<import("@sprucelabs/schema").SchemaStaticValues<import("@sprucelabs/schema").Schema, false, never, import("@sprucelabs/schema").StaticSchemaAllValues<import("@sprucelabs/schema").Schema, false>>, never>>;
|