@openrouter/ai-sdk-provider 2.4.2 → 2.4.3
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 +30 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +29 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +29 -2
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3896,6 +3896,13 @@ var OpenRouterChatLanguageModel = class {
|
|
|
3896
3896
|
id: toolCall.id,
|
|
3897
3897
|
toolName: toolCall.function.name
|
|
3898
3898
|
});
|
|
3899
|
+
if (toolCall.function.arguments) {
|
|
3900
|
+
controller.enqueue({
|
|
3901
|
+
type: "tool-input-delta",
|
|
3902
|
+
id: toolCall.id,
|
|
3903
|
+
delta: toolCall.function.arguments
|
|
3904
|
+
});
|
|
3905
|
+
}
|
|
3899
3906
|
}
|
|
3900
3907
|
if (((_o = toolCallDelta.function) == null ? void 0 : _o.arguments) != null) {
|
|
3901
3908
|
toolCall.function.arguments += (_q = (_p = toolCallDelta.function) == null ? void 0 : _p.arguments) != null ? _q : "";
|
|
@@ -3906,6 +3913,10 @@ var OpenRouterChatLanguageModel = class {
|
|
|
3906
3913
|
delta: (_r = toolCallDelta.function.arguments) != null ? _r : ""
|
|
3907
3914
|
});
|
|
3908
3915
|
if (((_s = toolCall.function) == null ? void 0 : _s.name) != null && ((_t = toolCall.function) == null ? void 0 : _t.arguments) != null && isParsableJson(toolCall.function.arguments)) {
|
|
3916
|
+
controller.enqueue({
|
|
3917
|
+
type: "tool-input-end",
|
|
3918
|
+
id: toolCall.id
|
|
3919
|
+
});
|
|
3909
3920
|
controller.enqueue({
|
|
3910
3921
|
type: "tool-call",
|
|
3911
3922
|
toolCallId: (_u = toolCall.id) != null ? _u : generateId(),
|
|
@@ -3951,12 +3962,28 @@ var OpenRouterChatLanguageModel = class {
|
|
|
3951
3962
|
if (finishReason.unified === "tool-calls") {
|
|
3952
3963
|
for (const toolCall of toolCalls) {
|
|
3953
3964
|
if (toolCall && !toolCall.sent) {
|
|
3965
|
+
const input = isParsableJson(toolCall.function.arguments) ? toolCall.function.arguments : "{}";
|
|
3966
|
+
if (!toolCall.inputStarted) {
|
|
3967
|
+
controller.enqueue({
|
|
3968
|
+
type: "tool-input-start",
|
|
3969
|
+
id: toolCall.id,
|
|
3970
|
+
toolName: toolCall.function.name
|
|
3971
|
+
});
|
|
3972
|
+
controller.enqueue({
|
|
3973
|
+
type: "tool-input-delta",
|
|
3974
|
+
id: toolCall.id,
|
|
3975
|
+
delta: input
|
|
3976
|
+
});
|
|
3977
|
+
}
|
|
3978
|
+
controller.enqueue({
|
|
3979
|
+
type: "tool-input-end",
|
|
3980
|
+
id: toolCall.id
|
|
3981
|
+
});
|
|
3954
3982
|
controller.enqueue({
|
|
3955
3983
|
type: "tool-call",
|
|
3956
3984
|
toolCallId: (_a17 = toolCall.id) != null ? _a17 : generateId(),
|
|
3957
3985
|
toolName: toolCall.function.name,
|
|
3958
|
-
|
|
3959
|
-
input: isParsableJson(toolCall.function.arguments) ? toolCall.function.arguments : "{}",
|
|
3986
|
+
input,
|
|
3960
3987
|
providerMetadata: !reasoningDetailsAttachedToToolCall ? {
|
|
3961
3988
|
openrouter: {
|
|
3962
3989
|
reasoning_details: accumulatedReasoningDetails
|
|
@@ -4786,7 +4813,7 @@ function withUserAgentSuffix2(headers, ...userAgentSuffixParts) {
|
|
|
4786
4813
|
}
|
|
4787
4814
|
|
|
4788
4815
|
// src/version.ts
|
|
4789
|
-
var VERSION2 = false ? "0.0.0-test" : "2.4.
|
|
4816
|
+
var VERSION2 = false ? "0.0.0-test" : "2.4.3";
|
|
4790
4817
|
|
|
4791
4818
|
// src/provider.ts
|
|
4792
4819
|
function createOpenRouter(options = {}) {
|