[API] Add token offsets to render endpoints (/v1/.../render) (#44226)

Signed-off-by: HyunKyun Moon <mhg5303@gmail.com>
This commit is contained in:
Hyunkyun Moon
2026-06-26 05:02:52 -07:00
committed by GitHub
parent d980a3cc6e
commit 950ee4c2e4
13 changed files with 518 additions and 22 deletions
+4
View File
@@ -38,6 +38,10 @@ class TokensInput(_InputOptions):
prompt: NotRequired[str]
"""The prompt text corresponding to the token IDs, if available."""
prompt_token_offsets: NotRequired[list[tuple[int, int]] | None]
"""Char-level (start, end) offsets per token, propagated from the
renderer's TokensPrompt when offsets were computed."""
def tokens_input(
prompt_token_ids: list[int],