diff --git a/shared/src/piThinkingLevel.ts b/shared/src/piThinkingLevel.ts index 6f70b40c..9f034349 100644 --- a/shared/src/piThinkingLevel.ts +++ b/shared/src/piThinkingLevel.ts @@ -1,6 +1,6 @@ // Pi thinking levels (from Pi's rpc-types.ts ThinkingLevel) // Controls how much reasoning/thinking the model performs. -export const PI_THINKING_LEVELS = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh'] as const +export const PI_THINKING_LEVELS = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'] as const export type PiThinkingLevel = typeof PI_THINKING_LEVELS[number] export const PI_THINKING_LEVEL_LABELS: Record = { @@ -10,4 +10,5 @@ export const PI_THINKING_LEVEL_LABELS: Record = { medium: 'Medium', high: 'High', xhigh: 'XHigh', + max: 'Max' } diff --git a/web/src/components/AssistantChat/PiThinkingLevelPanel.tsx b/web/src/components/AssistantChat/PiThinkingLevelPanel.tsx index 94029001..e778b31a 100644 --- a/web/src/components/AssistantChat/PiThinkingLevelPanel.tsx +++ b/web/src/components/AssistantChat/PiThinkingLevelPanel.tsx @@ -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. diff --git a/web/src/components/AssistantChat/piThinkingLevelOptions.ts b/web/src/components/AssistantChat/piThinkingLevelOptions.ts index 8a9ad358..ceed7261 100644 --- a/web/src/components/AssistantChat/piThinkingLevelOptions.ts +++ b/web/src/components/AssistantChat/piThinkingLevelOptions.ts @@ -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) }