@sprucelabs/sprucebot-llm 11.1.2 → 11.1.4
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.
|
@@ -48,7 +48,7 @@ class OpenAiMessageBuilder {
|
|
|
48
48
|
}
|
|
49
49
|
buildFirstMessage(youAre) {
|
|
50
50
|
return {
|
|
51
|
-
role: '
|
|
51
|
+
role: 'developer',
|
|
52
52
|
content: `You are ${youAre}.`,
|
|
53
53
|
};
|
|
54
54
|
}
|
|
@@ -112,37 +112,37 @@ class OpenAiMessageBuilder {
|
|
|
112
112
|
}
|
|
113
113
|
const api = `<APIReference>\n\n${descriptions.join('\n\n')}</APIReference>`;
|
|
114
114
|
return {
|
|
115
|
-
role: '
|
|
116
|
-
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. The API is as follows (in xml format):\n\n${api}`,
|
|
115
|
+
role: 'developer',
|
|
116
|
+
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}`,
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
buildPleaseKeepInMindMessage(pleaseKeepInMindThat) {
|
|
120
120
|
return {
|
|
121
|
-
role: '
|
|
121
|
+
role: 'developer',
|
|
122
122
|
content: `During this conversation, please keep the following in mind:\n\n${pleaseKeepInMindThat.map((m, idx) => `${idx + 1}. ${m}`).join('\n')}.`,
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
125
|
buildStateMessage(state) {
|
|
126
126
|
return {
|
|
127
|
-
role: '
|
|
127
|
+
role: 'developer',
|
|
128
128
|
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: ${templates_1.STATE_BOUNDARY} { "fieldName": "fieldValue" } ${templates_1.STATE_BOUNDARY}`,
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
131
|
buildYourJobMessage(yourJob) {
|
|
132
132
|
return {
|
|
133
|
-
role: '
|
|
133
|
+
role: 'developer',
|
|
134
134
|
content: `For this interaction, your job is ${yourJob}.`,
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
137
|
buildWeAreDoneWhenMessage(weAreDoneWhen) {
|
|
138
138
|
return {
|
|
139
|
-
role: '
|
|
139
|
+
role: 'developer',
|
|
140
140
|
content: `Our conversation is done when ${weAreDoneWhen}. Once you determine we are done, send me the following message so I know we're done: ${templates_1.DONE_TOKEN}`,
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
143
|
buildStateSchemaMessage(schema) {
|
|
144
144
|
return {
|
|
145
|
-
role: '
|
|
145
|
+
role: 'developer',
|
|
146
146
|
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)}`,
|
|
147
147
|
};
|
|
148
148
|
}
|
|
@@ -47,7 +47,7 @@ export default class OpenAiMessageBuilder {
|
|
|
47
47
|
}
|
|
48
48
|
buildFirstMessage(youAre) {
|
|
49
49
|
return {
|
|
50
|
-
role: '
|
|
50
|
+
role: 'developer',
|
|
51
51
|
content: `You are ${youAre}.`,
|
|
52
52
|
};
|
|
53
53
|
}
|
|
@@ -111,37 +111,37 @@ export default class OpenAiMessageBuilder {
|
|
|
111
111
|
}
|
|
112
112
|
const api = `<APIReference>\n\n${descriptions.join('\n\n')}</APIReference>`;
|
|
113
113
|
return {
|
|
114
|
-
role: '
|
|
115
|
-
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. The API is as follows (in xml format):\n\n${api}`,
|
|
114
|
+
role: 'developer',
|
|
115
|
+
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}`,
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
buildPleaseKeepInMindMessage(pleaseKeepInMindThat) {
|
|
119
119
|
return {
|
|
120
|
-
role: '
|
|
120
|
+
role: 'developer',
|
|
121
121
|
content: `During this conversation, please keep the following in mind:\n\n${pleaseKeepInMindThat.map((m, idx) => `${idx + 1}. ${m}`).join('\n')}.`,
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
124
|
buildStateMessage(state) {
|
|
125
125
|
return {
|
|
126
|
-
role: '
|
|
126
|
+
role: 'developer',
|
|
127
127
|
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}`,
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
buildYourJobMessage(yourJob) {
|
|
131
131
|
return {
|
|
132
|
-
role: '
|
|
132
|
+
role: 'developer',
|
|
133
133
|
content: `For this interaction, your job is ${yourJob}.`,
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
136
|
buildWeAreDoneWhenMessage(weAreDoneWhen) {
|
|
137
137
|
return {
|
|
138
|
-
role: '
|
|
138
|
+
role: 'developer',
|
|
139
139
|
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}`,
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
142
|
buildStateSchemaMessage(schema) {
|
|
143
143
|
return {
|
|
144
|
-
role: '
|
|
144
|
+
role: 'developer',
|
|
145
145
|
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)}`,
|
|
146
146
|
};
|
|
147
147
|
}
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"eta"
|
|
9
9
|
]
|
|
10
10
|
},
|
|
11
|
-
"version": "11.1.
|
|
11
|
+
"version": "11.1.4",
|
|
12
12
|
"files": [
|
|
13
13
|
"build"
|
|
14
14
|
],
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@sprucelabs/error": "^8.0.6",
|
|
57
|
-
"@sprucelabs/mercury-event-emitter": "^45.0.
|
|
58
|
-
"@sprucelabs/mercury-types": "^49.0.
|
|
59
|
-
"@sprucelabs/schema": "^33.0.
|
|
60
|
-
"@sprucelabs/spruce-skill-utils": "^33.0.
|
|
57
|
+
"@sprucelabs/mercury-event-emitter": "^45.0.21",
|
|
58
|
+
"@sprucelabs/mercury-types": "^49.0.17",
|
|
59
|
+
"@sprucelabs/schema": "^33.0.13",
|
|
60
|
+
"@sprucelabs/spruce-skill-utils": "^33.0.16",
|
|
61
61
|
"eta": "3.5.0",
|
|
62
62
|
"openai": "^6.9.1"
|
|
63
63
|
},
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@sprucelabs/resolve-path-aliases": "^4.0.7",
|
|
71
71
|
"@sprucelabs/semantic-release": "^6.0.0",
|
|
72
72
|
"@sprucelabs/test": "^11.0.2",
|
|
73
|
-
"@sprucelabs/test-utils": "^7.0.
|
|
73
|
+
"@sprucelabs/test-utils": "^7.0.13",
|
|
74
74
|
"@types/node": "^24.10.1",
|
|
75
75
|
"chokidar-cli": "^3.0.0",
|
|
76
76
|
"dotenv": "^17.2.3",
|