@ai-sdk/openai 4.0.0-canary.65 → 4.0.0-canary.67
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 +15 -0
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +195 -1
- package/dist/internal/index.js +19 -14
- package/dist/internal/index.js.map +1 -1
- package/package.json +2 -2
- package/src/internal/index.ts +1 -0
- package/src/responses/convert-to-openai-responses-input.ts +23 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 4.0.0-canary.67
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 61bcdb5: fix(provider/openai): send client-executed tool calls as full function_call items in the Responses API so they pair with their function_call_output by call_id
|
|
8
|
+
- Updated dependencies [ee798eb]
|
|
9
|
+
- Updated dependencies [daf6637]
|
|
10
|
+
- @ai-sdk/provider-utils@5.0.0-canary.45
|
|
11
|
+
|
|
12
|
+
## 4.0.0-canary.66
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- e776fc7: feat(provider/azure):web search tool in the Azure OpenAI Responses API.
|
|
17
|
+
|
|
3
18
|
## 4.0.0-canary.65
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -2963,7 +2963,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2963
2963
|
hasApplyPatchTool = false,
|
|
2964
2964
|
customProviderToolNames
|
|
2965
2965
|
}) {
|
|
2966
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
2966
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
|
|
2967
2967
|
let input = [];
|
|
2968
2968
|
const warnings = [];
|
|
2969
2969
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
@@ -3128,10 +3128,11 @@ async function convertToOpenAIResponsesInput({
|
|
|
3128
3128
|
}
|
|
3129
3129
|
break;
|
|
3130
3130
|
}
|
|
3131
|
-
if (store && id != null) {
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3131
|
+
if (hasPreviousResponseId && store && id != null) {
|
|
3132
|
+
break;
|
|
3133
|
+
}
|
|
3134
|
+
const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === "local_shell" || hasShellTool && resolvedToolName === "shell" || hasApplyPatchTool && resolvedToolName === "apply_patch" || ((_h = customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) != null ? _h : false);
|
|
3135
|
+
if (store && id != null && isProviderDefinedToolCall) {
|
|
3135
3136
|
input.push({ type: "item_reference", id });
|
|
3136
3137
|
break;
|
|
3137
3138
|
}
|
|
@@ -3201,8 +3202,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3201
3202
|
type: "function_call",
|
|
3202
3203
|
call_id: part.toolCallId,
|
|
3203
3204
|
name: resolvedToolName,
|
|
3204
|
-
arguments: serializeToolCallArguments2(part.input)
|
|
3205
|
-
id
|
|
3205
|
+
arguments: serializeToolCallArguments2(part.input)
|
|
3206
3206
|
});
|
|
3207
3207
|
break;
|
|
3208
3208
|
}
|
|
@@ -3218,7 +3218,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3218
3218
|
part.toolName
|
|
3219
3219
|
);
|
|
3220
3220
|
if (resolvedResultToolName === "tool_search") {
|
|
3221
|
-
const itemId = (
|
|
3221
|
+
const itemId = (_k = (_j = (_i = part.providerOptions) == null ? void 0 : _i[providerOptionsName]) == null ? void 0 : _j.itemId) != null ? _k : part.toolCallId;
|
|
3222
3222
|
if (store) {
|
|
3223
3223
|
input.push({ type: "item_reference", id: itemId });
|
|
3224
3224
|
} else if (part.output.type === "json") {
|
|
@@ -3259,7 +3259,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3259
3259
|
break;
|
|
3260
3260
|
}
|
|
3261
3261
|
if (store) {
|
|
3262
|
-
const itemId = (
|
|
3262
|
+
const itemId = (_n = (_m = (_l = part.providerOptions) == null ? void 0 : _l[providerOptionsName]) == null ? void 0 : _m.itemId) != null ? _n : part.toolCallId;
|
|
3263
3263
|
input.push({ type: "item_reference", id: itemId });
|
|
3264
3264
|
} else {
|
|
3265
3265
|
warnings.push({
|
|
@@ -3344,7 +3344,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3344
3344
|
}
|
|
3345
3345
|
case "custom": {
|
|
3346
3346
|
if (part.kind === "openai.compaction") {
|
|
3347
|
-
const providerOptions = (
|
|
3347
|
+
const providerOptions = (_o = part.providerOptions) == null ? void 0 : _o[providerOptionsName];
|
|
3348
3348
|
const id = providerOptions == null ? void 0 : providerOptions.itemId;
|
|
3349
3349
|
if (hasConversation && id != null) {
|
|
3350
3350
|
break;
|
|
@@ -3391,7 +3391,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3391
3391
|
}
|
|
3392
3392
|
const output = part.output;
|
|
3393
3393
|
if (output.type === "execution-denied") {
|
|
3394
|
-
const approvalId = (
|
|
3394
|
+
const approvalId = (_q = (_p = output.providerOptions) == null ? void 0 : _p.openai) == null ? void 0 : _q.approvalId;
|
|
3395
3395
|
if (approvalId) {
|
|
3396
3396
|
continue;
|
|
3397
3397
|
}
|
|
@@ -3465,7 +3465,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3465
3465
|
outputValue = output.value;
|
|
3466
3466
|
break;
|
|
3467
3467
|
case "execution-denied":
|
|
3468
|
-
outputValue = (
|
|
3468
|
+
outputValue = (_r = output.reason) != null ? _r : "Tool call execution denied.";
|
|
3469
3469
|
break;
|
|
3470
3470
|
case "json":
|
|
3471
3471
|
case "error-json":
|
|
@@ -3542,7 +3542,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3542
3542
|
contentValue = output.value;
|
|
3543
3543
|
break;
|
|
3544
3544
|
case "execution-denied":
|
|
3545
|
-
contentValue = (
|
|
3545
|
+
contentValue = (_s = output.reason) != null ? _s : "Tool call execution denied.";
|
|
3546
3546
|
break;
|
|
3547
3547
|
case "json":
|
|
3548
3548
|
case "error-json":
|
|
@@ -7320,7 +7320,7 @@ var OpenAISkills = class {
|
|
|
7320
7320
|
};
|
|
7321
7321
|
|
|
7322
7322
|
// src/version.ts
|
|
7323
|
-
var VERSION = true ? "4.0.0-canary.
|
|
7323
|
+
var VERSION = true ? "4.0.0-canary.67" : "0.0.0-test";
|
|
7324
7324
|
|
|
7325
7325
|
// src/openai-provider.ts
|
|
7326
7326
|
function createOpenAI(options = {}) {
|