billion-context 0.1.38 → 0.1.39
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 +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -49294,8 +49294,10 @@ function createOpenaiAdapter(requestBody) {
|
|
|
49294
49294
|
const delta = choice.delta;
|
|
49295
49295
|
const finishReason = typeof choice.finish_reason === "string" ? choice.finish_reason : void 0;
|
|
49296
49296
|
if (finishReason) {
|
|
49297
|
+
let yieldedToolCall = false;
|
|
49297
49298
|
for (const [, tc] of pending) {
|
|
49298
49299
|
if (tc.name.length > 0 || tc.id.length > 0) {
|
|
49300
|
+
yieldedToolCall = true;
|
|
49299
49301
|
yield {
|
|
49300
49302
|
kind: "tool_call",
|
|
49301
49303
|
name: tc.name,
|
|
@@ -49313,7 +49315,10 @@ function createOpenaiAdapter(requestBody) {
|
|
|
49313
49315
|
outputTokens: typeof u2?.completion_tokens === "number" ? u2.completion_tokens : void 0,
|
|
49314
49316
|
cachedTokens: typeof pd?.cached_tokens === "number" ? pd.cached_tokens : void 0
|
|
49315
49317
|
};
|
|
49316
|
-
yield {
|
|
49318
|
+
yield {
|
|
49319
|
+
kind: "done",
|
|
49320
|
+
finishReason: yieldedToolCall && finishReason === "stop" ? "tool_calls" : finishReason
|
|
49321
|
+
};
|
|
49317
49322
|
}
|
|
49318
49323
|
if (!delta) continue;
|
|
49319
49324
|
if (typeof delta.reasoning_content === "string" && delta.reasoning_content.length > 0) {
|