"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .toolcallstatus import ToolCallStatus
from openrouter.types import BaseModel
from openrouter.utils import validate_open_enum
from pydantic.functional_validators import PlainValidator
from typing import Literal, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


OutputSubagentServerToolItemType = Literal["openrouter:subagent",]


class OutputSubagentServerToolItemTypedDict(TypedDict):
    r"""An openrouter:subagent server tool output item"""

    status: ToolCallStatus
    type: OutputSubagentServerToolItemType
    error: NotRequired[str]
    r"""Error message when the subagent task did not produce an outcome."""
    id: NotRequired[str]
    model: NotRequired[str]
    r"""Slug of the worker model that executed the task."""
    outcome: NotRequired[str]
    r"""The worker model's result (the outcome text returned to the delegating model)."""
    task_description: NotRequired[str]
    r"""The task description the delegating model sent to the worker."""
    task_name: NotRequired[str]
    r"""The short task identifier the delegating model supplied."""


class OutputSubagentServerToolItem(BaseModel):
    r"""An openrouter:subagent server tool output item"""

    status: Annotated[ToolCallStatus, PlainValidator(validate_open_enum(False))]

    type: OutputSubagentServerToolItemType

    error: Optional[str] = None
    r"""Error message when the subagent task did not produce an outcome."""

    id: Optional[str] = None

    model: Optional[str] = None
    r"""Slug of the worker model that executed the task."""

    outcome: Optional[str] = None
    r"""The worker model's result (the outcome text returned to the delegating model)."""

    task_description: Optional[str] = None
    r"""The task description the delegating model sent to the worker."""

    task_name: Optional[str] = None
    r"""The short task identifier the delegating model supplied."""
