@@ -28,6 +28,7 @@ func TestImageGeneration_RecordTokenUsage(t *testing.T) {
2828 attrsBase = []attribute.KeyValue {
2929 attribute .Key (genaiAttributeOperationName ).String (genaiOperationImageGeneration ),
3030 attribute .Key (genaiAttributeProviderName ).String (genaiProviderOpenAI ),
31+ attribute .Key (genaiAttributeOriginalModel ).String ("test-model" ),
3132 attribute .Key (genaiAttributeRequestModel ).String ("test-model" ),
3233 attribute .Key (genaiAttributeResponseModel ).String ("test-model" ),
3334 }
@@ -36,7 +37,9 @@ func TestImageGeneration_RecordTokenUsage(t *testing.T) {
3637 )
3738
3839 // Set labels and record usage.
39- im .SetModel ("test-model" , "test-model" )
40+ im .SetOriginalModel ("test-model" )
41+ im .SetRequestModel ("test-model" )
42+ im .SetResponseModel ("test-model" )
4043 im .SetBackend (& filterapi.Backend {Schema : filterapi.VersionedAPISchema {Name : filterapi .APISchemaOpenAI }})
4144 im .RecordTokenUsage (t .Context (), 3 , 7 , nil )
4245
@@ -60,6 +63,7 @@ func TestImageGeneration_RecordImageGeneration(t *testing.T) {
6063 attrs := attribute .NewSet (
6164 attribute .Key (genaiAttributeOperationName ).String (genaiOperationImageGeneration ),
6265 attribute .Key (genaiAttributeProviderName ).String (genaiProviderOpenAI ),
66+ attribute .Key (genaiAttributeOriginalModel ).String ("img-model" ),
6367 attribute .Key (genaiAttributeRequestModel ).String ("img-model" ),
6468 attribute .Key (genaiAttributeResponseModel ).String ("img-model" ),
6569 attribute .Key ("gen_ai.image.count" ).Int (2 ),
@@ -68,7 +72,9 @@ func TestImageGeneration_RecordImageGeneration(t *testing.T) {
6872 )
6973
7074 im .StartRequest (nil )
71- im .SetModel ("img-model" , "img-model" )
75+ im .SetOriginalModel ("img-model" )
76+ im .SetRequestModel ("img-model" )
77+ im .SetResponseModel ("img-model" )
7278 im .SetBackend (& filterapi.Backend {Schema : filterapi.VersionedAPISchema {Name : filterapi .APISchemaOpenAI }})
7379
7480 time .Sleep (10 * time .Millisecond )
@@ -94,13 +100,16 @@ func TestImageGeneration_HeaderLabelMapping(t *testing.T) {
94100 "x-org-id" : "org456" ,
95101 }
96102
97- im .SetModel ("test-model" , "test-model" )
103+ im .SetOriginalModel ("test-model" )
104+ im .SetRequestModel ("test-model" )
105+ im .SetResponseModel ("test-model" )
98106 im .SetBackend (& filterapi.Backend {Schema : filterapi.VersionedAPISchema {Name : filterapi .APISchemaOpenAI }})
99107 im .RecordTokenUsage (t .Context (), 5 , 0 , requestHeaders )
100108
101109 attrs := attribute .NewSet (
102110 attribute .Key (genaiAttributeOperationName ).String (genaiOperationImageGeneration ),
103111 attribute .Key (genaiAttributeProviderName ).String (genaiProviderOpenAI ),
112+ attribute .Key (genaiAttributeOriginalModel ).String ("test-model" ),
104113 attribute .Key (genaiAttributeRequestModel ).String ("test-model" ),
105114 attribute .Key (genaiAttributeResponseModel ).String ("test-model" ),
106115 attribute .Key (genaiAttributeTokenType ).String (genaiTokenTypeInput ),
0 commit comments