tmpa-cli 1.0.18 → 1.0.20
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/bin/index.js +11 -9
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -273,8 +273,7 @@ function listSkills() {
|
|
|
273
273
|
console.log('');
|
|
274
274
|
|
|
275
275
|
const lines = [
|
|
276
|
-
`${C.bold}Perintah Instan Skill:${C.reset}
|
|
277
|
-
``
|
|
276
|
+
`${C.bold}Perintah Instan Skill:${C.reset}`
|
|
278
277
|
];
|
|
279
278
|
|
|
280
279
|
keys.forEach(name => {
|
|
@@ -584,20 +583,23 @@ async function handleChat(prompt, forcedTool = null) {
|
|
|
584
583
|
const data = await response.json();
|
|
585
584
|
|
|
586
585
|
let aiResponse = "";
|
|
587
|
-
|
|
588
|
-
|
|
586
|
+
|
|
587
|
+
// DUKUNGAN UNTUK REASONING MODELS & STANDAR OPENAI/GEMINI
|
|
588
|
+
if (data.choices && data.choices[0] && data.choices[0].message) {
|
|
589
|
+
const msg = data.choices[0].message;
|
|
590
|
+
aiResponse = msg.content || msg.reasoning || msg.reasoning_content || "";
|
|
589
591
|
} else if (data.candidates && data.candidates[0]?.content?.parts[0]?.text) {
|
|
590
592
|
aiResponse = data.candidates[0].content.parts[0].text;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
if (aiResponse) {
|
|
596
|
+
console.log(`\n${C.c1}TMPA CLI (${config.model || 'AI'}) :${C.reset}\n${aiResponse}\n`);
|
|
591
597
|
} else if (data.error) {
|
|
592
598
|
console.log(`\n${C.red}[x] API Error: ${data.error.message || JSON.stringify(data.error)}${C.reset}\n`);
|
|
593
|
-
return startPrompt();
|
|
594
599
|
} else {
|
|
595
|
-
console.log(`\n${C.red}[x] Response: ${JSON.stringify(data)}${C.reset}\n`);
|
|
596
|
-
return startPrompt();
|
|
600
|
+
console.log(`\n${C.red}[x] Response Unrecognized: ${JSON.stringify(data)}${C.reset}\n`);
|
|
597
601
|
}
|
|
598
602
|
|
|
599
|
-
console.log(`\n${C.c1}TMPA CLI (${config.model || 'AI'}) :${C.reset}\n${aiResponse}\n`);
|
|
600
|
-
|
|
601
603
|
} catch (error) {
|
|
602
604
|
console.log(`\n${C.red}[x] Fetch Error: ${error.message}${C.reset}\n`);
|
|
603
605
|
}
|