Commit b7b5d07
committed
fix(token-count): include Antigravity preprompt tokens in count
Token counting endpoints (/v1/token-count and /v1/messages/count_tokens)
were returning inaccurate counts because they didn't include the
Antigravity preprompts that get injected during actual API calls.
- Add get_antigravity_preprompt_text() helper to expose preprompt text
- Update RotatingClient.token_count() to add preprompt tokens for
Antigravity provider models
Signed-off-by: Moeeze Hassan <[email protected]>1 parent 67ffea5 commit b7b5d07
File tree
2 files changed
+64
-3
lines changed- src/rotator_library
- providers
2 files changed
+64
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2464 | 2464 | | |
2465 | 2465 | | |
2466 | 2466 | | |
2467 | | - | |
| 2467 | + | |
| 2468 | + | |
| 2469 | + | |
| 2470 | + | |
| 2471 | + | |
| 2472 | + | |
2468 | 2473 | | |
2469 | 2474 | | |
2470 | 2475 | | |
2471 | 2476 | | |
2472 | 2477 | | |
2473 | 2478 | | |
2474 | 2479 | | |
| 2480 | + | |
| 2481 | + | |
2475 | 2482 | | |
2476 | | - | |
| 2483 | + | |
2477 | 2484 | | |
2478 | | - | |
| 2485 | + | |
2479 | 2486 | | |
2480 | 2487 | | |
2481 | 2488 | | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
2482 | 2507 | | |
2483 | 2508 | | |
2484 | 2509 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
452 | 488 | | |
453 | 489 | | |
454 | 490 | | |
| |||
0 commit comments