"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
# @generated-id: c9268e93f943

from __future__ import annotations
from .jsonpatchpayload_input import (
    JSONPatchPayloadInput,
    JSONPatchPayloadInputTypedDict,
)
from .jsonpayload_input import JSONPayloadInput, JSONPayloadInputTypedDict
from mistralai.workflows.worker_client.types import BaseModel
from mistralai.workflows.worker_client.utils import get_discriminator
from pydantic import Discriminator, Tag
from typing import Union
from typing_extensions import Annotated, TypeAliasType, TypedDict


PayloadTypedDict = TypeAliasType(
    "PayloadTypedDict", Union[JSONPayloadInputTypedDict, JSONPatchPayloadInputTypedDict]
)
r"""The current state or incremental update for the task."""


Payload = Annotated[
    Union[
        Annotated[JSONPayloadInput, Tag("json")],
        Annotated[JSONPatchPayloadInput, Tag("json_patch")],
    ],
    Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
r"""The current state or incremental update for the task."""


class CustomTaskInProgressAttributesInputTypedDict(TypedDict):
    r"""Attributes for custom task in-progress events with streaming updates."""

    custom_task_id: str
    r"""Unique identifier for the custom task within the workflow."""
    custom_task_type: str
    r"""The type/category of the custom task (e.g., 'llm_call', 'api_request')."""
    payload: PayloadTypedDict
    r"""The current state or incremental update for the task."""


class CustomTaskInProgressAttributesInput(BaseModel):
    r"""Attributes for custom task in-progress events with streaming updates."""

    custom_task_id: str
    r"""Unique identifier for the custom task within the workflow."""

    custom_task_type: str
    r"""The type/category of the custom task (e.g., 'llm_call', 'api_request')."""

    payload: Payload
    r"""The current state or incremental update for the task."""
