mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-24 06:46:40 +00:00
fix
This commit is contained in:
parent
be44717d9e
commit
a4c1bed01e
@ -489,8 +489,8 @@ def get_personality_settings(data:PersonalityMountingInfos):
|
||||
category = data.category
|
||||
name = data.folder
|
||||
|
||||
if category.startswith("personal"):
|
||||
personality_folder = lollmsElfServer.lollms_paths.personal_personalities_path/f"{category}"/f"{name}"
|
||||
if category == "custom_personalities":
|
||||
personality_folder = lollmsElfServer.lollms_paths.personal_personalities_path/f"{name}"
|
||||
else:
|
||||
personality_folder = lollmsElfServer.lollms_paths.personalities_zoo_path/f"{category}"/f"{name}"
|
||||
|
||||
@ -555,6 +555,30 @@ async def set_active_personality_settings(request: Request):
|
||||
return {"status":False,"error":str(ex)}
|
||||
|
||||
|
||||
class PersonalityInfos(BaseModel):
|
||||
category:str
|
||||
name:str
|
||||
language:Optional[str] = None
|
||||
|
||||
@router.post("/copy_to_custom_personas")
|
||||
async def copy_to_custom_personas(data: PersonalityInfos):
|
||||
"""
|
||||
Copies the personality to custom personas so that you can modify it.
|
||||
|
||||
"""
|
||||
import shutil
|
||||
category = data.category
|
||||
name = data.name
|
||||
|
||||
if category=="custom_personalities":
|
||||
lollmsElfServer.InfoMessage("This persona is already in custom personalities folder")
|
||||
return {"status":False}
|
||||
else:
|
||||
personality_folder = lollmsElfServer.lollms_paths.personalities_zoo_path/f"{category}"/f"{name}"
|
||||
destination_folder = lollmsElfServer.lollms_paths.personal_personalities_path
|
||||
shutil.copy(personality_folder, destination_folder)
|
||||
return {"status":True}
|
||||
|
||||
# ------------------------------------------- Interaction with personas ------------------------------------------------
|
||||
@router.post("/post_to_personality")
|
||||
async def post_to_personality(request: Request):
|
||||
|
Loading…
Reference in New Issue
Block a user