@tiens.nguyen/gonext-local-worker 1.0.23 → 1.0.25
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/gonext-local-worker.mjs +12 -0
- package/package.json +1 -1
package/gonext-local-worker.mjs
CHANGED
|
@@ -265,6 +265,8 @@ async function runChatJob(job) {
|
|
|
265
265
|
await flushTail;
|
|
266
266
|
await flushChunks();
|
|
267
267
|
|
|
268
|
+
logModelResponseToWorker(jobId, payload.modelId, fullText);
|
|
269
|
+
|
|
268
270
|
const totalTimeSeconds = (Date.now() - start) / 1000;
|
|
269
271
|
await workerFetch(`/api/worker/jobs/${jobId}`, {
|
|
270
272
|
method: "PATCH",
|
|
@@ -314,6 +316,16 @@ function sourceLabelFromBase(base) {
|
|
|
314
316
|
}
|
|
315
317
|
}
|
|
316
318
|
|
|
319
|
+
/** Log assistant text to stdout; cap size so huge replies do not flood the terminal. */
|
|
320
|
+
function logModelResponseToWorker(jobId, modelId, text) {
|
|
321
|
+
const max = 12000;
|
|
322
|
+
const n = text.length;
|
|
323
|
+
const body = n <= max ? text : `${text.slice(0, max)}\n… [log truncated: ${n - max} more chars]`;
|
|
324
|
+
console.log(
|
|
325
|
+
`[gonext-worker] model reply job=${jobId} model=${modelId} chars=${n}:\n${body}`
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
|
|
317
329
|
async function checkOllamaTags(base) {
|
|
318
330
|
const endpoint = `${base}/api/tags`;
|
|
319
331
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiens.nguyen/gonext-local-worker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.25",
|
|
4
4
|
"description": "Polls GoNext cloud API for async local LLM jobs and runs them against Ollama/OpenAI-compatible servers on this Mac",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|