@ai-sdk/openai 4.0.90 → 4.0.92
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 +24 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +195 -102
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +11 -2
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +241 -153
- package/dist/internal/index.js.map +1 -1
- package/docs/03-openai.mdx +35 -0
- package/package.json +3 -3
- package/src/embedding/openai-embedding-model.ts +2 -1
- package/src/openai-batch.ts +3 -1
- package/src/openai-decision-model.ts +2 -0
- package/src/responses/convert-to-openai-responses-input.ts +89 -0
- package/src/responses/map-openai-responses-annotation.ts +75 -0
- package/src/responses/openai-responses-api.ts +8 -0
- package/src/responses/openai-responses-language-model.ts +174 -136
- package/src/responses/openai-responses-provider-metadata.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 4.0.92
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6aedb07: fix(openai): replay web search results when response storage is disabled
|
|
8
|
+
- e57803c: Expose complete retrieved web-search URLs and file-search documents as sources, and normalize inline references separately as citations on text parts and text-end events. Preserve citation-derived sources when retrieval data is unavailable, including web-search-preview and Azure responses. Keep raw annotations, citation titles, and text locations available. Deduplicate file-search passages by file ID.
|
|
9
|
+
- 1f7e5ad: fix(openai): JSON-encode custom tool input deltas for progressive UI updates
|
|
10
|
+
- Updated dependencies [9667bf2]
|
|
11
|
+
- Updated dependencies [e57803c]
|
|
12
|
+
- Updated dependencies [81663cc]
|
|
13
|
+
- @ai-sdk/provider-utils@5.0.59
|
|
14
|
+
- @ai-sdk/provider@4.0.27
|
|
15
|
+
|
|
16
|
+
## 4.0.91
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 5cf13d2: feat: map the top level embedding dimensions to provider settings
|
|
21
|
+
- 72e9d38: feat(openai): send image detail in decisions
|
|
22
|
+
- fb933f9: Report failed and incomplete web searches as tool errors instead of successful tool results in OpenAI Responses API calls and batch results.
|
|
23
|
+
- Updated dependencies [4dbc902]
|
|
24
|
+
- @ai-sdk/provider@4.0.26
|
|
25
|
+
- @ai-sdk/provider-utils@5.0.58
|
|
26
|
+
|
|
3
27
|
## 4.0.90
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1925,6 +1925,9 @@ type OpenaiResponsesTextProviderMetadata = {
|
|
|
1925
1925
|
openai: ResponsesTextProviderMetadata;
|
|
1926
1926
|
};
|
|
1927
1927
|
type ResponsesSourceDocumentProviderMetadata = {
|
|
1928
|
+
type: 'file_search';
|
|
1929
|
+
fileId: string;
|
|
1930
|
+
} | {
|
|
1928
1931
|
type: 'file_citation';
|
|
1929
1932
|
fileId: string;
|
|
1930
1933
|
index: number;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["_$__tool_apply_patch0.ApplyPatchOperation","_$__tool_custom0.customToolFactory","_$_0.OpenAIComputerAction","_$_0.OpenAIComputerSafetyCheck","_$__responses_openai_responses_api0.OpenAIResponsesFileSearchToolComparisonFilter","_$__responses_openai_responses_api0.OpenAIResponsesFileSearchToolCompoundFilter","_$__tool_web_search0.webSearchToolFactory","RealtimeModelV4ClientSecretOptions","RealtimeModelV4ClientSecretResult","RealtimeModelV4ServerEvent","RealtimeModelV4ClientEvent","RealtimeModelV4SessionConfig","RealtimeModelV4","RealtimeModelV4SessionConfig","RealtimeModelV4ClientEvent","RealtimeModelV4","RealtimeModelV4","RealtimeFactoryV4","DecisionModelV4","SpeechTranslationModelV4","BatchV4","SpeechTranslationModelV4StreamOptions","SpeechTranslationModelV4"],"sources":["../src/openai-config.ts","../src/openai-decision-model.ts","../src/chat/openai-chat-language-model-options.ts","../src/completion/openai-completion-language-model-options.ts","../src/embedding/openai-embedding-model-options.ts","../src/image/openai-image-model-options.ts","../src/tool/apply-patch.ts","../src/tool/custom.ts","../src/responses/openai-responses-api.ts","../src/tool/web-search.ts","../src/openai-tools.ts","../src/live/openai-realtime-model-live-options.ts","../src/realtime/openai-realtime-model.ts","../src/live/openai-realtime-model-live.ts","../src/realtime/openai-realtime-factory.ts","../src/responses/openai-responses-language-model-options.ts","../src/speech/openai-speech-model-options.ts","../src/transcription/openai-transcription-model-options.ts","../src/speech-translation/openai-speech-translation-model-options.ts","../src/openai-provider.ts","../src/responses/openai-responses-prepare-tools.ts","../src/speech-translation/openai-speech-translation-model.ts","../src/files/openai-files-options.ts","../src/tool/computer.ts","../src/responses/openai-responses-provider-metadata.ts","../src/version.ts","../src/openai-decision-model-options.ts"],"mappings":";;;;KAKK,gBAAgB;KAMT;EACV;EACA;EACA,MAAM;IAAW;IAAiB;;EAClC,gBAAgB;EAChB,QAAQ;EACR,YAAY;EACZ;;;;;;;EAOA;;;;;;;EAOA;;;;;;;;;EASA;;;;KCdU;;;KCnBA;cAsEC,iEAA8B;;;;;;;;;;;;;;;;;;;;;;;KAwJ/B,iCAAiC,mBACpC;;;KC/NG;cAKC,uEAAoC;;cAApC;;;;;KAiDD,uCAAuC,mBAC1C;;;KCxDG;cAMC,8DAA2B;;;;KAkB5B,8BAA8B,mBACjC;;;KCzBG;cAiFC,0DAAuB;;;;;;;KAIxB,0BAA0B,mBAC7B;cAGI,oEAAiC;;;;;;;;;KAmBlC,oCAAoC,mBACvC;cAGI,8DAA2B;;;;;;;;KAW5B,8BAA8B,mBACjC;;;;;;KCzEG;EAEN;;;;EAIA;;;;EAIA;;EAGA;;;;EAIA;;EAGA;;;;EAIA;;;;EAIA;;;;cCxDO,oDAAiB;;;;EAMZ;;;;;EAMN;;;;;EAOJ;IACE;IACA;IACA;;IAGA;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["_$__tool_apply_patch0.ApplyPatchOperation","_$__tool_custom0.customToolFactory","_$_0.OpenAIComputerAction","_$_0.OpenAIComputerSafetyCheck","_$__responses_openai_responses_api0.OpenAIResponsesFileSearchToolComparisonFilter","_$__responses_openai_responses_api0.OpenAIResponsesFileSearchToolCompoundFilter","_$__tool_web_search0.webSearchToolFactory","RealtimeModelV4ClientSecretOptions","RealtimeModelV4ClientSecretResult","RealtimeModelV4ServerEvent","RealtimeModelV4ClientEvent","RealtimeModelV4SessionConfig","RealtimeModelV4","RealtimeModelV4SessionConfig","RealtimeModelV4ClientEvent","RealtimeModelV4","RealtimeModelV4","RealtimeFactoryV4","DecisionModelV4","SpeechTranslationModelV4","BatchV4","SpeechTranslationModelV4StreamOptions","SpeechTranslationModelV4"],"sources":["../src/openai-config.ts","../src/openai-decision-model.ts","../src/chat/openai-chat-language-model-options.ts","../src/completion/openai-completion-language-model-options.ts","../src/embedding/openai-embedding-model-options.ts","../src/image/openai-image-model-options.ts","../src/tool/apply-patch.ts","../src/tool/custom.ts","../src/responses/openai-responses-api.ts","../src/tool/web-search.ts","../src/openai-tools.ts","../src/live/openai-realtime-model-live-options.ts","../src/realtime/openai-realtime-model.ts","../src/live/openai-realtime-model-live.ts","../src/realtime/openai-realtime-factory.ts","../src/responses/openai-responses-language-model-options.ts","../src/speech/openai-speech-model-options.ts","../src/transcription/openai-transcription-model-options.ts","../src/speech-translation/openai-speech-translation-model-options.ts","../src/openai-provider.ts","../src/responses/openai-responses-prepare-tools.ts","../src/speech-translation/openai-speech-translation-model.ts","../src/files/openai-files-options.ts","../src/tool/computer.ts","../src/responses/openai-responses-provider-metadata.ts","../src/version.ts","../src/openai-decision-model-options.ts"],"mappings":";;;;KAKK,gBAAgB;KAMT;EACV;EACA;EACA,MAAM;IAAW;IAAiB;;EAClC,gBAAgB;EAChB,QAAQ;EACR,YAAY;EACZ;;;;;;;EAOA;;;;;;;EAOA;;;;;;;;;E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,2DAAwB;;;;KAczB,qBAAqB,mBAAmB;;;cCd9C,mBAAiB,EAAA;;;;GAIrB,EAAA,KAAA;cAEI,sBAAoB,EAAA,uBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CxB,EAAA,KAAA;KAkCU,uBAAuB,EAAE,aAAa;KACtC,4BAA4B,EAAE,aAAa;;;KCzFlD,uBAAuB,mBAAmB;KAE1C,gDAAgD,QACnD;EACE;;KAGQ;EACV;EACA,WAAW,MAAM;EACjB;EACA;;KAGU;EACV;EACA;;KAGU;EACV,QAAQ;;KAGE;EACV,QAAQ;;KAGE;EACV;EACA;EACA;EACA;IACM;;IAEA;IACA;;;KAII;EACV,QAAQ;;KAGE;EACV;EACA;EACA;;KAGU;EACV,QAAQ;;KAGE;EACV;EACA;EACA,cAAc,MAAM;;KAGV;EACV,QAAQ;;KAGE;EAEN;EACA;;EAGA;EACA;EACA;;EAGA;EACA;EACA;;EAGA;EACA;EACA;;KAGM;EACV,QAAQ;;;;qBCzFG;;;cCKA,6DAA0B;EAAA;;KAS3B,6BAA6B,mBAChC"}
|
package/dist/index.js
CHANGED
|
@@ -142,9 +142,11 @@ var DecisionOpenAIModel = class DecisionOpenAIModel {
|
|
|
142
142
|
"image/webp",
|
|
143
143
|
"image/gif"
|
|
144
144
|
].includes(mediaType ?? "")) throw new UnsupportedFunctionalityError({ functionality: `OpenAI decision image media type: ${part.mediaType}` });
|
|
145
|
+
const detail = part.providerOptions?.openai?.imageDetail;
|
|
145
146
|
return {
|
|
146
147
|
type: "input_image",
|
|
147
|
-
image_url: `data:${mediaType};base64,${typeof part.data.data === "string" ? part.data.data : convertUint8ArrayToBase64(part.data.data)}
|
|
148
|
+
image_url: `data:${mediaType};base64,${typeof part.data.data === "string" ? part.data.data : convertUint8ArrayToBase64(part.data.data)}`,
|
|
149
|
+
...detail != null && { detail }
|
|
148
150
|
};
|
|
149
151
|
})
|
|
150
152
|
}],
|
|
@@ -1978,7 +1980,7 @@ var OpenAIEmbeddingModel = class OpenAIEmbeddingModel {
|
|
|
1978
1980
|
this.modelId = modelId;
|
|
1979
1981
|
this.config = config;
|
|
1980
1982
|
}
|
|
1981
|
-
async doEmbed({ values, headers, abortSignal, providerOptions }) {
|
|
1983
|
+
async doEmbed({ values, dimensions, headers, abortSignal, providerOptions }) {
|
|
1982
1984
|
if (values.length > this.maxEmbeddingsPerCall) throw new TooManyEmbeddingValuesForCallError({
|
|
1983
1985
|
provider: this.provider,
|
|
1984
1986
|
modelId: this.modelId,
|
|
@@ -2000,7 +2002,7 @@ var OpenAIEmbeddingModel = class OpenAIEmbeddingModel {
|
|
|
2000
2002
|
model: this.modelId,
|
|
2001
2003
|
input: values,
|
|
2002
2004
|
encoding_format: "float",
|
|
2003
|
-
dimensions: openaiOptions.dimensions,
|
|
2005
|
+
dimensions: openaiOptions.dimensions ?? dimensions,
|
|
2004
2006
|
user: openaiOptions.user
|
|
2005
2007
|
},
|
|
2006
2008
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
@@ -4578,6 +4580,47 @@ function mapToolCaller(caller) {
|
|
|
4578
4580
|
caller_id: caller.callerId
|
|
4579
4581
|
} : caller;
|
|
4580
4582
|
}
|
|
4583
|
+
async function convertWebSearchToolResultOutput({ output, id }) {
|
|
4584
|
+
if (output.type !== "json") return;
|
|
4585
|
+
const validation = await safeValidateTypes({
|
|
4586
|
+
value: output.value,
|
|
4587
|
+
schema: webSearchOutputSchema
|
|
4588
|
+
});
|
|
4589
|
+
if (!validation.success || validation.value.action == null) return;
|
|
4590
|
+
const { action, sources } = validation.value;
|
|
4591
|
+
switch (action.type) {
|
|
4592
|
+
case "search": return {
|
|
4593
|
+
type: "web_search_call",
|
|
4594
|
+
id,
|
|
4595
|
+
status: "completed",
|
|
4596
|
+
action: {
|
|
4597
|
+
type: "search",
|
|
4598
|
+
...action.query != null && { query: action.query },
|
|
4599
|
+
...action.queries != null && { queries: action.queries },
|
|
4600
|
+
...sources != null && { sources }
|
|
4601
|
+
}
|
|
4602
|
+
};
|
|
4603
|
+
case "openPage": return {
|
|
4604
|
+
type: "web_search_call",
|
|
4605
|
+
id,
|
|
4606
|
+
status: "completed",
|
|
4607
|
+
action: {
|
|
4608
|
+
type: "open_page",
|
|
4609
|
+
url: action.url
|
|
4610
|
+
}
|
|
4611
|
+
};
|
|
4612
|
+
case "findInPage": return {
|
|
4613
|
+
type: "web_search_call",
|
|
4614
|
+
id,
|
|
4615
|
+
status: "completed",
|
|
4616
|
+
action: {
|
|
4617
|
+
type: "find_in_page",
|
|
4618
|
+
url: action.url,
|
|
4619
|
+
pattern: action.pattern
|
|
4620
|
+
}
|
|
4621
|
+
};
|
|
4622
|
+
}
|
|
4623
|
+
}
|
|
4581
4624
|
async function convertFunctionToolResultOutput({ output, toolName, outputSchemaToolNames, promptCacheBreakpoint, providerOptionsName, warnings }) {
|
|
4582
4625
|
const hasOutputSchema = outputSchemaToolNames?.has(toolName);
|
|
4583
4626
|
const convertScalarOutput = (value) => promptCacheBreakpoint == null ? value : [{
|
|
@@ -5095,6 +5138,24 @@ async function convertToOpenAIResponsesInput({ prompt, toolNameMapping, systemMe
|
|
|
5095
5138
|
if (part.output.type === "execution-denied" || part.output.type === "json" && typeof part.output.value === "object" && part.output.value != null && "type" in part.output.value && part.output.value.type === "execution-denied") break;
|
|
5096
5139
|
if (hasConversation) break;
|
|
5097
5140
|
const resolvedResultToolName = toolNameMapping.toProviderToolName(part.toolName);
|
|
5141
|
+
if (resolvedResultToolName === "web_search" || resolvedResultToolName === "web_search_preview") {
|
|
5142
|
+
const itemId = (part.providerOptions?.[providerOptionsName])?.itemId ?? part.toolCallId;
|
|
5143
|
+
if (store) {
|
|
5144
|
+
input.push({
|
|
5145
|
+
type: "item_reference",
|
|
5146
|
+
id: itemId
|
|
5147
|
+
});
|
|
5148
|
+
break;
|
|
5149
|
+
}
|
|
5150
|
+
const webSearchCall = await convertWebSearchToolResultOutput({
|
|
5151
|
+
output: part.output,
|
|
5152
|
+
id: itemId
|
|
5153
|
+
});
|
|
5154
|
+
if (webSearchCall != null) {
|
|
5155
|
+
input.push(webSearchCall);
|
|
5156
|
+
break;
|
|
5157
|
+
}
|
|
5158
|
+
}
|
|
5098
5159
|
if (part.toolName === toolSearchToolName) {
|
|
5099
5160
|
const itemId = part.providerOptions?.[providerOptionsName]?.itemId ?? part.providerMetadata?.[providerOptionsName]?.itemId ?? part.toolCallId;
|
|
5100
5161
|
if (store) input.push({
|
|
@@ -5530,6 +5591,40 @@ const openaiResponsesReasoningProviderOptionsSchema = z.object({
|
|
|
5530
5591
|
reasoningEncryptedContent: z.string().nullish()
|
|
5531
5592
|
});
|
|
5532
5593
|
//#endregion
|
|
5594
|
+
//#region src/responses/map-openai-responses-annotation.ts
|
|
5595
|
+
function mapOpenAIResponsesAnnotationSource(annotation, providerOptionsName, id) {
|
|
5596
|
+
if (annotation.type === "url_citation") return {
|
|
5597
|
+
type: "source",
|
|
5598
|
+
sourceType: "url",
|
|
5599
|
+
id,
|
|
5600
|
+
url: annotation.url,
|
|
5601
|
+
title: annotation.title
|
|
5602
|
+
};
|
|
5603
|
+
const filename = annotation.type === "file_path" ? annotation.file_id : annotation.filename;
|
|
5604
|
+
return {
|
|
5605
|
+
type: "source",
|
|
5606
|
+
sourceType: "document",
|
|
5607
|
+
id,
|
|
5608
|
+
mediaType: annotation.type === "file_path" ? "application/octet-stream" : "text/plain",
|
|
5609
|
+
title: filename,
|
|
5610
|
+
filename,
|
|
5611
|
+
providerMetadata: { [providerOptionsName]: {
|
|
5612
|
+
type: annotation.type,
|
|
5613
|
+
fileId: annotation.file_id,
|
|
5614
|
+
...annotation.type === "container_file_citation" ? { containerId: annotation.container_id } : { index: annotation.index }
|
|
5615
|
+
} }
|
|
5616
|
+
};
|
|
5617
|
+
}
|
|
5618
|
+
function mapOpenAIResponsesCitations(annotations, providerOptionsName) {
|
|
5619
|
+
return annotations.flatMap((annotation) => annotation.type === "file_path" ? [] : [{
|
|
5620
|
+
source: mapOpenAIResponsesAnnotationSource(annotation, providerOptionsName, annotation.type === "url_citation" ? annotation.url : annotation.file_id),
|
|
5621
|
+
..."start_index" in annotation ? {
|
|
5622
|
+
startIndex: annotation.start_index,
|
|
5623
|
+
endIndex: annotation.end_index
|
|
5624
|
+
} : {}
|
|
5625
|
+
}]);
|
|
5626
|
+
}
|
|
5627
|
+
//#endregion
|
|
5533
5628
|
//#region src/responses/openai-responses-prepare-tools.ts
|
|
5534
5629
|
async function prepareResponsesTools({ tools, toolChoice, allowedTools, toolNameMapping, customProviderToolNames, outputSchemaToolNames, supportsAsyncToolCalling = true }) {
|
|
5535
5630
|
tools = tools?.length ? tools : void 0;
|
|
@@ -6416,6 +6511,9 @@ var OpenAIResponsesLanguageModel = class OpenAIResponsesLanguageModel {
|
|
|
6416
6511
|
const content = [];
|
|
6417
6512
|
const logprobs = [];
|
|
6418
6513
|
const functionTools = options.tools?.filter((tool) => tool.type === "function") ?? [];
|
|
6514
|
+
const hasWebSearchActionSources = response.output.some((part) => part.type === "web_search_call" && part.action?.type === "search" && part.action.sources?.some((source) => source.type === "url"));
|
|
6515
|
+
const hasFileSearchResults = response.output.some((part) => part.type === "file_search_call" && (part.results?.length ?? 0) > 0);
|
|
6516
|
+
const retrievedFileIds = /* @__PURE__ */ new Set();
|
|
6419
6517
|
let hasFunctionCall = false;
|
|
6420
6518
|
const hostedToolSearchCallIds = [];
|
|
6421
6519
|
for (const part of response.output) switch (part.type) {
|
|
@@ -6521,54 +6619,13 @@ var OpenAIResponsesLanguageModel = class OpenAIResponsesLanguageModel {
|
|
|
6521
6619
|
content.push({
|
|
6522
6620
|
type: "text",
|
|
6523
6621
|
text: contentPart.text,
|
|
6622
|
+
...contentPart.annotations.some((annotation) => annotation.type !== "file_path") && { citations: mapOpenAIResponsesCitations(contentPart.annotations, providerOptionsName) },
|
|
6524
6623
|
providerMetadata: { [providerOptionsName]: providerMetadata }
|
|
6525
6624
|
});
|
|
6526
|
-
for (const annotation of contentPart.annotations)
|
|
6527
|
-
type
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
url: annotation.url,
|
|
6531
|
-
title: annotation.title
|
|
6532
|
-
});
|
|
6533
|
-
else if (annotation.type === "file_citation") content.push({
|
|
6534
|
-
type: "source",
|
|
6535
|
-
sourceType: "document",
|
|
6536
|
-
id: this.config.generateId?.() ?? generateId(),
|
|
6537
|
-
mediaType: "text/plain",
|
|
6538
|
-
title: annotation.filename,
|
|
6539
|
-
filename: annotation.filename,
|
|
6540
|
-
providerMetadata: { [providerOptionsName]: {
|
|
6541
|
-
type: annotation.type,
|
|
6542
|
-
fileId: annotation.file_id,
|
|
6543
|
-
index: annotation.index
|
|
6544
|
-
} }
|
|
6545
|
-
});
|
|
6546
|
-
else if (annotation.type === "container_file_citation") content.push({
|
|
6547
|
-
type: "source",
|
|
6548
|
-
sourceType: "document",
|
|
6549
|
-
id: this.config.generateId?.() ?? generateId(),
|
|
6550
|
-
mediaType: "text/plain",
|
|
6551
|
-
title: annotation.filename,
|
|
6552
|
-
filename: annotation.filename,
|
|
6553
|
-
providerMetadata: { [providerOptionsName]: {
|
|
6554
|
-
type: annotation.type,
|
|
6555
|
-
fileId: annotation.file_id,
|
|
6556
|
-
containerId: annotation.container_id
|
|
6557
|
-
} }
|
|
6558
|
-
});
|
|
6559
|
-
else if (annotation.type === "file_path") content.push({
|
|
6560
|
-
type: "source",
|
|
6561
|
-
sourceType: "document",
|
|
6562
|
-
id: this.config.generateId?.() ?? generateId(),
|
|
6563
|
-
mediaType: "application/octet-stream",
|
|
6564
|
-
title: annotation.file_id,
|
|
6565
|
-
filename: annotation.file_id,
|
|
6566
|
-
providerMetadata: { [providerOptionsName]: {
|
|
6567
|
-
type: annotation.type,
|
|
6568
|
-
fileId: annotation.file_id,
|
|
6569
|
-
index: annotation.index
|
|
6570
|
-
} }
|
|
6571
|
-
});
|
|
6625
|
+
for (const annotation of contentPart.annotations) {
|
|
6626
|
+
if (annotation.type === "url_citation" && hasWebSearchActionSources || annotation.type === "file_citation" && hasFileSearchResults) continue;
|
|
6627
|
+
content.push(mapOpenAIResponsesAnnotationSource(annotation, providerOptionsName, this.config.generateId?.() ?? generateId()));
|
|
6628
|
+
}
|
|
6572
6629
|
}
|
|
6573
6630
|
break;
|
|
6574
6631
|
case "function_call": {
|
|
@@ -6656,8 +6713,19 @@ var OpenAIResponsesLanguageModel = class OpenAIResponsesLanguageModel {
|
|
|
6656
6713
|
type: "tool-result",
|
|
6657
6714
|
toolCallId: part.id,
|
|
6658
6715
|
toolName: toolNameMapping.toCustomToolName(webSearchToolName ?? "web_search"),
|
|
6659
|
-
|
|
6716
|
+
...part.status === "failed" || part.status === "incomplete" ? {
|
|
6717
|
+
isError: true,
|
|
6718
|
+
result: { status: part.status }
|
|
6719
|
+
} : { result: mapWebSearchOutput(part.action) }
|
|
6660
6720
|
});
|
|
6721
|
+
if (part.action?.type === "search") {
|
|
6722
|
+
for (const source of part.action.sources ?? []) if (source.type === "url") content.push({
|
|
6723
|
+
type: "source",
|
|
6724
|
+
sourceType: "url",
|
|
6725
|
+
id: this.config.generateId?.() ?? generateId(),
|
|
6726
|
+
url: source.url
|
|
6727
|
+
});
|
|
6728
|
+
}
|
|
6661
6729
|
break;
|
|
6662
6730
|
case "mcp_call": {
|
|
6663
6731
|
const toolCallId = part.approval_request_id != null ? approvalRequestIdToDummyToolCallIdFromPrompt[part.approval_request_id] ?? part.id : part.id;
|
|
@@ -6760,6 +6828,22 @@ var OpenAIResponsesLanguageModel = class OpenAIResponsesLanguageModel {
|
|
|
6760
6828
|
})) ?? null
|
|
6761
6829
|
}
|
|
6762
6830
|
});
|
|
6831
|
+
for (const result of part.results ?? []) {
|
|
6832
|
+
if (retrievedFileIds.has(result.file_id)) continue;
|
|
6833
|
+
retrievedFileIds.add(result.file_id);
|
|
6834
|
+
content.push({
|
|
6835
|
+
type: "source",
|
|
6836
|
+
sourceType: "document",
|
|
6837
|
+
id: this.config.generateId?.() ?? generateId(),
|
|
6838
|
+
mediaType: "text/plain",
|
|
6839
|
+
title: result.filename,
|
|
6840
|
+
filename: result.filename,
|
|
6841
|
+
providerMetadata: { [providerOptionsName]: {
|
|
6842
|
+
type: "file_search",
|
|
6843
|
+
fileId: result.file_id
|
|
6844
|
+
} }
|
|
6845
|
+
});
|
|
6846
|
+
}
|
|
6763
6847
|
break;
|
|
6764
6848
|
case "code_interpreter_call":
|
|
6765
6849
|
content.push({
|
|
@@ -6870,7 +6954,11 @@ var OpenAIResponsesLanguageModel = class OpenAIResponsesLanguageModel {
|
|
|
6870
6954
|
const logprobs = [];
|
|
6871
6955
|
let responseId = null;
|
|
6872
6956
|
const ongoingToolCalls = {};
|
|
6873
|
-
|
|
6957
|
+
let ongoingAnnotations = [];
|
|
6958
|
+
let hasWebSearchActionSources = false;
|
|
6959
|
+
let hasFileSearchResults = false;
|
|
6960
|
+
const retrievedFileIds = /* @__PURE__ */ new Set();
|
|
6961
|
+
const fallbackAnnotations = [];
|
|
6874
6962
|
let activeMessagePhase;
|
|
6875
6963
|
let hasFunctionCall = false;
|
|
6876
6964
|
const activeReasoning = {};
|
|
@@ -6943,6 +7031,11 @@ var OpenAIResponsesLanguageModel = class OpenAIResponsesLanguageModel {
|
|
|
6943
7031
|
id: value.item.call_id,
|
|
6944
7032
|
toolName
|
|
6945
7033
|
});
|
|
7034
|
+
controller.enqueue({
|
|
7035
|
+
type: "tool-input-delta",
|
|
7036
|
+
id: value.item.call_id,
|
|
7037
|
+
delta: "\""
|
|
7038
|
+
});
|
|
6946
7039
|
} else if (value.item.type === "web_search_call") {
|
|
6947
7040
|
ongoingToolCalls[value.output_index] = {
|
|
6948
7041
|
toolName: toolNameMapping.toCustomToolName(webSearchToolName ?? "web_search"),
|
|
@@ -7062,7 +7155,7 @@ var OpenAIResponsesLanguageModel = class OpenAIResponsesLanguageModel {
|
|
|
7062
7155
|
};
|
|
7063
7156
|
else if (value.item.type === "shell_call_output") {} else if (value.item.type === "message") {
|
|
7064
7157
|
activeOutputItemIds[value.output_index] = value.item.id;
|
|
7065
|
-
ongoingAnnotations
|
|
7158
|
+
ongoingAnnotations = [];
|
|
7066
7159
|
activeMessagePhase = value.item.phase ?? void 0;
|
|
7067
7160
|
controller.enqueue({
|
|
7068
7161
|
type: "text-start",
|
|
@@ -7098,6 +7191,7 @@ var OpenAIResponsesLanguageModel = class OpenAIResponsesLanguageModel {
|
|
|
7098
7191
|
controller.enqueue({
|
|
7099
7192
|
type: "text-end",
|
|
7100
7193
|
id: itemId,
|
|
7194
|
+
...ongoingAnnotations.some((annotation) => annotation.type !== "file_path") && { citations: mapOpenAIResponsesCitations(ongoingAnnotations, providerOptionsName) },
|
|
7101
7195
|
providerMetadata: { [providerOptionsName]: {
|
|
7102
7196
|
itemId,
|
|
7103
7197
|
...phase != null && { phase },
|
|
@@ -7216,6 +7310,11 @@ var OpenAIResponsesLanguageModel = class OpenAIResponsesLanguageModel {
|
|
|
7216
7310
|
ongoingToolCalls[value.output_index] = void 0;
|
|
7217
7311
|
hasFunctionCall = true;
|
|
7218
7312
|
const toolName = toolNameMapping.toCustomToolName(value.item.name);
|
|
7313
|
+
controller.enqueue({
|
|
7314
|
+
type: "tool-input-delta",
|
|
7315
|
+
id: value.item.call_id,
|
|
7316
|
+
delta: "\""
|
|
7317
|
+
});
|
|
7219
7318
|
controller.enqueue({
|
|
7220
7319
|
type: "tool-input-end",
|
|
7221
7320
|
id: value.item.call_id
|
|
@@ -7236,8 +7335,22 @@ var OpenAIResponsesLanguageModel = class OpenAIResponsesLanguageModel {
|
|
|
7236
7335
|
type: "tool-result",
|
|
7237
7336
|
toolCallId: value.item.id,
|
|
7238
7337
|
toolName: toolNameMapping.toCustomToolName(webSearchToolName ?? "web_search"),
|
|
7239
|
-
|
|
7338
|
+
...value.item.status === "failed" || value.item.status === "incomplete" ? {
|
|
7339
|
+
isError: true,
|
|
7340
|
+
result: { status: value.item.status }
|
|
7341
|
+
} : { result: mapWebSearchOutput(value.item.action) }
|
|
7240
7342
|
});
|
|
7343
|
+
if (value.item.action?.type === "search") {
|
|
7344
|
+
for (const source of value.item.action.sources ?? []) if (source.type === "url") {
|
|
7345
|
+
hasWebSearchActionSources = true;
|
|
7346
|
+
controller.enqueue({
|
|
7347
|
+
type: "source",
|
|
7348
|
+
sourceType: "url",
|
|
7349
|
+
id: self.config.generateId?.() ?? generateId(),
|
|
7350
|
+
url: source.url
|
|
7351
|
+
});
|
|
7352
|
+
}
|
|
7353
|
+
}
|
|
7241
7354
|
} else if (value.item.type === "computer_call") {
|
|
7242
7355
|
ongoingToolCalls[value.output_index] = void 0;
|
|
7243
7356
|
if (value.item.call_id == null) {
|
|
@@ -7299,6 +7412,23 @@ var OpenAIResponsesLanguageModel = class OpenAIResponsesLanguageModel {
|
|
|
7299
7412
|
})) ?? null
|
|
7300
7413
|
}
|
|
7301
7414
|
});
|
|
7415
|
+
for (const result of value.item.results ?? []) {
|
|
7416
|
+
hasFileSearchResults = true;
|
|
7417
|
+
if (retrievedFileIds.has(result.file_id)) continue;
|
|
7418
|
+
retrievedFileIds.add(result.file_id);
|
|
7419
|
+
controller.enqueue({
|
|
7420
|
+
type: "source",
|
|
7421
|
+
sourceType: "document",
|
|
7422
|
+
id: self.config.generateId?.() ?? generateId(),
|
|
7423
|
+
mediaType: "text/plain",
|
|
7424
|
+
title: result.filename,
|
|
7425
|
+
filename: result.filename,
|
|
7426
|
+
providerMetadata: { [providerOptionsName]: {
|
|
7427
|
+
type: "file_search",
|
|
7428
|
+
fileId: result.file_id
|
|
7429
|
+
} }
|
|
7430
|
+
});
|
|
7431
|
+
}
|
|
7302
7432
|
} else if (value.item.type === "code_interpreter_call") {
|
|
7303
7433
|
ongoingToolCalls[value.output_index] = void 0;
|
|
7304
7434
|
controller.enqueue({
|
|
@@ -7512,7 +7642,7 @@ var OpenAIResponsesLanguageModel = class OpenAIResponsesLanguageModel {
|
|
|
7512
7642
|
if (toolCall != null) controller.enqueue({
|
|
7513
7643
|
type: "tool-input-delta",
|
|
7514
7644
|
id: toolCall.toolCallId,
|
|
7515
|
-
delta: value.delta
|
|
7645
|
+
delta: escapeJSONDelta(value.delta)
|
|
7516
7646
|
});
|
|
7517
7647
|
} else if (isResponseApplyPatchCallOperationDiffDeltaChunk(value)) {
|
|
7518
7648
|
const toolCall = ongoingToolCalls[value.output_index];
|
|
@@ -7696,52 +7826,8 @@ var OpenAIResponsesLanguageModel = class OpenAIResponsesLanguageModel {
|
|
|
7696
7826
|
}
|
|
7697
7827
|
} else if (isResponseAnnotationAddedChunk(value)) {
|
|
7698
7828
|
ongoingAnnotations.push(value.annotation);
|
|
7699
|
-
if (value.annotation.type === "url_citation")
|
|
7700
|
-
|
|
7701
|
-
sourceType: "url",
|
|
7702
|
-
id: self.config.generateId?.() ?? generateId(),
|
|
7703
|
-
url: value.annotation.url,
|
|
7704
|
-
title: value.annotation.title
|
|
7705
|
-
});
|
|
7706
|
-
else if (value.annotation.type === "file_citation") controller.enqueue({
|
|
7707
|
-
type: "source",
|
|
7708
|
-
sourceType: "document",
|
|
7709
|
-
id: self.config.generateId?.() ?? generateId(),
|
|
7710
|
-
mediaType: "text/plain",
|
|
7711
|
-
title: value.annotation.filename,
|
|
7712
|
-
filename: value.annotation.filename,
|
|
7713
|
-
providerMetadata: { [providerOptionsName]: {
|
|
7714
|
-
type: value.annotation.type,
|
|
7715
|
-
fileId: value.annotation.file_id,
|
|
7716
|
-
index: value.annotation.index
|
|
7717
|
-
} }
|
|
7718
|
-
});
|
|
7719
|
-
else if (value.annotation.type === "container_file_citation") controller.enqueue({
|
|
7720
|
-
type: "source",
|
|
7721
|
-
sourceType: "document",
|
|
7722
|
-
id: self.config.generateId?.() ?? generateId(),
|
|
7723
|
-
mediaType: "text/plain",
|
|
7724
|
-
title: value.annotation.filename,
|
|
7725
|
-
filename: value.annotation.filename,
|
|
7726
|
-
providerMetadata: { [providerOptionsName]: {
|
|
7727
|
-
type: value.annotation.type,
|
|
7728
|
-
fileId: value.annotation.file_id,
|
|
7729
|
-
containerId: value.annotation.container_id
|
|
7730
|
-
} }
|
|
7731
|
-
});
|
|
7732
|
-
else if (value.annotation.type === "file_path") controller.enqueue({
|
|
7733
|
-
type: "source",
|
|
7734
|
-
sourceType: "document",
|
|
7735
|
-
id: self.config.generateId?.() ?? generateId(),
|
|
7736
|
-
mediaType: "application/octet-stream",
|
|
7737
|
-
title: value.annotation.file_id,
|
|
7738
|
-
filename: value.annotation.file_id,
|
|
7739
|
-
providerMetadata: { [providerOptionsName]: {
|
|
7740
|
-
type: value.annotation.type,
|
|
7741
|
-
fileId: value.annotation.file_id,
|
|
7742
|
-
index: value.annotation.index
|
|
7743
|
-
} }
|
|
7744
|
-
});
|
|
7829
|
+
if (value.annotation.type === "url_citation" || value.annotation.type === "file_citation") fallbackAnnotations.push(value.annotation);
|
|
7830
|
+
else controller.enqueue(mapOpenAIResponsesAnnotationSource(value.annotation, providerOptionsName, self.config.generateId?.() ?? generateId()));
|
|
7745
7831
|
} else if (isErrorChunk(value)) {
|
|
7746
7832
|
encounteredStreamError = true;
|
|
7747
7833
|
finishReason = {
|
|
@@ -7755,6 +7841,10 @@ var OpenAIResponsesLanguageModel = class OpenAIResponsesLanguageModel {
|
|
|
7755
7841
|
}
|
|
7756
7842
|
},
|
|
7757
7843
|
flush(controller) {
|
|
7844
|
+
for (const annotation of fallbackAnnotations) {
|
|
7845
|
+
if (annotation.type === "url_citation" && hasWebSearchActionSources || annotation.type === "file_citation" && hasFileSearchResults) continue;
|
|
7846
|
+
controller.enqueue(mapOpenAIResponsesAnnotationSource(annotation, providerOptionsName, self.config.generateId?.() ?? generateId()));
|
|
7847
|
+
}
|
|
7758
7848
|
for (const toolCall of Object.values(ongoingToolCalls)) {
|
|
7759
7849
|
if (!toolCall?.suppressInputStreaming) continue;
|
|
7760
7850
|
controller.enqueue({
|
|
@@ -8369,7 +8459,10 @@ async function convertOpenAIBatchResult(body) {
|
|
|
8369
8459
|
type: "tool-result",
|
|
8370
8460
|
toolCallId: part.id,
|
|
8371
8461
|
toolName: "web_search",
|
|
8372
|
-
|
|
8462
|
+
...part.status === "failed" || part.status === "incomplete" ? {
|
|
8463
|
+
isError: true,
|
|
8464
|
+
result: { status: part.status }
|
|
8465
|
+
} : { result: mapWebSearchOutput(part.action) },
|
|
8373
8466
|
dynamic: true
|
|
8374
8467
|
});
|
|
8375
8468
|
break;
|
|
@@ -10075,7 +10168,7 @@ var OpenAISkills = class {
|
|
|
10075
10168
|
};
|
|
10076
10169
|
//#endregion
|
|
10077
10170
|
//#region src/version.ts
|
|
10078
|
-
const VERSION = "4.0.
|
|
10171
|
+
const VERSION = "4.0.92";
|
|
10079
10172
|
//#endregion
|
|
10080
10173
|
//#region src/openai-provider.ts
|
|
10081
10174
|
/**
|