Streamed Anthropic thinking content_block_start has no signature field
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从server/anthropic_api.py开始,阅读_open_thinking()和_event();issue的复现过程展示了如何检查流式传输的content_block_start。为thinking块设置预期的空签名,并运行有针对性的流检查。开始事件包含"signature":""且与预期payload一致,即表示完成。
由索引模型根据 Issue 内容生成。
描述
A streamed thinking block's content_block_start on /v1/messages is {"type":"thinking","thinking":""}, with no signature. _open_thinking() (server/anthropic_api.py) never sets it, and _event() serializes with exclude_none=True. The Anthropic SDK types ThinkingBlock.signature as a required str. The non-streaming response and the closing signature_delta already send "".
import asyncio
from freetoken.server import anthropic_api as A
from freetoken.server.generation import ReasoningDelta, ContentDelta, GenDone
async def ev():
for e in (ReasoningDelta("x"), ContentDelta("hi"), GenDone("stop", 1, 1)):
yield e
async def main():
async for f in A.anthropic_event_stream(ev(), "m", 1):
if "content_block_start" in f:
print(f.splitlines()[1]) # ..."content_block":{"type":"thinking","thinking":""}...
asyncio.run(main())
Expected: {"type":"thinking","thinking":"","signature":""}.
Environment: main 07813248 (CPU-only check), Python 3.14.
Implementation (on my fork, with a test): e106a9e
- 主要语言
- Python
- 星标
- 14.2k
- 派生
- 1.4k
- 平均合并
- 21 小时 39 分钟
- 30 天内合并 PR
- 100
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
FlashML-org/FreeToken 的其他 Issue
-
Desktop feature
难度 2/5 1-3 小时 新手友好度 72/100
FlashML-org/FreeToken#800 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
FlashML-org/FreeToken#767 ·
维护者通常 1 天内回复
-
test_gemv_path_matches_the_transcription fails on sm_120 (bf16 rounding tie exceeds the tolerance)可能已有人在做 @void-mckenzie 于 17 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 77/100
FlashML-org/FreeToken#649 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
FlashML-org/FreeToken#648 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
FlashML-org/FreeToken#646 · 1 条评论 ·
维护者通常 1 天内回复
查看 FlashML-org/FreeToken 的全部 Issue
相似的 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 86/100
awslabs/visual-asset-management-system#937 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
follow-up
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 83/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 2 天内回复