* Configure effort parameters for API request. *
( effortValue: EffortValue | undefined, outputConfig: BetaOutputConfig, extraBodyParams: Record<string, unknown>, betas: string[], model: string, )
| 438 | * |
| 439 | */ |
| 440 | function configureEffortParams( |
| 441 | effortValue: EffortValue | undefined, |
| 442 | outputConfig: BetaOutputConfig, |
| 443 | extraBodyParams: Record<string, unknown>, |
| 444 | betas: string[], |
| 445 | model: string, |
| 446 | ): void { |
| 447 | if (!modelSupportsEffort(model) || 'effort' in outputConfig) { |
| 448 | return |
| 449 | } |
| 450 | |
| 451 | if (effortValue === undefined) { |
| 452 | betas.push(EFFORT_BETA_HEADER) |
| 453 | } else if (typeof effortValue === 'string') { |
| 454 | // Send string effort level as is |
| 455 | outputConfig.effort = effortValue |
| 456 | betas.push(EFFORT_BETA_HEADER) |
| 457 | } else if (process.env.USER_TYPE === 'ant') { |
| 458 | // Numeric effort override - ant-only (uses anthropic_internal) |
| 459 | const existingInternal = |
| 460 | (extraBodyParams.anthropic_internal as Record<string, unknown>) || {} |
| 461 | extraBodyParams.anthropic_internal = { |
| 462 | ...existingInternal, |
| 463 | effort_override: effortValue, |
| 464 | } |
| 465 | } |
| 466 | } |
| 467 | |
| 468 | // output_config.task_budget — API-side token budget awareness for the model. |
| 469 | // Stainless SDK types don't yet include task_budget on BetaOutputConfig, so we |
no test coverage detected