mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-02-02 10:36:47 +01:00
Adds /config/soft_prompts_list API endpoint
This commit is contained in:
parent
39944c4258
commit
c1bf91f86c
26
aiserver.py
26
aiserver.py
@ -9593,6 +9593,32 @@ def get_config_soft_prompt():
|
|||||||
"""
|
"""
|
||||||
return {"value": vars.spfilename.strip()}
|
return {"value": vars.spfilename.strip()}
|
||||||
|
|
||||||
|
class SoftPromptsListSchema(KoboldSchema):
|
||||||
|
values: List[SoftPromptSettingSchema] = fields.List(fields.Nested(SoftPromptSettingSchema), required=True, metadata={"description": "Array of available softprompts."})
|
||||||
|
|
||||||
|
@api_v1.get("/config/soft_prompts_list")
|
||||||
|
@api_schema_wrap
|
||||||
|
def get_config_soft_prompts_list():
|
||||||
|
"""---
|
||||||
|
get:
|
||||||
|
summary: Retrieve all available softprompt filenames
|
||||||
|
tags:
|
||||||
|
- config
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: Successful request
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema: SoftPromptsListSchema
|
||||||
|
example:
|
||||||
|
values: []
|
||||||
|
"""
|
||||||
|
splist = []
|
||||||
|
for sp in fileops.getspfiles(vars.modeldim):
|
||||||
|
|
||||||
|
splist.append({"value":sp["filename"]})
|
||||||
|
return {"values": splist}
|
||||||
|
|
||||||
@api_v1.put("/config/soft_prompt")
|
@api_v1.put("/config/soft_prompt")
|
||||||
@api_schema_wrap
|
@api_schema_wrap
|
||||||
def put_config_soft_prompt(body: SoftPromptSettingSchema):
|
def put_config_soft_prompt(body: SoftPromptSettingSchema):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user