feat : BaseToolParser.feed 增加可选 token_ids 参数

- format_chunk ABC 改为 (token, **kwargs),body/token_ids 通过 kw 传入
- ProtocolHandler._handle_stream 逐 token encode 并透传
- Anthropic builder 用 **kwargs 吸收不使用的参数,零变更
- 新增 3 个 token_ids 参数测试
This commit is contained in:
2026-06-06 11:19:30 +08:00
parent 52aa4d01d5
commit 9e31d4ef2b
6 changed files with 105 additions and 13 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ class AnthropicResponseBuilder(ResponseBuilder):
),
]
def format_chunk(self, token: str, body: str) -> List[str]:
def format_chunk(self, token: str, **kwargs) -> List[str]:
return [
sse_event(
{