Arize Phoenix TS
    Preparing search index...
    • Converts function output into a standardized SpanOutput format for tracing.

      This function processes the return value of a traced function and determines the appropriate MIME type. String outputs are preserved as text, while other types are JSON stringified.

      Parameters

      • result: unknown

        The function's return value to process into span output format

      Returns SpanOutput | undefined

      A SpanOutput object with value and mimeType, or undefined if result is null/undefined

      // String output
      toOutputType("success") // { value: "success", mimeType: MimeType.TEXT }

      // Object output
      toOutputType({ status: "ok" }) // { value: '{"status":"ok"}', mimeType: MimeType.JSON }

      // Null/undefined output
      toOutputType(null) // undefined