utilitas 1998.2.12 → 1998.2.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/dist/utilitas.lite.mjs +1 -1
- package/dist/utilitas.lite.mjs.map +1 -1
- package/lib/alan.mjs +14 -12
- package/lib/manifest.mjs +1 -1
- package/package.json +1 -1
package/lib/alan.mjs
CHANGED
|
@@ -1095,10 +1095,10 @@ const distillFile = async (attachments, o) => {
|
|
|
1095
1095
|
'- For images or video files that are not primarily text-based, describe the tragic scene you observe, highlight key details, convey the emotional tone of the setting, and share your impressions.',
|
|
1096
1096
|
'- For video files, please describe the content, including the theme, subjects, characters, scenes, objects, storyline, and emotional tone.',
|
|
1097
1097
|
'- Please RETURN ONLY your analysis results without including your thought process or other unrelated information.',
|
|
1098
|
-
o
|
|
1099
|
-
o
|
|
1100
|
-
o
|
|
1101
|
-
o
|
|
1098
|
+
o?.summarize ? '- Please organize the key content of this document, systematically present the key information it contains in a concise summary, and remove any unimportant filler content, ONLY return the summary.' : '',
|
|
1099
|
+
o?.toLanguage ? `- Please return the results in ${o?.toLanguage}.` : '',
|
|
1100
|
+
o?.keepPaging ? '' : '- If the document has multiple pages, merge them into one page. Please do not return any paging information.',
|
|
1101
|
+
o?.keepDecoration ? '' : '- If the document has side notes, headers, footers, or watermarks, please ignore them.',
|
|
1102
1102
|
].filter(x => x).join('\n');
|
|
1103
1103
|
attachments = ensureArray(attachments);
|
|
1104
1104
|
for (const i in attachments) {
|
|
@@ -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