@zenning/openai 1.4.8 → 1.4.9

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.
@@ -2727,16 +2727,14 @@ var OpenAIResponsesLanguageModel = class {
2727
2727
  console.log("\u2705 Created URL source:", JSON.stringify(urlSource, null, 2));
2728
2728
  return urlSource;
2729
2729
  } else if (annotation.type === "file_citation") {
2730
- const documentSource = {
2731
- sourceType: "document",
2730
+ const urlSource = {
2731
+ sourceType: "url",
2732
2732
  id: (_f2 = (_e2 = (_d2 = this.config).generateId) == null ? void 0 : _e2.call(_d2)) != null ? _f2 : generateId2(),
2733
- mediaType: "text/plain",
2734
- title: annotation.quote || annotation.filename || "Document",
2735
- filename: annotation.filename,
2736
- quote: annotation.quote
2733
+ url: `file://${annotation.file_id}`,
2734
+ title: annotation.quote || annotation.filename || "Document"
2737
2735
  };
2738
- console.log("\u{1F4C4} Created document source:", JSON.stringify(documentSource, null, 2));
2739
- return documentSource;
2736
+ console.log("\u{1F4C4} Created URL source for file citation:", JSON.stringify(urlSource, null, 2));
2737
+ return urlSource;
2740
2738
  } else {
2741
2739
  console.log("\u26A0\uFE0F Unknown annotation type in doGenerate:", annotation.type);
2742
2740
  return {
@@ -3036,23 +3034,21 @@ var OpenAIResponsesLanguageModel = class {
3036
3034
  });
3037
3035
  console.log("\u2705 URL source enqueued successfully");
3038
3036
  } else if (value.annotation.type === "file_citation") {
3039
- console.log("\u{1F4C4} Processing FILE citation - this is where the error likely occurs");
3037
+ console.log("\u{1F4C4} Processing FILE citation - using URL format for v4 compatibility");
3040
3038
  console.log("\u{1F4C4} File citation raw data:", JSON.stringify(value.annotation, null, 2));
3041
- const documentSource = {
3042
- sourceType: "document",
3039
+ const urlSource = {
3040
+ sourceType: "url",
3043
3041
  id: (_l = (_k = (_j = self.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : generateId2(),
3044
- mediaType: "text/plain",
3045
- title: String(value.annotation.quote || value.annotation.filename || "Document"),
3046
- filename: value.annotation.filename ? String(value.annotation.filename) : void 0,
3047
- quote: value.annotation.quote ? String(value.annotation.quote) : void 0
3042
+ url: `file://${value.annotation.file_id}`,
3043
+ title: String(value.annotation.quote || value.annotation.filename || "Document")
3048
3044
  };
3049
- console.log("\u{1F4C4} Created document source:", JSON.stringify(documentSource, null, 2));
3050
- console.log("\u{1F50D} Annotation processing - step 3: Enqueuing document source");
3045
+ console.log("\u{1F4C4} Created URL source for file citation:", JSON.stringify(urlSource, null, 2));
3046
+ console.log("\u{1F50D} Annotation processing - step 3: Enqueuing URL source");
3051
3047
  controller.enqueue({
3052
3048
  type: "source",
3053
- source: documentSource
3049
+ source: urlSource
3054
3050
  });
3055
- console.log("\u2705 Document source enqueued successfully");
3051
+ console.log("\u2705 File citation URL source enqueued successfully");
3056
3052
  } else {
3057
3053
  console.log("\u26A0\uFE0F Unknown annotation type:", value.annotation.type);
3058
3054
  }