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