mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-08 07:17:39 +00:00
feat(pi): add 'max' thinking level (#1032)
* feat(pi): add 'max' thinking level Pi's --thinking flag accepts 7 levels: off, minimal, low, medium, high, xhigh, max. The shared constant and UI only exposed 6 levels (missing max). Add 'max' to PI_THINKING_LEVELS and PI_THINKING_LEVEL_LABELS. Like xhigh, max requires explicit opt-in via the model's thinkingLevelMap — models that support it will include max in their map and the UI will show it accordingly. * fix(pi): close max thinking-level branch
This commit is contained in:
@@ -3,7 +3,7 @@ import type { PiThinkingLevelMap } from '@/types/api'
|
||||
import { FloatingOverlay } from '@/components/ChatInput/FloatingOverlay'
|
||||
import { isThinkingLevelSupported } from './piThinkingLevelOptions'
|
||||
|
||||
const ALL_LEVELS = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh'] as const
|
||||
const ALL_LEVELS = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'] as const
|
||||
|
||||
/**
|
||||
* Determine which thinking levels a model supports.
|
||||
|
||||
@@ -57,16 +57,17 @@ export function getPiThinkingLevelOptions(
|
||||
|
||||
/** Check whether a thinking level is supported by the model's thinkingLevelMap */
|
||||
export function isThinkingLevelSupported(level: string, map?: PiThinkingLevelMap): boolean {
|
||||
// xhigh requires explicit opt-in via the map
|
||||
if (level === 'xhigh') {
|
||||
// xhigh and max require explicit opt-in via the map
|
||||
if (level === 'xhigh' || level === 'max') {
|
||||
if (!map || !(level in map)) return false
|
||||
return map[level] !== null
|
||||
}
|
||||
|
||||
if (!map || !(level in map)) return true
|
||||
return map[level] !== null
|
||||
}
|
||||
|
||||
/** A level is excluded if it maps to `null` in the thinkingLevelMap, or xhigh without explicit opt-in */
|
||||
/** A level is excluded if it maps to `null` in the thinkingLevelMap, or xhigh/max without explicit opt-in */
|
||||
function isLevelExcluded(level: string, map?: PiThinkingLevelMap): boolean {
|
||||
return !isThinkingLevelSupported(level, map)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user