Skip to content

Commit 90e59fe

Browse files
committed
custom code: change type hinting execute_workflow_and_wait to handle pydantic BaseModel
1 parent 85276eb commit 90e59fe

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/mistralai/client/workflows.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
# region imports
2323
import asyncio
24+
from pydantic import BaseModel
2425
import time
2526
# endregion imports
2627

@@ -58,7 +59,7 @@ def _init_sdks(self):
5859
def execute_workflow_and_wait(
5960
self,
6061
workflow_identifier: str,
61-
input: OptionalNullable[Dict[str, Any]] = UNSET,
62+
input: OptionalNullable[Dict[str, Any] | BaseModel] = UNSET,
6263
execution_id: OptionalNullable[str] = UNSET,
6364
deployment_name: OptionalNullable[str] = UNSET,
6465
custom_tracing_attributes: OptionalNullable[Dict[str, str]] = UNSET,
@@ -71,7 +72,7 @@ def execute_workflow_and_wait(
7172
7273
Args:
7374
workflow_identifier: The workflow name or ID.
74-
input: Input parameters for the workflow
75+
input: The input to the workflow. This should be a dictionary or a BaseModel that matches the workflow's input schema.
7576
execution_id: Optional custom execution ID
7677
deployment_name: Name of the deployment to route this execution to
7778
custom_tracing_attributes: Custom tracing attributes
@@ -155,7 +156,7 @@ def wait_for_workflow_completion(
155156
async def execute_workflow_and_wait_async(
156157
self,
157158
workflow_identifier: str,
158-
input: OptionalNullable[Dict[str, Any]] = UNSET,
159+
input: OptionalNullable[Dict[str, Any] | BaseModel] = UNSET,
159160
execution_id: OptionalNullable[str] = UNSET,
160161
deployment_name: OptionalNullable[str] = UNSET,
161162
custom_tracing_attributes: OptionalNullable[Dict[str, str]] = UNSET,
@@ -168,7 +169,7 @@ async def execute_workflow_and_wait_async(
168169
169170
Args:
170171
workflow_identifier: The workflow name or ID.
171-
input: Input parameters for the workflow
172+
input: The input to the workflow. This should be a dictionary or a BaseModel that matches the workflow's input schema.
172173
execution_id: Optional custom execution ID
173174
deployment_name: Name of the deployment to route this execution to
174175
custom_tracing_attributes: Custom tracing attributes

0 commit comments

Comments
 (0)