> ## Documentation Index
> Fetch the complete documentation index at: https://arizeai-433a7140.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit Agent Session Tool Outputs

> Persist resolved client tool outputs for the session's open turn.



## OpenAPI

````yaml post /v1/agent_sessions/{session_id}/tool_outputs
openapi: 3.1.0
info:
  title: Arize-Phoenix REST API
  description: Schema for Arize-Phoenix REST API
  version: '1.0'
servers: []
security: []
paths:
  /v1/agent_sessions/{session_id}/tool_outputs:
    post:
      tags:
        - chat
      summary: Submit Agent Session Tool Outputs
      description: Persist resolved client tool outputs for the session's open turn.
      operationId: submitAgentSessionToolOutputs
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            title: Session Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitAgentSessionToolOutputsRequestBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitAgentSessionToolOutputsResponseBody'
        '400':
          content:
            text/plain:
              schema:
                type: string
          description: Bad Request
        '401':
          content:
            text/plain:
              schema:
                type: string
          description: Unauthorized
        '403':
          content:
            text/plain:
              schema:
                type: string
          description: Forbidden
        '404':
          content:
            text/plain:
              schema:
                type: string
          description: Not Found
        '409':
          description: >-
            The request conflicts with the session's current state; the body's
            ``code`` field says how.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSessionConflictError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '507':
          content:
            text/plain:
              schema:
                type: string
          description: Insufficient Storage
