MCPcopy Index your code
hub / github.com/anomalyco/opencode / openaiReasoningEfforts

Function openaiReasoningEfforts

packages/opencode/src/provider/transform.ts:573–590  ·  view source on GitHub ↗
(apiId: string, releaseDate: string)

Source from the content-addressed store, hash-verified

571// routed through it, e.g. cf-ai-gateway) model exposes. Effort order: weakest
572// to strongest.
573function openaiReasoningEfforts(apiId: string, releaseDate: string) {
574 const id = apiId.toLowerCase()
575 if (id.includes("deep-research")) return ["medium"]
576 const chatEfforts = gpt5ChatReasoningEfforts(id)
577 if (chatEfforts) return chatEfforts
578 if (GPT5_PRO_RE.test(id)) return OPENAI_GPT5_PRO_EFFORTS
579 const codexEfforts = gpt5CodexReasoningEfforts(id)
580 if (codexEfforts) return codexEfforts
581 const versionedEfforts = versionedGpt5ReasoningEfforts(id)
582 // GPT-5.1 replaced GPT-5's `minimal` effort with `none`; GPT-5.2+
583 // additionally accepts `xhigh`. Model pages list the supported subset.
584 if (versionedEfforts) return versionedEfforts
585 const efforts = [...WIDELY_SUPPORTED_EFFORTS]
586 if (GPT5_FAMILY_RE.test(id)) efforts.unshift("minimal")
587 if (releaseDate >= OPENAI_NONE_EFFORT_RELEASE_DATE) efforts.unshift("none")
588 if (releaseDate >= OPENAI_XHIGH_EFFORT_RELEASE_DATE) efforts.push("xhigh")
589 return efforts
590}
591
592function openaiCompatibleReasoningEfforts(id: string) {
593 const apiId = id.toLowerCase()

Callers 1

variantsFunction · 0.85

Calls 4

gpt5ChatReasoningEffortsFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected