@@ -953,7 +953,10 @@ describe("AI SDK Transformations", () => {
953953 attributes [ SpanAttributes . LLM_USAGE_CACHE_CREATION_INPUT_TOKENS ] ,
954954 1024 ,
955955 ) ;
956- assert . strictEqual ( attributes [ "ai.usage.cacheCreationInputTokens" ] , undefined ) ;
956+ assert . strictEqual (
957+ attributes [ "ai.usage.cacheCreationInputTokens" ] ,
958+ undefined ,
959+ ) ;
957960 assert . strictEqual ( attributes . someOtherAttr , "value" ) ;
958961 } ) ;
959962
@@ -969,7 +972,10 @@ describe("AI SDK Transformations", () => {
969972 attributes [ SpanAttributes . LLM_USAGE_CACHE_READ_INPUT_TOKENS ] ,
970973 512 ,
971974 ) ;
972- assert . strictEqual ( attributes [ "ai.usage.cacheReadInputTokens" ] , undefined ) ;
975+ assert . strictEqual (
976+ attributes [ "ai.usage.cacheReadInputTokens" ] ,
977+ undefined ,
978+ ) ;
973979 assert . strictEqual ( attributes . someOtherAttr , "value" ) ;
974980 } ) ;
975981
@@ -1007,11 +1013,26 @@ describe("AI SDK Transformations", () => {
10071013 attributes [ SpanAttributes . LLM_USAGE_CACHE_READ_INPUT_TOKENS ] ,
10081014 512 ,
10091015 ) ;
1010- assert . strictEqual ( attributes [ SpanAttributes . LLM_USAGE_INPUT_TOKENS ] , 2048 ) ;
1011- assert . strictEqual ( attributes [ SpanAttributes . LLM_USAGE_OUTPUT_TOKENS ] , 100 ) ;
1012- assert . strictEqual ( attributes [ SpanAttributes . LLM_USAGE_TOTAL_TOKENS ] , 2148 ) ;
1013- assert . strictEqual ( attributes [ "ai.usage.cacheCreationInputTokens" ] , undefined ) ;
1014- assert . strictEqual ( attributes [ "ai.usage.cacheReadInputTokens" ] , undefined ) ;
1016+ assert . strictEqual (
1017+ attributes [ SpanAttributes . LLM_USAGE_INPUT_TOKENS ] ,
1018+ 2048 ,
1019+ ) ;
1020+ assert . strictEqual (
1021+ attributes [ SpanAttributes . LLM_USAGE_OUTPUT_TOKENS ] ,
1022+ 100 ,
1023+ ) ;
1024+ assert . strictEqual (
1025+ attributes [ SpanAttributes . LLM_USAGE_TOTAL_TOKENS ] ,
1026+ 2148 ,
1027+ ) ;
1028+ assert . strictEqual (
1029+ attributes [ "ai.usage.cacheCreationInputTokens" ] ,
1030+ undefined ,
1031+ ) ;
1032+ assert . strictEqual (
1033+ attributes [ "ai.usage.cacheReadInputTokens" ] ,
1034+ undefined ,
1035+ ) ;
10151036 } ) ;
10161037
10171038 it ( "should prefer cacheReadInputTokens over cachedInputTokens when both present" , ( ) => {
@@ -1029,7 +1050,10 @@ describe("AI SDK Transformations", () => {
10291050 attributes [ SpanAttributes . LLM_USAGE_CACHE_READ_INPUT_TOKENS ] ,
10301051 256 ,
10311052 ) ;
1032- assert . strictEqual ( attributes [ "ai.usage.cacheReadInputTokens" ] , undefined ) ;
1053+ assert . strictEqual (
1054+ attributes [ "ai.usage.cacheReadInputTokens" ] ,
1055+ undefined ,
1056+ ) ;
10331057 assert . strictEqual ( attributes [ "ai.usage.cachedInputTokens" ] , undefined ) ;
10341058 } ) ;
10351059
@@ -1079,7 +1103,10 @@ describe("AI SDK Transformations", () => {
10791103 transformLLMSpans ( attributes ) ;
10801104
10811105 // Should preserve input tokens and add total tokens
1082- assert . strictEqual ( attributes [ SpanAttributes . LLM_USAGE_INPUT_TOKENS ] , 100 ) ;
1106+ assert . strictEqual (
1107+ attributes [ SpanAttributes . LLM_USAGE_INPUT_TOKENS ] ,
1108+ 100 ,
1109+ ) ;
10831110 assert . strictEqual ( attributes . someOtherAttr , "value" ) ;
10841111 assert . strictEqual (
10851112 attributes [ SpanAttributes . LLM_USAGE_CACHE_CREATION_INPUT_TOKENS ] ,
@@ -1128,8 +1155,14 @@ describe("AI SDK Transformations", () => {
11281155 assert . strictEqual ( attributes [ SpanAttributes . LLM_SYSTEM ] , "Anthropic" ) ;
11291156
11301157 // Check original attributes are removed
1131- assert . strictEqual ( attributes [ "ai.usage.cacheCreationInputTokens" ] , undefined ) ;
1132- assert . strictEqual ( attributes [ "ai.usage.cacheReadInputTokens" ] , undefined ) ;
1158+ assert . strictEqual (
1159+ attributes [ "ai.usage.cacheCreationInputTokens" ] ,
1160+ undefined ,
1161+ ) ;
1162+ assert . strictEqual (
1163+ attributes [ "ai.usage.cacheReadInputTokens" ] ,
1164+ undefined ,
1165+ ) ;
11331166 assert . strictEqual ( attributes [ "ai.response.text" ] , undefined ) ;
11341167 assert . strictEqual ( attributes [ "ai.model.provider" ] , undefined ) ;
11351168 assert . strictEqual ( attributes . someOtherAttr , "value" ) ;
0 commit comments