mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-08 01:43:07 +00:00
* fix(codex): support model-reported reasoning efforts * fix(web): prevent service worker edge caching * ci: retrigger stuck Actions run * fix(codex): accept dynamic reasoning effort values * fix(web): restore reasoning effort on model switch failure
17 lines
461 B
TypeScript
17 lines
461 B
TypeScript
import type { ReasoningEffort } from '../appServerTypes';
|
|
|
|
export function parseReasoningEffortValue(value: unknown): ReasoningEffort | undefined {
|
|
if (value === null) {
|
|
return undefined;
|
|
}
|
|
if (typeof value !== 'string') {
|
|
throw new Error('Invalid model reasoning effort');
|
|
}
|
|
|
|
const effort = value.trim().toLowerCase();
|
|
if (!effort) {
|
|
throw new Error('Invalid model reasoning effort');
|
|
}
|
|
return effort;
|
|
}
|