neuralnode 2.2.2__py3-none-any.whl → 2.2.4__py3-none-any.whl
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.
- neuralnode/__init__.py +1 -1
- neuralnode/integrations/openclaw.py +60 -8
- neuralnode/integrations/whatsapp.py +4 -0
- neuralnode/providers/horus.py +13 -1
- {neuralnode-2.2.2.dist-info → neuralnode-2.2.4.dist-info}/METADATA +1 -1
- {neuralnode-2.2.2.dist-info → neuralnode-2.2.4.dist-info}/RECORD +8 -8
- {neuralnode-2.2.2.dist-info → neuralnode-2.2.4.dist-info}/WHEEL +0 -0
- {neuralnode-2.2.2.dist-info → neuralnode-2.2.4.dist-info}/licenses/LICENSE +0 -0
neuralnode/__init__.py
CHANGED
|
@@ -13,6 +13,8 @@ import socket
|
|
|
13
13
|
import logging
|
|
14
14
|
import threading
|
|
15
15
|
import subprocess
|
|
16
|
+
import shutil
|
|
17
|
+
import json
|
|
16
18
|
from pathlib import Path
|
|
17
19
|
from typing import Any, Dict, List, Optional, Union, Generator
|
|
18
20
|
|
|
@@ -348,6 +350,8 @@ class OpenClawManager:
|
|
|
348
350
|
|
|
349
351
|
# Step 1: Clone OpenClaw repository if not present
|
|
350
352
|
if not repo_dir.exists():
|
|
353
|
+
if shutil.which("git") is None:
|
|
354
|
+
raise RuntimeError("git is required to download OpenClaw. Install git and retry.")
|
|
351
355
|
logger.info(f"Cloning OpenClaw repository to {repo_dir}...")
|
|
352
356
|
try:
|
|
353
357
|
subprocess.run(
|
|
@@ -363,16 +367,45 @@ class OpenClawManager:
|
|
|
363
367
|
# Check npm package manager
|
|
364
368
|
try:
|
|
365
369
|
# We check if pnpm or npm is available
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
370
|
+
if shutil.which("pnpm"):
|
|
371
|
+
pm_cmd = ["pnpm", "install"]
|
|
372
|
+
elif shutil.which("npm"):
|
|
373
|
+
pm_cmd = ["npm", "install"]
|
|
374
|
+
else:
|
|
375
|
+
raise RuntimeError("npm or pnpm is required to install OpenClaw dependencies. Install Node.js and retry.")
|
|
376
|
+
install_result = subprocess.run(
|
|
369
377
|
pm_cmd,
|
|
370
378
|
cwd=str(repo_dir),
|
|
371
379
|
check=True,
|
|
372
380
|
capture_output=True
|
|
373
381
|
)
|
|
374
382
|
except subprocess.CalledProcessError as e:
|
|
375
|
-
|
|
383
|
+
output = (e.stdout or b"").decode(errors="replace") + (e.stderr or b"").decode(errors="replace")
|
|
384
|
+
raise RuntimeError(f"Failed to install node dependencies: {output.strip()}")
|
|
385
|
+
|
|
386
|
+
package_json_path = repo_dir / "package.json"
|
|
387
|
+
dist_entry_exists = (repo_dir / "dist" / "entry.mjs").exists() or (repo_dir / "dist" / "entry.js").exists()
|
|
388
|
+
if package_json_path.exists() and not dist_entry_exists:
|
|
389
|
+
try:
|
|
390
|
+
with open(package_json_path, "r", encoding="utf-8") as f:
|
|
391
|
+
package_json = json.load(f)
|
|
392
|
+
scripts = package_json.get("scripts", {})
|
|
393
|
+
except Exception:
|
|
394
|
+
scripts = {}
|
|
395
|
+
|
|
396
|
+
if "build" in scripts:
|
|
397
|
+
build_cmd = [pm_cmd[0], "run", "build"]
|
|
398
|
+
logger.info(f"Building OpenClaw via: {' '.join(build_cmd)}")
|
|
399
|
+
try:
|
|
400
|
+
subprocess.run(
|
|
401
|
+
build_cmd,
|
|
402
|
+
cwd=str(repo_dir),
|
|
403
|
+
check=True,
|
|
404
|
+
capture_output=True,
|
|
405
|
+
)
|
|
406
|
+
except subprocess.CalledProcessError as e:
|
|
407
|
+
output = (e.stdout or b"").decode(errors="replace") + (e.stderr or b"").decode(errors="replace")
|
|
408
|
+
raise RuntimeError(f"Failed to build OpenClaw source tree: {output.strip()}")
|
|
376
409
|
|
|
377
410
|
# Step 3: Write configuration pointing to NeuralNode API server
|
|
378
411
|
self.configure()
|
|
@@ -427,18 +460,34 @@ class OpenClawManager:
|
|
|
427
460
|
|
|
428
461
|
# Find starting command
|
|
429
462
|
# Use node openclaw.mjs gateway or npm run dev/start
|
|
430
|
-
startup_cmd = ["node", "openclaw.mjs", "gateway"]
|
|
463
|
+
startup_cmd = ["node", "openclaw.mjs", "gateway", "--allow-unconfigured"]
|
|
431
464
|
|
|
432
465
|
# Fallback to dev command if js build not present
|
|
433
466
|
if not (repo_dir / "openclaw.mjs").exists():
|
|
434
467
|
# Check pnpm vs npm run dev
|
|
435
|
-
|
|
436
|
-
|
|
468
|
+
if shutil.which("pnpm"):
|
|
469
|
+
startup_cmd = ["pnpm", "run", "dev"]
|
|
470
|
+
elif shutil.which("npm"):
|
|
471
|
+
startup_cmd = ["npm", "run", "dev"]
|
|
472
|
+
else:
|
|
473
|
+
raise RuntimeError("npm or pnpm is required to start OpenClaw. Install Node.js and retry.")
|
|
437
474
|
|
|
438
475
|
logger.info(f"Starting OpenClaw Gateway via: {' '.join(startup_cmd)}")
|
|
476
|
+
process_env = os.environ.copy()
|
|
477
|
+
process_env.update(
|
|
478
|
+
{
|
|
479
|
+
"PORT": str(self.gateway_port),
|
|
480
|
+
"GATEWAY_HOST": self.gateway_host,
|
|
481
|
+
"GATEWAY_TOKEN": self.api_key or "neuralnode-secret-key",
|
|
482
|
+
"OPENAI_BASE_URL": f"http://127.0.0.1:{self.api_server_port}/v1",
|
|
483
|
+
"OPENAI_API_KEY": "neuralnode-secret-key",
|
|
484
|
+
"OPENAI_MODEL": getattr(self.node, "model", "neuralnode-model") or "neuralnode-model",
|
|
485
|
+
}
|
|
486
|
+
)
|
|
439
487
|
self.process = subprocess.Popen(
|
|
440
488
|
startup_cmd,
|
|
441
489
|
cwd=str(repo_dir),
|
|
490
|
+
env=process_env,
|
|
442
491
|
stdout=subprocess.PIPE,
|
|
443
492
|
stderr=subprocess.PIPE,
|
|
444
493
|
text=True
|
|
@@ -457,7 +506,10 @@ class OpenClawManager:
|
|
|
457
506
|
# Check process state
|
|
458
507
|
if self.process.poll() is not None:
|
|
459
508
|
stdout, stderr = self.process.communicate()
|
|
460
|
-
raise RuntimeError(
|
|
509
|
+
raise RuntimeError(
|
|
510
|
+
f"OpenClaw process exited immediately with code {self.process.returncode}. "
|
|
511
|
+
f"Output: {(stdout or '') + (stderr or '')}"
|
|
512
|
+
)
|
|
461
513
|
|
|
462
514
|
logger.warning("OpenClaw Gateway start timed out, but process is still running.")
|
|
463
515
|
|
|
@@ -12,6 +12,7 @@ import time
|
|
|
12
12
|
import requests
|
|
13
13
|
import subprocess
|
|
14
14
|
import threading
|
|
15
|
+
import shutil
|
|
15
16
|
from pathlib import Path
|
|
16
17
|
from typing import Optional, Dict, Any, List, Union
|
|
17
18
|
from dataclasses import dataclass, field
|
|
@@ -209,6 +210,9 @@ class EvolutionWhatsAppBot:
|
|
|
209
210
|
|
|
210
211
|
def start_gateway(self, port: int = 8080, wait_seconds: int = 15):
|
|
211
212
|
"""Start the rebranded local Node.js Evolution API gateway."""
|
|
213
|
+
if shutil.which("npm") is None:
|
|
214
|
+
raise RuntimeError("npm is required to start the WhatsApp gateway. Install Node.js and retry.")
|
|
215
|
+
|
|
212
216
|
gateway_dir = Path(__file__).parent / "whatsapp" / "evolution-api"
|
|
213
217
|
if not gateway_dir.exists():
|
|
214
218
|
raise FileNotFoundError(
|
neuralnode/providers/horus.py
CHANGED
|
@@ -1195,7 +1195,19 @@ class HorusProvider(BaseLLMProvider):
|
|
|
1195
1195
|
except Exception:
|
|
1196
1196
|
cpu_kwargs = dict(base_kwargs)
|
|
1197
1197
|
cpu_kwargs["n_gpu_layers"] = 0
|
|
1198
|
-
|
|
1198
|
+
try:
|
|
1199
|
+
self.model = Llama(**cpu_kwargs)
|
|
1200
|
+
except Exception as exc:
|
|
1201
|
+
raise RuntimeError(
|
|
1202
|
+
"Failed to load Horus GGUF with llama.cpp.\n"
|
|
1203
|
+
f"Model file: {model_path}\n"
|
|
1204
|
+
f"Runtime context window: {llama_kwargs.get('n_ctx')}\n"
|
|
1205
|
+
"The file was downloaded, but llama.cpp could not initialize it. "
|
|
1206
|
+
"This usually means the GGUF file is incompatible with the installed "
|
|
1207
|
+
"llama-cpp-python build, the GGUF conversion is invalid, or the file "
|
|
1208
|
+
"requires a newer llama.cpp backend. Try upgrading llama-cpp-python, "
|
|
1209
|
+
"using a different quantization, or loading the Transformers model variant."
|
|
1210
|
+
) from exc
|
|
1199
1211
|
return self
|
|
1200
1212
|
|
|
1201
1213
|
def _resolve_gguf_turboquant_kwargs(self) -> Dict[str, Any]:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: neuralnode
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.4
|
|
4
4
|
Summary: Comprehensive AI Framework with 50+ LLM Providers, Advanced Agents, Chains, Memory, RAG, and 100+ Tools
|
|
5
5
|
Project-URL: Homepage, https://assem.cloud/
|
|
6
6
|
Project-URL: Documentation, https://neuralnode.readthedocs.io
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
neuralnode/__init__.py,sha256=
|
|
1
|
+
neuralnode/__init__.py,sha256=l_ziDzLMzafX4x93mwwhDGorLr2Qzx0m1zSDPrPLn78,25360
|
|
2
2
|
neuralnode/replica.py,sha256=QlvR3tfLt0Y7XSsUsB5wiKI_EO7oUFM-8XH0wsrrvls,7995
|
|
3
3
|
neuralnode/thinking.py,sha256=iBfCfBrLkD6AaHf2WaWfmzhFeV6zcXEZDjzLxmYt4VY,12614
|
|
4
4
|
neuralnode/turboquant.py,sha256=bRKsUbniJrtxvQ8mQqlSK-N6M2PltJJxd5H4lBW7kDc,18340
|
|
@@ -10,10 +10,10 @@ neuralnode/core/openai_blocker.py,sha256=NyMH5aXBF5toSfc_eObr3L7qHszWiOoCwDVrbOn
|
|
|
10
10
|
neuralnode/diagnostics/__init__.py,sha256=22U_NVNN3Y9FhheUXxwDLx1LGELxiN75ehHrH0t_QkM,25622
|
|
11
11
|
neuralnode/integrations/__init__.py,sha256=lB3CU5Inw5JQYiIMHzZgJtygxtsaQp_5_AefnU1lQh0,711
|
|
12
12
|
neuralnode/integrations/discord.py,sha256=_xneToa06BFcvvaXWjG4G3w6iRtCJ_dwtfFz7pjtBZA,6465
|
|
13
|
-
neuralnode/integrations/openclaw.py,sha256=
|
|
13
|
+
neuralnode/integrations/openclaw.py,sha256=qmI-dda-28t7wBwT1RmjsQXyjU36iCxkjHTDGU5CCLA,20651
|
|
14
14
|
neuralnode/integrations/slack.py,sha256=phgr4_fS2uMFkY7FeDOuzOagY2wQxhNDlqHK2KbtLGw,6259
|
|
15
15
|
neuralnode/integrations/telegram.py,sha256=re9Off7zT_Rxm7yR4FOYN3JrjYqth4UQJ3O5AIJXKMU,26632
|
|
16
|
-
neuralnode/integrations/whatsapp.py,sha256=
|
|
16
|
+
neuralnode/integrations/whatsapp.py,sha256=dVDFA-IhkE6AGBEvIViIrL2rY-D0OoPDfgQM7Ft_B3U,14670
|
|
17
17
|
neuralnode/integrations/whatsapp/evolution_rebrander.py,sha256=gJz17UKNdZgm17Rq9sYkWLEJyMraHjZPupeadoAudzQ,2167
|
|
18
18
|
neuralnode/integrations/whatsapp/evolution-api/.dockerignore,sha256=13PLq0nO_oGE6lbH3NL1xqLQe1TLFSnuDqlrdXKGZlo,62
|
|
19
19
|
neuralnode/integrations/whatsapp/evolution-api/.env.example,sha256=kK5glghFWjbbeZYc4Y7Md-BTFg7QdFkPDnTFrbqzQu0,13777
|
|
@@ -372,7 +372,7 @@ neuralnode/prompts/__init__.py,sha256=GVCynrijvJ6zXWmg8knn7AkxGM0PFHwU7rEOUAdlJr
|
|
|
372
372
|
neuralnode/providers/__init__.py,sha256=e0bI1rFwIl-olmVKrZ5wyzpWl9HputNf8FrBBS9gM1k,9422
|
|
373
373
|
neuralnode/providers/base.py,sha256=kkNDOuij2E4TM2lsbJKoRwUDd2n6u0C67Qg0hy449iE,12668
|
|
374
374
|
neuralnode/providers/embeddings.py,sha256=P2AO36a0j6kd2ldN0CpVJZ0q0hDkKlUlTlf-_8x3Iz4,37551
|
|
375
|
-
neuralnode/providers/horus.py,sha256=
|
|
375
|
+
neuralnode/providers/horus.py,sha256=ObMOo6L6KxM2NJeNn1nQP63VqHGkn0Dn28JvvYyedqo,99652
|
|
376
376
|
neuralnode/providers/local_providers.py,sha256=5c5E7kLhk-YTEp9EXNX3-BIiacvWPgxMRZye9A6htNA,61417
|
|
377
377
|
neuralnode/providers/text_generation.py,sha256=FMTJ6aDe78ODvnZ7WEFRfqeNiij0sBR0pRRjU7rxxag,36513
|
|
378
378
|
neuralnode/providers/universal_local.py,sha256=DNqICw0G99eR5BnXjYCeEvjUhnoSS22D4HnLs0x9Y70,19541
|
|
@@ -407,7 +407,7 @@ neuralnode/utils/logger.py,sha256=vh0K2JYqqgwdtyYjtNbPK9QW6ZhOEqpp_NOHghl94e8,86
|
|
|
407
407
|
neuralnode/utils/metrics.py,sha256=z5JHDV-I5foOiY8j7vQE-GYyTSM5p04_EcWBP7qJlY4,7389
|
|
408
408
|
neuralnode/vectorstores/__init__.py,sha256=vCQ-L7jbhTVEQPrLehpzhm6K3SQIprUicF1X7BOF8w8,28172
|
|
409
409
|
neuralnode/vision/__init__.py,sha256=MepTSuvOBXjGJK1i2zxZLSGlBm-WOV1ylu4Xa-pAObw,5756
|
|
410
|
-
neuralnode-2.2.
|
|
411
|
-
neuralnode-2.2.
|
|
412
|
-
neuralnode-2.2.
|
|
413
|
-
neuralnode-2.2.
|
|
410
|
+
neuralnode-2.2.4.dist-info/METADATA,sha256=pqift6g64Q3ZRUOPlviWPfiKHZ_q7RTYKRKraq6ygY8,14175
|
|
411
|
+
neuralnode-2.2.4.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
412
|
+
neuralnode-2.2.4.dist-info/licenses/LICENSE,sha256=Pwd03UGSoleqoehkTRuTj6FwLzMknjSiVDuLOD2sfts,1067
|
|
413
|
+
neuralnode-2.2.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|