@ai-sdk/openai 3.0.54 → 3.0.57
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 +22 -0
- package/dist/index.d.mts +28 -1
- package/dist/index.d.ts +28 -1
- package/dist/index.js +1204 -1122
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1176 -1063
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +28 -1
- package/dist/internal/index.d.ts +28 -1
- package/dist/internal/index.js +1203 -1115
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +1177 -1061
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +12 -3
- package/package.json +4 -4
- package/src/chat/convert-openai-chat-usage.ts +1 -1
- package/src/chat/convert-to-openai-chat-messages.ts +3 -3
- package/src/chat/map-openai-finish-reason.ts +1 -1
- package/src/chat/openai-chat-api.ts +6 -2
- package/src/chat/openai-chat-language-model.ts +14 -14
- package/src/chat/openai-chat-options.ts +5 -1
- package/src/chat/openai-chat-prepare-tools.ts +3 -3
- package/src/completion/convert-openai-completion-usage.ts +1 -1
- package/src/completion/convert-to-openai-completion-prompt.ts +1 -1
- package/src/completion/map-openai-finish-reason.ts +1 -1
- package/src/completion/openai-completion-api.ts +5 -1
- package/src/completion/openai-completion-language-model.ts +6 -6
- package/src/completion/openai-completion-options.ts +5 -1
- package/src/embedding/openai-embedding-model.ts +3 -3
- package/src/embedding/openai-embedding-options.ts +5 -1
- package/src/image/openai-image-model-options.ts +123 -0
- package/src/image/openai-image-model.ts +43 -80
- package/src/index.ts +5 -0
- package/src/internal/index.ts +1 -1
- package/src/openai-config.ts +1 -1
- package/src/openai-provider.ts +9 -9
- package/src/responses/convert-openai-responses-usage.ts +1 -1
- package/src/responses/convert-to-openai-responses-input.ts +5 -5
- package/src/responses/map-openai-responses-finish-reason.ts +1 -1
- package/src/responses/openai-responses-api.ts +6 -2
- package/src/responses/openai-responses-language-model.ts +35 -35
- package/src/responses/openai-responses-options.ts +5 -1
- package/src/responses/openai-responses-prepare-tools.ts +4 -4
- package/src/responses/openai-responses-provider-metadata.ts +2 -2
- package/src/speech/openai-speech-model.ts +4 -4
- package/src/speech/openai-speech-options.ts +5 -1
- package/src/tool/file-search.ts +1 -1
- package/src/tool/mcp.ts +1 -1
- package/src/tool/tool-search.ts +2 -2
- package/src/transcription/openai-transcription-model.ts +4 -4
- package/src/transcription/openai-transcription-options.ts +5 -1
- package/src/image/openai-image-options.ts +0 -34
package/dist/internal/index.js
CHANGED
|
@@ -47,6 +47,9 @@ __export(index_exports, {
|
|
|
47
47
|
modelMaxImagesPerCall: () => modelMaxImagesPerCall,
|
|
48
48
|
openAITranscriptionModelOptions: () => openAITranscriptionModelOptions,
|
|
49
49
|
openaiEmbeddingModelOptions: () => openaiEmbeddingModelOptions,
|
|
50
|
+
openaiImageModelEditOptions: () => openaiImageModelEditOptions,
|
|
51
|
+
openaiImageModelGenerationOptions: () => openaiImageModelGenerationOptions,
|
|
52
|
+
openaiImageModelOptions: () => openaiImageModelOptions,
|
|
50
53
|
openaiLanguageModelChatOptions: () => openaiLanguageModelChatOptions,
|
|
51
54
|
openaiLanguageModelCompletionOptions: () => openaiLanguageModelCompletionOptions,
|
|
52
55
|
openaiSpeechModelOptionsSchema: () => openaiSpeechModelOptionsSchema,
|
|
@@ -1741,7 +1744,7 @@ var OpenAIEmbeddingModel = class {
|
|
|
1741
1744
|
};
|
|
1742
1745
|
|
|
1743
1746
|
// src/image/openai-image-model.ts
|
|
1744
|
-
var
|
|
1747
|
+
var import_provider_utils14 = require("@ai-sdk/provider-utils");
|
|
1745
1748
|
|
|
1746
1749
|
// src/image/openai-image-api.ts
|
|
1747
1750
|
var import_provider_utils12 = require("@ai-sdk/provider-utils");
|
|
@@ -1773,7 +1776,9 @@ var openaiImageResponseSchema = (0, import_provider_utils12.lazySchema)(
|
|
|
1773
1776
|
)
|
|
1774
1777
|
);
|
|
1775
1778
|
|
|
1776
|
-
// src/image/openai-image-options.ts
|
|
1779
|
+
// src/image/openai-image-model-options.ts
|
|
1780
|
+
var import_provider_utils13 = require("@ai-sdk/provider-utils");
|
|
1781
|
+
var import_v49 = require("zod/v4");
|
|
1777
1782
|
var modelMaxImagesPerCall = {
|
|
1778
1783
|
"dall-e-3": 1,
|
|
1779
1784
|
"dall-e-2": 10,
|
|
@@ -1795,6 +1800,65 @@ function hasDefaultResponseFormat(modelId) {
|
|
|
1795
1800
|
(prefix) => modelId.startsWith(prefix)
|
|
1796
1801
|
);
|
|
1797
1802
|
}
|
|
1803
|
+
var baseImageModelOptionsObject = import_v49.z.object({
|
|
1804
|
+
/**
|
|
1805
|
+
* Quality of the generated image(s).
|
|
1806
|
+
*
|
|
1807
|
+
* Valid values: `standard`, `hd`, `low`, `medium`, `high`, `auto`.
|
|
1808
|
+
*/
|
|
1809
|
+
quality: import_v49.z.enum(["standard", "hd", "low", "medium", "high", "auto"]).optional(),
|
|
1810
|
+
/**
|
|
1811
|
+
* Background behavior for the generated image(s).
|
|
1812
|
+
*
|
|
1813
|
+
* If `transparent`, the output format must support transparency
|
|
1814
|
+
* (i.e. `png` or `webp`).
|
|
1815
|
+
*/
|
|
1816
|
+
background: import_v49.z.enum(["transparent", "opaque", "auto"]).optional(),
|
|
1817
|
+
/**
|
|
1818
|
+
* Format in which the generated image(s) are returned.
|
|
1819
|
+
*/
|
|
1820
|
+
outputFormat: import_v49.z.enum(["png", "jpeg", "webp"]).optional(),
|
|
1821
|
+
/**
|
|
1822
|
+
* Compression level (0-100) for the generated image(s). Applies to the
|
|
1823
|
+
* `jpeg` and `webp` output formats.
|
|
1824
|
+
*/
|
|
1825
|
+
outputCompression: import_v49.z.number().int().min(0).max(100).optional(),
|
|
1826
|
+
/**
|
|
1827
|
+
* A unique identifier representing your end-user, which can help OpenAI
|
|
1828
|
+
* to monitor and detect abuse.
|
|
1829
|
+
*/
|
|
1830
|
+
user: import_v49.z.string().optional()
|
|
1831
|
+
});
|
|
1832
|
+
var openaiImageModelOptions = (0, import_provider_utils13.lazySchema)(
|
|
1833
|
+
() => (0, import_provider_utils13.zodSchema)(baseImageModelOptionsObject)
|
|
1834
|
+
);
|
|
1835
|
+
var openaiImageModelGenerationOptions = (0, import_provider_utils13.lazySchema)(
|
|
1836
|
+
() => (0, import_provider_utils13.zodSchema)(
|
|
1837
|
+
baseImageModelOptionsObject.extend({
|
|
1838
|
+
/**
|
|
1839
|
+
* Style of the generated image. `vivid` produces hyper-real and
|
|
1840
|
+
* dramatic images; `natural` produces more subdued, less hyper-real
|
|
1841
|
+
* looking images.
|
|
1842
|
+
*/
|
|
1843
|
+
style: import_v49.z.enum(["vivid", "natural"]).optional(),
|
|
1844
|
+
/**
|
|
1845
|
+
* Content moderation level for the generated image(s). `low` applies
|
|
1846
|
+
* less restrictive filtering.
|
|
1847
|
+
*/
|
|
1848
|
+
moderation: import_v49.z.enum(["auto", "low"]).optional()
|
|
1849
|
+
})
|
|
1850
|
+
)
|
|
1851
|
+
);
|
|
1852
|
+
var openaiImageModelEditOptions = (0, import_provider_utils13.lazySchema)(
|
|
1853
|
+
() => (0, import_provider_utils13.zodSchema)(
|
|
1854
|
+
baseImageModelOptionsObject.extend({
|
|
1855
|
+
/**
|
|
1856
|
+
* Fidelity of the output image(s) to the input image(s).
|
|
1857
|
+
*/
|
|
1858
|
+
inputFidelity: import_v49.z.enum(["high", "low"]).optional()
|
|
1859
|
+
})
|
|
1860
|
+
)
|
|
1861
|
+
);
|
|
1798
1862
|
|
|
1799
1863
|
// src/image/openai-image-model.ts
|
|
1800
1864
|
var OpenAIImageModel = class {
|
|
@@ -1836,13 +1900,18 @@ var OpenAIImageModel = class {
|
|
|
1836
1900
|
}
|
|
1837
1901
|
const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
|
|
1838
1902
|
if (files != null) {
|
|
1839
|
-
const
|
|
1903
|
+
const openaiOptions2 = (_d = await (0, import_provider_utils14.parseProviderOptions)({
|
|
1904
|
+
provider: "openai",
|
|
1905
|
+
providerOptions,
|
|
1906
|
+
schema: openaiImageModelEditOptions
|
|
1907
|
+
})) != null ? _d : {};
|
|
1908
|
+
const { value: response2, responseHeaders: responseHeaders2 } = await (0, import_provider_utils14.postFormDataToApi)({
|
|
1840
1909
|
url: this.config.url({
|
|
1841
1910
|
path: "/images/edits",
|
|
1842
1911
|
modelId: this.modelId
|
|
1843
1912
|
}),
|
|
1844
|
-
headers: (0,
|
|
1845
|
-
formData: (0,
|
|
1913
|
+
headers: (0, import_provider_utils14.combineHeaders)(this.config.headers(), headers),
|
|
1914
|
+
formData: (0, import_provider_utils14.convertToFormData)({
|
|
1846
1915
|
model: this.modelId,
|
|
1847
1916
|
prompt,
|
|
1848
1917
|
image: await Promise.all(
|
|
@@ -1851,21 +1920,26 @@ var OpenAIImageModel = class {
|
|
|
1851
1920
|
[
|
|
1852
1921
|
file.data instanceof Uint8Array ? new Blob([file.data], {
|
|
1853
1922
|
type: file.mediaType
|
|
1854
|
-
}) : new Blob([(0,
|
|
1923
|
+
}) : new Blob([(0, import_provider_utils14.convertBase64ToUint8Array)(file.data)], {
|
|
1855
1924
|
type: file.mediaType
|
|
1856
1925
|
})
|
|
1857
1926
|
],
|
|
1858
1927
|
{ type: file.mediaType }
|
|
1859
|
-
) : (0,
|
|
1928
|
+
) : (0, import_provider_utils14.downloadBlob)(file.url)
|
|
1860
1929
|
)
|
|
1861
1930
|
),
|
|
1862
1931
|
mask: mask != null ? await fileToBlob(mask) : void 0,
|
|
1863
1932
|
n,
|
|
1864
1933
|
size,
|
|
1865
|
-
|
|
1934
|
+
quality: openaiOptions2.quality,
|
|
1935
|
+
background: openaiOptions2.background,
|
|
1936
|
+
output_format: openaiOptions2.outputFormat,
|
|
1937
|
+
output_compression: openaiOptions2.outputCompression,
|
|
1938
|
+
input_fidelity: openaiOptions2.inputFidelity,
|
|
1939
|
+
user: openaiOptions2.user
|
|
1866
1940
|
}),
|
|
1867
1941
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
1868
|
-
successfulResponseHandler: (0,
|
|
1942
|
+
successfulResponseHandler: (0, import_provider_utils14.createJsonResponseHandler)(
|
|
1869
1943
|
openaiImageResponseSchema
|
|
1870
1944
|
),
|
|
1871
1945
|
abortSignal,
|
|
@@ -1906,22 +1980,33 @@ var OpenAIImageModel = class {
|
|
|
1906
1980
|
}
|
|
1907
1981
|
};
|
|
1908
1982
|
}
|
|
1909
|
-
const
|
|
1983
|
+
const openaiOptions = (_h = await (0, import_provider_utils14.parseProviderOptions)({
|
|
1984
|
+
provider: "openai",
|
|
1985
|
+
providerOptions,
|
|
1986
|
+
schema: openaiImageModelGenerationOptions
|
|
1987
|
+
})) != null ? _h : {};
|
|
1988
|
+
const { value: response, responseHeaders } = await (0, import_provider_utils14.postJsonToApi)({
|
|
1910
1989
|
url: this.config.url({
|
|
1911
1990
|
path: "/images/generations",
|
|
1912
1991
|
modelId: this.modelId
|
|
1913
1992
|
}),
|
|
1914
|
-
headers: (0,
|
|
1993
|
+
headers: (0, import_provider_utils14.combineHeaders)(this.config.headers(), headers),
|
|
1915
1994
|
body: {
|
|
1916
1995
|
model: this.modelId,
|
|
1917
1996
|
prompt,
|
|
1918
1997
|
n,
|
|
1919
1998
|
size,
|
|
1920
|
-
|
|
1999
|
+
quality: openaiOptions.quality,
|
|
2000
|
+
style: openaiOptions.style,
|
|
2001
|
+
background: openaiOptions.background,
|
|
2002
|
+
moderation: openaiOptions.moderation,
|
|
2003
|
+
output_format: openaiOptions.outputFormat,
|
|
2004
|
+
output_compression: openaiOptions.outputCompression,
|
|
2005
|
+
user: openaiOptions.user,
|
|
1921
2006
|
...!hasDefaultResponseFormat(this.modelId) ? { response_format: "b64_json" } : {}
|
|
1922
2007
|
},
|
|
1923
2008
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
1924
|
-
successfulResponseHandler: (0,
|
|
2009
|
+
successfulResponseHandler: (0, import_provider_utils14.createJsonResponseHandler)(
|
|
1925
2010
|
openaiImageResponseSchema
|
|
1926
2011
|
),
|
|
1927
2012
|
abortSignal,
|
|
@@ -1983,43 +2068,43 @@ function distributeTokenDetails(details, index, total) {
|
|
|
1983
2068
|
async function fileToBlob(file) {
|
|
1984
2069
|
if (!file) return void 0;
|
|
1985
2070
|
if (file.type === "url") {
|
|
1986
|
-
return (0,
|
|
2071
|
+
return (0, import_provider_utils14.downloadBlob)(file.url);
|
|
1987
2072
|
}
|
|
1988
|
-
const data = file.data instanceof Uint8Array ? file.data : (0,
|
|
2073
|
+
const data = file.data instanceof Uint8Array ? file.data : (0, import_provider_utils14.convertBase64ToUint8Array)(file.data);
|
|
1989
2074
|
return new Blob([data], { type: file.mediaType });
|
|
1990
2075
|
}
|
|
1991
2076
|
|
|
1992
2077
|
// src/transcription/openai-transcription-model.ts
|
|
1993
|
-
var
|
|
2078
|
+
var import_provider_utils17 = require("@ai-sdk/provider-utils");
|
|
1994
2079
|
|
|
1995
2080
|
// src/transcription/openai-transcription-api.ts
|
|
1996
|
-
var
|
|
1997
|
-
var
|
|
1998
|
-
var openaiTranscriptionResponseSchema = (0,
|
|
1999
|
-
() => (0,
|
|
2000
|
-
|
|
2001
|
-
text:
|
|
2002
|
-
language:
|
|
2003
|
-
duration:
|
|
2004
|
-
words:
|
|
2005
|
-
|
|
2006
|
-
word:
|
|
2007
|
-
start:
|
|
2008
|
-
end:
|
|
2081
|
+
var import_provider_utils15 = require("@ai-sdk/provider-utils");
|
|
2082
|
+
var import_v410 = require("zod/v4");
|
|
2083
|
+
var openaiTranscriptionResponseSchema = (0, import_provider_utils15.lazySchema)(
|
|
2084
|
+
() => (0, import_provider_utils15.zodSchema)(
|
|
2085
|
+
import_v410.z.object({
|
|
2086
|
+
text: import_v410.z.string(),
|
|
2087
|
+
language: import_v410.z.string().nullish(),
|
|
2088
|
+
duration: import_v410.z.number().nullish(),
|
|
2089
|
+
words: import_v410.z.array(
|
|
2090
|
+
import_v410.z.object({
|
|
2091
|
+
word: import_v410.z.string(),
|
|
2092
|
+
start: import_v410.z.number(),
|
|
2093
|
+
end: import_v410.z.number()
|
|
2009
2094
|
})
|
|
2010
2095
|
).nullish(),
|
|
2011
|
-
segments:
|
|
2012
|
-
|
|
2013
|
-
id:
|
|
2014
|
-
seek:
|
|
2015
|
-
start:
|
|
2016
|
-
end:
|
|
2017
|
-
text:
|
|
2018
|
-
tokens:
|
|
2019
|
-
temperature:
|
|
2020
|
-
avg_logprob:
|
|
2021
|
-
compression_ratio:
|
|
2022
|
-
no_speech_prob:
|
|
2096
|
+
segments: import_v410.z.array(
|
|
2097
|
+
import_v410.z.object({
|
|
2098
|
+
id: import_v410.z.number(),
|
|
2099
|
+
seek: import_v410.z.number(),
|
|
2100
|
+
start: import_v410.z.number(),
|
|
2101
|
+
end: import_v410.z.number(),
|
|
2102
|
+
text: import_v410.z.string(),
|
|
2103
|
+
tokens: import_v410.z.array(import_v410.z.number()),
|
|
2104
|
+
temperature: import_v410.z.number(),
|
|
2105
|
+
avg_logprob: import_v410.z.number(),
|
|
2106
|
+
compression_ratio: import_v410.z.number(),
|
|
2107
|
+
no_speech_prob: import_v410.z.number()
|
|
2023
2108
|
})
|
|
2024
2109
|
).nullish()
|
|
2025
2110
|
})
|
|
@@ -2027,33 +2112,33 @@ var openaiTranscriptionResponseSchema = (0, import_provider_utils14.lazySchema)(
|
|
|
2027
2112
|
);
|
|
2028
2113
|
|
|
2029
2114
|
// src/transcription/openai-transcription-options.ts
|
|
2030
|
-
var
|
|
2031
|
-
var
|
|
2032
|
-
var openAITranscriptionModelOptions = (0,
|
|
2033
|
-
() => (0,
|
|
2034
|
-
|
|
2115
|
+
var import_provider_utils16 = require("@ai-sdk/provider-utils");
|
|
2116
|
+
var import_v411 = require("zod/v4");
|
|
2117
|
+
var openAITranscriptionModelOptions = (0, import_provider_utils16.lazySchema)(
|
|
2118
|
+
() => (0, import_provider_utils16.zodSchema)(
|
|
2119
|
+
import_v411.z.object({
|
|
2035
2120
|
/**
|
|
2036
2121
|
* Additional information to include in the transcription response.
|
|
2037
2122
|
*/
|
|
2038
|
-
include:
|
|
2123
|
+
include: import_v411.z.array(import_v411.z.string()).optional(),
|
|
2039
2124
|
/**
|
|
2040
2125
|
* The language of the input audio in ISO-639-1 format.
|
|
2041
2126
|
*/
|
|
2042
|
-
language:
|
|
2127
|
+
language: import_v411.z.string().optional(),
|
|
2043
2128
|
/**
|
|
2044
2129
|
* An optional text to guide the model's style or continue a previous audio segment.
|
|
2045
2130
|
*/
|
|
2046
|
-
prompt:
|
|
2131
|
+
prompt: import_v411.z.string().optional(),
|
|
2047
2132
|
/**
|
|
2048
2133
|
* The sampling temperature, between 0 and 1.
|
|
2049
2134
|
* @default 0
|
|
2050
2135
|
*/
|
|
2051
|
-
temperature:
|
|
2136
|
+
temperature: import_v411.z.number().min(0).max(1).default(0).optional(),
|
|
2052
2137
|
/**
|
|
2053
2138
|
* The timestamp granularities to populate for this transcription.
|
|
2054
2139
|
* @default ['segment']
|
|
2055
2140
|
*/
|
|
2056
|
-
timestampGranularities:
|
|
2141
|
+
timestampGranularities: import_v411.z.array(import_v411.z.enum(["word", "segment"])).default(["segment"]).optional()
|
|
2057
2142
|
})
|
|
2058
2143
|
)
|
|
2059
2144
|
);
|
|
@@ -2133,15 +2218,15 @@ var OpenAITranscriptionModel = class {
|
|
|
2133
2218
|
providerOptions
|
|
2134
2219
|
}) {
|
|
2135
2220
|
const warnings = [];
|
|
2136
|
-
const openAIOptions = await (0,
|
|
2221
|
+
const openAIOptions = await (0, import_provider_utils17.parseProviderOptions)({
|
|
2137
2222
|
provider: "openai",
|
|
2138
2223
|
providerOptions,
|
|
2139
2224
|
schema: openAITranscriptionModelOptions
|
|
2140
2225
|
});
|
|
2141
2226
|
const formData = new FormData();
|
|
2142
|
-
const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([(0,
|
|
2227
|
+
const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([(0, import_provider_utils17.convertBase64ToUint8Array)(audio)]);
|
|
2143
2228
|
formData.append("model", this.modelId);
|
|
2144
|
-
const fileExtension = (0,
|
|
2229
|
+
const fileExtension = (0, import_provider_utils17.mediaTypeToExtension)(mediaType);
|
|
2145
2230
|
formData.append(
|
|
2146
2231
|
"file",
|
|
2147
2232
|
new File([blob], "audio", { type: mediaType }),
|
|
@@ -2186,15 +2271,15 @@ var OpenAITranscriptionModel = class {
|
|
|
2186
2271
|
value: response,
|
|
2187
2272
|
responseHeaders,
|
|
2188
2273
|
rawValue: rawResponse
|
|
2189
|
-
} = await (0,
|
|
2274
|
+
} = await (0, import_provider_utils17.postFormDataToApi)({
|
|
2190
2275
|
url: this.config.url({
|
|
2191
2276
|
path: "/audio/transcriptions",
|
|
2192
2277
|
modelId: this.modelId
|
|
2193
2278
|
}),
|
|
2194
|
-
headers: (0,
|
|
2279
|
+
headers: (0, import_provider_utils17.combineHeaders)(this.config.headers(), options.headers),
|
|
2195
2280
|
formData,
|
|
2196
2281
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
2197
|
-
successfulResponseHandler: (0,
|
|
2282
|
+
successfulResponseHandler: (0, import_provider_utils17.createJsonResponseHandler)(
|
|
2198
2283
|
openaiTranscriptionResponseSchema
|
|
2199
2284
|
),
|
|
2200
2285
|
abortSignal: options.abortSignal,
|
|
@@ -2226,16 +2311,16 @@ var OpenAITranscriptionModel = class {
|
|
|
2226
2311
|
};
|
|
2227
2312
|
|
|
2228
2313
|
// src/speech/openai-speech-model.ts
|
|
2229
|
-
var
|
|
2314
|
+
var import_provider_utils19 = require("@ai-sdk/provider-utils");
|
|
2230
2315
|
|
|
2231
2316
|
// src/speech/openai-speech-options.ts
|
|
2232
|
-
var
|
|
2233
|
-
var
|
|
2234
|
-
var openaiSpeechModelOptionsSchema = (0,
|
|
2235
|
-
() => (0,
|
|
2236
|
-
|
|
2237
|
-
instructions:
|
|
2238
|
-
speed:
|
|
2317
|
+
var import_provider_utils18 = require("@ai-sdk/provider-utils");
|
|
2318
|
+
var import_v412 = require("zod/v4");
|
|
2319
|
+
var openaiSpeechModelOptionsSchema = (0, import_provider_utils18.lazySchema)(
|
|
2320
|
+
() => (0, import_provider_utils18.zodSchema)(
|
|
2321
|
+
import_v412.z.object({
|
|
2322
|
+
instructions: import_v412.z.string().nullish(),
|
|
2323
|
+
speed: import_v412.z.number().min(0.25).max(4).default(1).nullish()
|
|
2239
2324
|
})
|
|
2240
2325
|
)
|
|
2241
2326
|
);
|
|
@@ -2260,7 +2345,7 @@ var OpenAISpeechModel = class {
|
|
|
2260
2345
|
providerOptions
|
|
2261
2346
|
}) {
|
|
2262
2347
|
const warnings = [];
|
|
2263
|
-
const openAIOptions = await (0,
|
|
2348
|
+
const openAIOptions = await (0, import_provider_utils19.parseProviderOptions)({
|
|
2264
2349
|
provider: "openai",
|
|
2265
2350
|
providerOptions,
|
|
2266
2351
|
schema: openaiSpeechModelOptionsSchema
|
|
@@ -2313,15 +2398,15 @@ var OpenAISpeechModel = class {
|
|
|
2313
2398
|
value: audio,
|
|
2314
2399
|
responseHeaders,
|
|
2315
2400
|
rawValue: rawResponse
|
|
2316
|
-
} = await (0,
|
|
2401
|
+
} = await (0, import_provider_utils19.postJsonToApi)({
|
|
2317
2402
|
url: this.config.url({
|
|
2318
2403
|
path: "/audio/speech",
|
|
2319
2404
|
modelId: this.modelId
|
|
2320
2405
|
}),
|
|
2321
|
-
headers: (0,
|
|
2406
|
+
headers: (0, import_provider_utils19.combineHeaders)(this.config.headers(), options.headers),
|
|
2322
2407
|
body: requestBody,
|
|
2323
2408
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
2324
|
-
successfulResponseHandler: (0,
|
|
2409
|
+
successfulResponseHandler: (0, import_provider_utils19.createBinaryResponseHandler)(),
|
|
2325
2410
|
abortSignal: options.abortSignal,
|
|
2326
2411
|
fetch: this.config.fetch
|
|
2327
2412
|
});
|
|
@@ -2343,7 +2428,7 @@ var OpenAISpeechModel = class {
|
|
|
2343
2428
|
|
|
2344
2429
|
// src/responses/openai-responses-language-model.ts
|
|
2345
2430
|
var import_provider8 = require("@ai-sdk/provider");
|
|
2346
|
-
var
|
|
2431
|
+
var import_provider_utils35 = require("@ai-sdk/provider-utils");
|
|
2347
2432
|
|
|
2348
2433
|
// src/responses/convert-openai-responses-usage.ts
|
|
2349
2434
|
function convertOpenAIResponsesUsage(usage) {
|
|
@@ -2386,45 +2471,45 @@ function convertOpenAIResponsesUsage(usage) {
|
|
|
2386
2471
|
|
|
2387
2472
|
// src/responses/convert-to-openai-responses-input.ts
|
|
2388
2473
|
var import_provider6 = require("@ai-sdk/provider");
|
|
2389
|
-
var
|
|
2390
|
-
var
|
|
2474
|
+
var import_provider_utils24 = require("@ai-sdk/provider-utils");
|
|
2475
|
+
var import_v417 = require("zod/v4");
|
|
2391
2476
|
|
|
2392
2477
|
// src/tool/apply-patch.ts
|
|
2393
|
-
var
|
|
2394
|
-
var
|
|
2395
|
-
var applyPatchInputSchema = (0,
|
|
2396
|
-
() => (0,
|
|
2397
|
-
|
|
2398
|
-
callId:
|
|
2399
|
-
operation:
|
|
2400
|
-
|
|
2401
|
-
type:
|
|
2402
|
-
path:
|
|
2403
|
-
diff:
|
|
2478
|
+
var import_provider_utils20 = require("@ai-sdk/provider-utils");
|
|
2479
|
+
var import_v413 = require("zod/v4");
|
|
2480
|
+
var applyPatchInputSchema = (0, import_provider_utils20.lazySchema)(
|
|
2481
|
+
() => (0, import_provider_utils20.zodSchema)(
|
|
2482
|
+
import_v413.z.object({
|
|
2483
|
+
callId: import_v413.z.string(),
|
|
2484
|
+
operation: import_v413.z.discriminatedUnion("type", [
|
|
2485
|
+
import_v413.z.object({
|
|
2486
|
+
type: import_v413.z.literal("create_file"),
|
|
2487
|
+
path: import_v413.z.string(),
|
|
2488
|
+
diff: import_v413.z.string()
|
|
2404
2489
|
}),
|
|
2405
|
-
|
|
2406
|
-
type:
|
|
2407
|
-
path:
|
|
2490
|
+
import_v413.z.object({
|
|
2491
|
+
type: import_v413.z.literal("delete_file"),
|
|
2492
|
+
path: import_v413.z.string()
|
|
2408
2493
|
}),
|
|
2409
|
-
|
|
2410
|
-
type:
|
|
2411
|
-
path:
|
|
2412
|
-
diff:
|
|
2494
|
+
import_v413.z.object({
|
|
2495
|
+
type: import_v413.z.literal("update_file"),
|
|
2496
|
+
path: import_v413.z.string(),
|
|
2497
|
+
diff: import_v413.z.string()
|
|
2413
2498
|
})
|
|
2414
2499
|
])
|
|
2415
2500
|
})
|
|
2416
2501
|
)
|
|
2417
2502
|
);
|
|
2418
|
-
var applyPatchOutputSchema = (0,
|
|
2419
|
-
() => (0,
|
|
2420
|
-
|
|
2421
|
-
status:
|
|
2422
|
-
output:
|
|
2503
|
+
var applyPatchOutputSchema = (0, import_provider_utils20.lazySchema)(
|
|
2504
|
+
() => (0, import_provider_utils20.zodSchema)(
|
|
2505
|
+
import_v413.z.object({
|
|
2506
|
+
status: import_v413.z.enum(["completed", "failed"]),
|
|
2507
|
+
output: import_v413.z.string().optional()
|
|
2423
2508
|
})
|
|
2424
2509
|
)
|
|
2425
2510
|
);
|
|
2426
|
-
var applyPatchArgsSchema = (0,
|
|
2427
|
-
var applyPatchToolFactory = (0,
|
|
2511
|
+
var applyPatchArgsSchema = (0, import_provider_utils20.lazySchema)(() => (0, import_provider_utils20.zodSchema)(import_v413.z.object({})));
|
|
2512
|
+
var applyPatchToolFactory = (0, import_provider_utils20.createProviderToolFactoryWithOutputSchema)({
|
|
2428
2513
|
id: "openai.apply_patch",
|
|
2429
2514
|
inputSchema: applyPatchInputSchema,
|
|
2430
2515
|
outputSchema: applyPatchOutputSchema
|
|
@@ -2432,115 +2517,115 @@ var applyPatchToolFactory = (0, import_provider_utils19.createProviderToolFactor
|
|
|
2432
2517
|
var applyPatch = applyPatchToolFactory;
|
|
2433
2518
|
|
|
2434
2519
|
// src/tool/local-shell.ts
|
|
2435
|
-
var
|
|
2436
|
-
var
|
|
2437
|
-
var localShellInputSchema = (0,
|
|
2438
|
-
() => (0,
|
|
2439
|
-
|
|
2440
|
-
action:
|
|
2441
|
-
type:
|
|
2442
|
-
command:
|
|
2443
|
-
timeoutMs:
|
|
2444
|
-
user:
|
|
2445
|
-
workingDirectory:
|
|
2446
|
-
env:
|
|
2520
|
+
var import_provider_utils21 = require("@ai-sdk/provider-utils");
|
|
2521
|
+
var import_v414 = require("zod/v4");
|
|
2522
|
+
var localShellInputSchema = (0, import_provider_utils21.lazySchema)(
|
|
2523
|
+
() => (0, import_provider_utils21.zodSchema)(
|
|
2524
|
+
import_v414.z.object({
|
|
2525
|
+
action: import_v414.z.object({
|
|
2526
|
+
type: import_v414.z.literal("exec"),
|
|
2527
|
+
command: import_v414.z.array(import_v414.z.string()),
|
|
2528
|
+
timeoutMs: import_v414.z.number().optional(),
|
|
2529
|
+
user: import_v414.z.string().optional(),
|
|
2530
|
+
workingDirectory: import_v414.z.string().optional(),
|
|
2531
|
+
env: import_v414.z.record(import_v414.z.string(), import_v414.z.string()).optional()
|
|
2447
2532
|
})
|
|
2448
2533
|
})
|
|
2449
2534
|
)
|
|
2450
2535
|
);
|
|
2451
|
-
var localShellOutputSchema = (0,
|
|
2452
|
-
() => (0,
|
|
2536
|
+
var localShellOutputSchema = (0, import_provider_utils21.lazySchema)(
|
|
2537
|
+
() => (0, import_provider_utils21.zodSchema)(import_v414.z.object({ output: import_v414.z.string() }))
|
|
2453
2538
|
);
|
|
2454
|
-
var localShell = (0,
|
|
2539
|
+
var localShell = (0, import_provider_utils21.createProviderToolFactoryWithOutputSchema)({
|
|
2455
2540
|
id: "openai.local_shell",
|
|
2456
2541
|
inputSchema: localShellInputSchema,
|
|
2457
2542
|
outputSchema: localShellOutputSchema
|
|
2458
2543
|
});
|
|
2459
2544
|
|
|
2460
2545
|
// src/tool/shell.ts
|
|
2461
|
-
var
|
|
2462
|
-
var
|
|
2463
|
-
var shellInputSchema = (0,
|
|
2464
|
-
() => (0,
|
|
2465
|
-
|
|
2466
|
-
action:
|
|
2467
|
-
commands:
|
|
2468
|
-
timeoutMs:
|
|
2469
|
-
maxOutputLength:
|
|
2546
|
+
var import_provider_utils22 = require("@ai-sdk/provider-utils");
|
|
2547
|
+
var import_v415 = require("zod/v4");
|
|
2548
|
+
var shellInputSchema = (0, import_provider_utils22.lazySchema)(
|
|
2549
|
+
() => (0, import_provider_utils22.zodSchema)(
|
|
2550
|
+
import_v415.z.object({
|
|
2551
|
+
action: import_v415.z.object({
|
|
2552
|
+
commands: import_v415.z.array(import_v415.z.string()),
|
|
2553
|
+
timeoutMs: import_v415.z.number().optional(),
|
|
2554
|
+
maxOutputLength: import_v415.z.number().optional()
|
|
2470
2555
|
})
|
|
2471
2556
|
})
|
|
2472
2557
|
)
|
|
2473
2558
|
);
|
|
2474
|
-
var shellOutputSchema = (0,
|
|
2475
|
-
() => (0,
|
|
2476
|
-
|
|
2477
|
-
output:
|
|
2478
|
-
|
|
2479
|
-
stdout:
|
|
2480
|
-
stderr:
|
|
2481
|
-
outcome:
|
|
2482
|
-
|
|
2483
|
-
|
|
2559
|
+
var shellOutputSchema = (0, import_provider_utils22.lazySchema)(
|
|
2560
|
+
() => (0, import_provider_utils22.zodSchema)(
|
|
2561
|
+
import_v415.z.object({
|
|
2562
|
+
output: import_v415.z.array(
|
|
2563
|
+
import_v415.z.object({
|
|
2564
|
+
stdout: import_v415.z.string(),
|
|
2565
|
+
stderr: import_v415.z.string(),
|
|
2566
|
+
outcome: import_v415.z.discriminatedUnion("type", [
|
|
2567
|
+
import_v415.z.object({ type: import_v415.z.literal("timeout") }),
|
|
2568
|
+
import_v415.z.object({ type: import_v415.z.literal("exit"), exitCode: import_v415.z.number() })
|
|
2484
2569
|
])
|
|
2485
2570
|
})
|
|
2486
2571
|
)
|
|
2487
2572
|
})
|
|
2488
2573
|
)
|
|
2489
2574
|
);
|
|
2490
|
-
var shellSkillsSchema =
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
type:
|
|
2494
|
-
skillId:
|
|
2495
|
-
version:
|
|
2575
|
+
var shellSkillsSchema = import_v415.z.array(
|
|
2576
|
+
import_v415.z.discriminatedUnion("type", [
|
|
2577
|
+
import_v415.z.object({
|
|
2578
|
+
type: import_v415.z.literal("skillReference"),
|
|
2579
|
+
skillId: import_v415.z.string(),
|
|
2580
|
+
version: import_v415.z.string().optional()
|
|
2496
2581
|
}),
|
|
2497
|
-
|
|
2498
|
-
type:
|
|
2499
|
-
name:
|
|
2500
|
-
description:
|
|
2501
|
-
source:
|
|
2502
|
-
type:
|
|
2503
|
-
mediaType:
|
|
2504
|
-
data:
|
|
2582
|
+
import_v415.z.object({
|
|
2583
|
+
type: import_v415.z.literal("inline"),
|
|
2584
|
+
name: import_v415.z.string(),
|
|
2585
|
+
description: import_v415.z.string(),
|
|
2586
|
+
source: import_v415.z.object({
|
|
2587
|
+
type: import_v415.z.literal("base64"),
|
|
2588
|
+
mediaType: import_v415.z.literal("application/zip"),
|
|
2589
|
+
data: import_v415.z.string()
|
|
2505
2590
|
})
|
|
2506
2591
|
})
|
|
2507
2592
|
])
|
|
2508
2593
|
).optional();
|
|
2509
|
-
var shellArgsSchema = (0,
|
|
2510
|
-
() => (0,
|
|
2511
|
-
|
|
2512
|
-
environment:
|
|
2513
|
-
|
|
2514
|
-
type:
|
|
2515
|
-
fileIds:
|
|
2516
|
-
memoryLimit:
|
|
2517
|
-
networkPolicy:
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
type:
|
|
2521
|
-
allowedDomains:
|
|
2522
|
-
domainSecrets:
|
|
2523
|
-
|
|
2524
|
-
domain:
|
|
2525
|
-
name:
|
|
2526
|
-
value:
|
|
2594
|
+
var shellArgsSchema = (0, import_provider_utils22.lazySchema)(
|
|
2595
|
+
() => (0, import_provider_utils22.zodSchema)(
|
|
2596
|
+
import_v415.z.object({
|
|
2597
|
+
environment: import_v415.z.union([
|
|
2598
|
+
import_v415.z.object({
|
|
2599
|
+
type: import_v415.z.literal("containerAuto"),
|
|
2600
|
+
fileIds: import_v415.z.array(import_v415.z.string()).optional(),
|
|
2601
|
+
memoryLimit: import_v415.z.enum(["1g", "4g", "16g", "64g"]).optional(),
|
|
2602
|
+
networkPolicy: import_v415.z.discriminatedUnion("type", [
|
|
2603
|
+
import_v415.z.object({ type: import_v415.z.literal("disabled") }),
|
|
2604
|
+
import_v415.z.object({
|
|
2605
|
+
type: import_v415.z.literal("allowlist"),
|
|
2606
|
+
allowedDomains: import_v415.z.array(import_v415.z.string()),
|
|
2607
|
+
domainSecrets: import_v415.z.array(
|
|
2608
|
+
import_v415.z.object({
|
|
2609
|
+
domain: import_v415.z.string(),
|
|
2610
|
+
name: import_v415.z.string(),
|
|
2611
|
+
value: import_v415.z.string()
|
|
2527
2612
|
})
|
|
2528
2613
|
).optional()
|
|
2529
2614
|
})
|
|
2530
2615
|
]).optional(),
|
|
2531
2616
|
skills: shellSkillsSchema
|
|
2532
2617
|
}),
|
|
2533
|
-
|
|
2534
|
-
type:
|
|
2535
|
-
containerId:
|
|
2618
|
+
import_v415.z.object({
|
|
2619
|
+
type: import_v415.z.literal("containerReference"),
|
|
2620
|
+
containerId: import_v415.z.string()
|
|
2536
2621
|
}),
|
|
2537
|
-
|
|
2538
|
-
type:
|
|
2539
|
-
skills:
|
|
2540
|
-
|
|
2541
|
-
name:
|
|
2542
|
-
description:
|
|
2543
|
-
path:
|
|
2622
|
+
import_v415.z.object({
|
|
2623
|
+
type: import_v415.z.literal("local").optional(),
|
|
2624
|
+
skills: import_v415.z.array(
|
|
2625
|
+
import_v415.z.object({
|
|
2626
|
+
name: import_v415.z.string(),
|
|
2627
|
+
description: import_v415.z.string(),
|
|
2628
|
+
path: import_v415.z.string()
|
|
2544
2629
|
})
|
|
2545
2630
|
).optional()
|
|
2546
2631
|
})
|
|
@@ -2548,40 +2633,40 @@ var shellArgsSchema = (0, import_provider_utils21.lazySchema)(
|
|
|
2548
2633
|
})
|
|
2549
2634
|
)
|
|
2550
2635
|
);
|
|
2551
|
-
var shell = (0,
|
|
2636
|
+
var shell = (0, import_provider_utils22.createProviderToolFactoryWithOutputSchema)({
|
|
2552
2637
|
id: "openai.shell",
|
|
2553
2638
|
inputSchema: shellInputSchema,
|
|
2554
2639
|
outputSchema: shellOutputSchema
|
|
2555
2640
|
});
|
|
2556
2641
|
|
|
2557
2642
|
// src/tool/tool-search.ts
|
|
2558
|
-
var
|
|
2559
|
-
var
|
|
2560
|
-
var toolSearchArgsSchema = (0,
|
|
2561
|
-
() => (0,
|
|
2562
|
-
|
|
2563
|
-
execution:
|
|
2564
|
-
description:
|
|
2565
|
-
parameters:
|
|
2643
|
+
var import_provider_utils23 = require("@ai-sdk/provider-utils");
|
|
2644
|
+
var import_v416 = require("zod/v4");
|
|
2645
|
+
var toolSearchArgsSchema = (0, import_provider_utils23.lazySchema)(
|
|
2646
|
+
() => (0, import_provider_utils23.zodSchema)(
|
|
2647
|
+
import_v416.z.object({
|
|
2648
|
+
execution: import_v416.z.enum(["server", "client"]).optional(),
|
|
2649
|
+
description: import_v416.z.string().optional(),
|
|
2650
|
+
parameters: import_v416.z.record(import_v416.z.string(), import_v416.z.unknown()).optional()
|
|
2566
2651
|
})
|
|
2567
2652
|
)
|
|
2568
2653
|
);
|
|
2569
|
-
var toolSearchInputSchema = (0,
|
|
2570
|
-
() => (0,
|
|
2571
|
-
|
|
2572
|
-
arguments:
|
|
2573
|
-
call_id:
|
|
2654
|
+
var toolSearchInputSchema = (0, import_provider_utils23.lazySchema)(
|
|
2655
|
+
() => (0, import_provider_utils23.zodSchema)(
|
|
2656
|
+
import_v416.z.object({
|
|
2657
|
+
arguments: import_v416.z.unknown().optional(),
|
|
2658
|
+
call_id: import_v416.z.string().nullish()
|
|
2574
2659
|
})
|
|
2575
2660
|
)
|
|
2576
2661
|
);
|
|
2577
|
-
var toolSearchOutputSchema = (0,
|
|
2578
|
-
() => (0,
|
|
2579
|
-
|
|
2580
|
-
tools:
|
|
2662
|
+
var toolSearchOutputSchema = (0, import_provider_utils23.lazySchema)(
|
|
2663
|
+
() => (0, import_provider_utils23.zodSchema)(
|
|
2664
|
+
import_v416.z.object({
|
|
2665
|
+
tools: import_v416.z.array(import_v416.z.record(import_v416.z.string(), import_v416.z.unknown()))
|
|
2581
2666
|
})
|
|
2582
2667
|
)
|
|
2583
2668
|
);
|
|
2584
|
-
var toolSearchToolFactory = (0,
|
|
2669
|
+
var toolSearchToolFactory = (0, import_provider_utils23.createProviderToolFactoryWithOutputSchema)({
|
|
2585
2670
|
id: "openai.tool_search",
|
|
2586
2671
|
inputSchema: toolSearchInputSchema,
|
|
2587
2672
|
outputSchema: toolSearchOutputSchema
|
|
@@ -2655,7 +2740,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2655
2740
|
return {
|
|
2656
2741
|
type: "input_image",
|
|
2657
2742
|
...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
2658
|
-
image_url: `data:${mediaType};base64,${(0,
|
|
2743
|
+
image_url: `data:${mediaType};base64,${(0, import_provider_utils24.convertToBase64)(part.data)}`
|
|
2659
2744
|
},
|
|
2660
2745
|
detail: (_b2 = (_a2 = part.providerOptions) == null ? void 0 : _a2[providerOptionsName]) == null ? void 0 : _b2.imageDetail
|
|
2661
2746
|
};
|
|
@@ -2670,7 +2755,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2670
2755
|
type: "input_file",
|
|
2671
2756
|
...typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
2672
2757
|
filename: (_c2 = part.filename) != null ? _c2 : `part-${index}.pdf`,
|
|
2673
|
-
file_data: `data:application/pdf;base64,${(0,
|
|
2758
|
+
file_data: `data:application/pdf;base64,${(0, import_provider_utils24.convertToBase64)(part.data)}`
|
|
2674
2759
|
}
|
|
2675
2760
|
};
|
|
2676
2761
|
} else {
|
|
@@ -2720,10 +2805,10 @@ async function convertToOpenAIResponsesInput({
|
|
|
2720
2805
|
input.push({ type: "item_reference", id });
|
|
2721
2806
|
break;
|
|
2722
2807
|
}
|
|
2723
|
-
const parsedInput = typeof part.input === "string" ? await (0,
|
|
2808
|
+
const parsedInput = typeof part.input === "string" ? await (0, import_provider_utils24.parseJSON)({
|
|
2724
2809
|
text: part.input,
|
|
2725
2810
|
schema: toolSearchInputSchema
|
|
2726
|
-
}) : await (0,
|
|
2811
|
+
}) : await (0, import_provider_utils24.validateTypes)({
|
|
2727
2812
|
value: part.input,
|
|
2728
2813
|
schema: toolSearchInputSchema
|
|
2729
2814
|
});
|
|
@@ -2749,7 +2834,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2749
2834
|
break;
|
|
2750
2835
|
}
|
|
2751
2836
|
if (hasLocalShellTool && resolvedToolName === "local_shell") {
|
|
2752
|
-
const parsedInput = await (0,
|
|
2837
|
+
const parsedInput = await (0, import_provider_utils24.validateTypes)({
|
|
2753
2838
|
value: part.input,
|
|
2754
2839
|
schema: localShellInputSchema
|
|
2755
2840
|
});
|
|
@@ -2769,7 +2854,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2769
2854
|
break;
|
|
2770
2855
|
}
|
|
2771
2856
|
if (hasShellTool && resolvedToolName === "shell") {
|
|
2772
|
-
const parsedInput = await (0,
|
|
2857
|
+
const parsedInput = await (0, import_provider_utils24.validateTypes)({
|
|
2773
2858
|
value: part.input,
|
|
2774
2859
|
schema: shellInputSchema
|
|
2775
2860
|
});
|
|
@@ -2787,7 +2872,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2787
2872
|
break;
|
|
2788
2873
|
}
|
|
2789
2874
|
if (hasApplyPatchTool && resolvedToolName === "apply_patch") {
|
|
2790
|
-
const parsedInput = await (0,
|
|
2875
|
+
const parsedInput = await (0, import_provider_utils24.validateTypes)({
|
|
2791
2876
|
value: part.input,
|
|
2792
2877
|
schema: applyPatchInputSchema
|
|
2793
2878
|
});
|
|
@@ -2835,7 +2920,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2835
2920
|
if (store) {
|
|
2836
2921
|
input.push({ type: "item_reference", id: itemId });
|
|
2837
2922
|
} else if (part.output.type === "json") {
|
|
2838
|
-
const parsedOutput = await (0,
|
|
2923
|
+
const parsedOutput = await (0, import_provider_utils24.validateTypes)({
|
|
2839
2924
|
value: part.output.value,
|
|
2840
2925
|
schema: toolSearchOutputSchema
|
|
2841
2926
|
});
|
|
@@ -2852,7 +2937,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2852
2937
|
}
|
|
2853
2938
|
if (hasShellTool && resolvedResultToolName === "shell") {
|
|
2854
2939
|
if (part.output.type === "json") {
|
|
2855
|
-
const parsedOutput = await (0,
|
|
2940
|
+
const parsedOutput = await (0, import_provider_utils24.validateTypes)({
|
|
2856
2941
|
value: part.output.value,
|
|
2857
2942
|
schema: shellOutputSchema
|
|
2858
2943
|
});
|
|
@@ -2883,7 +2968,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2883
2968
|
break;
|
|
2884
2969
|
}
|
|
2885
2970
|
case "reasoning": {
|
|
2886
|
-
const providerOptions = await (0,
|
|
2971
|
+
const providerOptions = await (0, import_provider_utils24.parseProviderOptions)({
|
|
2887
2972
|
provider: providerOptionsName,
|
|
2888
2973
|
providerOptions: part.providerOptions,
|
|
2889
2974
|
schema: openaiResponsesReasoningProviderOptionsSchema
|
|
@@ -2991,7 +3076,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2991
3076
|
part.toolName
|
|
2992
3077
|
);
|
|
2993
3078
|
if (resolvedToolName === "tool_search" && output.type === "json") {
|
|
2994
|
-
const parsedOutput = await (0,
|
|
3079
|
+
const parsedOutput = await (0, import_provider_utils24.validateTypes)({
|
|
2995
3080
|
value: output.value,
|
|
2996
3081
|
schema: toolSearchOutputSchema
|
|
2997
3082
|
});
|
|
@@ -3005,7 +3090,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3005
3090
|
continue;
|
|
3006
3091
|
}
|
|
3007
3092
|
if (hasLocalShellTool && resolvedToolName === "local_shell" && output.type === "json") {
|
|
3008
|
-
const parsedOutput = await (0,
|
|
3093
|
+
const parsedOutput = await (0, import_provider_utils24.validateTypes)({
|
|
3009
3094
|
value: output.value,
|
|
3010
3095
|
schema: localShellOutputSchema
|
|
3011
3096
|
});
|
|
@@ -3017,7 +3102,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3017
3102
|
continue;
|
|
3018
3103
|
}
|
|
3019
3104
|
if (hasShellTool && resolvedToolName === "shell" && output.type === "json") {
|
|
3020
|
-
const parsedOutput = await (0,
|
|
3105
|
+
const parsedOutput = await (0, import_provider_utils24.validateTypes)({
|
|
3021
3106
|
value: output.value,
|
|
3022
3107
|
schema: shellOutputSchema
|
|
3023
3108
|
});
|
|
@@ -3036,7 +3121,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3036
3121
|
continue;
|
|
3037
3122
|
}
|
|
3038
3123
|
if (hasApplyPatchTool && part.toolName === "apply_patch" && output.type === "json") {
|
|
3039
|
-
const parsedOutput = await (0,
|
|
3124
|
+
const parsedOutput = await (0, import_provider_utils24.validateTypes)({
|
|
3040
3125
|
value: output.value,
|
|
3041
3126
|
schema: applyPatchOutputSchema
|
|
3042
3127
|
});
|
|
@@ -3096,7 +3181,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3096
3181
|
});
|
|
3097
3182
|
return void 0;
|
|
3098
3183
|
}
|
|
3099
|
-
}).filter(
|
|
3184
|
+
}).filter(import_provider_utils24.isNonNullable);
|
|
3100
3185
|
break;
|
|
3101
3186
|
default:
|
|
3102
3187
|
outputValue = "";
|
|
@@ -3161,7 +3246,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3161
3246
|
return void 0;
|
|
3162
3247
|
}
|
|
3163
3248
|
}
|
|
3164
|
-
}).filter(
|
|
3249
|
+
}).filter(import_provider_utils24.isNonNullable);
|
|
3165
3250
|
break;
|
|
3166
3251
|
}
|
|
3167
3252
|
input.push({
|
|
@@ -3191,9 +3276,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
3191
3276
|
}
|
|
3192
3277
|
return { input, warnings };
|
|
3193
3278
|
}
|
|
3194
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
3195
|
-
itemId:
|
|
3196
|
-
reasoningEncryptedContent:
|
|
3279
|
+
var openaiResponsesReasoningProviderOptionsSchema = import_v417.z.object({
|
|
3280
|
+
itemId: import_v417.z.string().nullish(),
|
|
3281
|
+
reasoningEncryptedContent: import_v417.z.string().nullish()
|
|
3197
3282
|
});
|
|
3198
3283
|
|
|
3199
3284
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -3215,542 +3300,542 @@ function mapOpenAIResponseFinishReason({
|
|
|
3215
3300
|
}
|
|
3216
3301
|
|
|
3217
3302
|
// src/responses/openai-responses-api.ts
|
|
3218
|
-
var
|
|
3219
|
-
var
|
|
3220
|
-
var jsonValueSchema =
|
|
3221
|
-
() =>
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3303
|
+
var import_provider_utils25 = require("@ai-sdk/provider-utils");
|
|
3304
|
+
var import_v418 = require("zod/v4");
|
|
3305
|
+
var jsonValueSchema = import_v418.z.lazy(
|
|
3306
|
+
() => import_v418.z.union([
|
|
3307
|
+
import_v418.z.string(),
|
|
3308
|
+
import_v418.z.number(),
|
|
3309
|
+
import_v418.z.boolean(),
|
|
3310
|
+
import_v418.z.null(),
|
|
3311
|
+
import_v418.z.array(jsonValueSchema),
|
|
3312
|
+
import_v418.z.record(import_v418.z.string(), jsonValueSchema.optional())
|
|
3228
3313
|
])
|
|
3229
3314
|
);
|
|
3230
|
-
var openaiResponsesChunkSchema = (0,
|
|
3231
|
-
() => (0,
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
type:
|
|
3235
|
-
item_id:
|
|
3236
|
-
delta:
|
|
3237
|
-
logprobs:
|
|
3238
|
-
|
|
3239
|
-
token:
|
|
3240
|
-
logprob:
|
|
3241
|
-
top_logprobs:
|
|
3242
|
-
|
|
3243
|
-
token:
|
|
3244
|
-
logprob:
|
|
3315
|
+
var openaiResponsesChunkSchema = (0, import_provider_utils25.lazySchema)(
|
|
3316
|
+
() => (0, import_provider_utils25.zodSchema)(
|
|
3317
|
+
import_v418.z.union([
|
|
3318
|
+
import_v418.z.object({
|
|
3319
|
+
type: import_v418.z.literal("response.output_text.delta"),
|
|
3320
|
+
item_id: import_v418.z.string(),
|
|
3321
|
+
delta: import_v418.z.string(),
|
|
3322
|
+
logprobs: import_v418.z.array(
|
|
3323
|
+
import_v418.z.object({
|
|
3324
|
+
token: import_v418.z.string(),
|
|
3325
|
+
logprob: import_v418.z.number(),
|
|
3326
|
+
top_logprobs: import_v418.z.array(
|
|
3327
|
+
import_v418.z.object({
|
|
3328
|
+
token: import_v418.z.string(),
|
|
3329
|
+
logprob: import_v418.z.number()
|
|
3245
3330
|
})
|
|
3246
3331
|
)
|
|
3247
3332
|
})
|
|
3248
3333
|
).nullish()
|
|
3249
3334
|
}),
|
|
3250
|
-
|
|
3251
|
-
type:
|
|
3252
|
-
response:
|
|
3253
|
-
incomplete_details:
|
|
3254
|
-
usage:
|
|
3255
|
-
input_tokens:
|
|
3256
|
-
input_tokens_details:
|
|
3257
|
-
output_tokens:
|
|
3258
|
-
output_tokens_details:
|
|
3335
|
+
import_v418.z.object({
|
|
3336
|
+
type: import_v418.z.enum(["response.completed", "response.incomplete"]),
|
|
3337
|
+
response: import_v418.z.object({
|
|
3338
|
+
incomplete_details: import_v418.z.object({ reason: import_v418.z.string() }).nullish(),
|
|
3339
|
+
usage: import_v418.z.object({
|
|
3340
|
+
input_tokens: import_v418.z.number(),
|
|
3341
|
+
input_tokens_details: import_v418.z.object({ cached_tokens: import_v418.z.number().nullish() }).nullish(),
|
|
3342
|
+
output_tokens: import_v418.z.number(),
|
|
3343
|
+
output_tokens_details: import_v418.z.object({ reasoning_tokens: import_v418.z.number().nullish() }).nullish()
|
|
3259
3344
|
}),
|
|
3260
|
-
service_tier:
|
|
3345
|
+
service_tier: import_v418.z.string().nullish()
|
|
3261
3346
|
})
|
|
3262
3347
|
}),
|
|
3263
|
-
|
|
3264
|
-
type:
|
|
3265
|
-
response:
|
|
3266
|
-
error:
|
|
3267
|
-
code:
|
|
3268
|
-
message:
|
|
3348
|
+
import_v418.z.object({
|
|
3349
|
+
type: import_v418.z.literal("response.failed"),
|
|
3350
|
+
response: import_v418.z.object({
|
|
3351
|
+
error: import_v418.z.object({
|
|
3352
|
+
code: import_v418.z.string().nullish(),
|
|
3353
|
+
message: import_v418.z.string()
|
|
3269
3354
|
}).nullish(),
|
|
3270
|
-
incomplete_details:
|
|
3271
|
-
usage:
|
|
3272
|
-
input_tokens:
|
|
3273
|
-
input_tokens_details:
|
|
3274
|
-
output_tokens:
|
|
3275
|
-
output_tokens_details:
|
|
3355
|
+
incomplete_details: import_v418.z.object({ reason: import_v418.z.string() }).nullish(),
|
|
3356
|
+
usage: import_v418.z.object({
|
|
3357
|
+
input_tokens: import_v418.z.number(),
|
|
3358
|
+
input_tokens_details: import_v418.z.object({ cached_tokens: import_v418.z.number().nullish() }).nullish(),
|
|
3359
|
+
output_tokens: import_v418.z.number(),
|
|
3360
|
+
output_tokens_details: import_v418.z.object({ reasoning_tokens: import_v418.z.number().nullish() }).nullish()
|
|
3276
3361
|
}).nullish(),
|
|
3277
|
-
service_tier:
|
|
3362
|
+
service_tier: import_v418.z.string().nullish()
|
|
3278
3363
|
})
|
|
3279
3364
|
}),
|
|
3280
|
-
|
|
3281
|
-
type:
|
|
3282
|
-
response:
|
|
3283
|
-
id:
|
|
3284
|
-
created_at:
|
|
3285
|
-
model:
|
|
3286
|
-
service_tier:
|
|
3365
|
+
import_v418.z.object({
|
|
3366
|
+
type: import_v418.z.literal("response.created"),
|
|
3367
|
+
response: import_v418.z.object({
|
|
3368
|
+
id: import_v418.z.string(),
|
|
3369
|
+
created_at: import_v418.z.number(),
|
|
3370
|
+
model: import_v418.z.string(),
|
|
3371
|
+
service_tier: import_v418.z.string().nullish()
|
|
3287
3372
|
})
|
|
3288
3373
|
}),
|
|
3289
|
-
|
|
3290
|
-
type:
|
|
3291
|
-
output_index:
|
|
3292
|
-
item:
|
|
3293
|
-
|
|
3294
|
-
type:
|
|
3295
|
-
id:
|
|
3296
|
-
phase:
|
|
3374
|
+
import_v418.z.object({
|
|
3375
|
+
type: import_v418.z.literal("response.output_item.added"),
|
|
3376
|
+
output_index: import_v418.z.number(),
|
|
3377
|
+
item: import_v418.z.discriminatedUnion("type", [
|
|
3378
|
+
import_v418.z.object({
|
|
3379
|
+
type: import_v418.z.literal("message"),
|
|
3380
|
+
id: import_v418.z.string(),
|
|
3381
|
+
phase: import_v418.z.enum(["commentary", "final_answer"]).nullish()
|
|
3297
3382
|
}),
|
|
3298
|
-
|
|
3299
|
-
type:
|
|
3300
|
-
id:
|
|
3301
|
-
encrypted_content:
|
|
3383
|
+
import_v418.z.object({
|
|
3384
|
+
type: import_v418.z.literal("reasoning"),
|
|
3385
|
+
id: import_v418.z.string(),
|
|
3386
|
+
encrypted_content: import_v418.z.string().nullish()
|
|
3302
3387
|
}),
|
|
3303
|
-
|
|
3304
|
-
type:
|
|
3305
|
-
id:
|
|
3306
|
-
call_id:
|
|
3307
|
-
name:
|
|
3308
|
-
arguments:
|
|
3388
|
+
import_v418.z.object({
|
|
3389
|
+
type: import_v418.z.literal("function_call"),
|
|
3390
|
+
id: import_v418.z.string(),
|
|
3391
|
+
call_id: import_v418.z.string(),
|
|
3392
|
+
name: import_v418.z.string(),
|
|
3393
|
+
arguments: import_v418.z.string()
|
|
3309
3394
|
}),
|
|
3310
|
-
|
|
3311
|
-
type:
|
|
3312
|
-
id:
|
|
3313
|
-
status:
|
|
3395
|
+
import_v418.z.object({
|
|
3396
|
+
type: import_v418.z.literal("web_search_call"),
|
|
3397
|
+
id: import_v418.z.string(),
|
|
3398
|
+
status: import_v418.z.string()
|
|
3314
3399
|
}),
|
|
3315
|
-
|
|
3316
|
-
type:
|
|
3317
|
-
id:
|
|
3318
|
-
status:
|
|
3400
|
+
import_v418.z.object({
|
|
3401
|
+
type: import_v418.z.literal("computer_call"),
|
|
3402
|
+
id: import_v418.z.string(),
|
|
3403
|
+
status: import_v418.z.string()
|
|
3319
3404
|
}),
|
|
3320
|
-
|
|
3321
|
-
type:
|
|
3322
|
-
id:
|
|
3405
|
+
import_v418.z.object({
|
|
3406
|
+
type: import_v418.z.literal("file_search_call"),
|
|
3407
|
+
id: import_v418.z.string()
|
|
3323
3408
|
}),
|
|
3324
|
-
|
|
3325
|
-
type:
|
|
3326
|
-
id:
|
|
3409
|
+
import_v418.z.object({
|
|
3410
|
+
type: import_v418.z.literal("image_generation_call"),
|
|
3411
|
+
id: import_v418.z.string()
|
|
3327
3412
|
}),
|
|
3328
|
-
|
|
3329
|
-
type:
|
|
3330
|
-
id:
|
|
3331
|
-
container_id:
|
|
3332
|
-
code:
|
|
3333
|
-
outputs:
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3413
|
+
import_v418.z.object({
|
|
3414
|
+
type: import_v418.z.literal("code_interpreter_call"),
|
|
3415
|
+
id: import_v418.z.string(),
|
|
3416
|
+
container_id: import_v418.z.string(),
|
|
3417
|
+
code: import_v418.z.string().nullable(),
|
|
3418
|
+
outputs: import_v418.z.array(
|
|
3419
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3420
|
+
import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
|
|
3421
|
+
import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
|
|
3337
3422
|
])
|
|
3338
3423
|
).nullable(),
|
|
3339
|
-
status:
|
|
3424
|
+
status: import_v418.z.string()
|
|
3340
3425
|
}),
|
|
3341
|
-
|
|
3342
|
-
type:
|
|
3343
|
-
id:
|
|
3344
|
-
status:
|
|
3345
|
-
approval_request_id:
|
|
3426
|
+
import_v418.z.object({
|
|
3427
|
+
type: import_v418.z.literal("mcp_call"),
|
|
3428
|
+
id: import_v418.z.string(),
|
|
3429
|
+
status: import_v418.z.string(),
|
|
3430
|
+
approval_request_id: import_v418.z.string().nullish()
|
|
3346
3431
|
}),
|
|
3347
|
-
|
|
3348
|
-
type:
|
|
3349
|
-
id:
|
|
3432
|
+
import_v418.z.object({
|
|
3433
|
+
type: import_v418.z.literal("mcp_list_tools"),
|
|
3434
|
+
id: import_v418.z.string()
|
|
3350
3435
|
}),
|
|
3351
|
-
|
|
3352
|
-
type:
|
|
3353
|
-
id:
|
|
3436
|
+
import_v418.z.object({
|
|
3437
|
+
type: import_v418.z.literal("mcp_approval_request"),
|
|
3438
|
+
id: import_v418.z.string()
|
|
3354
3439
|
}),
|
|
3355
|
-
|
|
3356
|
-
type:
|
|
3357
|
-
id:
|
|
3358
|
-
call_id:
|
|
3359
|
-
status:
|
|
3360
|
-
operation:
|
|
3361
|
-
|
|
3362
|
-
type:
|
|
3363
|
-
path:
|
|
3364
|
-
diff:
|
|
3440
|
+
import_v418.z.object({
|
|
3441
|
+
type: import_v418.z.literal("apply_patch_call"),
|
|
3442
|
+
id: import_v418.z.string(),
|
|
3443
|
+
call_id: import_v418.z.string(),
|
|
3444
|
+
status: import_v418.z.enum(["in_progress", "completed"]),
|
|
3445
|
+
operation: import_v418.z.discriminatedUnion("type", [
|
|
3446
|
+
import_v418.z.object({
|
|
3447
|
+
type: import_v418.z.literal("create_file"),
|
|
3448
|
+
path: import_v418.z.string(),
|
|
3449
|
+
diff: import_v418.z.string()
|
|
3365
3450
|
}),
|
|
3366
|
-
|
|
3367
|
-
type:
|
|
3368
|
-
path:
|
|
3451
|
+
import_v418.z.object({
|
|
3452
|
+
type: import_v418.z.literal("delete_file"),
|
|
3453
|
+
path: import_v418.z.string()
|
|
3369
3454
|
}),
|
|
3370
|
-
|
|
3371
|
-
type:
|
|
3372
|
-
path:
|
|
3373
|
-
diff:
|
|
3455
|
+
import_v418.z.object({
|
|
3456
|
+
type: import_v418.z.literal("update_file"),
|
|
3457
|
+
path: import_v418.z.string(),
|
|
3458
|
+
diff: import_v418.z.string()
|
|
3374
3459
|
})
|
|
3375
3460
|
])
|
|
3376
3461
|
}),
|
|
3377
|
-
|
|
3378
|
-
type:
|
|
3379
|
-
id:
|
|
3380
|
-
call_id:
|
|
3381
|
-
name:
|
|
3382
|
-
input:
|
|
3462
|
+
import_v418.z.object({
|
|
3463
|
+
type: import_v418.z.literal("custom_tool_call"),
|
|
3464
|
+
id: import_v418.z.string(),
|
|
3465
|
+
call_id: import_v418.z.string(),
|
|
3466
|
+
name: import_v418.z.string(),
|
|
3467
|
+
input: import_v418.z.string()
|
|
3383
3468
|
}),
|
|
3384
|
-
|
|
3385
|
-
type:
|
|
3386
|
-
id:
|
|
3387
|
-
call_id:
|
|
3388
|
-
status:
|
|
3389
|
-
action:
|
|
3390
|
-
commands:
|
|
3469
|
+
import_v418.z.object({
|
|
3470
|
+
type: import_v418.z.literal("shell_call"),
|
|
3471
|
+
id: import_v418.z.string(),
|
|
3472
|
+
call_id: import_v418.z.string(),
|
|
3473
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3474
|
+
action: import_v418.z.object({
|
|
3475
|
+
commands: import_v418.z.array(import_v418.z.string())
|
|
3391
3476
|
})
|
|
3392
3477
|
}),
|
|
3393
|
-
|
|
3394
|
-
type:
|
|
3395
|
-
id:
|
|
3396
|
-
call_id:
|
|
3397
|
-
status:
|
|
3398
|
-
output:
|
|
3399
|
-
|
|
3400
|
-
stdout:
|
|
3401
|
-
stderr:
|
|
3402
|
-
outcome:
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
type:
|
|
3406
|
-
exit_code:
|
|
3478
|
+
import_v418.z.object({
|
|
3479
|
+
type: import_v418.z.literal("shell_call_output"),
|
|
3480
|
+
id: import_v418.z.string(),
|
|
3481
|
+
call_id: import_v418.z.string(),
|
|
3482
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3483
|
+
output: import_v418.z.array(
|
|
3484
|
+
import_v418.z.object({
|
|
3485
|
+
stdout: import_v418.z.string(),
|
|
3486
|
+
stderr: import_v418.z.string(),
|
|
3487
|
+
outcome: import_v418.z.discriminatedUnion("type", [
|
|
3488
|
+
import_v418.z.object({ type: import_v418.z.literal("timeout") }),
|
|
3489
|
+
import_v418.z.object({
|
|
3490
|
+
type: import_v418.z.literal("exit"),
|
|
3491
|
+
exit_code: import_v418.z.number()
|
|
3407
3492
|
})
|
|
3408
3493
|
])
|
|
3409
3494
|
})
|
|
3410
3495
|
)
|
|
3411
3496
|
}),
|
|
3412
|
-
|
|
3413
|
-
type:
|
|
3414
|
-
id:
|
|
3415
|
-
execution:
|
|
3416
|
-
call_id:
|
|
3417
|
-
status:
|
|
3418
|
-
arguments:
|
|
3497
|
+
import_v418.z.object({
|
|
3498
|
+
type: import_v418.z.literal("tool_search_call"),
|
|
3499
|
+
id: import_v418.z.string(),
|
|
3500
|
+
execution: import_v418.z.enum(["server", "client"]),
|
|
3501
|
+
call_id: import_v418.z.string().nullable(),
|
|
3502
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3503
|
+
arguments: import_v418.z.unknown()
|
|
3419
3504
|
}),
|
|
3420
|
-
|
|
3421
|
-
type:
|
|
3422
|
-
id:
|
|
3423
|
-
execution:
|
|
3424
|
-
call_id:
|
|
3425
|
-
status:
|
|
3426
|
-
tools:
|
|
3505
|
+
import_v418.z.object({
|
|
3506
|
+
type: import_v418.z.literal("tool_search_output"),
|
|
3507
|
+
id: import_v418.z.string(),
|
|
3508
|
+
execution: import_v418.z.enum(["server", "client"]),
|
|
3509
|
+
call_id: import_v418.z.string().nullable(),
|
|
3510
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3511
|
+
tools: import_v418.z.array(import_v418.z.record(import_v418.z.string(), jsonValueSchema.optional()))
|
|
3427
3512
|
})
|
|
3428
3513
|
])
|
|
3429
3514
|
}),
|
|
3430
|
-
|
|
3431
|
-
type:
|
|
3432
|
-
output_index:
|
|
3433
|
-
item:
|
|
3434
|
-
|
|
3435
|
-
type:
|
|
3436
|
-
id:
|
|
3437
|
-
phase:
|
|
3515
|
+
import_v418.z.object({
|
|
3516
|
+
type: import_v418.z.literal("response.output_item.done"),
|
|
3517
|
+
output_index: import_v418.z.number(),
|
|
3518
|
+
item: import_v418.z.discriminatedUnion("type", [
|
|
3519
|
+
import_v418.z.object({
|
|
3520
|
+
type: import_v418.z.literal("message"),
|
|
3521
|
+
id: import_v418.z.string(),
|
|
3522
|
+
phase: import_v418.z.enum(["commentary", "final_answer"]).nullish()
|
|
3438
3523
|
}),
|
|
3439
|
-
|
|
3440
|
-
type:
|
|
3441
|
-
id:
|
|
3442
|
-
encrypted_content:
|
|
3524
|
+
import_v418.z.object({
|
|
3525
|
+
type: import_v418.z.literal("reasoning"),
|
|
3526
|
+
id: import_v418.z.string(),
|
|
3527
|
+
encrypted_content: import_v418.z.string().nullish()
|
|
3443
3528
|
}),
|
|
3444
|
-
|
|
3445
|
-
type:
|
|
3446
|
-
id:
|
|
3447
|
-
call_id:
|
|
3448
|
-
name:
|
|
3449
|
-
arguments:
|
|
3450
|
-
status:
|
|
3529
|
+
import_v418.z.object({
|
|
3530
|
+
type: import_v418.z.literal("function_call"),
|
|
3531
|
+
id: import_v418.z.string(),
|
|
3532
|
+
call_id: import_v418.z.string(),
|
|
3533
|
+
name: import_v418.z.string(),
|
|
3534
|
+
arguments: import_v418.z.string(),
|
|
3535
|
+
status: import_v418.z.literal("completed")
|
|
3451
3536
|
}),
|
|
3452
|
-
|
|
3453
|
-
type:
|
|
3454
|
-
id:
|
|
3455
|
-
call_id:
|
|
3456
|
-
name:
|
|
3457
|
-
input:
|
|
3458
|
-
status:
|
|
3537
|
+
import_v418.z.object({
|
|
3538
|
+
type: import_v418.z.literal("custom_tool_call"),
|
|
3539
|
+
id: import_v418.z.string(),
|
|
3540
|
+
call_id: import_v418.z.string(),
|
|
3541
|
+
name: import_v418.z.string(),
|
|
3542
|
+
input: import_v418.z.string(),
|
|
3543
|
+
status: import_v418.z.literal("completed")
|
|
3459
3544
|
}),
|
|
3460
|
-
|
|
3461
|
-
type:
|
|
3462
|
-
id:
|
|
3463
|
-
code:
|
|
3464
|
-
container_id:
|
|
3465
|
-
outputs:
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3545
|
+
import_v418.z.object({
|
|
3546
|
+
type: import_v418.z.literal("code_interpreter_call"),
|
|
3547
|
+
id: import_v418.z.string(),
|
|
3548
|
+
code: import_v418.z.string().nullable(),
|
|
3549
|
+
container_id: import_v418.z.string(),
|
|
3550
|
+
outputs: import_v418.z.array(
|
|
3551
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3552
|
+
import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
|
|
3553
|
+
import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
|
|
3469
3554
|
])
|
|
3470
3555
|
).nullable()
|
|
3471
3556
|
}),
|
|
3472
|
-
|
|
3473
|
-
type:
|
|
3474
|
-
id:
|
|
3475
|
-
result:
|
|
3557
|
+
import_v418.z.object({
|
|
3558
|
+
type: import_v418.z.literal("image_generation_call"),
|
|
3559
|
+
id: import_v418.z.string(),
|
|
3560
|
+
result: import_v418.z.string()
|
|
3476
3561
|
}),
|
|
3477
|
-
|
|
3478
|
-
type:
|
|
3479
|
-
id:
|
|
3480
|
-
status:
|
|
3481
|
-
action:
|
|
3482
|
-
|
|
3483
|
-
type:
|
|
3484
|
-
query:
|
|
3485
|
-
sources:
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3562
|
+
import_v418.z.object({
|
|
3563
|
+
type: import_v418.z.literal("web_search_call"),
|
|
3564
|
+
id: import_v418.z.string(),
|
|
3565
|
+
status: import_v418.z.string(),
|
|
3566
|
+
action: import_v418.z.discriminatedUnion("type", [
|
|
3567
|
+
import_v418.z.object({
|
|
3568
|
+
type: import_v418.z.literal("search"),
|
|
3569
|
+
query: import_v418.z.string().nullish(),
|
|
3570
|
+
sources: import_v418.z.array(
|
|
3571
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3572
|
+
import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() }),
|
|
3573
|
+
import_v418.z.object({ type: import_v418.z.literal("api"), name: import_v418.z.string() })
|
|
3489
3574
|
])
|
|
3490
3575
|
).nullish()
|
|
3491
3576
|
}),
|
|
3492
|
-
|
|
3493
|
-
type:
|
|
3494
|
-
url:
|
|
3577
|
+
import_v418.z.object({
|
|
3578
|
+
type: import_v418.z.literal("open_page"),
|
|
3579
|
+
url: import_v418.z.string().nullish()
|
|
3495
3580
|
}),
|
|
3496
|
-
|
|
3497
|
-
type:
|
|
3498
|
-
url:
|
|
3499
|
-
pattern:
|
|
3581
|
+
import_v418.z.object({
|
|
3582
|
+
type: import_v418.z.literal("find_in_page"),
|
|
3583
|
+
url: import_v418.z.string().nullish(),
|
|
3584
|
+
pattern: import_v418.z.string().nullish()
|
|
3500
3585
|
})
|
|
3501
3586
|
]).nullish()
|
|
3502
3587
|
}),
|
|
3503
|
-
|
|
3504
|
-
type:
|
|
3505
|
-
id:
|
|
3506
|
-
queries:
|
|
3507
|
-
results:
|
|
3508
|
-
|
|
3509
|
-
attributes:
|
|
3510
|
-
|
|
3511
|
-
|
|
3588
|
+
import_v418.z.object({
|
|
3589
|
+
type: import_v418.z.literal("file_search_call"),
|
|
3590
|
+
id: import_v418.z.string(),
|
|
3591
|
+
queries: import_v418.z.array(import_v418.z.string()),
|
|
3592
|
+
results: import_v418.z.array(
|
|
3593
|
+
import_v418.z.object({
|
|
3594
|
+
attributes: import_v418.z.record(
|
|
3595
|
+
import_v418.z.string(),
|
|
3596
|
+
import_v418.z.union([import_v418.z.string(), import_v418.z.number(), import_v418.z.boolean()])
|
|
3512
3597
|
),
|
|
3513
|
-
file_id:
|
|
3514
|
-
filename:
|
|
3515
|
-
score:
|
|
3516
|
-
text:
|
|
3598
|
+
file_id: import_v418.z.string(),
|
|
3599
|
+
filename: import_v418.z.string(),
|
|
3600
|
+
score: import_v418.z.number(),
|
|
3601
|
+
text: import_v418.z.string()
|
|
3517
3602
|
})
|
|
3518
3603
|
).nullish()
|
|
3519
3604
|
}),
|
|
3520
|
-
|
|
3521
|
-
type:
|
|
3522
|
-
id:
|
|
3523
|
-
call_id:
|
|
3524
|
-
action:
|
|
3525
|
-
type:
|
|
3526
|
-
command:
|
|
3527
|
-
timeout_ms:
|
|
3528
|
-
user:
|
|
3529
|
-
working_directory:
|
|
3530
|
-
env:
|
|
3605
|
+
import_v418.z.object({
|
|
3606
|
+
type: import_v418.z.literal("local_shell_call"),
|
|
3607
|
+
id: import_v418.z.string(),
|
|
3608
|
+
call_id: import_v418.z.string(),
|
|
3609
|
+
action: import_v418.z.object({
|
|
3610
|
+
type: import_v418.z.literal("exec"),
|
|
3611
|
+
command: import_v418.z.array(import_v418.z.string()),
|
|
3612
|
+
timeout_ms: import_v418.z.number().optional(),
|
|
3613
|
+
user: import_v418.z.string().optional(),
|
|
3614
|
+
working_directory: import_v418.z.string().optional(),
|
|
3615
|
+
env: import_v418.z.record(import_v418.z.string(), import_v418.z.string()).optional()
|
|
3531
3616
|
})
|
|
3532
3617
|
}),
|
|
3533
|
-
|
|
3534
|
-
type:
|
|
3535
|
-
id:
|
|
3536
|
-
status:
|
|
3618
|
+
import_v418.z.object({
|
|
3619
|
+
type: import_v418.z.literal("computer_call"),
|
|
3620
|
+
id: import_v418.z.string(),
|
|
3621
|
+
status: import_v418.z.literal("completed")
|
|
3537
3622
|
}),
|
|
3538
|
-
|
|
3539
|
-
type:
|
|
3540
|
-
id:
|
|
3541
|
-
status:
|
|
3542
|
-
arguments:
|
|
3543
|
-
name:
|
|
3544
|
-
server_label:
|
|
3545
|
-
output:
|
|
3546
|
-
error:
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
type:
|
|
3550
|
-
code:
|
|
3551
|
-
message:
|
|
3623
|
+
import_v418.z.object({
|
|
3624
|
+
type: import_v418.z.literal("mcp_call"),
|
|
3625
|
+
id: import_v418.z.string(),
|
|
3626
|
+
status: import_v418.z.string(),
|
|
3627
|
+
arguments: import_v418.z.string(),
|
|
3628
|
+
name: import_v418.z.string(),
|
|
3629
|
+
server_label: import_v418.z.string(),
|
|
3630
|
+
output: import_v418.z.string().nullish(),
|
|
3631
|
+
error: import_v418.z.union([
|
|
3632
|
+
import_v418.z.string(),
|
|
3633
|
+
import_v418.z.object({
|
|
3634
|
+
type: import_v418.z.string().optional(),
|
|
3635
|
+
code: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).optional(),
|
|
3636
|
+
message: import_v418.z.string().optional()
|
|
3552
3637
|
}).loose()
|
|
3553
3638
|
]).nullish(),
|
|
3554
|
-
approval_request_id:
|
|
3639
|
+
approval_request_id: import_v418.z.string().nullish()
|
|
3555
3640
|
}),
|
|
3556
|
-
|
|
3557
|
-
type:
|
|
3558
|
-
id:
|
|
3559
|
-
server_label:
|
|
3560
|
-
tools:
|
|
3561
|
-
|
|
3562
|
-
name:
|
|
3563
|
-
description:
|
|
3564
|
-
input_schema:
|
|
3565
|
-
annotations:
|
|
3641
|
+
import_v418.z.object({
|
|
3642
|
+
type: import_v418.z.literal("mcp_list_tools"),
|
|
3643
|
+
id: import_v418.z.string(),
|
|
3644
|
+
server_label: import_v418.z.string(),
|
|
3645
|
+
tools: import_v418.z.array(
|
|
3646
|
+
import_v418.z.object({
|
|
3647
|
+
name: import_v418.z.string(),
|
|
3648
|
+
description: import_v418.z.string().optional(),
|
|
3649
|
+
input_schema: import_v418.z.any(),
|
|
3650
|
+
annotations: import_v418.z.record(import_v418.z.string(), import_v418.z.unknown()).optional()
|
|
3566
3651
|
})
|
|
3567
3652
|
),
|
|
3568
|
-
error:
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
type:
|
|
3572
|
-
code:
|
|
3573
|
-
message:
|
|
3653
|
+
error: import_v418.z.union([
|
|
3654
|
+
import_v418.z.string(),
|
|
3655
|
+
import_v418.z.object({
|
|
3656
|
+
type: import_v418.z.string().optional(),
|
|
3657
|
+
code: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).optional(),
|
|
3658
|
+
message: import_v418.z.string().optional()
|
|
3574
3659
|
}).loose()
|
|
3575
3660
|
]).optional()
|
|
3576
3661
|
}),
|
|
3577
|
-
|
|
3578
|
-
type:
|
|
3579
|
-
id:
|
|
3580
|
-
server_label:
|
|
3581
|
-
name:
|
|
3582
|
-
arguments:
|
|
3583
|
-
approval_request_id:
|
|
3662
|
+
import_v418.z.object({
|
|
3663
|
+
type: import_v418.z.literal("mcp_approval_request"),
|
|
3664
|
+
id: import_v418.z.string(),
|
|
3665
|
+
server_label: import_v418.z.string(),
|
|
3666
|
+
name: import_v418.z.string(),
|
|
3667
|
+
arguments: import_v418.z.string(),
|
|
3668
|
+
approval_request_id: import_v418.z.string().optional()
|
|
3584
3669
|
}),
|
|
3585
|
-
|
|
3586
|
-
type:
|
|
3587
|
-
id:
|
|
3588
|
-
call_id:
|
|
3589
|
-
status:
|
|
3590
|
-
operation:
|
|
3591
|
-
|
|
3592
|
-
type:
|
|
3593
|
-
path:
|
|
3594
|
-
diff:
|
|
3670
|
+
import_v418.z.object({
|
|
3671
|
+
type: import_v418.z.literal("apply_patch_call"),
|
|
3672
|
+
id: import_v418.z.string(),
|
|
3673
|
+
call_id: import_v418.z.string(),
|
|
3674
|
+
status: import_v418.z.enum(["in_progress", "completed"]),
|
|
3675
|
+
operation: import_v418.z.discriminatedUnion("type", [
|
|
3676
|
+
import_v418.z.object({
|
|
3677
|
+
type: import_v418.z.literal("create_file"),
|
|
3678
|
+
path: import_v418.z.string(),
|
|
3679
|
+
diff: import_v418.z.string()
|
|
3595
3680
|
}),
|
|
3596
|
-
|
|
3597
|
-
type:
|
|
3598
|
-
path:
|
|
3681
|
+
import_v418.z.object({
|
|
3682
|
+
type: import_v418.z.literal("delete_file"),
|
|
3683
|
+
path: import_v418.z.string()
|
|
3599
3684
|
}),
|
|
3600
|
-
|
|
3601
|
-
type:
|
|
3602
|
-
path:
|
|
3603
|
-
diff:
|
|
3685
|
+
import_v418.z.object({
|
|
3686
|
+
type: import_v418.z.literal("update_file"),
|
|
3687
|
+
path: import_v418.z.string(),
|
|
3688
|
+
diff: import_v418.z.string()
|
|
3604
3689
|
})
|
|
3605
3690
|
])
|
|
3606
3691
|
}),
|
|
3607
|
-
|
|
3608
|
-
type:
|
|
3609
|
-
id:
|
|
3610
|
-
call_id:
|
|
3611
|
-
status:
|
|
3612
|
-
action:
|
|
3613
|
-
commands:
|
|
3692
|
+
import_v418.z.object({
|
|
3693
|
+
type: import_v418.z.literal("shell_call"),
|
|
3694
|
+
id: import_v418.z.string(),
|
|
3695
|
+
call_id: import_v418.z.string(),
|
|
3696
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3697
|
+
action: import_v418.z.object({
|
|
3698
|
+
commands: import_v418.z.array(import_v418.z.string())
|
|
3614
3699
|
})
|
|
3615
3700
|
}),
|
|
3616
|
-
|
|
3617
|
-
type:
|
|
3618
|
-
id:
|
|
3619
|
-
call_id:
|
|
3620
|
-
status:
|
|
3621
|
-
output:
|
|
3622
|
-
|
|
3623
|
-
stdout:
|
|
3624
|
-
stderr:
|
|
3625
|
-
outcome:
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
type:
|
|
3629
|
-
exit_code:
|
|
3701
|
+
import_v418.z.object({
|
|
3702
|
+
type: import_v418.z.literal("shell_call_output"),
|
|
3703
|
+
id: import_v418.z.string(),
|
|
3704
|
+
call_id: import_v418.z.string(),
|
|
3705
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3706
|
+
output: import_v418.z.array(
|
|
3707
|
+
import_v418.z.object({
|
|
3708
|
+
stdout: import_v418.z.string(),
|
|
3709
|
+
stderr: import_v418.z.string(),
|
|
3710
|
+
outcome: import_v418.z.discriminatedUnion("type", [
|
|
3711
|
+
import_v418.z.object({ type: import_v418.z.literal("timeout") }),
|
|
3712
|
+
import_v418.z.object({
|
|
3713
|
+
type: import_v418.z.literal("exit"),
|
|
3714
|
+
exit_code: import_v418.z.number()
|
|
3630
3715
|
})
|
|
3631
3716
|
])
|
|
3632
3717
|
})
|
|
3633
3718
|
)
|
|
3634
3719
|
}),
|
|
3635
|
-
|
|
3636
|
-
type:
|
|
3637
|
-
id:
|
|
3638
|
-
execution:
|
|
3639
|
-
call_id:
|
|
3640
|
-
status:
|
|
3641
|
-
arguments:
|
|
3720
|
+
import_v418.z.object({
|
|
3721
|
+
type: import_v418.z.literal("tool_search_call"),
|
|
3722
|
+
id: import_v418.z.string(),
|
|
3723
|
+
execution: import_v418.z.enum(["server", "client"]),
|
|
3724
|
+
call_id: import_v418.z.string().nullable(),
|
|
3725
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3726
|
+
arguments: import_v418.z.unknown()
|
|
3642
3727
|
}),
|
|
3643
|
-
|
|
3644
|
-
type:
|
|
3645
|
-
id:
|
|
3646
|
-
execution:
|
|
3647
|
-
call_id:
|
|
3648
|
-
status:
|
|
3649
|
-
tools:
|
|
3728
|
+
import_v418.z.object({
|
|
3729
|
+
type: import_v418.z.literal("tool_search_output"),
|
|
3730
|
+
id: import_v418.z.string(),
|
|
3731
|
+
execution: import_v418.z.enum(["server", "client"]),
|
|
3732
|
+
call_id: import_v418.z.string().nullable(),
|
|
3733
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3734
|
+
tools: import_v418.z.array(import_v418.z.record(import_v418.z.string(), jsonValueSchema.optional()))
|
|
3650
3735
|
})
|
|
3651
3736
|
])
|
|
3652
3737
|
}),
|
|
3653
|
-
|
|
3654
|
-
type:
|
|
3655
|
-
item_id:
|
|
3656
|
-
output_index:
|
|
3657
|
-
delta:
|
|
3738
|
+
import_v418.z.object({
|
|
3739
|
+
type: import_v418.z.literal("response.function_call_arguments.delta"),
|
|
3740
|
+
item_id: import_v418.z.string(),
|
|
3741
|
+
output_index: import_v418.z.number(),
|
|
3742
|
+
delta: import_v418.z.string()
|
|
3658
3743
|
}),
|
|
3659
|
-
|
|
3660
|
-
type:
|
|
3661
|
-
item_id:
|
|
3662
|
-
output_index:
|
|
3663
|
-
delta:
|
|
3744
|
+
import_v418.z.object({
|
|
3745
|
+
type: import_v418.z.literal("response.custom_tool_call_input.delta"),
|
|
3746
|
+
item_id: import_v418.z.string(),
|
|
3747
|
+
output_index: import_v418.z.number(),
|
|
3748
|
+
delta: import_v418.z.string()
|
|
3664
3749
|
}),
|
|
3665
|
-
|
|
3666
|
-
type:
|
|
3667
|
-
item_id:
|
|
3668
|
-
output_index:
|
|
3669
|
-
partial_image_b64:
|
|
3750
|
+
import_v418.z.object({
|
|
3751
|
+
type: import_v418.z.literal("response.image_generation_call.partial_image"),
|
|
3752
|
+
item_id: import_v418.z.string(),
|
|
3753
|
+
output_index: import_v418.z.number(),
|
|
3754
|
+
partial_image_b64: import_v418.z.string()
|
|
3670
3755
|
}),
|
|
3671
|
-
|
|
3672
|
-
type:
|
|
3673
|
-
item_id:
|
|
3674
|
-
output_index:
|
|
3675
|
-
delta:
|
|
3756
|
+
import_v418.z.object({
|
|
3757
|
+
type: import_v418.z.literal("response.code_interpreter_call_code.delta"),
|
|
3758
|
+
item_id: import_v418.z.string(),
|
|
3759
|
+
output_index: import_v418.z.number(),
|
|
3760
|
+
delta: import_v418.z.string()
|
|
3676
3761
|
}),
|
|
3677
|
-
|
|
3678
|
-
type:
|
|
3679
|
-
item_id:
|
|
3680
|
-
output_index:
|
|
3681
|
-
code:
|
|
3762
|
+
import_v418.z.object({
|
|
3763
|
+
type: import_v418.z.literal("response.code_interpreter_call_code.done"),
|
|
3764
|
+
item_id: import_v418.z.string(),
|
|
3765
|
+
output_index: import_v418.z.number(),
|
|
3766
|
+
code: import_v418.z.string()
|
|
3682
3767
|
}),
|
|
3683
|
-
|
|
3684
|
-
type:
|
|
3685
|
-
annotation:
|
|
3686
|
-
|
|
3687
|
-
type:
|
|
3688
|
-
start_index:
|
|
3689
|
-
end_index:
|
|
3690
|
-
url:
|
|
3691
|
-
title:
|
|
3768
|
+
import_v418.z.object({
|
|
3769
|
+
type: import_v418.z.literal("response.output_text.annotation.added"),
|
|
3770
|
+
annotation: import_v418.z.discriminatedUnion("type", [
|
|
3771
|
+
import_v418.z.object({
|
|
3772
|
+
type: import_v418.z.literal("url_citation"),
|
|
3773
|
+
start_index: import_v418.z.number(),
|
|
3774
|
+
end_index: import_v418.z.number(),
|
|
3775
|
+
url: import_v418.z.string(),
|
|
3776
|
+
title: import_v418.z.string()
|
|
3692
3777
|
}),
|
|
3693
|
-
|
|
3694
|
-
type:
|
|
3695
|
-
file_id:
|
|
3696
|
-
filename:
|
|
3697
|
-
index:
|
|
3778
|
+
import_v418.z.object({
|
|
3779
|
+
type: import_v418.z.literal("file_citation"),
|
|
3780
|
+
file_id: import_v418.z.string(),
|
|
3781
|
+
filename: import_v418.z.string(),
|
|
3782
|
+
index: import_v418.z.number()
|
|
3698
3783
|
}),
|
|
3699
|
-
|
|
3700
|
-
type:
|
|
3701
|
-
container_id:
|
|
3702
|
-
file_id:
|
|
3703
|
-
filename:
|
|
3704
|
-
start_index:
|
|
3705
|
-
end_index:
|
|
3784
|
+
import_v418.z.object({
|
|
3785
|
+
type: import_v418.z.literal("container_file_citation"),
|
|
3786
|
+
container_id: import_v418.z.string(),
|
|
3787
|
+
file_id: import_v418.z.string(),
|
|
3788
|
+
filename: import_v418.z.string(),
|
|
3789
|
+
start_index: import_v418.z.number(),
|
|
3790
|
+
end_index: import_v418.z.number()
|
|
3706
3791
|
}),
|
|
3707
|
-
|
|
3708
|
-
type:
|
|
3709
|
-
file_id:
|
|
3710
|
-
index:
|
|
3792
|
+
import_v418.z.object({
|
|
3793
|
+
type: import_v418.z.literal("file_path"),
|
|
3794
|
+
file_id: import_v418.z.string(),
|
|
3795
|
+
index: import_v418.z.number()
|
|
3711
3796
|
})
|
|
3712
3797
|
])
|
|
3713
3798
|
}),
|
|
3714
|
-
|
|
3715
|
-
type:
|
|
3716
|
-
item_id:
|
|
3717
|
-
summary_index:
|
|
3799
|
+
import_v418.z.object({
|
|
3800
|
+
type: import_v418.z.literal("response.reasoning_summary_part.added"),
|
|
3801
|
+
item_id: import_v418.z.string(),
|
|
3802
|
+
summary_index: import_v418.z.number()
|
|
3718
3803
|
}),
|
|
3719
|
-
|
|
3720
|
-
type:
|
|
3721
|
-
item_id:
|
|
3722
|
-
summary_index:
|
|
3723
|
-
delta:
|
|
3804
|
+
import_v418.z.object({
|
|
3805
|
+
type: import_v418.z.literal("response.reasoning_summary_text.delta"),
|
|
3806
|
+
item_id: import_v418.z.string(),
|
|
3807
|
+
summary_index: import_v418.z.number(),
|
|
3808
|
+
delta: import_v418.z.string()
|
|
3724
3809
|
}),
|
|
3725
|
-
|
|
3726
|
-
type:
|
|
3727
|
-
item_id:
|
|
3728
|
-
summary_index:
|
|
3810
|
+
import_v418.z.object({
|
|
3811
|
+
type: import_v418.z.literal("response.reasoning_summary_part.done"),
|
|
3812
|
+
item_id: import_v418.z.string(),
|
|
3813
|
+
summary_index: import_v418.z.number()
|
|
3729
3814
|
}),
|
|
3730
|
-
|
|
3731
|
-
type:
|
|
3732
|
-
item_id:
|
|
3733
|
-
output_index:
|
|
3734
|
-
delta:
|
|
3735
|
-
obfuscation:
|
|
3815
|
+
import_v418.z.object({
|
|
3816
|
+
type: import_v418.z.literal("response.apply_patch_call_operation_diff.delta"),
|
|
3817
|
+
item_id: import_v418.z.string(),
|
|
3818
|
+
output_index: import_v418.z.number(),
|
|
3819
|
+
delta: import_v418.z.string(),
|
|
3820
|
+
obfuscation: import_v418.z.string().nullish()
|
|
3736
3821
|
}),
|
|
3737
|
-
|
|
3738
|
-
type:
|
|
3739
|
-
item_id:
|
|
3740
|
-
output_index:
|
|
3741
|
-
diff:
|
|
3822
|
+
import_v418.z.object({
|
|
3823
|
+
type: import_v418.z.literal("response.apply_patch_call_operation_diff.done"),
|
|
3824
|
+
item_id: import_v418.z.string(),
|
|
3825
|
+
output_index: import_v418.z.number(),
|
|
3826
|
+
diff: import_v418.z.string()
|
|
3742
3827
|
}),
|
|
3743
|
-
|
|
3744
|
-
type:
|
|
3745
|
-
sequence_number:
|
|
3746
|
-
error:
|
|
3747
|
-
type:
|
|
3748
|
-
code:
|
|
3749
|
-
message:
|
|
3750
|
-
param:
|
|
3828
|
+
import_v418.z.object({
|
|
3829
|
+
type: import_v418.z.literal("error"),
|
|
3830
|
+
sequence_number: import_v418.z.number(),
|
|
3831
|
+
error: import_v418.z.object({
|
|
3832
|
+
type: import_v418.z.string(),
|
|
3833
|
+
code: import_v418.z.string(),
|
|
3834
|
+
message: import_v418.z.string(),
|
|
3835
|
+
param: import_v418.z.string().nullish()
|
|
3751
3836
|
})
|
|
3752
3837
|
}),
|
|
3753
|
-
|
|
3838
|
+
import_v418.z.object({ type: import_v418.z.string() }).loose().transform((value) => ({
|
|
3754
3839
|
type: "unknown_chunk",
|
|
3755
3840
|
message: value.type
|
|
3756
3841
|
}))
|
|
@@ -3758,310 +3843,310 @@ var openaiResponsesChunkSchema = (0, import_provider_utils24.lazySchema)(
|
|
|
3758
3843
|
])
|
|
3759
3844
|
)
|
|
3760
3845
|
);
|
|
3761
|
-
var openaiResponsesResponseSchema = (0,
|
|
3762
|
-
() => (0,
|
|
3763
|
-
|
|
3764
|
-
id:
|
|
3765
|
-
created_at:
|
|
3766
|
-
error:
|
|
3767
|
-
message:
|
|
3768
|
-
type:
|
|
3769
|
-
param:
|
|
3770
|
-
code:
|
|
3846
|
+
var openaiResponsesResponseSchema = (0, import_provider_utils25.lazySchema)(
|
|
3847
|
+
() => (0, import_provider_utils25.zodSchema)(
|
|
3848
|
+
import_v418.z.object({
|
|
3849
|
+
id: import_v418.z.string().optional(),
|
|
3850
|
+
created_at: import_v418.z.number().optional(),
|
|
3851
|
+
error: import_v418.z.object({
|
|
3852
|
+
message: import_v418.z.string(),
|
|
3853
|
+
type: import_v418.z.string(),
|
|
3854
|
+
param: import_v418.z.string().nullish(),
|
|
3855
|
+
code: import_v418.z.string()
|
|
3771
3856
|
}).nullish(),
|
|
3772
|
-
model:
|
|
3773
|
-
output:
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
type:
|
|
3777
|
-
role:
|
|
3778
|
-
id:
|
|
3779
|
-
phase:
|
|
3780
|
-
content:
|
|
3781
|
-
|
|
3782
|
-
type:
|
|
3783
|
-
text:
|
|
3784
|
-
logprobs:
|
|
3785
|
-
|
|
3786
|
-
token:
|
|
3787
|
-
logprob:
|
|
3788
|
-
top_logprobs:
|
|
3789
|
-
|
|
3790
|
-
token:
|
|
3791
|
-
logprob:
|
|
3857
|
+
model: import_v418.z.string().optional(),
|
|
3858
|
+
output: import_v418.z.array(
|
|
3859
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3860
|
+
import_v418.z.object({
|
|
3861
|
+
type: import_v418.z.literal("message"),
|
|
3862
|
+
role: import_v418.z.literal("assistant"),
|
|
3863
|
+
id: import_v418.z.string(),
|
|
3864
|
+
phase: import_v418.z.enum(["commentary", "final_answer"]).nullish(),
|
|
3865
|
+
content: import_v418.z.array(
|
|
3866
|
+
import_v418.z.object({
|
|
3867
|
+
type: import_v418.z.literal("output_text"),
|
|
3868
|
+
text: import_v418.z.string(),
|
|
3869
|
+
logprobs: import_v418.z.array(
|
|
3870
|
+
import_v418.z.object({
|
|
3871
|
+
token: import_v418.z.string(),
|
|
3872
|
+
logprob: import_v418.z.number(),
|
|
3873
|
+
top_logprobs: import_v418.z.array(
|
|
3874
|
+
import_v418.z.object({
|
|
3875
|
+
token: import_v418.z.string(),
|
|
3876
|
+
logprob: import_v418.z.number()
|
|
3792
3877
|
})
|
|
3793
3878
|
)
|
|
3794
3879
|
})
|
|
3795
3880
|
).nullish(),
|
|
3796
|
-
annotations:
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
type:
|
|
3800
|
-
start_index:
|
|
3801
|
-
end_index:
|
|
3802
|
-
url:
|
|
3803
|
-
title:
|
|
3881
|
+
annotations: import_v418.z.array(
|
|
3882
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3883
|
+
import_v418.z.object({
|
|
3884
|
+
type: import_v418.z.literal("url_citation"),
|
|
3885
|
+
start_index: import_v418.z.number(),
|
|
3886
|
+
end_index: import_v418.z.number(),
|
|
3887
|
+
url: import_v418.z.string(),
|
|
3888
|
+
title: import_v418.z.string()
|
|
3804
3889
|
}),
|
|
3805
|
-
|
|
3806
|
-
type:
|
|
3807
|
-
file_id:
|
|
3808
|
-
filename:
|
|
3809
|
-
index:
|
|
3890
|
+
import_v418.z.object({
|
|
3891
|
+
type: import_v418.z.literal("file_citation"),
|
|
3892
|
+
file_id: import_v418.z.string(),
|
|
3893
|
+
filename: import_v418.z.string(),
|
|
3894
|
+
index: import_v418.z.number()
|
|
3810
3895
|
}),
|
|
3811
|
-
|
|
3812
|
-
type:
|
|
3813
|
-
container_id:
|
|
3814
|
-
file_id:
|
|
3815
|
-
filename:
|
|
3816
|
-
start_index:
|
|
3817
|
-
end_index:
|
|
3896
|
+
import_v418.z.object({
|
|
3897
|
+
type: import_v418.z.literal("container_file_citation"),
|
|
3898
|
+
container_id: import_v418.z.string(),
|
|
3899
|
+
file_id: import_v418.z.string(),
|
|
3900
|
+
filename: import_v418.z.string(),
|
|
3901
|
+
start_index: import_v418.z.number(),
|
|
3902
|
+
end_index: import_v418.z.number()
|
|
3818
3903
|
}),
|
|
3819
|
-
|
|
3820
|
-
type:
|
|
3821
|
-
file_id:
|
|
3822
|
-
index:
|
|
3904
|
+
import_v418.z.object({
|
|
3905
|
+
type: import_v418.z.literal("file_path"),
|
|
3906
|
+
file_id: import_v418.z.string(),
|
|
3907
|
+
index: import_v418.z.number()
|
|
3823
3908
|
})
|
|
3824
3909
|
])
|
|
3825
3910
|
)
|
|
3826
3911
|
})
|
|
3827
3912
|
)
|
|
3828
3913
|
}),
|
|
3829
|
-
|
|
3830
|
-
type:
|
|
3831
|
-
id:
|
|
3832
|
-
status:
|
|
3833
|
-
action:
|
|
3834
|
-
|
|
3835
|
-
type:
|
|
3836
|
-
query:
|
|
3837
|
-
sources:
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
type:
|
|
3842
|
-
name:
|
|
3914
|
+
import_v418.z.object({
|
|
3915
|
+
type: import_v418.z.literal("web_search_call"),
|
|
3916
|
+
id: import_v418.z.string(),
|
|
3917
|
+
status: import_v418.z.string(),
|
|
3918
|
+
action: import_v418.z.discriminatedUnion("type", [
|
|
3919
|
+
import_v418.z.object({
|
|
3920
|
+
type: import_v418.z.literal("search"),
|
|
3921
|
+
query: import_v418.z.string().nullish(),
|
|
3922
|
+
sources: import_v418.z.array(
|
|
3923
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3924
|
+
import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() }),
|
|
3925
|
+
import_v418.z.object({
|
|
3926
|
+
type: import_v418.z.literal("api"),
|
|
3927
|
+
name: import_v418.z.string()
|
|
3843
3928
|
})
|
|
3844
3929
|
])
|
|
3845
3930
|
).nullish()
|
|
3846
3931
|
}),
|
|
3847
|
-
|
|
3848
|
-
type:
|
|
3849
|
-
url:
|
|
3932
|
+
import_v418.z.object({
|
|
3933
|
+
type: import_v418.z.literal("open_page"),
|
|
3934
|
+
url: import_v418.z.string().nullish()
|
|
3850
3935
|
}),
|
|
3851
|
-
|
|
3852
|
-
type:
|
|
3853
|
-
url:
|
|
3854
|
-
pattern:
|
|
3936
|
+
import_v418.z.object({
|
|
3937
|
+
type: import_v418.z.literal("find_in_page"),
|
|
3938
|
+
url: import_v418.z.string().nullish(),
|
|
3939
|
+
pattern: import_v418.z.string().nullish()
|
|
3855
3940
|
})
|
|
3856
3941
|
]).nullish()
|
|
3857
3942
|
}),
|
|
3858
|
-
|
|
3859
|
-
type:
|
|
3860
|
-
id:
|
|
3861
|
-
queries:
|
|
3862
|
-
results:
|
|
3863
|
-
|
|
3864
|
-
attributes:
|
|
3865
|
-
|
|
3866
|
-
|
|
3943
|
+
import_v418.z.object({
|
|
3944
|
+
type: import_v418.z.literal("file_search_call"),
|
|
3945
|
+
id: import_v418.z.string(),
|
|
3946
|
+
queries: import_v418.z.array(import_v418.z.string()),
|
|
3947
|
+
results: import_v418.z.array(
|
|
3948
|
+
import_v418.z.object({
|
|
3949
|
+
attributes: import_v418.z.record(
|
|
3950
|
+
import_v418.z.string(),
|
|
3951
|
+
import_v418.z.union([import_v418.z.string(), import_v418.z.number(), import_v418.z.boolean()])
|
|
3867
3952
|
),
|
|
3868
|
-
file_id:
|
|
3869
|
-
filename:
|
|
3870
|
-
score:
|
|
3871
|
-
text:
|
|
3953
|
+
file_id: import_v418.z.string(),
|
|
3954
|
+
filename: import_v418.z.string(),
|
|
3955
|
+
score: import_v418.z.number(),
|
|
3956
|
+
text: import_v418.z.string()
|
|
3872
3957
|
})
|
|
3873
3958
|
).nullish()
|
|
3874
3959
|
}),
|
|
3875
|
-
|
|
3876
|
-
type:
|
|
3877
|
-
id:
|
|
3878
|
-
code:
|
|
3879
|
-
container_id:
|
|
3880
|
-
outputs:
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3960
|
+
import_v418.z.object({
|
|
3961
|
+
type: import_v418.z.literal("code_interpreter_call"),
|
|
3962
|
+
id: import_v418.z.string(),
|
|
3963
|
+
code: import_v418.z.string().nullable(),
|
|
3964
|
+
container_id: import_v418.z.string(),
|
|
3965
|
+
outputs: import_v418.z.array(
|
|
3966
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3967
|
+
import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
|
|
3968
|
+
import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
|
|
3884
3969
|
])
|
|
3885
3970
|
).nullable()
|
|
3886
3971
|
}),
|
|
3887
|
-
|
|
3888
|
-
type:
|
|
3889
|
-
id:
|
|
3890
|
-
result:
|
|
3972
|
+
import_v418.z.object({
|
|
3973
|
+
type: import_v418.z.literal("image_generation_call"),
|
|
3974
|
+
id: import_v418.z.string(),
|
|
3975
|
+
result: import_v418.z.string()
|
|
3891
3976
|
}),
|
|
3892
|
-
|
|
3893
|
-
type:
|
|
3894
|
-
id:
|
|
3895
|
-
call_id:
|
|
3896
|
-
action:
|
|
3897
|
-
type:
|
|
3898
|
-
command:
|
|
3899
|
-
timeout_ms:
|
|
3900
|
-
user:
|
|
3901
|
-
working_directory:
|
|
3902
|
-
env:
|
|
3977
|
+
import_v418.z.object({
|
|
3978
|
+
type: import_v418.z.literal("local_shell_call"),
|
|
3979
|
+
id: import_v418.z.string(),
|
|
3980
|
+
call_id: import_v418.z.string(),
|
|
3981
|
+
action: import_v418.z.object({
|
|
3982
|
+
type: import_v418.z.literal("exec"),
|
|
3983
|
+
command: import_v418.z.array(import_v418.z.string()),
|
|
3984
|
+
timeout_ms: import_v418.z.number().optional(),
|
|
3985
|
+
user: import_v418.z.string().optional(),
|
|
3986
|
+
working_directory: import_v418.z.string().optional(),
|
|
3987
|
+
env: import_v418.z.record(import_v418.z.string(), import_v418.z.string()).optional()
|
|
3903
3988
|
})
|
|
3904
3989
|
}),
|
|
3905
|
-
|
|
3906
|
-
type:
|
|
3907
|
-
call_id:
|
|
3908
|
-
name:
|
|
3909
|
-
arguments:
|
|
3910
|
-
id:
|
|
3990
|
+
import_v418.z.object({
|
|
3991
|
+
type: import_v418.z.literal("function_call"),
|
|
3992
|
+
call_id: import_v418.z.string(),
|
|
3993
|
+
name: import_v418.z.string(),
|
|
3994
|
+
arguments: import_v418.z.string(),
|
|
3995
|
+
id: import_v418.z.string()
|
|
3911
3996
|
}),
|
|
3912
|
-
|
|
3913
|
-
type:
|
|
3914
|
-
call_id:
|
|
3915
|
-
name:
|
|
3916
|
-
input:
|
|
3917
|
-
id:
|
|
3997
|
+
import_v418.z.object({
|
|
3998
|
+
type: import_v418.z.literal("custom_tool_call"),
|
|
3999
|
+
call_id: import_v418.z.string(),
|
|
4000
|
+
name: import_v418.z.string(),
|
|
4001
|
+
input: import_v418.z.string(),
|
|
4002
|
+
id: import_v418.z.string()
|
|
3918
4003
|
}),
|
|
3919
|
-
|
|
3920
|
-
type:
|
|
3921
|
-
id:
|
|
3922
|
-
status:
|
|
4004
|
+
import_v418.z.object({
|
|
4005
|
+
type: import_v418.z.literal("computer_call"),
|
|
4006
|
+
id: import_v418.z.string(),
|
|
4007
|
+
status: import_v418.z.string().optional()
|
|
3923
4008
|
}),
|
|
3924
|
-
|
|
3925
|
-
type:
|
|
3926
|
-
id:
|
|
3927
|
-
encrypted_content:
|
|
3928
|
-
summary:
|
|
3929
|
-
|
|
3930
|
-
type:
|
|
3931
|
-
text:
|
|
4009
|
+
import_v418.z.object({
|
|
4010
|
+
type: import_v418.z.literal("reasoning"),
|
|
4011
|
+
id: import_v418.z.string(),
|
|
4012
|
+
encrypted_content: import_v418.z.string().nullish(),
|
|
4013
|
+
summary: import_v418.z.array(
|
|
4014
|
+
import_v418.z.object({
|
|
4015
|
+
type: import_v418.z.literal("summary_text"),
|
|
4016
|
+
text: import_v418.z.string()
|
|
3932
4017
|
})
|
|
3933
4018
|
)
|
|
3934
4019
|
}),
|
|
3935
|
-
|
|
3936
|
-
type:
|
|
3937
|
-
id:
|
|
3938
|
-
status:
|
|
3939
|
-
arguments:
|
|
3940
|
-
name:
|
|
3941
|
-
server_label:
|
|
3942
|
-
output:
|
|
3943
|
-
error:
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
type:
|
|
3947
|
-
code:
|
|
3948
|
-
message:
|
|
4020
|
+
import_v418.z.object({
|
|
4021
|
+
type: import_v418.z.literal("mcp_call"),
|
|
4022
|
+
id: import_v418.z.string(),
|
|
4023
|
+
status: import_v418.z.string(),
|
|
4024
|
+
arguments: import_v418.z.string(),
|
|
4025
|
+
name: import_v418.z.string(),
|
|
4026
|
+
server_label: import_v418.z.string(),
|
|
4027
|
+
output: import_v418.z.string().nullish(),
|
|
4028
|
+
error: import_v418.z.union([
|
|
4029
|
+
import_v418.z.string(),
|
|
4030
|
+
import_v418.z.object({
|
|
4031
|
+
type: import_v418.z.string().optional(),
|
|
4032
|
+
code: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).optional(),
|
|
4033
|
+
message: import_v418.z.string().optional()
|
|
3949
4034
|
}).loose()
|
|
3950
4035
|
]).nullish(),
|
|
3951
|
-
approval_request_id:
|
|
4036
|
+
approval_request_id: import_v418.z.string().nullish()
|
|
3952
4037
|
}),
|
|
3953
|
-
|
|
3954
|
-
type:
|
|
3955
|
-
id:
|
|
3956
|
-
server_label:
|
|
3957
|
-
tools:
|
|
3958
|
-
|
|
3959
|
-
name:
|
|
3960
|
-
description:
|
|
3961
|
-
input_schema:
|
|
3962
|
-
annotations:
|
|
4038
|
+
import_v418.z.object({
|
|
4039
|
+
type: import_v418.z.literal("mcp_list_tools"),
|
|
4040
|
+
id: import_v418.z.string(),
|
|
4041
|
+
server_label: import_v418.z.string(),
|
|
4042
|
+
tools: import_v418.z.array(
|
|
4043
|
+
import_v418.z.object({
|
|
4044
|
+
name: import_v418.z.string(),
|
|
4045
|
+
description: import_v418.z.string().optional(),
|
|
4046
|
+
input_schema: import_v418.z.any(),
|
|
4047
|
+
annotations: import_v418.z.record(import_v418.z.string(), import_v418.z.unknown()).optional()
|
|
3963
4048
|
})
|
|
3964
4049
|
),
|
|
3965
|
-
error:
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
type:
|
|
3969
|
-
code:
|
|
3970
|
-
message:
|
|
4050
|
+
error: import_v418.z.union([
|
|
4051
|
+
import_v418.z.string(),
|
|
4052
|
+
import_v418.z.object({
|
|
4053
|
+
type: import_v418.z.string().optional(),
|
|
4054
|
+
code: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).optional(),
|
|
4055
|
+
message: import_v418.z.string().optional()
|
|
3971
4056
|
}).loose()
|
|
3972
4057
|
]).optional()
|
|
3973
4058
|
}),
|
|
3974
|
-
|
|
3975
|
-
type:
|
|
3976
|
-
id:
|
|
3977
|
-
server_label:
|
|
3978
|
-
name:
|
|
3979
|
-
arguments:
|
|
3980
|
-
approval_request_id:
|
|
4059
|
+
import_v418.z.object({
|
|
4060
|
+
type: import_v418.z.literal("mcp_approval_request"),
|
|
4061
|
+
id: import_v418.z.string(),
|
|
4062
|
+
server_label: import_v418.z.string(),
|
|
4063
|
+
name: import_v418.z.string(),
|
|
4064
|
+
arguments: import_v418.z.string(),
|
|
4065
|
+
approval_request_id: import_v418.z.string().optional()
|
|
3981
4066
|
}),
|
|
3982
|
-
|
|
3983
|
-
type:
|
|
3984
|
-
id:
|
|
3985
|
-
call_id:
|
|
3986
|
-
status:
|
|
3987
|
-
operation:
|
|
3988
|
-
|
|
3989
|
-
type:
|
|
3990
|
-
path:
|
|
3991
|
-
diff:
|
|
4067
|
+
import_v418.z.object({
|
|
4068
|
+
type: import_v418.z.literal("apply_patch_call"),
|
|
4069
|
+
id: import_v418.z.string(),
|
|
4070
|
+
call_id: import_v418.z.string(),
|
|
4071
|
+
status: import_v418.z.enum(["in_progress", "completed"]),
|
|
4072
|
+
operation: import_v418.z.discriminatedUnion("type", [
|
|
4073
|
+
import_v418.z.object({
|
|
4074
|
+
type: import_v418.z.literal("create_file"),
|
|
4075
|
+
path: import_v418.z.string(),
|
|
4076
|
+
diff: import_v418.z.string()
|
|
3992
4077
|
}),
|
|
3993
|
-
|
|
3994
|
-
type:
|
|
3995
|
-
path:
|
|
4078
|
+
import_v418.z.object({
|
|
4079
|
+
type: import_v418.z.literal("delete_file"),
|
|
4080
|
+
path: import_v418.z.string()
|
|
3996
4081
|
}),
|
|
3997
|
-
|
|
3998
|
-
type:
|
|
3999
|
-
path:
|
|
4000
|
-
diff:
|
|
4082
|
+
import_v418.z.object({
|
|
4083
|
+
type: import_v418.z.literal("update_file"),
|
|
4084
|
+
path: import_v418.z.string(),
|
|
4085
|
+
diff: import_v418.z.string()
|
|
4001
4086
|
})
|
|
4002
4087
|
])
|
|
4003
4088
|
}),
|
|
4004
|
-
|
|
4005
|
-
type:
|
|
4006
|
-
id:
|
|
4007
|
-
call_id:
|
|
4008
|
-
status:
|
|
4009
|
-
action:
|
|
4010
|
-
commands:
|
|
4089
|
+
import_v418.z.object({
|
|
4090
|
+
type: import_v418.z.literal("shell_call"),
|
|
4091
|
+
id: import_v418.z.string(),
|
|
4092
|
+
call_id: import_v418.z.string(),
|
|
4093
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4094
|
+
action: import_v418.z.object({
|
|
4095
|
+
commands: import_v418.z.array(import_v418.z.string())
|
|
4011
4096
|
})
|
|
4012
4097
|
}),
|
|
4013
|
-
|
|
4014
|
-
type:
|
|
4015
|
-
id:
|
|
4016
|
-
call_id:
|
|
4017
|
-
status:
|
|
4018
|
-
output:
|
|
4019
|
-
|
|
4020
|
-
stdout:
|
|
4021
|
-
stderr:
|
|
4022
|
-
outcome:
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
type:
|
|
4026
|
-
exit_code:
|
|
4098
|
+
import_v418.z.object({
|
|
4099
|
+
type: import_v418.z.literal("shell_call_output"),
|
|
4100
|
+
id: import_v418.z.string(),
|
|
4101
|
+
call_id: import_v418.z.string(),
|
|
4102
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4103
|
+
output: import_v418.z.array(
|
|
4104
|
+
import_v418.z.object({
|
|
4105
|
+
stdout: import_v418.z.string(),
|
|
4106
|
+
stderr: import_v418.z.string(),
|
|
4107
|
+
outcome: import_v418.z.discriminatedUnion("type", [
|
|
4108
|
+
import_v418.z.object({ type: import_v418.z.literal("timeout") }),
|
|
4109
|
+
import_v418.z.object({
|
|
4110
|
+
type: import_v418.z.literal("exit"),
|
|
4111
|
+
exit_code: import_v418.z.number()
|
|
4027
4112
|
})
|
|
4028
4113
|
])
|
|
4029
4114
|
})
|
|
4030
4115
|
)
|
|
4031
4116
|
}),
|
|
4032
|
-
|
|
4033
|
-
type:
|
|
4034
|
-
id:
|
|
4035
|
-
execution:
|
|
4036
|
-
call_id:
|
|
4037
|
-
status:
|
|
4038
|
-
arguments:
|
|
4117
|
+
import_v418.z.object({
|
|
4118
|
+
type: import_v418.z.literal("tool_search_call"),
|
|
4119
|
+
id: import_v418.z.string(),
|
|
4120
|
+
execution: import_v418.z.enum(["server", "client"]),
|
|
4121
|
+
call_id: import_v418.z.string().nullable(),
|
|
4122
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4123
|
+
arguments: import_v418.z.unknown()
|
|
4039
4124
|
}),
|
|
4040
|
-
|
|
4041
|
-
type:
|
|
4042
|
-
id:
|
|
4043
|
-
execution:
|
|
4044
|
-
call_id:
|
|
4045
|
-
status:
|
|
4046
|
-
tools:
|
|
4125
|
+
import_v418.z.object({
|
|
4126
|
+
type: import_v418.z.literal("tool_search_output"),
|
|
4127
|
+
id: import_v418.z.string(),
|
|
4128
|
+
execution: import_v418.z.enum(["server", "client"]),
|
|
4129
|
+
call_id: import_v418.z.string().nullable(),
|
|
4130
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4131
|
+
tools: import_v418.z.array(import_v418.z.record(import_v418.z.string(), jsonValueSchema.optional()))
|
|
4047
4132
|
})
|
|
4048
4133
|
])
|
|
4049
4134
|
).optional(),
|
|
4050
|
-
service_tier:
|
|
4051
|
-
incomplete_details:
|
|
4052
|
-
usage:
|
|
4053
|
-
input_tokens:
|
|
4054
|
-
input_tokens_details:
|
|
4055
|
-
output_tokens:
|
|
4056
|
-
output_tokens_details:
|
|
4135
|
+
service_tier: import_v418.z.string().nullish(),
|
|
4136
|
+
incomplete_details: import_v418.z.object({ reason: import_v418.z.string() }).nullish(),
|
|
4137
|
+
usage: import_v418.z.object({
|
|
4138
|
+
input_tokens: import_v418.z.number(),
|
|
4139
|
+
input_tokens_details: import_v418.z.object({ cached_tokens: import_v418.z.number().nullish() }).nullish(),
|
|
4140
|
+
output_tokens: import_v418.z.number(),
|
|
4141
|
+
output_tokens_details: import_v418.z.object({ reasoning_tokens: import_v418.z.number().nullish() }).nullish()
|
|
4057
4142
|
}).optional()
|
|
4058
4143
|
})
|
|
4059
4144
|
)
|
|
4060
4145
|
);
|
|
4061
4146
|
|
|
4062
4147
|
// src/responses/openai-responses-options.ts
|
|
4063
|
-
var
|
|
4064
|
-
var
|
|
4148
|
+
var import_provider_utils26 = require("@ai-sdk/provider-utils");
|
|
4149
|
+
var import_v419 = require("zod/v4");
|
|
4065
4150
|
var TOP_LOGPROBS_MAX = 20;
|
|
4066
4151
|
var openaiResponsesReasoningModelIds = [
|
|
4067
4152
|
"o1",
|
|
@@ -4126,9 +4211,9 @@ var openaiResponsesModelIds = [
|
|
|
4126
4211
|
"gpt-5-chat-latest",
|
|
4127
4212
|
...openaiResponsesReasoningModelIds
|
|
4128
4213
|
];
|
|
4129
|
-
var openaiLanguageModelResponsesOptionsSchema = (0,
|
|
4130
|
-
() => (0,
|
|
4131
|
-
|
|
4214
|
+
var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils26.lazySchema)(
|
|
4215
|
+
() => (0, import_provider_utils26.zodSchema)(
|
|
4216
|
+
import_v419.z.object({
|
|
4132
4217
|
/**
|
|
4133
4218
|
* The ID of the OpenAI Conversation to continue.
|
|
4134
4219
|
* You must create a conversation first via the OpenAI API.
|
|
@@ -4136,13 +4221,13 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
|
|
|
4136
4221
|
* Defaults to `undefined`.
|
|
4137
4222
|
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
4138
4223
|
*/
|
|
4139
|
-
conversation:
|
|
4224
|
+
conversation: import_v419.z.string().nullish(),
|
|
4140
4225
|
/**
|
|
4141
4226
|
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
4142
4227
|
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
|
|
4143
4228
|
*/
|
|
4144
|
-
include:
|
|
4145
|
-
|
|
4229
|
+
include: import_v419.z.array(
|
|
4230
|
+
import_v419.z.enum([
|
|
4146
4231
|
"reasoning.encrypted_content",
|
|
4147
4232
|
// handled internally by default, only needed for unknown reasoning models
|
|
4148
4233
|
"file_search_call.results",
|
|
@@ -4154,7 +4239,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
|
|
|
4154
4239
|
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
4155
4240
|
* Defaults to `undefined`.
|
|
4156
4241
|
*/
|
|
4157
|
-
instructions:
|
|
4242
|
+
instructions: import_v419.z.string().nullish(),
|
|
4158
4243
|
/**
|
|
4159
4244
|
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
4160
4245
|
* the response size and can slow down response times. However, it can
|
|
@@ -4169,30 +4254,30 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
|
|
|
4169
4254
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
4170
4255
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
4171
4256
|
*/
|
|
4172
|
-
logprobs:
|
|
4257
|
+
logprobs: import_v419.z.union([import_v419.z.boolean(), import_v419.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
4173
4258
|
/**
|
|
4174
4259
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
4175
4260
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
4176
4261
|
* Any further attempts to call a tool by the model will be ignored.
|
|
4177
4262
|
*/
|
|
4178
|
-
maxToolCalls:
|
|
4263
|
+
maxToolCalls: import_v419.z.number().nullish(),
|
|
4179
4264
|
/**
|
|
4180
4265
|
* Additional metadata to store with the generation.
|
|
4181
4266
|
*/
|
|
4182
|
-
metadata:
|
|
4267
|
+
metadata: import_v419.z.any().nullish(),
|
|
4183
4268
|
/**
|
|
4184
4269
|
* Whether to use parallel tool calls. Defaults to `true`.
|
|
4185
4270
|
*/
|
|
4186
|
-
parallelToolCalls:
|
|
4271
|
+
parallelToolCalls: import_v419.z.boolean().nullish(),
|
|
4187
4272
|
/**
|
|
4188
4273
|
* The ID of the previous response. You can use it to continue a conversation.
|
|
4189
4274
|
* Defaults to `undefined`.
|
|
4190
4275
|
*/
|
|
4191
|
-
previousResponseId:
|
|
4276
|
+
previousResponseId: import_v419.z.string().nullish(),
|
|
4192
4277
|
/**
|
|
4193
4278
|
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
4194
4279
|
*/
|
|
4195
|
-
promptCacheKey:
|
|
4280
|
+
promptCacheKey: import_v419.z.string().nullish(),
|
|
4196
4281
|
/**
|
|
4197
4282
|
* The retention policy for the prompt cache.
|
|
4198
4283
|
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
@@ -4201,7 +4286,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
|
|
|
4201
4286
|
*
|
|
4202
4287
|
* @default 'in_memory'
|
|
4203
4288
|
*/
|
|
4204
|
-
promptCacheRetention:
|
|
4289
|
+
promptCacheRetention: import_v419.z.enum(["in_memory", "24h"]).nullish(),
|
|
4205
4290
|
/**
|
|
4206
4291
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
4207
4292
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
@@ -4212,17 +4297,17 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
|
|
|
4212
4297
|
* OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
|
|
4213
4298
|
* an error.
|
|
4214
4299
|
*/
|
|
4215
|
-
reasoningEffort:
|
|
4300
|
+
reasoningEffort: import_v419.z.string().nullish(),
|
|
4216
4301
|
/**
|
|
4217
4302
|
* Controls reasoning summary output from the model.
|
|
4218
4303
|
* Set to "auto" to automatically receive the richest level available,
|
|
4219
4304
|
* or "detailed" for comprehensive summaries.
|
|
4220
4305
|
*/
|
|
4221
|
-
reasoningSummary:
|
|
4306
|
+
reasoningSummary: import_v419.z.string().nullish(),
|
|
4222
4307
|
/**
|
|
4223
4308
|
* The identifier for safety monitoring and tracking.
|
|
4224
4309
|
*/
|
|
4225
|
-
safetyIdentifier:
|
|
4310
|
+
safetyIdentifier: import_v419.z.string().nullish(),
|
|
4226
4311
|
/**
|
|
4227
4312
|
* Service tier for the request.
|
|
4228
4313
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
@@ -4230,34 +4315,34 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
|
|
|
4230
4315
|
*
|
|
4231
4316
|
* Defaults to 'auto'.
|
|
4232
4317
|
*/
|
|
4233
|
-
serviceTier:
|
|
4318
|
+
serviceTier: import_v419.z.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
4234
4319
|
/**
|
|
4235
4320
|
* Whether to store the generation. Defaults to `true`.
|
|
4236
4321
|
*/
|
|
4237
|
-
store:
|
|
4322
|
+
store: import_v419.z.boolean().nullish(),
|
|
4238
4323
|
/**
|
|
4239
4324
|
* Whether to use strict JSON schema validation.
|
|
4240
4325
|
* Defaults to `true`.
|
|
4241
4326
|
*/
|
|
4242
|
-
strictJsonSchema:
|
|
4327
|
+
strictJsonSchema: import_v419.z.boolean().nullish(),
|
|
4243
4328
|
/**
|
|
4244
4329
|
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
4245
4330
|
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
4246
4331
|
* Valid values: 'low', 'medium', 'high'.
|
|
4247
4332
|
*/
|
|
4248
|
-
textVerbosity:
|
|
4333
|
+
textVerbosity: import_v419.z.enum(["low", "medium", "high"]).nullish(),
|
|
4249
4334
|
/**
|
|
4250
4335
|
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
4251
4336
|
* 'disabled' turns truncation off.
|
|
4252
4337
|
*/
|
|
4253
|
-
truncation:
|
|
4338
|
+
truncation: import_v419.z.enum(["auto", "disabled"]).nullish(),
|
|
4254
4339
|
/**
|
|
4255
4340
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
4256
4341
|
* monitor and detect abuse.
|
|
4257
4342
|
* Defaults to `undefined`.
|
|
4258
4343
|
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
4259
4344
|
*/
|
|
4260
|
-
user:
|
|
4345
|
+
user: import_v419.z.string().nullish(),
|
|
4261
4346
|
/**
|
|
4262
4347
|
* Override the system message mode for this model.
|
|
4263
4348
|
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
@@ -4266,7 +4351,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
|
|
|
4266
4351
|
*
|
|
4267
4352
|
* If not specified, the mode is automatically determined based on the model.
|
|
4268
4353
|
*/
|
|
4269
|
-
systemMessageMode:
|
|
4354
|
+
systemMessageMode: import_v419.z.enum(["system", "developer", "remove"]).optional(),
|
|
4270
4355
|
/**
|
|
4271
4356
|
* Force treating this model as a reasoning model.
|
|
4272
4357
|
*
|
|
@@ -4276,51 +4361,51 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
|
|
|
4276
4361
|
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
4277
4362
|
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
4278
4363
|
*/
|
|
4279
|
-
forceReasoning:
|
|
4364
|
+
forceReasoning: import_v419.z.boolean().optional()
|
|
4280
4365
|
})
|
|
4281
4366
|
)
|
|
4282
4367
|
);
|
|
4283
4368
|
|
|
4284
4369
|
// src/responses/openai-responses-prepare-tools.ts
|
|
4285
4370
|
var import_provider7 = require("@ai-sdk/provider");
|
|
4286
|
-
var
|
|
4371
|
+
var import_provider_utils34 = require("@ai-sdk/provider-utils");
|
|
4287
4372
|
|
|
4288
4373
|
// src/tool/code-interpreter.ts
|
|
4289
|
-
var
|
|
4290
|
-
var
|
|
4291
|
-
var codeInterpreterInputSchema = (0,
|
|
4292
|
-
() => (0,
|
|
4293
|
-
|
|
4294
|
-
code:
|
|
4295
|
-
containerId:
|
|
4374
|
+
var import_provider_utils27 = require("@ai-sdk/provider-utils");
|
|
4375
|
+
var import_v420 = require("zod/v4");
|
|
4376
|
+
var codeInterpreterInputSchema = (0, import_provider_utils27.lazySchema)(
|
|
4377
|
+
() => (0, import_provider_utils27.zodSchema)(
|
|
4378
|
+
import_v420.z.object({
|
|
4379
|
+
code: import_v420.z.string().nullish(),
|
|
4380
|
+
containerId: import_v420.z.string()
|
|
4296
4381
|
})
|
|
4297
4382
|
)
|
|
4298
4383
|
);
|
|
4299
|
-
var codeInterpreterOutputSchema = (0,
|
|
4300
|
-
() => (0,
|
|
4301
|
-
|
|
4302
|
-
outputs:
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4384
|
+
var codeInterpreterOutputSchema = (0, import_provider_utils27.lazySchema)(
|
|
4385
|
+
() => (0, import_provider_utils27.zodSchema)(
|
|
4386
|
+
import_v420.z.object({
|
|
4387
|
+
outputs: import_v420.z.array(
|
|
4388
|
+
import_v420.z.discriminatedUnion("type", [
|
|
4389
|
+
import_v420.z.object({ type: import_v420.z.literal("logs"), logs: import_v420.z.string() }),
|
|
4390
|
+
import_v420.z.object({ type: import_v420.z.literal("image"), url: import_v420.z.string() })
|
|
4306
4391
|
])
|
|
4307
4392
|
).nullish()
|
|
4308
4393
|
})
|
|
4309
4394
|
)
|
|
4310
4395
|
);
|
|
4311
|
-
var codeInterpreterArgsSchema = (0,
|
|
4312
|
-
() => (0,
|
|
4313
|
-
|
|
4314
|
-
container:
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
fileIds:
|
|
4396
|
+
var codeInterpreterArgsSchema = (0, import_provider_utils27.lazySchema)(
|
|
4397
|
+
() => (0, import_provider_utils27.zodSchema)(
|
|
4398
|
+
import_v420.z.object({
|
|
4399
|
+
container: import_v420.z.union([
|
|
4400
|
+
import_v420.z.string(),
|
|
4401
|
+
import_v420.z.object({
|
|
4402
|
+
fileIds: import_v420.z.array(import_v420.z.string()).optional()
|
|
4318
4403
|
})
|
|
4319
4404
|
]).optional()
|
|
4320
4405
|
})
|
|
4321
4406
|
)
|
|
4322
4407
|
);
|
|
4323
|
-
var codeInterpreterToolFactory = (0,
|
|
4408
|
+
var codeInterpreterToolFactory = (0, import_provider_utils27.createProviderToolFactoryWithOutputSchema)({
|
|
4324
4409
|
id: "openai.code_interpreter",
|
|
4325
4410
|
inputSchema: codeInterpreterInputSchema,
|
|
4326
4411
|
outputSchema: codeInterpreterOutputSchema
|
|
@@ -4330,81 +4415,81 @@ var codeInterpreter = (args = {}) => {
|
|
|
4330
4415
|
};
|
|
4331
4416
|
|
|
4332
4417
|
// src/tool/file-search.ts
|
|
4333
|
-
var
|
|
4334
|
-
var
|
|
4335
|
-
var comparisonFilterSchema =
|
|
4336
|
-
key:
|
|
4337
|
-
type:
|
|
4338
|
-
value:
|
|
4418
|
+
var import_provider_utils28 = require("@ai-sdk/provider-utils");
|
|
4419
|
+
var import_v421 = require("zod/v4");
|
|
4420
|
+
var comparisonFilterSchema = import_v421.z.object({
|
|
4421
|
+
key: import_v421.z.string(),
|
|
4422
|
+
type: import_v421.z.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
4423
|
+
value: import_v421.z.union([import_v421.z.string(), import_v421.z.number(), import_v421.z.boolean(), import_v421.z.array(import_v421.z.string())])
|
|
4339
4424
|
});
|
|
4340
|
-
var compoundFilterSchema =
|
|
4341
|
-
type:
|
|
4342
|
-
filters:
|
|
4343
|
-
|
|
4425
|
+
var compoundFilterSchema = import_v421.z.object({
|
|
4426
|
+
type: import_v421.z.enum(["and", "or"]),
|
|
4427
|
+
filters: import_v421.z.array(
|
|
4428
|
+
import_v421.z.union([comparisonFilterSchema, import_v421.z.lazy(() => compoundFilterSchema)])
|
|
4344
4429
|
)
|
|
4345
4430
|
});
|
|
4346
|
-
var fileSearchArgsSchema = (0,
|
|
4347
|
-
() => (0,
|
|
4348
|
-
|
|
4349
|
-
vectorStoreIds:
|
|
4350
|
-
maxNumResults:
|
|
4351
|
-
ranking:
|
|
4352
|
-
ranker:
|
|
4353
|
-
scoreThreshold:
|
|
4431
|
+
var fileSearchArgsSchema = (0, import_provider_utils28.lazySchema)(
|
|
4432
|
+
() => (0, import_provider_utils28.zodSchema)(
|
|
4433
|
+
import_v421.z.object({
|
|
4434
|
+
vectorStoreIds: import_v421.z.array(import_v421.z.string()),
|
|
4435
|
+
maxNumResults: import_v421.z.number().optional(),
|
|
4436
|
+
ranking: import_v421.z.object({
|
|
4437
|
+
ranker: import_v421.z.string().optional(),
|
|
4438
|
+
scoreThreshold: import_v421.z.number().optional()
|
|
4354
4439
|
}).optional(),
|
|
4355
|
-
filters:
|
|
4440
|
+
filters: import_v421.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
4356
4441
|
})
|
|
4357
4442
|
)
|
|
4358
4443
|
);
|
|
4359
|
-
var fileSearchOutputSchema = (0,
|
|
4360
|
-
() => (0,
|
|
4361
|
-
|
|
4362
|
-
queries:
|
|
4363
|
-
results:
|
|
4364
|
-
|
|
4365
|
-
attributes:
|
|
4366
|
-
fileId:
|
|
4367
|
-
filename:
|
|
4368
|
-
score:
|
|
4369
|
-
text:
|
|
4444
|
+
var fileSearchOutputSchema = (0, import_provider_utils28.lazySchema)(
|
|
4445
|
+
() => (0, import_provider_utils28.zodSchema)(
|
|
4446
|
+
import_v421.z.object({
|
|
4447
|
+
queries: import_v421.z.array(import_v421.z.string()),
|
|
4448
|
+
results: import_v421.z.array(
|
|
4449
|
+
import_v421.z.object({
|
|
4450
|
+
attributes: import_v421.z.record(import_v421.z.string(), import_v421.z.unknown()),
|
|
4451
|
+
fileId: import_v421.z.string(),
|
|
4452
|
+
filename: import_v421.z.string(),
|
|
4453
|
+
score: import_v421.z.number(),
|
|
4454
|
+
text: import_v421.z.string()
|
|
4370
4455
|
})
|
|
4371
4456
|
).nullable()
|
|
4372
4457
|
})
|
|
4373
4458
|
)
|
|
4374
4459
|
);
|
|
4375
|
-
var fileSearch = (0,
|
|
4460
|
+
var fileSearch = (0, import_provider_utils28.createProviderToolFactoryWithOutputSchema)({
|
|
4376
4461
|
id: "openai.file_search",
|
|
4377
|
-
inputSchema:
|
|
4462
|
+
inputSchema: import_v421.z.object({}),
|
|
4378
4463
|
outputSchema: fileSearchOutputSchema
|
|
4379
4464
|
});
|
|
4380
4465
|
|
|
4381
4466
|
// src/tool/image-generation.ts
|
|
4382
|
-
var
|
|
4383
|
-
var
|
|
4384
|
-
var imageGenerationArgsSchema = (0,
|
|
4385
|
-
() => (0,
|
|
4386
|
-
|
|
4387
|
-
background:
|
|
4388
|
-
inputFidelity:
|
|
4389
|
-
inputImageMask:
|
|
4390
|
-
fileId:
|
|
4391
|
-
imageUrl:
|
|
4467
|
+
var import_provider_utils29 = require("@ai-sdk/provider-utils");
|
|
4468
|
+
var import_v422 = require("zod/v4");
|
|
4469
|
+
var imageGenerationArgsSchema = (0, import_provider_utils29.lazySchema)(
|
|
4470
|
+
() => (0, import_provider_utils29.zodSchema)(
|
|
4471
|
+
import_v422.z.object({
|
|
4472
|
+
background: import_v422.z.enum(["auto", "opaque", "transparent"]).optional(),
|
|
4473
|
+
inputFidelity: import_v422.z.enum(["low", "high"]).optional(),
|
|
4474
|
+
inputImageMask: import_v422.z.object({
|
|
4475
|
+
fileId: import_v422.z.string().optional(),
|
|
4476
|
+
imageUrl: import_v422.z.string().optional()
|
|
4392
4477
|
}).optional(),
|
|
4393
|
-
model:
|
|
4394
|
-
moderation:
|
|
4395
|
-
outputCompression:
|
|
4396
|
-
outputFormat:
|
|
4397
|
-
partialImages:
|
|
4398
|
-
quality:
|
|
4399
|
-
size:
|
|
4478
|
+
model: import_v422.z.string().optional(),
|
|
4479
|
+
moderation: import_v422.z.enum(["auto"]).optional(),
|
|
4480
|
+
outputCompression: import_v422.z.number().int().min(0).max(100).optional(),
|
|
4481
|
+
outputFormat: import_v422.z.enum(["png", "jpeg", "webp"]).optional(),
|
|
4482
|
+
partialImages: import_v422.z.number().int().min(0).max(3).optional(),
|
|
4483
|
+
quality: import_v422.z.enum(["auto", "low", "medium", "high"]).optional(),
|
|
4484
|
+
size: import_v422.z.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
4400
4485
|
}).strict()
|
|
4401
4486
|
)
|
|
4402
4487
|
);
|
|
4403
|
-
var imageGenerationInputSchema = (0,
|
|
4404
|
-
var imageGenerationOutputSchema = (0,
|
|
4405
|
-
() => (0,
|
|
4488
|
+
var imageGenerationInputSchema = (0, import_provider_utils29.lazySchema)(() => (0, import_provider_utils29.zodSchema)(import_v422.z.object({})));
|
|
4489
|
+
var imageGenerationOutputSchema = (0, import_provider_utils29.lazySchema)(
|
|
4490
|
+
() => (0, import_provider_utils29.zodSchema)(import_v422.z.object({ result: import_v422.z.string() }))
|
|
4406
4491
|
);
|
|
4407
|
-
var imageGenerationToolFactory = (0,
|
|
4492
|
+
var imageGenerationToolFactory = (0, import_provider_utils29.createProviderToolFactoryWithOutputSchema)({
|
|
4408
4493
|
id: "openai.image_generation",
|
|
4409
4494
|
inputSchema: imageGenerationInputSchema,
|
|
4410
4495
|
outputSchema: imageGenerationOutputSchema
|
|
@@ -4414,153 +4499,102 @@ var imageGeneration = (args = {}) => {
|
|
|
4414
4499
|
};
|
|
4415
4500
|
|
|
4416
4501
|
// src/tool/custom.ts
|
|
4417
|
-
var
|
|
4418
|
-
var
|
|
4419
|
-
var customArgsSchema = (0,
|
|
4420
|
-
() => (0,
|
|
4421
|
-
|
|
4422
|
-
name:
|
|
4423
|
-
description:
|
|
4424
|
-
format:
|
|
4425
|
-
|
|
4426
|
-
type:
|
|
4427
|
-
syntax:
|
|
4428
|
-
definition:
|
|
4502
|
+
var import_provider_utils30 = require("@ai-sdk/provider-utils");
|
|
4503
|
+
var import_v423 = require("zod/v4");
|
|
4504
|
+
var customArgsSchema = (0, import_provider_utils30.lazySchema)(
|
|
4505
|
+
() => (0, import_provider_utils30.zodSchema)(
|
|
4506
|
+
import_v423.z.object({
|
|
4507
|
+
name: import_v423.z.string(),
|
|
4508
|
+
description: import_v423.z.string().optional(),
|
|
4509
|
+
format: import_v423.z.union([
|
|
4510
|
+
import_v423.z.object({
|
|
4511
|
+
type: import_v423.z.literal("grammar"),
|
|
4512
|
+
syntax: import_v423.z.enum(["regex", "lark"]),
|
|
4513
|
+
definition: import_v423.z.string()
|
|
4429
4514
|
}),
|
|
4430
|
-
|
|
4431
|
-
type:
|
|
4515
|
+
import_v423.z.object({
|
|
4516
|
+
type: import_v423.z.literal("text")
|
|
4432
4517
|
})
|
|
4433
4518
|
]).optional()
|
|
4434
4519
|
})
|
|
4435
4520
|
)
|
|
4436
4521
|
);
|
|
4437
|
-
var customInputSchema = (0,
|
|
4438
|
-
var customToolFactory = (0,
|
|
4522
|
+
var customInputSchema = (0, import_provider_utils30.lazySchema)(() => (0, import_provider_utils30.zodSchema)(import_v423.z.string()));
|
|
4523
|
+
var customToolFactory = (0, import_provider_utils30.createProviderToolFactory)({
|
|
4439
4524
|
id: "openai.custom",
|
|
4440
4525
|
inputSchema: customInputSchema
|
|
4441
4526
|
});
|
|
4442
4527
|
|
|
4443
4528
|
// src/tool/mcp.ts
|
|
4444
|
-
var
|
|
4445
|
-
var
|
|
4446
|
-
var jsonValueSchema2 =
|
|
4447
|
-
() =>
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4529
|
+
var import_provider_utils31 = require("@ai-sdk/provider-utils");
|
|
4530
|
+
var import_v424 = require("zod/v4");
|
|
4531
|
+
var jsonValueSchema2 = import_v424.z.lazy(
|
|
4532
|
+
() => import_v424.z.union([
|
|
4533
|
+
import_v424.z.string(),
|
|
4534
|
+
import_v424.z.number(),
|
|
4535
|
+
import_v424.z.boolean(),
|
|
4536
|
+
import_v424.z.null(),
|
|
4537
|
+
import_v424.z.array(jsonValueSchema2),
|
|
4538
|
+
import_v424.z.record(import_v424.z.string(), jsonValueSchema2)
|
|
4454
4539
|
])
|
|
4455
4540
|
);
|
|
4456
|
-
var mcpArgsSchema = (0,
|
|
4457
|
-
() => (0,
|
|
4458
|
-
|
|
4459
|
-
serverLabel:
|
|
4460
|
-
allowedTools:
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
readOnly:
|
|
4464
|
-
toolNames:
|
|
4541
|
+
var mcpArgsSchema = (0, import_provider_utils31.lazySchema)(
|
|
4542
|
+
() => (0, import_provider_utils31.zodSchema)(
|
|
4543
|
+
import_v424.z.object({
|
|
4544
|
+
serverLabel: import_v424.z.string(),
|
|
4545
|
+
allowedTools: import_v424.z.union([
|
|
4546
|
+
import_v424.z.array(import_v424.z.string()),
|
|
4547
|
+
import_v424.z.object({
|
|
4548
|
+
readOnly: import_v424.z.boolean().optional(),
|
|
4549
|
+
toolNames: import_v424.z.array(import_v424.z.string()).optional()
|
|
4465
4550
|
})
|
|
4466
4551
|
]).optional(),
|
|
4467
|
-
authorization:
|
|
4468
|
-
connectorId:
|
|
4469
|
-
headers:
|
|
4470
|
-
requireApproval:
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
never:
|
|
4474
|
-
toolNames:
|
|
4552
|
+
authorization: import_v424.z.string().optional(),
|
|
4553
|
+
connectorId: import_v424.z.string().optional(),
|
|
4554
|
+
headers: import_v424.z.record(import_v424.z.string(), import_v424.z.string()).optional(),
|
|
4555
|
+
requireApproval: import_v424.z.union([
|
|
4556
|
+
import_v424.z.enum(["always", "never"]),
|
|
4557
|
+
import_v424.z.object({
|
|
4558
|
+
never: import_v424.z.object({
|
|
4559
|
+
toolNames: import_v424.z.array(import_v424.z.string()).optional()
|
|
4475
4560
|
}).optional()
|
|
4476
4561
|
})
|
|
4477
4562
|
]).optional(),
|
|
4478
|
-
serverDescription:
|
|
4479
|
-
serverUrl:
|
|
4563
|
+
serverDescription: import_v424.z.string().optional(),
|
|
4564
|
+
serverUrl: import_v424.z.string().optional()
|
|
4480
4565
|
}).refine(
|
|
4481
4566
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
4482
4567
|
"One of serverUrl or connectorId must be provided."
|
|
4483
4568
|
)
|
|
4484
4569
|
)
|
|
4485
4570
|
);
|
|
4486
|
-
var mcpInputSchema = (0,
|
|
4487
|
-
var mcpOutputSchema = (0,
|
|
4488
|
-
() => (0,
|
|
4489
|
-
|
|
4490
|
-
type:
|
|
4491
|
-
serverLabel:
|
|
4492
|
-
name:
|
|
4493
|
-
arguments:
|
|
4494
|
-
output:
|
|
4495
|
-
error:
|
|
4571
|
+
var mcpInputSchema = (0, import_provider_utils31.lazySchema)(() => (0, import_provider_utils31.zodSchema)(import_v424.z.object({})));
|
|
4572
|
+
var mcpOutputSchema = (0, import_provider_utils31.lazySchema)(
|
|
4573
|
+
() => (0, import_provider_utils31.zodSchema)(
|
|
4574
|
+
import_v424.z.object({
|
|
4575
|
+
type: import_v424.z.literal("call"),
|
|
4576
|
+
serverLabel: import_v424.z.string(),
|
|
4577
|
+
name: import_v424.z.string(),
|
|
4578
|
+
arguments: import_v424.z.string(),
|
|
4579
|
+
output: import_v424.z.string().nullish(),
|
|
4580
|
+
error: import_v424.z.union([import_v424.z.string(), jsonValueSchema2]).optional()
|
|
4496
4581
|
})
|
|
4497
4582
|
)
|
|
4498
4583
|
);
|
|
4499
|
-
var mcpToolFactory = (0,
|
|
4584
|
+
var mcpToolFactory = (0, import_provider_utils31.createProviderToolFactoryWithOutputSchema)({
|
|
4500
4585
|
id: "openai.mcp",
|
|
4501
4586
|
inputSchema: mcpInputSchema,
|
|
4502
4587
|
outputSchema: mcpOutputSchema
|
|
4503
4588
|
});
|
|
4504
4589
|
|
|
4505
4590
|
// src/tool/web-search.ts
|
|
4506
|
-
var import_provider_utils31 = require("@ai-sdk/provider-utils");
|
|
4507
|
-
var import_v424 = require("zod/v4");
|
|
4508
|
-
var webSearchArgsSchema = (0, import_provider_utils31.lazySchema)(
|
|
4509
|
-
() => (0, import_provider_utils31.zodSchema)(
|
|
4510
|
-
import_v424.z.object({
|
|
4511
|
-
externalWebAccess: import_v424.z.boolean().optional(),
|
|
4512
|
-
filters: import_v424.z.object({ allowedDomains: import_v424.z.array(import_v424.z.string()).optional() }).optional(),
|
|
4513
|
-
searchContextSize: import_v424.z.enum(["low", "medium", "high"]).optional(),
|
|
4514
|
-
userLocation: import_v424.z.object({
|
|
4515
|
-
type: import_v424.z.literal("approximate"),
|
|
4516
|
-
country: import_v424.z.string().optional(),
|
|
4517
|
-
city: import_v424.z.string().optional(),
|
|
4518
|
-
region: import_v424.z.string().optional(),
|
|
4519
|
-
timezone: import_v424.z.string().optional()
|
|
4520
|
-
}).optional()
|
|
4521
|
-
})
|
|
4522
|
-
)
|
|
4523
|
-
);
|
|
4524
|
-
var webSearchInputSchema = (0, import_provider_utils31.lazySchema)(() => (0, import_provider_utils31.zodSchema)(import_v424.z.object({})));
|
|
4525
|
-
var webSearchOutputSchema = (0, import_provider_utils31.lazySchema)(
|
|
4526
|
-
() => (0, import_provider_utils31.zodSchema)(
|
|
4527
|
-
import_v424.z.object({
|
|
4528
|
-
action: import_v424.z.discriminatedUnion("type", [
|
|
4529
|
-
import_v424.z.object({
|
|
4530
|
-
type: import_v424.z.literal("search"),
|
|
4531
|
-
query: import_v424.z.string().optional()
|
|
4532
|
-
}),
|
|
4533
|
-
import_v424.z.object({
|
|
4534
|
-
type: import_v424.z.literal("openPage"),
|
|
4535
|
-
url: import_v424.z.string().nullish()
|
|
4536
|
-
}),
|
|
4537
|
-
import_v424.z.object({
|
|
4538
|
-
type: import_v424.z.literal("findInPage"),
|
|
4539
|
-
url: import_v424.z.string().nullish(),
|
|
4540
|
-
pattern: import_v424.z.string().nullish()
|
|
4541
|
-
})
|
|
4542
|
-
]).optional(),
|
|
4543
|
-
sources: import_v424.z.array(
|
|
4544
|
-
import_v424.z.discriminatedUnion("type", [
|
|
4545
|
-
import_v424.z.object({ type: import_v424.z.literal("url"), url: import_v424.z.string() }),
|
|
4546
|
-
import_v424.z.object({ type: import_v424.z.literal("api"), name: import_v424.z.string() })
|
|
4547
|
-
])
|
|
4548
|
-
).optional()
|
|
4549
|
-
})
|
|
4550
|
-
)
|
|
4551
|
-
);
|
|
4552
|
-
var webSearchToolFactory = (0, import_provider_utils31.createProviderToolFactoryWithOutputSchema)({
|
|
4553
|
-
id: "openai.web_search",
|
|
4554
|
-
inputSchema: webSearchInputSchema,
|
|
4555
|
-
outputSchema: webSearchOutputSchema
|
|
4556
|
-
});
|
|
4557
|
-
|
|
4558
|
-
// src/tool/web-search-preview.ts
|
|
4559
4591
|
var import_provider_utils32 = require("@ai-sdk/provider-utils");
|
|
4560
4592
|
var import_v425 = require("zod/v4");
|
|
4561
|
-
var
|
|
4593
|
+
var webSearchArgsSchema = (0, import_provider_utils32.lazySchema)(
|
|
4562
4594
|
() => (0, import_provider_utils32.zodSchema)(
|
|
4563
4595
|
import_v425.z.object({
|
|
4596
|
+
externalWebAccess: import_v425.z.boolean().optional(),
|
|
4597
|
+
filters: import_v425.z.object({ allowedDomains: import_v425.z.array(import_v425.z.string()).optional() }).optional(),
|
|
4564
4598
|
searchContextSize: import_v425.z.enum(["low", "medium", "high"]).optional(),
|
|
4565
4599
|
userLocation: import_v425.z.object({
|
|
4566
4600
|
type: import_v425.z.literal("approximate"),
|
|
@@ -4572,10 +4606,8 @@ var webSearchPreviewArgsSchema = (0, import_provider_utils32.lazySchema)(
|
|
|
4572
4606
|
})
|
|
4573
4607
|
)
|
|
4574
4608
|
);
|
|
4575
|
-
var
|
|
4576
|
-
|
|
4577
|
-
);
|
|
4578
|
-
var webSearchPreviewOutputSchema = (0, import_provider_utils32.lazySchema)(
|
|
4609
|
+
var webSearchInputSchema = (0, import_provider_utils32.lazySchema)(() => (0, import_provider_utils32.zodSchema)(import_v425.z.object({})));
|
|
4610
|
+
var webSearchOutputSchema = (0, import_provider_utils32.lazySchema)(
|
|
4579
4611
|
() => (0, import_provider_utils32.zodSchema)(
|
|
4580
4612
|
import_v425.z.object({
|
|
4581
4613
|
action: import_v425.z.discriminatedUnion("type", [
|
|
@@ -4592,11 +4624,64 @@ var webSearchPreviewOutputSchema = (0, import_provider_utils32.lazySchema)(
|
|
|
4592
4624
|
url: import_v425.z.string().nullish(),
|
|
4593
4625
|
pattern: import_v425.z.string().nullish()
|
|
4594
4626
|
})
|
|
4627
|
+
]).optional(),
|
|
4628
|
+
sources: import_v425.z.array(
|
|
4629
|
+
import_v425.z.discriminatedUnion("type", [
|
|
4630
|
+
import_v425.z.object({ type: import_v425.z.literal("url"), url: import_v425.z.string() }),
|
|
4631
|
+
import_v425.z.object({ type: import_v425.z.literal("api"), name: import_v425.z.string() })
|
|
4632
|
+
])
|
|
4633
|
+
).optional()
|
|
4634
|
+
})
|
|
4635
|
+
)
|
|
4636
|
+
);
|
|
4637
|
+
var webSearchToolFactory = (0, import_provider_utils32.createProviderToolFactoryWithOutputSchema)({
|
|
4638
|
+
id: "openai.web_search",
|
|
4639
|
+
inputSchema: webSearchInputSchema,
|
|
4640
|
+
outputSchema: webSearchOutputSchema
|
|
4641
|
+
});
|
|
4642
|
+
|
|
4643
|
+
// src/tool/web-search-preview.ts
|
|
4644
|
+
var import_provider_utils33 = require("@ai-sdk/provider-utils");
|
|
4645
|
+
var import_v426 = require("zod/v4");
|
|
4646
|
+
var webSearchPreviewArgsSchema = (0, import_provider_utils33.lazySchema)(
|
|
4647
|
+
() => (0, import_provider_utils33.zodSchema)(
|
|
4648
|
+
import_v426.z.object({
|
|
4649
|
+
searchContextSize: import_v426.z.enum(["low", "medium", "high"]).optional(),
|
|
4650
|
+
userLocation: import_v426.z.object({
|
|
4651
|
+
type: import_v426.z.literal("approximate"),
|
|
4652
|
+
country: import_v426.z.string().optional(),
|
|
4653
|
+
city: import_v426.z.string().optional(),
|
|
4654
|
+
region: import_v426.z.string().optional(),
|
|
4655
|
+
timezone: import_v426.z.string().optional()
|
|
4656
|
+
}).optional()
|
|
4657
|
+
})
|
|
4658
|
+
)
|
|
4659
|
+
);
|
|
4660
|
+
var webSearchPreviewInputSchema = (0, import_provider_utils33.lazySchema)(
|
|
4661
|
+
() => (0, import_provider_utils33.zodSchema)(import_v426.z.object({}))
|
|
4662
|
+
);
|
|
4663
|
+
var webSearchPreviewOutputSchema = (0, import_provider_utils33.lazySchema)(
|
|
4664
|
+
() => (0, import_provider_utils33.zodSchema)(
|
|
4665
|
+
import_v426.z.object({
|
|
4666
|
+
action: import_v426.z.discriminatedUnion("type", [
|
|
4667
|
+
import_v426.z.object({
|
|
4668
|
+
type: import_v426.z.literal("search"),
|
|
4669
|
+
query: import_v426.z.string().optional()
|
|
4670
|
+
}),
|
|
4671
|
+
import_v426.z.object({
|
|
4672
|
+
type: import_v426.z.literal("openPage"),
|
|
4673
|
+
url: import_v426.z.string().nullish()
|
|
4674
|
+
}),
|
|
4675
|
+
import_v426.z.object({
|
|
4676
|
+
type: import_v426.z.literal("findInPage"),
|
|
4677
|
+
url: import_v426.z.string().nullish(),
|
|
4678
|
+
pattern: import_v426.z.string().nullish()
|
|
4679
|
+
})
|
|
4595
4680
|
]).optional()
|
|
4596
4681
|
})
|
|
4597
4682
|
)
|
|
4598
4683
|
);
|
|
4599
|
-
var webSearchPreview = (0,
|
|
4684
|
+
var webSearchPreview = (0, import_provider_utils33.createProviderToolFactoryWithOutputSchema)({
|
|
4600
4685
|
id: "openai.web_search_preview",
|
|
4601
4686
|
inputSchema: webSearchPreviewInputSchema,
|
|
4602
4687
|
outputSchema: webSearchPreviewOutputSchema
|
|
@@ -4635,7 +4720,7 @@ async function prepareResponsesTools({
|
|
|
4635
4720
|
case "provider": {
|
|
4636
4721
|
switch (tool.id) {
|
|
4637
4722
|
case "openai.file_search": {
|
|
4638
|
-
const args = await (0,
|
|
4723
|
+
const args = await (0, import_provider_utils34.validateTypes)({
|
|
4639
4724
|
value: tool.args,
|
|
4640
4725
|
schema: fileSearchArgsSchema
|
|
4641
4726
|
});
|
|
@@ -4658,7 +4743,7 @@ async function prepareResponsesTools({
|
|
|
4658
4743
|
break;
|
|
4659
4744
|
}
|
|
4660
4745
|
case "openai.shell": {
|
|
4661
|
-
const args = await (0,
|
|
4746
|
+
const args = await (0, import_provider_utils34.validateTypes)({
|
|
4662
4747
|
value: tool.args,
|
|
4663
4748
|
schema: shellArgsSchema
|
|
4664
4749
|
});
|
|
@@ -4677,7 +4762,7 @@ async function prepareResponsesTools({
|
|
|
4677
4762
|
break;
|
|
4678
4763
|
}
|
|
4679
4764
|
case "openai.web_search_preview": {
|
|
4680
|
-
const args = await (0,
|
|
4765
|
+
const args = await (0, import_provider_utils34.validateTypes)({
|
|
4681
4766
|
value: tool.args,
|
|
4682
4767
|
schema: webSearchPreviewArgsSchema
|
|
4683
4768
|
});
|
|
@@ -4689,7 +4774,7 @@ async function prepareResponsesTools({
|
|
|
4689
4774
|
break;
|
|
4690
4775
|
}
|
|
4691
4776
|
case "openai.web_search": {
|
|
4692
|
-
const args = await (0,
|
|
4777
|
+
const args = await (0, import_provider_utils34.validateTypes)({
|
|
4693
4778
|
value: tool.args,
|
|
4694
4779
|
schema: webSearchArgsSchema
|
|
4695
4780
|
});
|
|
@@ -4703,7 +4788,7 @@ async function prepareResponsesTools({
|
|
|
4703
4788
|
break;
|
|
4704
4789
|
}
|
|
4705
4790
|
case "openai.code_interpreter": {
|
|
4706
|
-
const args = await (0,
|
|
4791
|
+
const args = await (0, import_provider_utils34.validateTypes)({
|
|
4707
4792
|
value: tool.args,
|
|
4708
4793
|
schema: codeInterpreterArgsSchema
|
|
4709
4794
|
});
|
|
@@ -4714,7 +4799,7 @@ async function prepareResponsesTools({
|
|
|
4714
4799
|
break;
|
|
4715
4800
|
}
|
|
4716
4801
|
case "openai.image_generation": {
|
|
4717
|
-
const args = await (0,
|
|
4802
|
+
const args = await (0, import_provider_utils34.validateTypes)({
|
|
4718
4803
|
value: tool.args,
|
|
4719
4804
|
schema: imageGenerationArgsSchema
|
|
4720
4805
|
});
|
|
@@ -4737,7 +4822,7 @@ async function prepareResponsesTools({
|
|
|
4737
4822
|
break;
|
|
4738
4823
|
}
|
|
4739
4824
|
case "openai.mcp": {
|
|
4740
|
-
const args = await (0,
|
|
4825
|
+
const args = await (0, import_provider_utils34.validateTypes)({
|
|
4741
4826
|
value: tool.args,
|
|
4742
4827
|
schema: mcpArgsSchema
|
|
4743
4828
|
});
|
|
@@ -4763,7 +4848,7 @@ async function prepareResponsesTools({
|
|
|
4763
4848
|
break;
|
|
4764
4849
|
}
|
|
4765
4850
|
case "openai.custom": {
|
|
4766
|
-
const args = await (0,
|
|
4851
|
+
const args = await (0, import_provider_utils34.validateTypes)({
|
|
4767
4852
|
value: tool.args,
|
|
4768
4853
|
schema: customArgsSchema
|
|
4769
4854
|
});
|
|
@@ -4777,7 +4862,7 @@ async function prepareResponsesTools({
|
|
|
4777
4862
|
break;
|
|
4778
4863
|
}
|
|
4779
4864
|
case "openai.tool_search": {
|
|
4780
|
-
const args = await (0,
|
|
4865
|
+
const args = await (0, import_provider_utils34.validateTypes)({
|
|
4781
4866
|
value: tool.args,
|
|
4782
4867
|
schema: toolSearchArgsSchema
|
|
4783
4868
|
});
|
|
@@ -4935,13 +5020,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4935
5020
|
warnings.push({ type: "unsupported", feature: "stopSequences" });
|
|
4936
5021
|
}
|
|
4937
5022
|
const providerOptionsName = this.config.provider.includes("azure") ? "azure" : "openai";
|
|
4938
|
-
let openaiOptions = await (0,
|
|
5023
|
+
let openaiOptions = await (0, import_provider_utils35.parseProviderOptions)({
|
|
4939
5024
|
provider: providerOptionsName,
|
|
4940
5025
|
providerOptions,
|
|
4941
5026
|
schema: openaiLanguageModelResponsesOptionsSchema
|
|
4942
5027
|
});
|
|
4943
5028
|
if (openaiOptions == null && providerOptionsName !== "openai") {
|
|
4944
|
-
openaiOptions = await (0,
|
|
5029
|
+
openaiOptions = await (0, import_provider_utils35.parseProviderOptions)({
|
|
4945
5030
|
provider: "openai",
|
|
4946
5031
|
providerOptions,
|
|
4947
5032
|
schema: openaiLanguageModelResponsesOptionsSchema
|
|
@@ -4955,7 +5040,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4955
5040
|
details: "conversation and previousResponseId cannot be used together"
|
|
4956
5041
|
});
|
|
4957
5042
|
}
|
|
4958
|
-
const toolNameMapping = (0,
|
|
5043
|
+
const toolNameMapping = (0, import_provider_utils35.createToolNameMapping)({
|
|
4959
5044
|
tools,
|
|
4960
5045
|
providerToolNames: {
|
|
4961
5046
|
"openai.code_interpreter": "code_interpreter",
|
|
@@ -5163,12 +5248,12 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5163
5248
|
responseHeaders,
|
|
5164
5249
|
value: response,
|
|
5165
5250
|
rawValue: rawResponse
|
|
5166
|
-
} = await (0,
|
|
5251
|
+
} = await (0, import_provider_utils35.postJsonToApi)({
|
|
5167
5252
|
url,
|
|
5168
|
-
headers: (0,
|
|
5253
|
+
headers: (0, import_provider_utils35.combineHeaders)(this.config.headers(), options.headers),
|
|
5169
5254
|
body,
|
|
5170
5255
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
5171
|
-
successfulResponseHandler: (0,
|
|
5256
|
+
successfulResponseHandler: (0, import_provider_utils35.createJsonResponseHandler)(
|
|
5172
5257
|
openaiResponsesResponseSchema
|
|
5173
5258
|
),
|
|
5174
5259
|
abortSignal: options.abortSignal,
|
|
@@ -5344,7 +5429,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5344
5429
|
content.push({
|
|
5345
5430
|
type: "source",
|
|
5346
5431
|
sourceType: "url",
|
|
5347
|
-
id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0,
|
|
5432
|
+
id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0, import_provider_utils35.generateId)(),
|
|
5348
5433
|
url: annotation.url,
|
|
5349
5434
|
title: annotation.title
|
|
5350
5435
|
});
|
|
@@ -5352,7 +5437,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5352
5437
|
content.push({
|
|
5353
5438
|
type: "source",
|
|
5354
5439
|
sourceType: "document",
|
|
5355
|
-
id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : (0,
|
|
5440
|
+
id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : (0, import_provider_utils35.generateId)(),
|
|
5356
5441
|
mediaType: "text/plain",
|
|
5357
5442
|
title: annotation.filename,
|
|
5358
5443
|
filename: annotation.filename,
|
|
@@ -5368,7 +5453,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5368
5453
|
content.push({
|
|
5369
5454
|
type: "source",
|
|
5370
5455
|
sourceType: "document",
|
|
5371
|
-
id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0,
|
|
5456
|
+
id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils35.generateId)(),
|
|
5372
5457
|
mediaType: "text/plain",
|
|
5373
5458
|
title: annotation.filename,
|
|
5374
5459
|
filename: annotation.filename,
|
|
@@ -5384,7 +5469,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5384
5469
|
content.push({
|
|
5385
5470
|
type: "source",
|
|
5386
5471
|
sourceType: "document",
|
|
5387
|
-
id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : (0,
|
|
5472
|
+
id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : (0, import_provider_utils35.generateId)(),
|
|
5388
5473
|
mediaType: "application/octet-stream",
|
|
5389
5474
|
title: annotation.file_id,
|
|
5390
5475
|
filename: annotation.file_id,
|
|
@@ -5488,7 +5573,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5488
5573
|
}
|
|
5489
5574
|
case "mcp_approval_request": {
|
|
5490
5575
|
const approvalRequestId = (_t = part.approval_request_id) != null ? _t : part.id;
|
|
5491
|
-
const dummyToolCallId = (_w = (_v = (_u = this.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : (0,
|
|
5576
|
+
const dummyToolCallId = (_w = (_v = (_u = this.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : (0, import_provider_utils35.generateId)();
|
|
5492
5577
|
const toolName = `mcp.${part.name}`;
|
|
5493
5578
|
content.push({
|
|
5494
5579
|
type: "tool-call",
|
|
@@ -5629,18 +5714,18 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5629
5714
|
providerOptionsName,
|
|
5630
5715
|
isShellProviderExecuted
|
|
5631
5716
|
} = await this.getArgs(options);
|
|
5632
|
-
const { responseHeaders, value: response } = await (0,
|
|
5717
|
+
const { responseHeaders, value: response } = await (0, import_provider_utils35.postJsonToApi)({
|
|
5633
5718
|
url: this.config.url({
|
|
5634
5719
|
path: "/responses",
|
|
5635
5720
|
modelId: this.modelId
|
|
5636
5721
|
}),
|
|
5637
|
-
headers: (0,
|
|
5722
|
+
headers: (0, import_provider_utils35.combineHeaders)(this.config.headers(), options.headers),
|
|
5638
5723
|
body: {
|
|
5639
5724
|
...body,
|
|
5640
5725
|
stream: true
|
|
5641
5726
|
},
|
|
5642
5727
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
5643
|
-
successfulResponseHandler: (0,
|
|
5728
|
+
successfulResponseHandler: (0, import_provider_utils35.createEventSourceResponseHandler)(
|
|
5644
5729
|
openaiResponsesChunkSchema
|
|
5645
5730
|
),
|
|
5646
5731
|
abortSignal: options.abortSignal,
|
|
@@ -6120,7 +6205,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6120
6205
|
ongoingToolCalls[value.output_index] = void 0;
|
|
6121
6206
|
} else if (value.item.type === "mcp_approval_request") {
|
|
6122
6207
|
ongoingToolCalls[value.output_index] = void 0;
|
|
6123
|
-
const dummyToolCallId = (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0,
|
|
6208
|
+
const dummyToolCallId = (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils35.generateId)();
|
|
6124
6209
|
const approvalRequestId = (_p = value.item.approval_request_id) != null ? _p : value.item.id;
|
|
6125
6210
|
approvalRequestIdToDummyToolCallIdFromStream.set(
|
|
6126
6211
|
approvalRequestId,
|
|
@@ -6411,7 +6496,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6411
6496
|
controller.enqueue({
|
|
6412
6497
|
type: "source",
|
|
6413
6498
|
sourceType: "url",
|
|
6414
|
-
id: (_C = (_B = (_A = self.config).generateId) == null ? void 0 : _B.call(_A)) != null ? _C : (0,
|
|
6499
|
+
id: (_C = (_B = (_A = self.config).generateId) == null ? void 0 : _B.call(_A)) != null ? _C : (0, import_provider_utils35.generateId)(),
|
|
6415
6500
|
url: value.annotation.url,
|
|
6416
6501
|
title: value.annotation.title
|
|
6417
6502
|
});
|
|
@@ -6419,7 +6504,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6419
6504
|
controller.enqueue({
|
|
6420
6505
|
type: "source",
|
|
6421
6506
|
sourceType: "document",
|
|
6422
|
-
id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : (0,
|
|
6507
|
+
id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : (0, import_provider_utils35.generateId)(),
|
|
6423
6508
|
mediaType: "text/plain",
|
|
6424
6509
|
title: value.annotation.filename,
|
|
6425
6510
|
filename: value.annotation.filename,
|
|
@@ -6435,7 +6520,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6435
6520
|
controller.enqueue({
|
|
6436
6521
|
type: "source",
|
|
6437
6522
|
sourceType: "document",
|
|
6438
|
-
id: (_I = (_H = (_G = self.config).generateId) == null ? void 0 : _H.call(_G)) != null ? _I : (0,
|
|
6523
|
+
id: (_I = (_H = (_G = self.config).generateId) == null ? void 0 : _H.call(_G)) != null ? _I : (0, import_provider_utils35.generateId)(),
|
|
6439
6524
|
mediaType: "text/plain",
|
|
6440
6525
|
title: value.annotation.filename,
|
|
6441
6526
|
filename: value.annotation.filename,
|
|
@@ -6451,7 +6536,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6451
6536
|
controller.enqueue({
|
|
6452
6537
|
type: "source",
|
|
6453
6538
|
sourceType: "document",
|
|
6454
|
-
id: (_L = (_K = (_J = self.config).generateId) == null ? void 0 : _K.call(_J)) != null ? _L : (0,
|
|
6539
|
+
id: (_L = (_K = (_J = self.config).generateId) == null ? void 0 : _K.call(_J)) != null ? _L : (0, import_provider_utils35.generateId)(),
|
|
6455
6540
|
mediaType: "application/octet-stream",
|
|
6456
6541
|
title: value.annotation.file_id,
|
|
6457
6542
|
filename: value.annotation.file_id,
|
|
@@ -6591,6 +6676,9 @@ function escapeJSONDelta(delta) {
|
|
|
6591
6676
|
modelMaxImagesPerCall,
|
|
6592
6677
|
openAITranscriptionModelOptions,
|
|
6593
6678
|
openaiEmbeddingModelOptions,
|
|
6679
|
+
openaiImageModelEditOptions,
|
|
6680
|
+
openaiImageModelGenerationOptions,
|
|
6681
|
+
openaiImageModelOptions,
|
|
6594
6682
|
openaiLanguageModelChatOptions,
|
|
6595
6683
|
openaiLanguageModelCompletionOptions,
|
|
6596
6684
|
openaiSpeechModelOptionsSchema,
|