nitro_intelligence 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: feb0fe8d0b4ae0d1da8564f048fa7130dc78318622a23a86163edc65d2f37dbf
|
|
4
|
+
data.tar.gz: 122277bfc6b70b0aeb67166624458f37f50b1ed2b1a77044ade87575ea101bb1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bf69e4777017afa0be7457612c42aadf434921c083b3a199e13a0682959b6579494793069e2548c592dd022ac5a96d342155549cfa5d36fdf798bd0a05bd647f
|
|
7
|
+
data.tar.gz: 18854e89e04d994bddc0315296d5f21ad2551dd9b7d64d01efda6aadc25dbcd0858d1e8f24dacb2f2b261b2b65ab1bb3fe747956f5064ce6ef176b017e59b712
|
|
@@ -74,16 +74,25 @@ module NitroIntelligence
|
|
|
74
74
|
# (OpenAI::Models::Audio::Transcription), so neither is set again here.
|
|
75
75
|
trace_attributes = {
|
|
76
76
|
output: audio_transcription.text,
|
|
77
|
-
usage_details:
|
|
78
|
-
input_tokens: audio_transcription.usage.input_tokens,
|
|
79
|
-
output_tokens: audio_transcription.usage.output_tokens,
|
|
80
|
-
total_tokens: audio_transcription.usage.total_tokens,
|
|
81
|
-
},
|
|
77
|
+
usage_details: usage_details(audio_transcription.usage),
|
|
82
78
|
cost_details: @base_handler.cost_details(audio_transcription),
|
|
83
79
|
}
|
|
84
80
|
|
|
85
81
|
[audio_transcription, trace_attributes]
|
|
86
82
|
end
|
|
83
|
+
|
|
84
|
+
def usage_details(usage)
|
|
85
|
+
case usage
|
|
86
|
+
when OpenAI::Models::Audio::Transcription::Usage::Tokens
|
|
87
|
+
{
|
|
88
|
+
input_tokens: usage.input_tokens,
|
|
89
|
+
output_tokens: usage.output_tokens,
|
|
90
|
+
total_tokens: usage.total_tokens,
|
|
91
|
+
}
|
|
92
|
+
when OpenAI::Models::Audio::Transcription::Usage::Duration
|
|
93
|
+
{ input_audio_seconds: usage.seconds.ceil }
|
|
94
|
+
end
|
|
95
|
+
end
|
|
87
96
|
end
|
|
88
97
|
end
|
|
89
98
|
end
|