> ## 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.

# Chat



## OpenAPI

````yaml post /v1/agent_sessions/{session_id}/chat
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}/chat:
    post:
      tags:
        - chat
      summary: Chat
      operationId: agentSessionChat
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            title: Session Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatRequestBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '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:
    ChatRequestBody:
      properties:
        headless:
          type: boolean
          title: Headless
          description: >-
            Whether a headless client (terminal or scripted) is driving the
            turn, as opposed to the browser assistant. Selects the agent
            configuration the turn runs on.
        contexts:
          items:
            $ref: '#/components/schemas/ChatContext'
          type: array
          title: Contexts
        editPermission:
          type: string
          enum:
            - manual
            - bypass
          title: Editpermission
          default: manual
        requestedSkills:
          items:
            type: string
          type: array
          title: Requestedskills
          description: >-
            Skills the user explicitly requested via the prompt's slash-command
            affordance. The server force-loads each available skill by injecting
            a synthetic load_skill tool call/result at the tail of the message
            history. Unknown or context-unavailable names are ignored.
        model:
          $ref: '#/components/schemas/AgentModelSelection'
          description: >-
            The model the client believes the session is set to. This is a
            precondition, not an instruction: the turn always runs on the
            session's persisted selection, and a mismatch is rejected with HTTP
            409 and code ``agent_session_model_stale`` rather than silently
            running on — or switching to — an unexpected model. Change the
            session's model with ``PATCH .../agent_sessions/{session_id}``.
        trigger:
          type: string
          const: submit-message
          title: Trigger
          default: submit-message
        id:
          type: string
          title: Id
        message:
          anyOf:
            - $ref: '#/components/schemas/PhoenixUIMessage'
            - type: 'null'
          description: >-
            The turn's new user message to append. May be omitted for
            client-tool continuation, where ``toolOutputs`` resolve the trailing
            assistant message's pending tool calls instead.
        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
          title: Tooloutputs
          description: >-
            Client-executed tool results for pending tool calls on the
            transcript's trailing assistant message, matched by ``toolCallId``.
            Submitted alone they continue the assistant turn; submitted with
            ``message`` they resolve dangling tool calls before the new user
            turn runs.
        lastMessageId:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastmessageid
          description: >-
            The id of the last transcript message the client has rendered, used
            for optimistic concurrency. Omit when the session has no messages;
            required (and validated against the persisted transcript) once it
            does. On mismatch the server rejects the send with HTTP 409 and code
            ``agent_session_messages_stale`` — the client should refetch the
            session before retrying.
        recordLocalTraces:
          type: boolean
          title: Recordlocaltraces
          default: false
        exportRemoteTraces:
          type: boolean
          title: Exportremotetraces
          default: false
        instrumentUserId:
          type: boolean
          title: Instrumentuserid
          description: >-
            When true and the request is authenticated as a PhoenixUser,
            attaches the user's email as the OpenInference ``user.id`` span
            attribute on all traced work for this request.
          default: false
      type: object
      required:
        - headless
        - model
        - id
      title: ChatRequestBody
      description: Assistant chat submit request payload.
    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
    ChatContext:
      oneOf:
        - $ref: '#/components/schemas/AppContext'
        - $ref: '#/components/schemas/ProjectContext'
        - $ref: '#/components/schemas/TraceContext'
        - $ref: '#/components/schemas/SessionContext'
        - $ref: '#/components/schemas/PromptContext'
        - $ref: '#/components/schemas/PromptVersionContext'
        - $ref: '#/components/schemas/AgentSpanContext'
        - $ref: '#/components/schemas/PlaygroundContext'
        - $ref: '#/components/schemas/CodeEvaluatorContext'
        - $ref: '#/components/schemas/LlmEvaluatorContext'
        - $ref: '#/components/schemas/DatasetContext'
        - $ref: '#/components/schemas/GraphQLContext'
        - $ref: '#/components/schemas/WebAccessContext'
        - $ref: '#/components/schemas/SubagentsContext'
      title: ChatContext
      description: Discriminated union of every UI-state context the agent understands.
      discriminator:
        propertyName: type
        mapping:
          app:
            $ref: '#/components/schemas/AppContext'
          code_evaluator:
            $ref: '#/components/schemas/CodeEvaluatorContext'
          dataset:
            $ref: '#/components/schemas/DatasetContext'
          graphql:
            $ref: '#/components/schemas/GraphQLContext'
          llm_evaluator:
            $ref: '#/components/schemas/LlmEvaluatorContext'
          playground:
            $ref: '#/components/schemas/PlaygroundContext'
          project:
            $ref: '#/components/schemas/ProjectContext'
          prompt:
            $ref: '#/components/schemas/PromptContext'
          prompt_version:
            $ref: '#/components/schemas/PromptVersionContext'
          session:
            $ref: '#/components/schemas/SessionContext'
          span:
            $ref: '#/components/schemas/AgentSpanContext'
          subagents:
            $ref: '#/components/schemas/SubagentsContext'
          trace:
            $ref: '#/components/schemas/TraceContext'
          web_access:
            $ref: '#/components/schemas/WebAccessContext'
    AgentModelSelection:
      oneOf:
        - $ref: '#/components/schemas/CustomProviderModelSelection'
        - $ref: '#/components/schemas/BuiltInProviderModelSelection'
      discriminator:
        propertyName: providerType
        mapping:
          builtin:
            $ref: '#/components/schemas/BuiltInProviderModelSelection'
          custom:
            $ref: '#/components/schemas/CustomProviderModelSelection'
    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.'
    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.
    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
    AppContext:
      properties:
        type:
          type: string
          const: app
          title: Type
        currentDateTime:
          type: string
          title: Currentdatetime
        timeZone:
          type: string
          title: Timezone
      type: object
      required:
        - type
        - currentDateTime
        - timeZone
      title: AppContext
      description: Per-turn browser clock context for resolving relative time requests.
    ProjectContext:
      properties:
        type:
          type: string
          const: project
          title: Type
        projectNodeId:
          type: string
          title: Projectnodeid
        spanFilter:
          anyOf:
            - type: string
            - type: 'null'
          title: Spanfilter
      type: object
      required:
        - type
        - projectNodeId
      title: ProjectContext
      description: >-
        Project the user is currently viewing.


        ``span_filter`` carries the project-scoped span filter expression when
        the

        span filter field is mounted — empty string when the field is mounted
        with

        no condition applied, ``None`` when the field is not present at all. It

        describes the view in full, root-span scoping included (which is
        expressed

        within the filter DSL as ``parent_id is None``).
    TraceContext:
      properties:
        type:
          type: string
          const: trace
          title: Type
        projectNodeId:
          type: string
          title: Projectnodeid
        otelTraceId:
          type: string
          title: Oteltraceid
      type: object
      required:
        - type
        - projectNodeId
        - otelTraceId
      title: TraceContext
    SessionContext:
      properties:
        type:
          type: string
          const: session
          title: Type
        projectNodeId:
          type: string
          title: Projectnodeid
        sessionNodeId:
          type: string
          title: Sessionnodeid
      type: object
      required:
        - type
        - projectNodeId
        - sessionNodeId
      title: SessionContext
      description: Session the user is currently viewing.
    PromptContext:
      properties:
        type:
          type: string
          const: prompt
          title: Type
        promptNodeId:
          type: string
          title: Promptnodeid
      type: object
      required:
        - type
        - promptNodeId
      title: PromptContext
      description: Prompt the user is currently viewing.
    PromptVersionContext:
      properties:
        type:
          type: string
          const: prompt_version
          title: Type
        promptNodeId:
          type: string
          title: Promptnodeid
        promptVersionNodeId:
          type: string
          title: Promptversionnodeid
      type: object
      required:
        - type
        - promptNodeId
        - promptVersionNodeId
      title: PromptVersionContext
      description: Prompt version the user is currently viewing.
    AgentSpanContext:
      properties:
        type:
          type: string
          const: span
          title: Type
        projectNodeId:
          anyOf:
            - type: string
            - type: 'null'
          title: Projectnodeid
        spanNodeId:
          anyOf:
            - type: string
            - type: 'null'
          title: Spannodeid
        otelSpanId:
          anyOf:
            - type: string
            - type: 'null'
          title: Otelspanid
      type: object
      required:
        - type
      title: AgentSpanContext
      description: >-
        Span the user has selected.


        Exactly one of ``span_node_id`` (relay) or ``otel_span_id``
        (OpenTelemetry

        hex) must be set. ``project_node_id`` is optional because a span can be

        selected from views outside a project route.
    PlaygroundContext:
      properties:
        type:
          type: string
          const: playground
          title: Type
        recordExperiments:
          type: boolean
          title: Recordexperiments
          default: true
        repetitions:
          type: integer
          title: Repetitions
          default: 1
        nextExperimentScaffold:
          anyOf:
            - $ref: '#/components/schemas/PlaygroundExperimentScaffoldContext'
            - type: 'null'
        instances:
          items:
            $ref: '#/components/schemas/PlaygroundInstanceContext'
          type: array
          title: Instances
        evaluators:
          items:
            $ref: '#/components/schemas/PlaygroundEvaluatorContext'
          type: array
          title: Evaluators
      type: object
      required:
        - type
      title: PlaygroundContext
      description: Playground prompt editor state mounted in the current browser route.
    CodeEvaluatorContext:
      properties:
        type:
          type: string
          const: code_evaluator
          title: Type
        evaluatorNodeId:
          anyOf:
            - type: string
            - type: 'null'
          title: Evaluatornodeid
      type: object
      required:
        - type
      title: CodeEvaluatorContext
      description: Code-evaluator create/edit form mounted in the current browser route.
    LlmEvaluatorContext:
      properties:
        type:
          type: string
          const: llm_evaluator
          title: Type
        evaluatorNodeId:
          anyOf:
            - type: string
            - type: 'null'
          title: Evaluatornodeid
      type: object
      required:
        - type
      title: LlmEvaluatorContext
      description: LLM-evaluator create/edit form mounted in the current browser route.
    DatasetContext:
      properties:
        type:
          type: string
          const: dataset
          title: Type
        datasetNodeId:
          type: string
          title: Datasetnodeid
        datasetVersionNodeId:
          anyOf:
            - type: string
            - type: 'null'
          title: Datasetversionnodeid
      type: object
      required:
        - type
        - datasetNodeId
      title: DatasetContext
      description: >-
        Dataset the user is currently viewing or has bound to a workflow.


        Carries the dataset's relay node id and, when known, the active version

        node id. These IDs scope the create-form handoff link and the sampling
        of

        active dataset examples used as prompt context; the dataset schema
        itself

        is open.
    GraphQLContext:
      properties:
        type:
          type: string
          const: graphql
          title: Type
        mutationsEnabled:
          type: boolean
          title: Mutationsenabled
      type: object
      required:
        - type
        - mutationsEnabled
      title: GraphQLContext
      description: GraphQL runtime state.
    WebAccessContext:
      properties:
        type:
          type: string
          const: web_access
          title: Type
        enabled:
          type: boolean
          title: Enabled
      type: object
      required:
        - type
        - enabled
      title: WebAccessContext
      description: User's per-turn request to expose web search / fetch tools.
    SubagentsContext:
      properties:
        type:
          type: string
          const: subagents
          title: Type
        enabled:
          type: boolean
          title: Enabled
      type: object
      required:
        - type
        - enabled
      title: SubagentsContext
      description: User's per-turn request to expose the subagent-spawning tool.
    CustomProviderModelSelection:
      properties:
        providerType:
          type: string
          const: custom
          title: Providertype
        providerId:
          type: string
          title: Providerid
        modelName:
          type: string
          title: Modelname
      type: object
      required:
        - providerType
        - providerId
        - modelName
      title: CustomProviderModelSelection
      description: Chat against a stored custom provider record.
    BuiltInProviderModelSelection:
      properties:
        providerType:
          type: string
          const: builtin
          title: Providertype
        provider:
          $ref: '#/components/schemas/ModelProvider'
        modelName:
          type: string
          title: Modelname
      type: object
      required:
        - providerType
        - provider
        - modelName
      title: BuiltInProviderModelSelection
      description: |-
        Chat against a Phoenix built-in provider.

        Credentials and connection details (base URL, Azure endpoint, AWS
        region) are resolved from the secret store first and the process
        environment second.
    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.
    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).
    PlaygroundExperimentScaffoldContext:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        hasMetadata:
          type: boolean
          title: Hasmetadata
          default: false
      type: object
      title: PlaygroundExperimentScaffoldContext
      description: >-
        Experiment name/description/metadata the user has staged for the
        playground's

        *next* dataset-backed run, before that run has started.


        The playground UI lets the user pre-set how the next recorded run's
        experiment

        will be named, described, and tagged (via the
        ``set_playground_experiment_recording``

        tool or the recording form). That staged state is surfaced here so the
        agent can

        see what is already set and avoid re-staging it.


        Field semantics:

        - ``name`` / ``description``: the staged values, surfaced to the model
        verbatim,
          or ``None`` when the user has not staged them.
        - ``has_metadata``: a presence flag, not the value. Only *whether*
        metadata has
          been staged is model-relevant (so the agent knows not to re-attach it); the
          metadata object itself is deliberately kept out of the prompt.

        A field left unstaged (``None`` / ``False``) falls back to the server
        default when

        the run starts. The scaffold is consumed once that next run begins.
    PlaygroundInstanceContext:
      properties:
        instanceId:
          type: integer
          title: Instanceid
        model:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/PlaygroundBuiltinModelContext'
                - $ref: '#/components/schemas/PlaygroundCustomProviderModelContext'
              discriminator:
                propertyName: type
                mapping:
                  builtin:
                    $ref: '#/components/schemas/PlaygroundBuiltinModelContext'
                  custom:
                    $ref: '#/components/schemas/PlaygroundCustomProviderModelContext'
            - type: 'null'
          title: Model
        experimentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Experimentid
      type: object
      required:
        - instanceId
      title: PlaygroundInstanceContext
      description: >-
        One mounted playground instance and its current model selection.


        ``experiment_id`` carries the relay node id of the experiment produced
        by

        this instance's last dataset-backed run, or ``None`` when the instance
        has

        not produced one. Ephemeral experiments are included: they remain
        queryable

        until the server sweeps them ~24h after their last update.
    PlaygroundEvaluatorContext:
      properties:
        datasetEvaluatorId:
          type: string
          title: Datasetevaluatorid
        name:
          type: string
          title: Name
        kind:
          type: string
          enum:
            - LLM
            - CODE
            - BUILTIN
          title: Kind
        isBuiltin:
          type: boolean
          title: Isbuiltin
        isApplied:
          type: boolean
          title: Isapplied
      type: object
      required:
        - datasetEvaluatorId
        - name
        - kind
        - isBuiltin
        - isApplied
      title: PlaygroundEvaluatorContext
      description: |-
        One dataset evaluator on the mounted playground's roster. ``name`` is
        user-controlled; sanitize at every model-visible boundary.
    ModelProvider:
      type: string
      enum:
        - OPENAI
        - AZURE_OPENAI
        - ANTHROPIC
        - GOOGLE
        - DEEPSEEK
        - XAI
        - OLLAMA
        - AWS
        - CEREBRAS
        - FIREWORKS
        - GROQ
        - MOONSHOT
        - PERPLEXITY
        - TOGETHER
      title: ModelProvider
    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.
    PlaygroundBuiltinModelContext:
      properties:
        type:
          type: string
          const: builtin
          title: Type
          default: builtin
        provider:
          type: string
          title: Provider
        modelName:
          type: string
          title: Modelname
      type: object
      required:
        - provider
        - modelName
      title: PlaygroundBuiltinModelContext
      description: Built-in playground model selection.
    PlaygroundCustomProviderModelContext:
      properties:
        type:
          type: string
          const: custom
          title: Type
          default: custom
        customProviderId:
          type: string
          title: Customproviderid
        customProviderName:
          type: string
          title: Customprovidername
        provider:
          type: string
          title: Provider
        modelName:
          type: string
          title: Modelname
      type: object
      required:
        - customProviderId
        - customProviderName
        - provider
        - modelName
      title: PlaygroundCustomProviderModelContext
      description: Custom-provider playground model selection.
    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.

````