- get_stream_events - Get Stream Events
- get_workflow_events - Get Workflow Events
Stream workflow events as Server-Sent Events (SSE).
One of root_workflow_exec_id, parent_workflow_exec_id or workflow_exec_id is required.
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.events.get_stream_events(scope="*", activity_name="*", activity_id="*", workflow_name="*", workflow_exec_id="*", root_workflow_exec_id="*", parent_workflow_exec_id="*", stream="*", start_seq=0)
with res as event_stream:
for event in event_stream:
# handle event
print(event, flush=True)| Parameter | Type | Required | Description |
|---|---|---|---|
scope |
Optional[models.Scope] | ➖ | N/A |
activity_name |
Optional[str] | ➖ | N/A |
activity_id |
Optional[str] | ➖ | N/A |
workflow_name |
Optional[str] | ➖ | N/A |
workflow_exec_id |
Optional[str] | ➖ | N/A |
root_workflow_exec_id |
Optional[str] | ➖ | N/A |
parent_workflow_exec_id |
Optional[str] | ➖ | N/A |
stream |
Optional[str] | ➖ | N/A |
start_seq |
Optional[int] | ➖ | N/A |
metadata_filters |
Dict[str, Any] | ➖ | N/A |
workflow_event_types |
List[models.WorkflowEventType] | ➖ | N/A |
last_event_id |
OptionalNullable[str] | ➖ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get Workflow Events
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.events.get_workflow_events(limit=100)
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
root_workflow_exec_id |
OptionalNullable[str] | ➖ | Execution ID of the root workflow that initiated this execution chain. |
workflow_exec_id |
OptionalNullable[str] | ➖ | Execution ID of the workflow that emitted this event. |
workflow_run_id |
OptionalNullable[str] | ➖ | Run ID of the workflow that emitted this event. |
limit |
Optional[int] | ➖ | Maximum number of events to return. |
cursor |
OptionalNullable[str] | ➖ | Cursor for pagination. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.ListWorkflowEventResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |