@lexicallayer/cli 0.1.2 → 0.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.
- package/bin/index.js +43 -3
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -57,8 +57,8 @@ function requestJSON(url, options = {}, data = null) {
|
|
|
57
57
|
|
|
58
58
|
function openBrowser(url) {
|
|
59
59
|
if (process.platform === "win32") {
|
|
60
|
-
//
|
|
61
|
-
exec(`
|
|
60
|
+
// PowerShell Start-Process is rock-solid on modern Windows (opens default browser reliably)
|
|
61
|
+
exec(`powershell.exe -NoProfile -Command "Start-Process '${url}'"`);
|
|
62
62
|
} else if (process.platform === "darwin") {
|
|
63
63
|
exec(`open "${url}"`);
|
|
64
64
|
} else {
|
|
@@ -116,15 +116,55 @@ async function calibrate() {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
async function startChat() {
|
|
120
|
+
const readline = require("readline");
|
|
121
|
+
const rl = readline.createInterface({
|
|
122
|
+
input: process.stdin,
|
|
123
|
+
output: process.stdout
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
log("\x1b[32mKalibre Edilmiş Model Başlatıldı (Rank-16 LoRA + Residual Steering Aktif)!\x1b[0m");
|
|
127
|
+
log("Çıkmak için 'q' veya 'exit' yazabilirsiniz.\n");
|
|
128
|
+
|
|
129
|
+
const promptUser = () => {
|
|
130
|
+
rl.question("\x1b[33mSen: \x1b[0m", async (input) => {
|
|
131
|
+
const q = input.trim();
|
|
132
|
+
if (!q || q === "exit" || q === "q") {
|
|
133
|
+
log("Oturum kapatıldı.");
|
|
134
|
+
rl.close();
|
|
135
|
+
process.exit(0);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
try {
|
|
139
|
+
const res = await requestJSON(`${ENGINE_BASE_URL}/api/user-weights/test`, { method: "POST" }, {
|
|
140
|
+
prompt: q,
|
|
141
|
+
use_user_weights: true
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
console.log(`\n\x1b[36mModel (Kalibre Ağırlıklarla): \x1b[0m${res.output}\n`);
|
|
145
|
+
} catch (err) {
|
|
146
|
+
console.log(`Hata: ${err.message}`);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
promptUser();
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
promptUser();
|
|
154
|
+
}
|
|
155
|
+
|
|
119
156
|
if (command === "calibrate") {
|
|
120
157
|
calibrate();
|
|
158
|
+
} else if (command === "chat") {
|
|
159
|
+
startChat();
|
|
121
160
|
} else if (command === "--version" || command === "-v") {
|
|
122
|
-
console.log("0.1.
|
|
161
|
+
console.log("0.1.4");
|
|
123
162
|
} else {
|
|
124
163
|
console.log(`
|
|
125
164
|
LexicalLayer CLI
|
|
126
165
|
Kullanım:
|
|
127
166
|
lexicallayer calibrate Studio arayüzünü açar ve agent için ağırlık türetir
|
|
167
|
+
lexicallayer chat Kalibre edilmiş ağırlıklarla terminalde doğrudan sohbet et
|
|
128
168
|
lexicallayer --version Versiyon bilgisi
|
|
129
169
|
`);
|
|
130
170
|
}
|