fix: record reasoning effort consistently in usage logs (#6641)
This commit is contained in:
@@ -74,6 +74,7 @@ import {
|
||||
isViolationFeeLog,
|
||||
getFirstResponseTimeColor,
|
||||
getResponseTimeColor,
|
||||
getReasoningEffortVariant,
|
||||
renderAuditContent,
|
||||
} from '../../lib/format'
|
||||
import {
|
||||
@@ -604,12 +605,9 @@ export function DetailsDialog(props: DetailsDialogProps) {
|
||||
const useChannel = other?.admin_info?.use_channel
|
||||
const channelChain =
|
||||
useChannel && useChannel.length > 0 ? useChannel.join(' → ') : undefined
|
||||
let reasoningEffortVariant: StatusBadgeProps['variant'] = 'green'
|
||||
if (other?.reasoning_effort === 'high') {
|
||||
reasoningEffortVariant = 'orange'
|
||||
} else if (other?.reasoning_effort === 'medium') {
|
||||
reasoningEffortVariant = 'yellow'
|
||||
}
|
||||
const reasoningEffortVariant = getReasoningEffortVariant(
|
||||
other?.reasoning_effort
|
||||
)
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
|
||||
@@ -167,6 +167,25 @@ export function parseLogOther(other: string): LogOtherData | null {
|
||||
}
|
||||
}
|
||||
|
||||
export function getReasoningEffortVariant(
|
||||
effort: string | undefined
|
||||
): StatusBadgeProps['variant'] {
|
||||
switch (effort?.trim().toLowerCase()) {
|
||||
case 'max':
|
||||
case 'xhigh':
|
||||
case 'high':
|
||||
return 'orange'
|
||||
case 'medium':
|
||||
return 'yellow'
|
||||
case 'low':
|
||||
case 'minimal':
|
||||
return 'green'
|
||||
case 'none':
|
||||
default:
|
||||
return 'grey'
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get time color based on duration (in seconds)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user