components:
  schemas:
    SubmitAgentSessionToolOutputsRequestBody:
      properties:
        toolOutputs:
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/phoenix__db__types__data_stream_protocol__request_types__ToolOutputAvailablePart
              - $ref: >-
                  #/components/schemas/phoenix__db__types__data_stream_protocol__request_types__ToolOutputErrorPart
              - $ref: >-
                  #/components/schemas/phoenix__db__types__data_stream_protocol__request_types__DynamicToolOutputAvailablePart
              - $ref: >-
                  #/components/schemas/phoenix__db__types__data_stream_protocol__request_types__DynamicToolOutputErrorPart
          type: array
          minItems: 1
          title: Tooloutputs
          description: >-
            Client tool results for pending calls on the trailing assistant
            message, matched by ``toolCallId``. Resending a persisted output
            verbatim is a no-op; an output that differs from the persisted
            result or matches no call is rejected with HTTP 409 and code
            ``agent_session_tool_outputs_conflict``.
        lastMessageId:
          type: string
          title: Lastmessageid
          description: >-
            The trailing assistant message's id. On mismatch the submission is
            rejected with HTTP 409 and code ``agent_session_messages_stale``.
      type: object
      required:
        - toolOutputs
        - lastMessageId
      title: SubmitAgentSessionToolOutputsRequestBody
      description: Persist resolved client tool outputs without continuing the turn.
    SubmitAgentSessionToolOutputsResponseBody:
      properties:
        data:
          $ref: '#/components/schemas/PhoenixUIMessage'
      type: object
      required:
        - data
      title: SubmitAgentSessionToolOutputsResponseBody
      description: The trailing assistant message with the submitted outputs applied.
    AgentSessionConflictError:
      properties:
        code:
          type: string
          enum:
            - agent_session_busy
            - agent_session_model_stale
            - agent_session_messages_stale
            - agent_session_tool_outputs_conflict
            - agent_session_already_compact
            - agent_session_compaction_conflict
          title: Code
          description: Machine-readable reason the request conflicted.
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: Optional human-readable elaboration on the conflict.
      type: object
      required:
        - code
      title: AgentSessionConflictError
      description: >-
        Body of every HTTP 409 returned by the agent session routes.


        - ``agent_session_busy``: another turn holds the session's turn lock.

        - ``agent_session_model_stale``: the request asserted a model the
        session
          is no longer set to; refetch the session before retrying.
        - ``agent_session_messages_stale``: the send's ``lastMessageId`` no
        longer
          matches the persisted transcript — another client appended; refetch the
          transcript and retry.
        - ``agent_session_tool_outputs_conflict``: the submitted ``toolOutputs``
        do
          not match the transcript's trailing assistant message (no trailing
          assistant message to continue, an unknown ``toolCallId``, or a tool-name
          mismatch). Unlike ``agent_session_messages_stale`` this is not a
          concurrent-writer race but an inconsistent request; fix the client
          rather than retrying.
        - ``agent_session_already_compact``: there are no complete turns to
          compact — either nothing new has finished since the transcript's latest
          checkpoint, or a concurrent request's checkpoint already covers them.
          Not retryable; the conversation is as compact as it can get.
        - ``agent_session_compaction_conflict``: the conversation changed while
        it
          was being compacted; retry.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    phoenix__db__types__data_stream_protocol__request_types__ToolOutputAvailablePart:
      properties:
        type:
          type: string
          pattern: ^tool-
          title: Type
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: output-available
          title: State
          default: output-available
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        output:
          anyOf:
            - {}
            - type: 'null'
          title: Output
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        resultProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Resultprovidermetadata
        preliminary:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Preliminary
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - type
        - toolCallId
      title: ToolOutputAvailablePart
      description: Tool part in output-available state.
    phoenix__db__types__data_stream_protocol__request_types__ToolOutputErrorPart:
      properties:
        type:
          type: string
          pattern: ^tool-
          title: Type
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: output-error
          title: State
          default: output-error
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        rawInput:
          anyOf:
            - {}
            - type: 'null'
          title: Rawinput
        errorText:
          type: string
          title: Errortext
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        resultProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Resultprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - type
        - toolCallId
        - errorText
      title: ToolOutputErrorPart
      description: Tool part in output-error state.
    phoenix__db__types__data_stream_protocol__request_types__DynamicToolOutputAvailablePart:
      properties:
        type:
          type: string
          const: dynamic-tool
          title: Type
          default: dynamic-tool
        toolName:
          type: string
          title: Toolname
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: output-available
          title: State
          default: output-available
        input:
          title: Input
        output:
          title: Output
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        resultProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Resultprovidermetadata
        preliminary:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Preliminary
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - toolName
        - toolCallId
        - input
        - output
      title: DynamicToolOutputAvailablePart
      description: Dynamic tool part in output-available state.
    phoenix__db__types__data_stream_protocol__request_types__DynamicToolOutputErrorPart:
      properties:
        type:
          type: string
          const: dynamic-tool
          title: Type
          default: dynamic-tool
        toolName:
          type: string
          title: Toolname
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: output-error
          title: State
          default: output-error
        input:
          title: Input
        errorText:
          type: string
          title: Errortext
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        resultProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Resultprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - toolName
        - toolCallId
        - input
        - errorText
      title: DynamicToolOutputErrorPart
      description: Dynamic tool part in output-error state.
    PhoenixUIMessage:
      properties:
        id:
          type: string
          title: Id
        role:
          type: string
          enum:
            - system
            - user
            - assistant
          title: Role
        metadata:
          anyOf:
            - $ref: '#/components/schemas/MessageMetadata'
            - type: 'null'
        parts:
          items:
            anyOf:
              - $ref: '#/components/schemas/TextUIPart'
              - $ref: '#/components/schemas/ReasoningUIPart'
              - $ref: '#/components/schemas/ToolInputStreamingPart'
              - $ref: '#/components/schemas/ToolInputAvailablePart'
              - $ref: >-
                  #/components/schemas/phoenix__db__types__data_stream_protocol__request_types__ToolOutputAvailablePart
              - $ref: >-
                  #/components/schemas/phoenix__db__types__data_stream_protocol__request_types__ToolOutputErrorPart
              - $ref: '#/components/schemas/ToolApprovalRequestedPart'
              - $ref: '#/components/schemas/ToolApprovalRespondedPart'
              - $ref: '#/components/schemas/ToolOutputDeniedPart'
              - $ref: '#/components/schemas/DynamicToolInputStreamingPart'
              - $ref: '#/components/schemas/DynamicToolInputAvailablePart'
              - $ref: >-
                  #/components/schemas/phoenix__db__types__data_stream_protocol__request_types__DynamicToolOutputAvailablePart
              - $ref: >-
                  #/components/schemas/phoenix__db__types__data_stream_protocol__request_types__DynamicToolOutputErrorPart
              - $ref: '#/components/schemas/DynamicToolApprovalRequestedPart'
              - $ref: '#/components/schemas/DynamicToolApprovalRespondedPart'
              - $ref: '#/components/schemas/DynamicToolOutputDeniedPart'
              - $ref: '#/components/schemas/SourceUrlUIPart'
              - $ref: '#/components/schemas/SourceDocumentUIPart'
              - $ref: '#/components/schemas/FileUIPart'
              - $ref: '#/components/schemas/DataUIPart'
              - $ref: '#/components/schemas/StepStartUIPart'
          type: array
          title: Parts
      additionalProperties: false
      type: object
      required:
        - id
        - role
        - parts
      title: PhoenixUIMessage
      description: '``UIMessage`` with metadata narrowed to the Phoenix wire shapes.'
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ToolApprovalRequested:
      properties:
        id:
          type: string
          title: Id
      additionalProperties: false
      type: object
      required:
        - id
      title: ToolApprovalRequested
      description: Tool approval in requested state (awaiting user response).
    ToolApprovalResponded:
      properties:
        id:
          type: string
          title: Id
        approved:
          type: boolean
          title: Approved
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
      additionalProperties: false
      type: object
      required:
        - id
        - approved
      title: ToolApprovalResponded
      description: Tool approval in responded state (user has approved or denied).
    MessageMetadata:
      properties:
        phoenix:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/PhoenixAssistantMessageMetadata'
                - $ref: '#/components/schemas/PhoenixUserMessageMetadata'
              discriminator:
                propertyName: type
                mapping:
                  assistant:
                    $ref: '#/components/schemas/PhoenixAssistantMessageMetadata'
                  user:
                    $ref: '#/components/schemas/PhoenixUserMessageMetadata'
            - type: 'null'
          title: Phoenix
        pydantic_ai:
          anyOf:
            - $ref: '#/components/schemas/PydanticAIMessageMetadata'
            - type: 'null'
      additionalProperties: false
      type: object
      title: MessageMetadata
      description: '``UIMessage.metadata`` as a registry of namespaces.'
    TextUIPart:
      properties:
        type:
          type: string
          const: text
          title: Type
          default: text
        text:
          type: string
          title: Text
        state:
          anyOf:
            - type: string
              enum:
                - streaming
                - done
            - type: 'null'
          title: State
        providerMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Providermetadata
      additionalProperties: false
      type: object
      required:
        - text
      title: TextUIPart
      description: A text part of a message.
    ReasoningUIPart:
      properties:
        type:
          type: string
          const: reasoning
          title: Type
          default: reasoning
        text:
          type: string
          title: Text
        state:
          anyOf:
            - type: string
              enum:
                - streaming
                - done
            - type: 'null'
          title: State
        providerMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Providermetadata
      additionalProperties: false
      type: object
      required:
        - text
      title: ReasoningUIPart
      description: A reasoning part of a message.
    ToolInputStreamingPart:
      properties:
        type:
          type: string
          pattern: ^tool-
          title: Type
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: input-streaming
          title: State
          default: input-streaming
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - type
        - toolCallId
      title: ToolInputStreamingPart
      description: Tool part in input-streaming state.
    ToolInputAvailablePart:
      properties:
        type:
          type: string
          pattern: ^tool-
          title: Type
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: input-available
          title: State
          default: input-available
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - type
        - toolCallId
      title: ToolInputAvailablePart
      description: Tool part in input-available state.
    ToolApprovalRequestedPart:
      properties:
        type:
          type: string
          pattern: ^tool-
          title: Type
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: approval-requested
          title: State
          default: approval-requested
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - type
        - toolCallId
      title: ToolApprovalRequestedPart
      description: Tool part in approval-requested state (awaiting user decision).
    ToolApprovalRespondedPart:
      properties:
        type:
          type: string
          pattern: ^tool-
          title: Type
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: approval-responded
          title: State
          default: approval-responded
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - type
        - toolCallId
      title: ToolApprovalRespondedPart
      description: >-
        Tool part in approval-responded state (user approved/denied, execution
        pending).
    ToolOutputDeniedPart:
      properties:
        type:
          type: string
          pattern: ^tool-
          title: Type
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: output-denied
          title: State
          default: output-denied
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - type
        - toolCallId
      title: ToolOutputDeniedPart
      description: Tool part in output-denied state (tool was denied, terminal state).
    DynamicToolInputStreamingPart:
      properties:
        type:
          type: string
          const: dynamic-tool
          title: Type
          default: dynamic-tool
        toolName:
          type: string
          title: Toolname
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: input-streaming
          title: State
          default: input-streaming
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - toolName
        - toolCallId
      title: DynamicToolInputStreamingPart
      description: Dynamic tool part in input-streaming state.
    DynamicToolInputAvailablePart:
      properties:
        type:
          type: string
          const: dynamic-tool
          title: Type
          default: dynamic-tool
        toolName:
          type: string
          title: Toolname
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: input-available
          title: State
          default: input-available
        input:
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - toolName
        - toolCallId
        - input
      title: DynamicToolInputAvailablePart
      description: Dynamic tool part in input-available state.
    DynamicToolApprovalRequestedPart:
      properties:
        type:
          type: string
          const: dynamic-tool
          title: Type
          default: dynamic-tool
        toolName:
          type: string
          title: Toolname
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: approval-requested
          title: State
          default: approval-requested
        input:
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - toolName
        - toolCallId
        - input
      title: DynamicToolApprovalRequestedPart
      description: Dynamic tool part in approval-requested state (awaiting user decision).
    DynamicToolApprovalRespondedPart:
      properties:
        type:
          type: string
          const: dynamic-tool
          title: Type
          default: dynamic-tool
        toolName:
          type: string
          title: Toolname
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: approval-responded
          title: State
          default: approval-responded
        input:
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - toolName
        - toolCallId
        - input
      title: DynamicToolApprovalRespondedPart
      description: >-
        Dynamic tool part in approval-responded state (user approved/denied,
        execution pending).
    DynamicToolOutputDeniedPart:
      properties:
        type:
          type: string
          const: dynamic-tool
          title: Type
          default: dynamic-tool
        toolName:
          type: string
          title: Toolname
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: output-denied
          title: State
          default: output-denied
        input:
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - toolName
        - toolCallId
        - input
      title: DynamicToolOutputDeniedPart
      description: >-
        Dynamic tool part in output-denied state (tool was denied, terminal
        state).
    SourceUrlUIPart:
      properties:
        type:
          type: string
          const: source-url
          title: Type
          default: source-url
        sourceId:
          type: string
          title: Sourceid
        url:
          type: string
          title: Url
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        providerMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Providermetadata
      additionalProperties: false
      type: object
      required:
        - sourceId
        - url
      title: SourceUrlUIPart
      description: A source part of a message.
    SourceDocumentUIPart:
      properties:
        type:
          type: string
          const: source-document
          title: Type
          default: source-document
        sourceId:
          type: string
          title: Sourceid
        mediaType:
          type: string
          title: Mediatype
        title:
          type: string
          title: Title
        filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
        providerMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Providermetadata
      additionalProperties: false
      type: object
      required:
        - sourceId
        - mediaType
        - title
      title: SourceDocumentUIPart
      description: A document source part of a message.
    FileUIPart:
      properties:
        type:
          type: string
          const: file
          title: Type
          default: file
        mediaType:
          type: string
          title: Mediatype
        filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
        url:
          type: string
          title: Url
        providerMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Providermetadata
      additionalProperties: false
      type: object
      required:
        - mediaType
        - url
      title: FileUIPart
      description: A file part of a message.
    DataUIPart:
      properties:
        type:
          type: string
          pattern: ^data-
          title: Type
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        data:
          title: Data
      additionalProperties: false
      type: object
      required:
        - type
        - data
      title: DataUIPart
      description: Data part with dynamic type based on data name.
    StepStartUIPart:
      properties:
        type:
          type: string
          const: step-start
          title: Type
          default: step-start
      additionalProperties: false
      type: object
      title: StepStartUIPart
      description: A step boundary part of a message.
    PhoenixAssistantMessageMetadata:
      properties:
        type:
          type: string
          const: assistant
          title: Type
        sessionId:
          type: string
          title: Sessionid
        turnTraceContext:
          anyOf:
            - $ref: '#/components/schemas/TurnTraceContext'
            - type: 'null'
        usage:
          anyOf:
            - $ref: '#/components/schemas/AssistantMessageMetadataUsage'
            - type: 'null'
        interrupted:
          type: boolean
          title: Interrupted
          default: false
      additionalProperties: false
      type: object
      required:
        - type
        - sessionId
      title: PhoenixAssistantMessageMetadata
      description: The ``phoenix`` metadata namespace of an assistant message.
    PhoenixUserMessageMetadata:
      properties:
        type:
          type: string
          const: user
          title: Type
        currentDateTime:
          type: string
          maxLength: 128
          title: Currentdatetime
        timeZone:
          type: string
          maxLength: 128
          title: Timezone
        isCompactionMessage:
          type: boolean
          title: Iscompactionmessage
          default: false
      additionalProperties: false
      type: object
      required:
        - type
        - currentDateTime
        - timeZone
      title: PhoenixUserMessageMetadata
      description: |-
        The ``phoenix`` metadata namespace the browser attaches to outgoing
        user messages.
    PydanticAIMessageMetadata:
      properties:
        timestamp:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Timestamp
      additionalProperties: false
      type: object
      title: PydanticAIMessageMetadata
      description: |-
        Local pin of pydantic-ai's message-level ``pydantic_ai`` metadata
        namespace (its private ``_PydanticAIMessageMetadata``), merged into the
        assistant metadata by the stream's metadata chunk.
    TurnTraceContext:
      properties:
        traceId:
          type: string
          pattern: ^[0-9a-f]{32}$
          title: Traceid
        rootSpanId:
          type: string
          pattern: ^[0-9a-f]{16}$
          title: Rootspanid
        startedAt:
          type: string
          format: date-time
          title: Startedat
      additionalProperties: false
      type: object
      required:
        - traceId
        - rootSpanId
        - startedAt
      title: TurnTraceContext
      description: The trace identity a turn's spans are parented to.
    AssistantMessageMetadataUsage:
      properties:
        tokens:
          $ref: '#/components/schemas/AssistantMessageMetadataUsageTokens'
        promptDetails:
          anyOf:
            - $ref: >-
                #/components/schemas/AssistantMessageMetadataUsageCacheTokenDetails
            - type: 'null'
      additionalProperties: false
      type: object
      required:
        - tokens
      title: AssistantMessageMetadataUsage
    AssistantMessageMetadataUsageTokens:
      properties:
        prompt:
          type: integer
          title: Prompt
        completion:
          type: integer
          title: Completion
        total:
          type: integer
          title: Total
      additionalProperties: false
      type: object
      required:
        - prompt
        - completion
        - total
      title: AssistantMessageMetadataUsageTokens
    AssistantMessageMetadataUsageCacheTokenDetails:
      properties:
        cacheRead:
          type: integer
          title: Cacheread
        cacheWrite:
          type: integer
          title: Cachewrite
      additionalProperties: false
      type: object
      required:
        - cacheRead
        - cacheWrite
      title: AssistantMessageMetadataUsageCacheTokenDetails
      description: |-
        Prompt-cache token counts, mounted as the usage payload's
        ``prompt_details`` because cached tokens are a breakdown of the prompt.

````