gitlab-ai-provider 6.7.0 → 6.7.1
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/CHANGELOG.md +7 -0
- package/dist/gitlab-ai-provider-6.7.1.tgz +0 -0
- package/dist/index.js +13 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/gitlab-ai-provider-6.7.0.tgz +0 -0
package/dist/index.mjs
CHANGED
|
@@ -403,14 +403,15 @@ ${message.content}` : message.content;
|
|
|
403
403
|
return { unified, raw: stopReason ?? void 0 };
|
|
404
404
|
}
|
|
405
405
|
createUsage(params) {
|
|
406
|
-
const
|
|
406
|
+
const inputNoCache = params?.inputTotal;
|
|
407
407
|
const outputTotal = params?.outputTotal;
|
|
408
408
|
const cacheRead = params?.cacheRead;
|
|
409
409
|
const cacheWrite = params?.cacheWrite;
|
|
410
|
+
const inputTotal = inputNoCache != null ? inputNoCache + (cacheRead ?? 0) + (cacheWrite ?? 0) : void 0;
|
|
410
411
|
return {
|
|
411
412
|
inputTokens: {
|
|
412
413
|
total: inputTotal,
|
|
413
|
-
noCache:
|
|
414
|
+
noCache: inputNoCache,
|
|
414
415
|
cacheRead,
|
|
415
416
|
cacheWrite
|
|
416
417
|
},
|
|
@@ -538,12 +539,13 @@ ${message.content}` : message.content;
|
|
|
538
539
|
switch (event.type) {
|
|
539
540
|
case "message_start":
|
|
540
541
|
if (event.message.usage) {
|
|
542
|
+
const msgUsage = event.message.usage;
|
|
541
543
|
usage = self.createUsage({
|
|
542
|
-
inputTotal:
|
|
544
|
+
inputTotal: msgUsage.input_tokens,
|
|
543
545
|
outputTotal: usage.outputTokens.total,
|
|
544
546
|
outputReasoning: usage.outputTokens.reasoning,
|
|
545
|
-
cacheRead:
|
|
546
|
-
cacheWrite:
|
|
547
|
+
cacheRead: msgUsage.cache_read_input_tokens,
|
|
548
|
+
cacheWrite: msgUsage.cache_creation_input_tokens,
|
|
547
549
|
raw: usage.raw
|
|
548
550
|
});
|
|
549
551
|
}
|
|
@@ -617,12 +619,13 @@ ${message.content}` : message.content;
|
|
|
617
619
|
}
|
|
618
620
|
case "message_delta":
|
|
619
621
|
if (event.usage) {
|
|
622
|
+
const deltaUsage = event.usage;
|
|
620
623
|
usage = self.createUsage({
|
|
621
|
-
inputTotal: usage.inputTokens.
|
|
622
|
-
outputTotal:
|
|
624
|
+
inputTotal: usage.inputTokens.noCache,
|
|
625
|
+
outputTotal: deltaUsage.output_tokens,
|
|
623
626
|
outputReasoning: usage.outputTokens.reasoning,
|
|
624
|
-
cacheRead: usage.inputTokens.cacheRead,
|
|
625
|
-
cacheWrite: usage.inputTokens.cacheWrite,
|
|
627
|
+
cacheRead: deltaUsage.cache_read_input_tokens ?? usage.inputTokens.cacheRead,
|
|
628
|
+
cacheWrite: deltaUsage.cache_creation_input_tokens ?? usage.inputTokens.cacheWrite,
|
|
626
629
|
raw: usage.raw
|
|
627
630
|
});
|
|
628
631
|
}
|
|
@@ -1610,7 +1613,7 @@ var GitLabOpenAILanguageModel = class {
|
|
|
1610
1613
|
import WebSocket from "isomorphic-ws";
|
|
1611
1614
|
|
|
1612
1615
|
// src/version.ts
|
|
1613
|
-
var VERSION = true ? "6.
|
|
1616
|
+
var VERSION = true ? "6.7.0" : "0.0.0-dev";
|
|
1614
1617
|
|
|
1615
1618
|
// src/gitlab-workflow-types.ts
|
|
1616
1619
|
var WorkflowType = /* @__PURE__ */ ((WorkflowType2) => {
|