@tiens.nguyen/gonext-local-worker 1.0.55 → 1.0.56
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 +1 -1
- package/gonext_agent_chat.py +13 -8
- package/package.json +1 -1
package/gonext-local-worker.mjs
CHANGED
|
@@ -1237,7 +1237,7 @@ async function runAgentChatJob(job) {
|
|
|
1237
1237
|
agentApiKey: payload?.agentApiKey ?? "",
|
|
1238
1238
|
agentModelId: payload?.agentModelId ?? "",
|
|
1239
1239
|
tools: payload?.tools ?? ["http_request"],
|
|
1240
|
-
maxSteps: payload?.maxSteps ??
|
|
1240
|
+
maxSteps: payload?.maxSteps ?? 5,
|
|
1241
1241
|
});
|
|
1242
1242
|
const timeoutMs = 300_000; // 5 min max for an agent run
|
|
1243
1243
|
|
package/gonext_agent_chat.py
CHANGED
|
@@ -98,9 +98,11 @@ def _summarise_step(step_log):
|
|
|
98
98
|
|
|
99
99
|
if observations:
|
|
100
100
|
obs = str(observations).strip()
|
|
101
|
-
#
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
# smolagents prefixes output with "Execution logs:" — skip that header line
|
|
102
|
+
# and show the first line of actual content.
|
|
103
|
+
lines = [l for l in obs.splitlines() if l.strip() and l.strip() != "Execution logs:"]
|
|
104
|
+
if lines:
|
|
105
|
+
parts.append(f"→ {lines[0][:200]}")
|
|
104
106
|
|
|
105
107
|
if error:
|
|
106
108
|
err = str(error)
|
|
@@ -124,7 +126,7 @@ def run_agent_chat(cfg):
|
|
|
124
126
|
agent_base_url = cfg.get("agentBaseURL") or ""
|
|
125
127
|
agent_api_key = cfg.get("agentApiKey") or "local"
|
|
126
128
|
agent_model_id = cfg.get("agentModelId") or ""
|
|
127
|
-
max_steps = int(cfg.get("maxSteps") or
|
|
129
|
+
max_steps = int(cfg.get("maxSteps") or 5)
|
|
128
130
|
|
|
129
131
|
_log(f"start model={agent_model_id!r} base={agent_base_url!r} maxSteps={max_steps}")
|
|
130
132
|
|
|
@@ -146,12 +148,15 @@ def run_agent_chat(cfg):
|
|
|
146
148
|
if context_lines:
|
|
147
149
|
task_text = "\n".join(context_lines) + "\n\nNow answer: " + task_text
|
|
148
150
|
|
|
149
|
-
# Prepend explicit tool instructions so small models
|
|
150
|
-
#
|
|
151
|
+
# Prepend explicit tool instructions so small models use http_request correctly
|
|
152
|
+
# and always terminate with final_answer() rather than looping forever.
|
|
151
153
|
tool_hint = (
|
|
152
154
|
"You have ONE built-in function: `http_request(method, url, headers='', body='')`. "
|
|
153
|
-
"
|
|
154
|
-
"
|
|
155
|
+
"Do NOT import requests, urllib, or any library — call http_request() directly.\n"
|
|
156
|
+
"When you have the answer, ALWAYS end with `final_answer(your_answer)` — this stops the agent.\n"
|
|
157
|
+
"Example:\n"
|
|
158
|
+
"result = http_request(method='GET', url='https://example.com')\n"
|
|
159
|
+
"final_answer(result)\n\n"
|
|
155
160
|
)
|
|
156
161
|
task_with_hint = tool_hint + "Task: " + task_text
|
|
157
162
|
_log(f"task={task_text[:120]!r}")
|
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.56",
|
|
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",
|