# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

import typing_extensions
from .tool_call_output_processed_payload_tool import ToolCallOutputProcessedPayloadToolParams


class ToolCallOutputProcessedPayloadParams(typing_extensions.TypedDict):
    type: typing.Literal["tool_call_output_processed"]
    tool_call_id: str
    """
    ID of the completed tool call
    """

    tool: ToolCallOutputProcessedPayloadToolParams
    endpoint_url: typing_extensions.NotRequired[typing.Optional[str]]
    """
    Webhook endpoint URL (null for WebSocket tools)
    """

    endpoint_timeout_ms: typing_extensions.NotRequired[typing.Optional[float]]
    """
    Webhook timeout in milliseconds (null for WebSocket tools)
    """

    endpoint_called_at: typing_extensions.NotRequired[typing.Optional[dt.datetime]]
    """
    When webhook was called (null for WebSocket tools)
    """

    request_body: typing_extensions.NotRequired[typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]]
    """
    Webhook request body (null for WebSocket tools)
    """

    response_body: typing_extensions.NotRequired[typing.Optional[typing.Any]]
    parameters: typing_extensions.NotRequired[typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]]
    """
    WebSocket tool parameters (null for webhook tools)
    """

    output: typing_extensions.NotRequired[typing.Optional[typing.Any]]
    response_status_code: typing_extensions.NotRequired[typing.Optional[float]]
    """
    Webhook HTTP status code (null for WebSocket tools)
    """

    timed_out: typing_extensions.NotRequired[typing.Optional[bool]]
    """
    Whether the tool call timed out
    """

    error_message: typing_extensions.NotRequired[typing.Optional[str]]
    """
    Error message if tool call failed
    """
