Propogate streaming token stats to chat calls

This commit is contained in:
Nicolas Mowen 2026-05-14 09:36:13 -06:00
parent 475f87d40b
commit ee20bd9930

View File

@ -1411,6 +1411,11 @@ When a user refers to a specific object they have seen or describe with identify
)
+ b"\n"
)
elif kind == "stats":
yield (
json.dumps({"type": "stats", **value}).encode("utf-8")
+ b"\n"
)
elif kind == "message":
msg = value
if msg.get("finish_reason") == "error":