@zenning/openai 3.0.23 → 3.0.25

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 3.0.25
4
+
5
+ ### Patch Changes
6
+
7
+ - rgr
8
+
9
+ ## 3.0.24
10
+
11
+ ### Patch Changes
12
+
13
+ - efverv
14
+
3
15
  ## 3.0.23
4
16
 
5
17
  ### Patch Changes
package/dist/index.js CHANGED
@@ -2488,10 +2488,23 @@ async function convertToOpenAIResponsesInput({
2488
2488
  const warnings = [];
2489
2489
  const processedApprovalIds = /* @__PURE__ */ new Set();
2490
2490
  const approvalToolCallIds = new Set(approvalToolCallIdsArray || []);
2491
+ console.log("CALDEBUG [convertToOpenAIResponsesInput] Starting conversion:", {
2492
+ containsApprovalResponses,
2493
+ approvalToolCallIdsCount: approvalToolCallIds.size,
2494
+ approvalToolCallIds: Array.from(approvalToolCallIds),
2495
+ previousResponseId,
2496
+ promptLength: prompt.length
2497
+ });
2491
2498
  if (compactionInput && compactionInput.length > 0) {
2492
2499
  input.push(...compactionInput);
2493
2500
  }
2494
2501
  for (const { role, content } of prompt) {
2502
+ console.log("CALDEBUG [convertToOpenAIResponsesInput] Processing message:", {
2503
+ role,
2504
+ isString: typeof content === "string",
2505
+ partsCount: typeof content === "string" ? 0 : content.length,
2506
+ partTypes: typeof content === "string" ? [] : content.map((p) => p.type)
2507
+ });
2495
2508
  switch (role) {
2496
2509
  case "system": {
2497
2510
  switch (systemMessageMode) {
@@ -2722,6 +2735,10 @@ async function convertToOpenAIResponsesInput({
2722
2735
  break;
2723
2736
  }
2724
2737
  case "tool": {
2738
+ console.log("CALDEBUG [convertToOpenAIResponsesInput] Processing tool role message:", {
2739
+ partsCount: content.length,
2740
+ partTypes: content.map((p) => p.type)
2741
+ });
2725
2742
  for (const part of content) {
2726
2743
  if (part.type === "tool-approval-response") {
2727
2744
  const approvalResponse = part;
@@ -2745,6 +2762,13 @@ async function convertToOpenAIResponsesInput({
2745
2762
  const output = part.output;
2746
2763
  if (output.type === "execution-denied") {
2747
2764
  const approvalId = (_l = (_k = output.providerOptions) == null ? void 0 : _k.openai) == null ? void 0 : _l.approvalId;
2765
+ console.log("CALDEBUG [convertToOpenAIResponsesInput] Found execution-denied:", {
2766
+ toolCallId: part.toolCallId,
2767
+ toolName: part.toolName,
2768
+ hasApprovalId: !!approvalId,
2769
+ approvalId,
2770
+ willSkip: !!approvalId
2771
+ });
2748
2772
  if (approvalId) {
2749
2773
  continue;
2750
2774
  }
@@ -2854,6 +2878,15 @@ async function convertToOpenAIResponsesInput({
2854
2878
  }
2855
2879
  }
2856
2880
  }
2881
+ console.log("CALDEBUG [convertToOpenAIResponsesInput] Final input:", {
2882
+ inputLength: input.length,
2883
+ inputTypes: input.map((item) => item.type || item.role),
2884
+ hasItemReferences: input.some((item) => item.type === "item_reference"),
2885
+ itemReferences: input.filter((item) => item.type === "item_reference").map((item) => ({
2886
+ type: item.type,
2887
+ id: typeof item.id === "string" ? item.id.substring(0, 20) + "..." : item.id
2888
+ }))
2889
+ });
2857
2890
  return { input, warnings };
2858
2891
  }
2859
2892
  var openaiResponsesReasoningProviderOptionsSchema = import_v418.z.object({
@@ -5793,7 +5826,7 @@ var OpenAITranscriptionModel = class {
5793
5826
  };
5794
5827
 
5795
5828
  // src/version.ts
5796
- var VERSION = true ? "3.0.23" : "0.0.0-test";
5829
+ var VERSION = true ? "3.0.25" : "0.0.0-test";
5797
5830
 
5798
5831
  // src/openai-provider.ts
5799
5832
  function createOpenAI(options = {}) {