mirror of
https://github.com/ParisNeo/lollms.git
synced 2025-04-08 03:14:13 +00:00
upgraded
This commit is contained in:
parent
6708243a62
commit
c86dbe7e59
@ -159,7 +159,7 @@ async def serve_outputs(path: str):
|
||||
Returns:
|
||||
FileResponse: The file response containing the requested output file.
|
||||
"""
|
||||
root_dir = lollmsElfServer.lollms_paths.personal_path / "outputs"
|
||||
root_dir = lollmsElfServer.lollms_paths.personal_outputs_path
|
||||
root_dir.mkdir(exist_ok=True, parents=True)
|
||||
file_path = root_dir / path
|
||||
|
||||
|
@ -8,6 +8,8 @@ description:
|
||||
|
||||
"""
|
||||
from fastapi import APIRouter, Request
|
||||
from fastapi import HTTPException
|
||||
from fastapi.responses import FileResponse
|
||||
from pydantic import BaseModel
|
||||
import pkg_resources
|
||||
from lollms.server.elf_server import LOLLMSElfServer
|
||||
@ -482,7 +484,7 @@ def set_active_personality_settings(data):
|
||||
|
||||
|
||||
# ------------------------------------------- Interaction with personas ------------------------------------------------
|
||||
@router.get("/post_to_personality")
|
||||
@router.post("/post_to_personality")
|
||||
def post_to_personality(data):
|
||||
"""Post data to a personality"""
|
||||
if hasattr(lollmsElfServer.personality.processor,'handle_request'):
|
||||
@ -491,7 +493,7 @@ def post_to_personality(data):
|
||||
return {}
|
||||
|
||||
|
||||
@router.get("/post_to_personality")
|
||||
@router.get("/get_current_personality_files_list")
|
||||
def get_current_personality_files_list():
|
||||
if lollmsElfServer.personality is None:
|
||||
return {"state":False, "error":"No personality selected"}
|
||||
|
@ -54,8 +54,10 @@ def run_async(func):
|
||||
asyncio.create_task(func())
|
||||
else:
|
||||
# We're not in a running event loop, so we need to create one and run the function in it
|
||||
asyncio.run(func())
|
||||
|
||||
try:
|
||||
asyncio.run(func())
|
||||
except:
|
||||
func()
|
||||
def terminate_thread(thread):
|
||||
if thread:
|
||||
if not thread.is_alive():
|
||||
|
Loading…
x
Reference in New Issue
Block a user