openlayer 0.0.8 → 0.1.0
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.
- package/dist/index.js +5 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -46,7 +46,7 @@ class OpenAIMonitor {
|
|
|
46
46
|
tokensColumnName: 'tokens',
|
|
47
47
|
},
|
|
48
48
|
rows: [
|
|
49
|
-
Object.assign({ id: (0, uuid_1.v4)()
|
|
49
|
+
Object.assign(Object.assign({}, data), { id: (0, uuid_1.v4)(), timestamp: data.timestamp / 1000 }),
|
|
50
50
|
],
|
|
51
51
|
}),
|
|
52
52
|
headers: {
|
|
@@ -171,6 +171,7 @@ class OpenAIMonitor {
|
|
|
171
171
|
input: this.formatChatCompletionInput(body.messages),
|
|
172
172
|
latency,
|
|
173
173
|
output: outputData,
|
|
174
|
+
timestamp: startTime,
|
|
174
175
|
});
|
|
175
176
|
}
|
|
176
177
|
else {
|
|
@@ -182,6 +183,7 @@ class OpenAIMonitor {
|
|
|
182
183
|
input: this.formatChatCompletionInput(body.messages),
|
|
183
184
|
latency,
|
|
184
185
|
output: nonStreamedResponse.choices[0].message.content,
|
|
186
|
+
timestamp: startTime,
|
|
185
187
|
tokens: (_e = (_d = nonStreamedResponse.usage) === null || _d === void 0 ? void 0 : _d.total_tokens) !== null && _e !== void 0 ? _e : 0,
|
|
186
188
|
});
|
|
187
189
|
}
|
|
@@ -224,6 +226,7 @@ class OpenAIMonitor {
|
|
|
224
226
|
input: body.prompt,
|
|
225
227
|
latency,
|
|
226
228
|
output: outputData,
|
|
229
|
+
timestamp: startTime,
|
|
227
230
|
tokens: tokensData,
|
|
228
231
|
});
|
|
229
232
|
}
|
|
@@ -236,6 +239,7 @@ class OpenAIMonitor {
|
|
|
236
239
|
input: body.prompt,
|
|
237
240
|
latency,
|
|
238
241
|
output: nonStreamedResponse.choices[0].text,
|
|
242
|
+
timestamp: startTime,
|
|
239
243
|
tokens: (_o = (_m = nonStreamedResponse.usage) === null || _m === void 0 ? void 0 : _m.total_tokens) !== null && _o !== void 0 ? _o : 0,
|
|
240
244
|
});
|
|
241
245
|
}
|