utilitas 1998.2.13 → 1998.2.15
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/dist/utilitas.lite.mjs +1 -1
- package/dist/utilitas.lite.mjs.map +1 -1
- package/lib/alan.mjs +11 -9
- package/lib/manifest.mjs +1 -1
- package/package.json +1 -1
package/lib/alan.mjs
CHANGED
|
@@ -968,7 +968,7 @@ const packResult = resp => {
|
|
|
968
968
|
resp.text, { noCode: true, noLink: true }
|
|
969
969
|
).replace(/\[\^\d\^\]/ig, ''),
|
|
970
970
|
};
|
|
971
|
-
log(`Response: ${JSON.stringify(result.text)}`);
|
|
971
|
+
log(`Response (${result.model}): ${JSON.stringify(result.text)}`);
|
|
972
972
|
// log(result);
|
|
973
973
|
return result;
|
|
974
974
|
};
|
|
@@ -1160,14 +1160,16 @@ const analyzeSessions = async (sessionIds, options) => {
|
|
|
1160
1160
|
}
|
|
1161
1161
|
const pmt = options?.prompt || (
|
|
1162
1162
|
'Help me organize the dialogues in the following JSON into a title '
|
|
1163
|
-
+ 'dictionary and return it in JSON format.
|
|
1164
|
-
+ '
|
|
1165
|
-
+ '
|
|
1166
|
-
+ '
|
|
1167
|
-
+ '
|
|
1168
|
-
+ '
|
|
1163
|
+
+ 'dictionary and return it in JSON format. The input data may contain '
|
|
1164
|
+
+ 'one or more sets of data. Try to summarize the content briefly '
|
|
1165
|
+
+ 'without copying the original text. The returned JSON uses the key '
|
|
1166
|
+
+ 'from the original JSON session data as the key, and the title should'
|
|
1167
|
+
+ ' be a brief summary of your review of that chat record. Title '
|
|
1168
|
+
+ 'should be a brief text string. The return format is as follows '
|
|
1169
|
+
+ '`{"id_1": "title_1", "id_2": "title_2"}`. The following is a '
|
|
1170
|
+
+ 'conversation data that needs to be organized: \n\n');
|
|
1169
1171
|
const getInput = () =>
|
|
1170
|
-
`${pmt}\`\`\`JSON\n${JSON.stringify(sses
|
|
1172
|
+
`${pmt}\`\`\`JSON\n${JSON.stringify(sses)}\n\`\`\``;
|
|
1171
1173
|
await trimPrompt(getInput, () => {
|
|
1172
1174
|
if (!Object.values(sses).sort((x, y) =>
|
|
1173
1175
|
y.messages.length - x.messages.length)[0].messages.shift()) {
|
|
@@ -1180,7 +1182,7 @@ const analyzeSessions = async (sessionIds, options) => {
|
|
|
1180
1182
|
jsonMode: true, fast: true, simple: true, ...options || {}
|
|
1181
1183
|
})) : {};
|
|
1182
1184
|
assert(aiResp, 'Unable to analyze sessions.');
|
|
1183
|
-
ids.map(x => resp[x] = aiResp[x] || null)
|
|
1185
|
+
ids.map(x => resp[x] = aiResp[x] || null);
|
|
1184
1186
|
return Array.isArray(sessionIds) ? resp : resp[sessionIds[0]];
|
|
1185
1187
|
};
|
|
1186
1188
|
|
package/lib/manifest.mjs
CHANGED