mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
API: Fix /story
This commit is contained in:
10
aiserver.py
10
aiserver.py
@@ -8817,8 +8817,14 @@ def get_story():
|
||||
chunks = []
|
||||
if koboldai_vars.gamestarted:
|
||||
chunks.append({"num": 0, "text": koboldai_vars.prompt})
|
||||
for num, action in koboldai_vars.actions.items():
|
||||
chunks.append({"num": num + 1, "text": action})
|
||||
|
||||
last_action_num = list(koboldai_vars.actions.actions.keys())[-1]
|
||||
for num, action in koboldai_vars.actions.actions.items():
|
||||
text = action["Selected Text"]
|
||||
# The last action seems to always be empty
|
||||
if not text and num == last_action_num:
|
||||
continue
|
||||
chunks.append({"num": num + 1, "text": text})
|
||||
return {"results": chunks}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user