utilitas 2001.1.109 → 2001.1.111
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 +3 -2
- package/lib/manifest.mjs +1 -1
- package/package.json +1 -1
package/lib/alan.mjs
CHANGED
|
@@ -38,7 +38,7 @@ General inquiries, writing, translation, and common knowledge:
|
|
|
38
38
|
Issues related to computers, programming, code, mathematics, science and engineering:
|
|
39
39
|
- Use 4 spaces for code indentation, avoid using tabs.`;
|
|
40
40
|
|
|
41
|
-
const TTS_PROMPT = "As an AI voice assistant, please say the following content in a warm, friendly and professional tone
|
|
41
|
+
const TTS_PROMPT = "As an AI voice assistant, please say the following content in a warm, friendly and professional tone. If the language is English, use an American accent, if it's Traditional Chinese, use Hong Kong Cantonese, if it's Simplified Chinese, use standard Mandarin, for other languages, please speak with a standard, clear accent. Do not interpret the content, only read it out. Here is the content to be read";
|
|
42
42
|
|
|
43
43
|
const STT_PROMPT = 'Please transcribe the audio into clean text. Return only the text content, DO NOT include any additional information or metadata. You may encounter input that contains different languages. Please do your best to transcribe text from all possible languages. Please distinguish between background noise and the main speech content. Do not be disturbed by background noise. Only return the main speech content.';
|
|
44
44
|
|
|
@@ -806,6 +806,7 @@ const handleToolsCall = async (msg, options) => {
|
|
|
806
806
|
const output = JSON.stringify((await f?.func(input)) ?? OK);
|
|
807
807
|
content.push(packMsg(output));
|
|
808
808
|
await resp(f.showRes ? `Output: ${output}` : `Status: OK`);
|
|
809
|
+
log(`Tool: ${name}(${JSON.stringify(input)}): ${output}`);
|
|
809
810
|
} catch (err) {
|
|
810
811
|
const rt = `Failed: ${err.message}`;
|
|
811
812
|
content.push(packMsg(rt, true));
|
|
@@ -990,7 +991,7 @@ const promptGoogle = async (aiId, prompt, options = {}) => {
|
|
|
990
991
|
prompt = ensureString(prompt, { trim: true });
|
|
991
992
|
// M.name === IMAGEN_4_UPSCALE ||
|
|
992
993
|
assertPrompt(prompt);
|
|
993
|
-
M.tts && (prompt = `${options?.prompt || TTS_PROMPT}
|
|
994
|
+
M.tts && (prompt = `${options?.prompt || TTS_PROMPT}:\n\n${prompt}`);
|
|
994
995
|
prompt = trimText(prompt, { limit: M.maxInputTokens });
|
|
995
996
|
if (M?.image) {
|
|
996
997
|
var resp;
|
package/lib/manifest.mjs
CHANGED