Skip to content

Commit 2ecb675

Browse files
Allow the prompt request to specify the prompt ID.
This makes it easier to write asynchronous clients that submit requests, because they can store the task immediately.
1 parent d8e5662 commit 2ecb675

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ async def post_prompt(request):
652652
if "client_id" in json_data:
653653
extra_data["client_id"] = json_data["client_id"]
654654
if valid[0]:
655-
prompt_id = str(uuid.uuid4())
655+
prompt_id = json_data.get("prompt_id", str(uuid.uuid4()))
656656
outputs_to_execute = valid[2]
657657
self.prompt_queue.put((number, prompt_id, prompt, extra_data, outputs_to_execute))
658658
response = {"prompt_id": prompt_id, "number": number, "node_errors": valid[3]}

0 commit comments

Comments
 (0)