mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-06-15 05:48:07 +00:00
enhanced ui
This commit is contained in:
@ -11,9 +11,11 @@ from ascii_colors import get_trace_exception, trace_exception
|
||||
import time
|
||||
import subprocess
|
||||
import json
|
||||
from lollms.client_session import Client
|
||||
|
||||
|
||||
lollmsElfServer:LOLLMSWebUI = LOLLMSWebUI.get_instance()
|
||||
def execute_bash(code, discussion_id, message_id):
|
||||
def execute_bash(code, client:Client):
|
||||
def spawn_process(code):
|
||||
"""Executes Python code and returns the output as JSON."""
|
||||
|
||||
@ -21,7 +23,7 @@ def execute_bash(code, discussion_id, message_id):
|
||||
start_time = time.time()
|
||||
|
||||
# Create a temporary file.
|
||||
root_folder = lollmsElfServer.lollms_paths.personal_outputs_path/"discussions"/f"d_{discussion_id}"
|
||||
root_folder = client.discussion.discussion_folder
|
||||
root_folder.mkdir(parents=True,exist_ok=True)
|
||||
try:
|
||||
# Execute the Python code in a temporary file.
|
||||
|
Reference in New Issue
Block a user