core/src/tracing/vercel-ai/index.ts
Another tough one: The vercel AI event processor does a lot of post processing:
- setting/removing attributes on a single ended span (
processEndedVercelAiSpan, applyToolDescriptionsAndTokens) should be easy to port to client.processSpan
- We accumulate token usage data on parent spans (
accumulateTokensForParent, applyAccumulatedTokens). This can become more dangerous because to guarantee continued correctness, we need a guarantee that the child spans end before their parent so that we can accumulate at end time. This might need careful investigation if its the case. Otherwise we loose accuracy.
core/src/tracing/vercel-ai/index.tsAnother tough one: The vercel AI event processor does a lot of post processing:
processEndedVercelAiSpan,applyToolDescriptionsAndTokens) should be easy to port toclient.processSpanaccumulateTokensForParent,applyAccumulatedTokens). This can become more dangerous because to guarantee continued correctness, we need a guarantee that the child spans end before their parent so that we can accumulate at end time. This might need careful investigation if its the case. Otherwise we loose accuracy.