Skip to content

Latest commit

 

History

History
107 lines (74 loc) · 8.82 KB

File metadata and controls

107 lines (74 loc) · 8.82 KB

Workflows.Events

Overview

Available Operations

get_stream_events

Get Stream Events

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.workflows.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)

Parameters

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.

Response

Union[eventstreaming.EventStream[models.GetStreamEventsV1WorkflowsEventsStreamGetResponseBody], eventstreaming.EventStreamAsync[models.GetStreamEventsV1WorkflowsEventsStreamGetResponseBody]]

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

get_workflow_events

Get Workflow Events

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.workflows.events.get_workflow_events(limit=100)

    # Handle response
    print(res)

Parameters

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.

Response

models.ListWorkflowEventResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*