(
taskBudget: Options['taskBudget'],
outputConfig: BetaOutputConfig & { task_budget?: TaskBudgetParam },
betas: string[],
)
| 477 | } |
| 478 | |
| 479 | export function configureTaskBudgetParams( |
| 480 | taskBudget: Options['taskBudget'], |
| 481 | outputConfig: BetaOutputConfig & { task_budget?: TaskBudgetParam }, |
| 482 | betas: string[], |
| 483 | ): void { |
| 484 | if ( |
| 485 | !taskBudget || |
| 486 | 'task_budget' in outputConfig || |
| 487 | !shouldIncludeFirstPartyOnlyBetas() |
| 488 | ) { |
| 489 | return |
| 490 | } |
| 491 | outputConfig.task_budget = { |
| 492 | type: 'tokens', |
| 493 | total: taskBudget.total, |
| 494 | ...(taskBudget.remaining !== undefined && { |
| 495 | remaining: taskBudget.remaining, |
| 496 | }), |
| 497 | } |
| 498 | if (!betas.includes(TASK_BUDGETS_BETA_HEADER)) { |
| 499 | betas.push(TASK_BUDGETS_BETA_HEADER) |
| 500 | } |
| 501 | } |
| 502 | |
| 503 | export function getAPIMetadata() { |
| 504 | // https://docs.google.com/document/d/1dURO9ycXXQCBS0V4Vhl4poDBRgkelFc5t2BNPoEgH5Q/edit?tab=t.0#heading=h.5g7nec5b09w5 |
no test coverage detected