mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-24 06:46:40 +00:00
sync
This commit is contained in:
parent
78f736ccec
commit
3a066c8b70
@ -46,6 +46,12 @@ from lollms.com import LoLLMsCom
|
|||||||
from lollms.helpers import trace_exception
|
from lollms.helpers import trace_exception
|
||||||
from lollms.utilities import PackageManager
|
from lollms.utilities import PackageManager
|
||||||
|
|
||||||
|
import pipmaster as pm
|
||||||
|
|
||||||
|
if not pm.is_installed("inspect"):
|
||||||
|
pm.install("inspect")
|
||||||
|
import inspect
|
||||||
|
|
||||||
from lollms.code_parser import compress_js, compress_python, compress_html
|
from lollms.code_parser import compress_js, compress_python, compress_html
|
||||||
|
|
||||||
|
|
||||||
@ -2057,11 +2063,18 @@ class StateMachine:
|
|||||||
|
|
||||||
for cmd, func in commands.items():
|
for cmd, func in commands.items():
|
||||||
if cmd == command[0:len(cmd)]:
|
if cmd == command[0:len(cmd)]:
|
||||||
try:
|
# Get the number of parameters the function expects
|
||||||
func(command, full_context, callback, context_state, client)
|
param_count = len(inspect.signature(func).parameters)
|
||||||
except:# retrocompatibility
|
|
||||||
func(command, full_context, client)
|
if param_count == 3:
|
||||||
return
|
# Old version of the function
|
||||||
|
return func(command, full_context, client)
|
||||||
|
elif param_count == 5:
|
||||||
|
# New version of the function
|
||||||
|
return func(command, full_context, callback, context_state, client)
|
||||||
|
else:
|
||||||
|
raise ValueError(f"Unexpected number of parameters for function {func.__name__}. Expected 3 or 5, got {param_count}")
|
||||||
|
|
||||||
|
|
||||||
default_func = current_state.get("default")
|
default_func = current_state.get("default")
|
||||||
if default_func is not None:
|
if default_func is not None:
|
||||||
|
@ -20,7 +20,7 @@ import pipmaster as pm
|
|||||||
if version.parse(str(pm.get_installed_version("numpy"))) > version.parse(str("1.26.9")):
|
if version.parse(str(pm.get_installed_version("numpy"))) > version.parse(str("1.26.9")):
|
||||||
pm.install_version("numpy", "1.26.4")
|
pm.install_version("numpy", "1.26.4")
|
||||||
|
|
||||||
if pm.is_installed("pydub"):
|
if not pm.is_installed("pydub"):
|
||||||
pm.install("pydub")
|
pm.install("pydub")
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
@ -22,3 +22,5 @@ python-socketio[asyncio_client]
|
|||||||
|
|
||||||
freedom-search
|
freedom-search
|
||||||
scrapemaster
|
scrapemaster
|
||||||
|
|
||||||
|
inspect
|
Loading…
Reference in New Issue
Block a user