add offset param (#9977)

This commit is contained in:
Christian Byrne
2025-09-22 14:12:32 -07:00
committed by GitHub
parent 1fee8827cb
commit e3206351b0
2 changed files with 112 additions and 2 deletions

View File

@@ -645,7 +645,14 @@ class PromptServer():
max_items = request.rel_url.query.get("max_items", None)
if max_items is not None:
max_items = int(max_items)
return web.json_response(self.prompt_queue.get_history(max_items=max_items))
offset = request.rel_url.query.get("offset", None)
if offset is not None:
offset = int(offset)
else:
offset = -1
return web.json_response(self.prompt_queue.get_history(max_items=max_items, offset=offset))
@routes.get("/history/{prompt_id}")
async def get_history_prompt_id(request):