+
+
+ { log.operation }
+
+
+ { getStatusIcon( log.status ) } { log.status }
+
+
+
+
+
{ __( 'General', 'ai' ) }
+
+
+
+ | { __( 'Timestamp', 'ai' ) } |
+ { formatTimestamp( log.timestamp ) } |
+
+
+ | { __( 'Duration', 'ai' ) } |
+
+ { log.duration_ms !== null
+ ? sprintf(
+ /* translators: %d: request duration in milliseconds. */
+ __( '%d ms', 'ai' ),
+ log.duration_ms
+ )
+ : '-' }
+ |
+
+
+ | { __( 'Type', 'ai' ) } |
+ { log.type } |
+
+ { requestKind && (
+
+ | { __( 'Request Kind', 'ai' ) } |
+ { formatKindLabel( requestKind ) } |
+
+ ) }
+ { log.user_id && (
+
+ | { __( 'User ID', 'ai' ) } |
+ { log.user_id } |
+
+ ) }
+
+
+
+
+ { ( log.provider || log.model ) && (
+
+
{ __( 'Provider & Model', 'ai' ) }
+
+
+ { log.provider && (
+
+ | { __( 'Provider', 'ai' ) } |
+ { log.provider } |
+
+ ) }
+ { log.model && (
+
+ | { __( 'Model', 'ai' ) } |
+ { log.model } |
+
+ ) }
+
+
+
+ ) }
+
+ { ( log.tokens_input !== null ||
+ log.tokens_output !== null ) && (
+
+
{ __( 'Token Usage', 'ai' ) }
+
+
+
+ | { __( 'Input Tokens', 'ai' ) } |
+
+ { log.tokens_input?.toLocaleString() ??
+ '-' }
+ |
+
+
+ | { __( 'Output Tokens', 'ai' ) } |
+
+ { log.tokens_output?.toLocaleString() ??
+ '-' }
+ |
+
+
+ | { __( 'Total Tokens', 'ai' ) } |
+
+ { log.tokens_total?.toLocaleString() ??
+ '-' }
+ |
+
+
+ | { __( 'Tokens per Second', 'ai' ) } |
+
+ { formatTokensPerSecond(
+ log.tokens_per_second ?? null
+ ) }
+ |
+
+
+ | { __( 'Estimated Cost', 'ai' ) } |
+ { formatCost( log.cost_estimate ) } |
+
+
+
+
+ ) }
+
+ { log.error_message && (
+
+
{ __( 'Error', 'ai' ) }
+
+ { log.error_message }
+
+
+ ) }
+
+ { inputPreview && (
+
+
{ __( 'Input Preview', 'ai' ) }
+
+ { inputPreview }
+
+
+ ) }
+
+ { outputPreview && (
+
+
{ __( 'Output Preview', 'ai' ) }
+
+ { outputPreview }
+
+
+ ) }
+
+ { ( imageUrls.length > 0 || base64Images.length > 0 ) && (
+
+
{ __( 'Generated Images', 'ai' ) }
+
+ { imageUrls.map( ( url, index ) => (
+
+
+
+ { sprintf(
+ /* translators: %d: image index */
+ __( 'Image %d', 'ai' ),
+ index + 1
+ ) }
+
+
+ ) ) }
+ { base64Images.map( ( sample, index ) => (
+
+
+
+ { sprintf(
+ /* translators: %d: image index */
+ __( 'Image %d', 'ai' ),
+ imageUrls.length + index + 1
+ ) }
+
+
+ ) ) }
+
+
+ ) }
+
+ { log.context && Object.keys( log.context ).length > 0 && (
+
+
{ __( 'Context', 'ai' ) }
+
+ { JSON.stringify( log.context, null, 2 ) }
+
+
+ ) }
+
+
+
+ { log.id }
+
+
+
+
+