From c54f17202169a2efe08cd236ddbf7555c305fadb Mon Sep 17 00:00:00 2001 From: Diwank Singh Tomer Date: Wed, 4 Sep 2024 19:46:30 -0400 Subject: [PATCH] feat: Add max-value of 100 to parallelism Signed-off-by: Diwank Singh Tomer --- agents-api/agents_api/autogen/Tasks.py | 4 ++-- agents-api/tests/test_execution_workflow.py | 1 + sdks/ts/src/api/schemas/$Tasks_CreateTaskRequest.ts | 1 + sdks/ts/src/api/schemas/$Tasks_PatchTaskRequest.ts | 1 + sdks/ts/src/api/schemas/$Tasks_Task.ts | 1 + sdks/ts/src/api/schemas/$Tasks_UpdateTaskRequest.ts | 1 + 6 files changed, 7 insertions(+), 2 deletions(-) diff --git a/agents-api/agents_api/autogen/Tasks.py b/agents-api/agents_api/autogen/Tasks.py index 8c8a22dbb..c1e69d492 100644 --- a/agents-api/agents_api/autogen/Tasks.py +++ b/agents-api/agents_api/autogen/Tasks.py @@ -350,7 +350,7 @@ class Main(BaseModel): """ The initial value of the reduce expression """ - parallelism: Annotated[int | None, Field(None, ge=1)] + parallelism: Annotated[int | None, Field(None, ge=1, le=100)] """ Whether to run the reduce expression in parallel and how many items to run in each batch """ @@ -391,7 +391,7 @@ class MainModel(BaseModel): """ The initial value of the reduce expression """ - parallelism: Annotated[int | None, Field(None, ge=1)] + parallelism: Annotated[int | None, Field(None, ge=1, le=100)] """ Whether to run the reduce expression in parallel and how many items to run in each batch """ diff --git a/agents-api/tests/test_execution_workflow.py b/agents-api/tests/test_execution_workflow.py index 9517736d3..82c4e3814 100644 --- a/agents-api/tests/test_execution_workflow.py +++ b/agents-api/tests/test_execution_workflow.py @@ -700,6 +700,7 @@ async def _( for p in [1, 3, 5]: + @test(f"workflow: map reduce step parallel (parallelism={p})") async def _( client=cozo_client, diff --git a/sdks/ts/src/api/schemas/$Tasks_CreateTaskRequest.ts b/sdks/ts/src/api/schemas/$Tasks_CreateTaskRequest.ts index 0cbdabf41..305335b5f 100644 --- a/sdks/ts/src/api/schemas/$Tasks_CreateTaskRequest.ts +++ b/sdks/ts/src/api/schemas/$Tasks_CreateTaskRequest.ts @@ -139,6 +139,7 @@ export const $Tasks_CreateTaskRequest = { type: "number", description: `Whether to run the reduce expression in parallel and how many items to run in each batch`, format: "uint16", + maximum: 100, minimum: 1, }, }, diff --git a/sdks/ts/src/api/schemas/$Tasks_PatchTaskRequest.ts b/sdks/ts/src/api/schemas/$Tasks_PatchTaskRequest.ts index 3bc182d80..200efb0e5 100644 --- a/sdks/ts/src/api/schemas/$Tasks_PatchTaskRequest.ts +++ b/sdks/ts/src/api/schemas/$Tasks_PatchTaskRequest.ts @@ -133,6 +133,7 @@ export const $Tasks_PatchTaskRequest = { type: "number", description: `Whether to run the reduce expression in parallel and how many items to run in each batch`, format: "uint16", + maximum: 100, minimum: 1, }, }, diff --git a/sdks/ts/src/api/schemas/$Tasks_Task.ts b/sdks/ts/src/api/schemas/$Tasks_Task.ts index 35cb45e9d..ba3e63928 100644 --- a/sdks/ts/src/api/schemas/$Tasks_Task.ts +++ b/sdks/ts/src/api/schemas/$Tasks_Task.ts @@ -139,6 +139,7 @@ export const $Tasks_Task = { type: "number", description: `Whether to run the reduce expression in parallel and how many items to run in each batch`, format: "uint16", + maximum: 100, minimum: 1, }, }, diff --git a/sdks/ts/src/api/schemas/$Tasks_UpdateTaskRequest.ts b/sdks/ts/src/api/schemas/$Tasks_UpdateTaskRequest.ts index 6a3869214..297fffd37 100644 --- a/sdks/ts/src/api/schemas/$Tasks_UpdateTaskRequest.ts +++ b/sdks/ts/src/api/schemas/$Tasks_UpdateTaskRequest.ts @@ -139,6 +139,7 @@ export const $Tasks_UpdateTaskRequest = { type: "number", description: `Whether to run the reduce expression in parallel and how many items to run in each batch`, format: "uint16", + maximum: 100, minimum: 1, }, },