Skip to content

Commit 0ce72f0

Browse files
committed
fix comment
1 parent 20abb58 commit 0ce72f0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

packages/core/src/utils/vercel-ai.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,13 @@ export function addVercelAiProcessors(client: Client): void {
249249
}
250250

251251
/**
252-
* For the gen_ai.invoke_agent span, correctly iterate over child spans and aggregate:
253-
* - Input tokens from client LLM child spans that include this attribute.
254-
* - Output tokens from client LLM child spans that include this attribute.
255-
* - Total tokens from client LLM child spans that include this attribute.
252+
* For the gen_ai.invoke_agent span, iterate over child spans and aggregate tokens:
253+
* - Input tokens from client LLM child spans that include `gen_ai.usage.input_tokens` attribute.
254+
* - Output tokens from client LLM child spans that include `gen_ai.usage.output_tokens` attribute.
255+
* - Total tokens from client LLM child spans that include `gen_ai.usage.total_tokens` attribute.
256256
*
257-
* Only immediate children of the invoke_agent span need to be considered,
257+
* Only immediate children of the `gen_ai.invoke_agent` span need to be considered,
258258
* since aggregation will automatically occur for each parent span.
259-
*
260259
*/
261260
function accumulateTokensFromChildSpans(spanJSON: SpanJSON, allSpans: SpanJSON[]): void {
262261
if (spanJSON.op !== 'gen_ai.invoke_agent') {

0 commit comments

Comments
 (0)