mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-02 22:32:27 +08:00
Bedrock streaming responses don't auto-report token usage to OpenTelemetry. This fix manually sets span attributes (ai.usage.promptTokens, gen_ai.usage.input_tokens) from the AI SDK onFinish callback to ensure Langfuse captures token counts.