(apiId: string, releaseDate: string)
| 571 | // routed through it, e.g. cf-ai-gateway) model exposes. Effort order: weakest |
| 572 | // to strongest. |
| 573 | function 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 | |
| 592 | function openaiCompatibleReasoningEfforts(id: string) { |
| 593 | const apiId = id.toLowerCase() |
no test coverage detected