@ai-sdk/openai 3.0.55 → 3.0.58
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 +19 -0
- package/dist/index.d.mts +30 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js +1221 -1125
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1165 -1065
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +30 -1
- package/dist/internal/index.d.ts +30 -1
- package/dist/internal/index.js +1220 -1118
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +1166 -1063
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +12 -3
- package/package.json +2 -2
- package/src/image/openai-image-model-options.ts +123 -0
- package/src/image/openai-image-model.ts +40 -77
- package/src/index.ts +5 -0
- package/src/internal/index.ts +1 -1
- package/src/openai-provider.ts +1 -1
- package/src/responses/openai-responses-api.ts +3 -0
- package/src/responses/openai-responses-language-model.ts +11 -0
- 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,544 @@ 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(),
|
|
3394
|
+
namespace: import_v418.z.string().nullish()
|
|
3309
3395
|
}),
|
|
3310
|
-
|
|
3311
|
-
type:
|
|
3312
|
-
id:
|
|
3313
|
-
status:
|
|
3396
|
+
import_v418.z.object({
|
|
3397
|
+
type: import_v418.z.literal("web_search_call"),
|
|
3398
|
+
id: import_v418.z.string(),
|
|
3399
|
+
status: import_v418.z.string()
|
|
3314
3400
|
}),
|
|
3315
|
-
|
|
3316
|
-
type:
|
|
3317
|
-
id:
|
|
3318
|
-
status:
|
|
3401
|
+
import_v418.z.object({
|
|
3402
|
+
type: import_v418.z.literal("computer_call"),
|
|
3403
|
+
id: import_v418.z.string(),
|
|
3404
|
+
status: import_v418.z.string()
|
|
3319
3405
|
}),
|
|
3320
|
-
|
|
3321
|
-
type:
|
|
3322
|
-
id:
|
|
3406
|
+
import_v418.z.object({
|
|
3407
|
+
type: import_v418.z.literal("file_search_call"),
|
|
3408
|
+
id: import_v418.z.string()
|
|
3323
3409
|
}),
|
|
3324
|
-
|
|
3325
|
-
type:
|
|
3326
|
-
id:
|
|
3410
|
+
import_v418.z.object({
|
|
3411
|
+
type: import_v418.z.literal("image_generation_call"),
|
|
3412
|
+
id: import_v418.z.string()
|
|
3327
3413
|
}),
|
|
3328
|
-
|
|
3329
|
-
type:
|
|
3330
|
-
id:
|
|
3331
|
-
container_id:
|
|
3332
|
-
code:
|
|
3333
|
-
outputs:
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3414
|
+
import_v418.z.object({
|
|
3415
|
+
type: import_v418.z.literal("code_interpreter_call"),
|
|
3416
|
+
id: import_v418.z.string(),
|
|
3417
|
+
container_id: import_v418.z.string(),
|
|
3418
|
+
code: import_v418.z.string().nullable(),
|
|
3419
|
+
outputs: import_v418.z.array(
|
|
3420
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3421
|
+
import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
|
|
3422
|
+
import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
|
|
3337
3423
|
])
|
|
3338
3424
|
).nullable(),
|
|
3339
|
-
status:
|
|
3425
|
+
status: import_v418.z.string()
|
|
3340
3426
|
}),
|
|
3341
|
-
|
|
3342
|
-
type:
|
|
3343
|
-
id:
|
|
3344
|
-
status:
|
|
3345
|
-
approval_request_id:
|
|
3427
|
+
import_v418.z.object({
|
|
3428
|
+
type: import_v418.z.literal("mcp_call"),
|
|
3429
|
+
id: import_v418.z.string(),
|
|
3430
|
+
status: import_v418.z.string(),
|
|
3431
|
+
approval_request_id: import_v418.z.string().nullish()
|
|
3346
3432
|
}),
|
|
3347
|
-
|
|
3348
|
-
type:
|
|
3349
|
-
id:
|
|
3433
|
+
import_v418.z.object({
|
|
3434
|
+
type: import_v418.z.literal("mcp_list_tools"),
|
|
3435
|
+
id: import_v418.z.string()
|
|
3350
3436
|
}),
|
|
3351
|
-
|
|
3352
|
-
type:
|
|
3353
|
-
id:
|
|
3437
|
+
import_v418.z.object({
|
|
3438
|
+
type: import_v418.z.literal("mcp_approval_request"),
|
|
3439
|
+
id: import_v418.z.string()
|
|
3354
3440
|
}),
|
|
3355
|
-
|
|
3356
|
-
type:
|
|
3357
|
-
id:
|
|
3358
|
-
call_id:
|
|
3359
|
-
status:
|
|
3360
|
-
operation:
|
|
3361
|
-
|
|
3362
|
-
type:
|
|
3363
|
-
path:
|
|
3364
|
-
diff:
|
|
3441
|
+
import_v418.z.object({
|
|
3442
|
+
type: import_v418.z.literal("apply_patch_call"),
|
|
3443
|
+
id: import_v418.z.string(),
|
|
3444
|
+
call_id: import_v418.z.string(),
|
|
3445
|
+
status: import_v418.z.enum(["in_progress", "completed"]),
|
|
3446
|
+
operation: import_v418.z.discriminatedUnion("type", [
|
|
3447
|
+
import_v418.z.object({
|
|
3448
|
+
type: import_v418.z.literal("create_file"),
|
|
3449
|
+
path: import_v418.z.string(),
|
|
3450
|
+
diff: import_v418.z.string()
|
|
3365
3451
|
}),
|
|
3366
|
-
|
|
3367
|
-
type:
|
|
3368
|
-
path:
|
|
3452
|
+
import_v418.z.object({
|
|
3453
|
+
type: import_v418.z.literal("delete_file"),
|
|
3454
|
+
path: import_v418.z.string()
|
|
3369
3455
|
}),
|
|
3370
|
-
|
|
3371
|
-
type:
|
|
3372
|
-
path:
|
|
3373
|
-
diff:
|
|
3456
|
+
import_v418.z.object({
|
|
3457
|
+
type: import_v418.z.literal("update_file"),
|
|
3458
|
+
path: import_v418.z.string(),
|
|
3459
|
+
diff: import_v418.z.string()
|
|
3374
3460
|
})
|
|
3375
3461
|
])
|
|
3376
3462
|
}),
|
|
3377
|
-
|
|
3378
|
-
type:
|
|
3379
|
-
id:
|
|
3380
|
-
call_id:
|
|
3381
|
-
name:
|
|
3382
|
-
input:
|
|
3463
|
+
import_v418.z.object({
|
|
3464
|
+
type: import_v418.z.literal("custom_tool_call"),
|
|
3465
|
+
id: import_v418.z.string(),
|
|
3466
|
+
call_id: import_v418.z.string(),
|
|
3467
|
+
name: import_v418.z.string(),
|
|
3468
|
+
input: import_v418.z.string()
|
|
3383
3469
|
}),
|
|
3384
|
-
|
|
3385
|
-
type:
|
|
3386
|
-
id:
|
|
3387
|
-
call_id:
|
|
3388
|
-
status:
|
|
3389
|
-
action:
|
|
3390
|
-
commands:
|
|
3470
|
+
import_v418.z.object({
|
|
3471
|
+
type: import_v418.z.literal("shell_call"),
|
|
3472
|
+
id: import_v418.z.string(),
|
|
3473
|
+
call_id: import_v418.z.string(),
|
|
3474
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3475
|
+
action: import_v418.z.object({
|
|
3476
|
+
commands: import_v418.z.array(import_v418.z.string())
|
|
3391
3477
|
})
|
|
3392
3478
|
}),
|
|
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:
|
|
3479
|
+
import_v418.z.object({
|
|
3480
|
+
type: import_v418.z.literal("shell_call_output"),
|
|
3481
|
+
id: import_v418.z.string(),
|
|
3482
|
+
call_id: import_v418.z.string(),
|
|
3483
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3484
|
+
output: import_v418.z.array(
|
|
3485
|
+
import_v418.z.object({
|
|
3486
|
+
stdout: import_v418.z.string(),
|
|
3487
|
+
stderr: import_v418.z.string(),
|
|
3488
|
+
outcome: import_v418.z.discriminatedUnion("type", [
|
|
3489
|
+
import_v418.z.object({ type: import_v418.z.literal("timeout") }),
|
|
3490
|
+
import_v418.z.object({
|
|
3491
|
+
type: import_v418.z.literal("exit"),
|
|
3492
|
+
exit_code: import_v418.z.number()
|
|
3407
3493
|
})
|
|
3408
3494
|
])
|
|
3409
3495
|
})
|
|
3410
3496
|
)
|
|
3411
3497
|
}),
|
|
3412
|
-
|
|
3413
|
-
type:
|
|
3414
|
-
id:
|
|
3415
|
-
execution:
|
|
3416
|
-
call_id:
|
|
3417
|
-
status:
|
|
3418
|
-
arguments:
|
|
3498
|
+
import_v418.z.object({
|
|
3499
|
+
type: import_v418.z.literal("tool_search_call"),
|
|
3500
|
+
id: import_v418.z.string(),
|
|
3501
|
+
execution: import_v418.z.enum(["server", "client"]),
|
|
3502
|
+
call_id: import_v418.z.string().nullable(),
|
|
3503
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3504
|
+
arguments: import_v418.z.unknown()
|
|
3419
3505
|
}),
|
|
3420
|
-
|
|
3421
|
-
type:
|
|
3422
|
-
id:
|
|
3423
|
-
execution:
|
|
3424
|
-
call_id:
|
|
3425
|
-
status:
|
|
3426
|
-
tools:
|
|
3506
|
+
import_v418.z.object({
|
|
3507
|
+
type: import_v418.z.literal("tool_search_output"),
|
|
3508
|
+
id: import_v418.z.string(),
|
|
3509
|
+
execution: import_v418.z.enum(["server", "client"]),
|
|
3510
|
+
call_id: import_v418.z.string().nullable(),
|
|
3511
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3512
|
+
tools: import_v418.z.array(import_v418.z.record(import_v418.z.string(), jsonValueSchema.optional()))
|
|
3427
3513
|
})
|
|
3428
3514
|
])
|
|
3429
3515
|
}),
|
|
3430
|
-
|
|
3431
|
-
type:
|
|
3432
|
-
output_index:
|
|
3433
|
-
item:
|
|
3434
|
-
|
|
3435
|
-
type:
|
|
3436
|
-
id:
|
|
3437
|
-
phase:
|
|
3516
|
+
import_v418.z.object({
|
|
3517
|
+
type: import_v418.z.literal("response.output_item.done"),
|
|
3518
|
+
output_index: import_v418.z.number(),
|
|
3519
|
+
item: import_v418.z.discriminatedUnion("type", [
|
|
3520
|
+
import_v418.z.object({
|
|
3521
|
+
type: import_v418.z.literal("message"),
|
|
3522
|
+
id: import_v418.z.string(),
|
|
3523
|
+
phase: import_v418.z.enum(["commentary", "final_answer"]).nullish()
|
|
3438
3524
|
}),
|
|
3439
|
-
|
|
3440
|
-
type:
|
|
3441
|
-
id:
|
|
3442
|
-
encrypted_content:
|
|
3525
|
+
import_v418.z.object({
|
|
3526
|
+
type: import_v418.z.literal("reasoning"),
|
|
3527
|
+
id: import_v418.z.string(),
|
|
3528
|
+
encrypted_content: import_v418.z.string().nullish()
|
|
3443
3529
|
}),
|
|
3444
|
-
|
|
3445
|
-
type:
|
|
3446
|
-
id:
|
|
3447
|
-
call_id:
|
|
3448
|
-
name:
|
|
3449
|
-
arguments:
|
|
3450
|
-
status:
|
|
3530
|
+
import_v418.z.object({
|
|
3531
|
+
type: import_v418.z.literal("function_call"),
|
|
3532
|
+
id: import_v418.z.string(),
|
|
3533
|
+
call_id: import_v418.z.string(),
|
|
3534
|
+
name: import_v418.z.string(),
|
|
3535
|
+
arguments: import_v418.z.string(),
|
|
3536
|
+
status: import_v418.z.literal("completed"),
|
|
3537
|
+
namespace: import_v418.z.string().nullish()
|
|
3451
3538
|
}),
|
|
3452
|
-
|
|
3453
|
-
type:
|
|
3454
|
-
id:
|
|
3455
|
-
call_id:
|
|
3456
|
-
name:
|
|
3457
|
-
input:
|
|
3458
|
-
status:
|
|
3539
|
+
import_v418.z.object({
|
|
3540
|
+
type: import_v418.z.literal("custom_tool_call"),
|
|
3541
|
+
id: import_v418.z.string(),
|
|
3542
|
+
call_id: import_v418.z.string(),
|
|
3543
|
+
name: import_v418.z.string(),
|
|
3544
|
+
input: import_v418.z.string(),
|
|
3545
|
+
status: import_v418.z.literal("completed")
|
|
3459
3546
|
}),
|
|
3460
|
-
|
|
3461
|
-
type:
|
|
3462
|
-
id:
|
|
3463
|
-
code:
|
|
3464
|
-
container_id:
|
|
3465
|
-
outputs:
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3547
|
+
import_v418.z.object({
|
|
3548
|
+
type: import_v418.z.literal("code_interpreter_call"),
|
|
3549
|
+
id: import_v418.z.string(),
|
|
3550
|
+
code: import_v418.z.string().nullable(),
|
|
3551
|
+
container_id: import_v418.z.string(),
|
|
3552
|
+
outputs: import_v418.z.array(
|
|
3553
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3554
|
+
import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
|
|
3555
|
+
import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
|
|
3469
3556
|
])
|
|
3470
3557
|
).nullable()
|
|
3471
3558
|
}),
|
|
3472
|
-
|
|
3473
|
-
type:
|
|
3474
|
-
id:
|
|
3475
|
-
result:
|
|
3559
|
+
import_v418.z.object({
|
|
3560
|
+
type: import_v418.z.literal("image_generation_call"),
|
|
3561
|
+
id: import_v418.z.string(),
|
|
3562
|
+
result: import_v418.z.string()
|
|
3476
3563
|
}),
|
|
3477
|
-
|
|
3478
|
-
type:
|
|
3479
|
-
id:
|
|
3480
|
-
status:
|
|
3481
|
-
action:
|
|
3482
|
-
|
|
3483
|
-
type:
|
|
3484
|
-
query:
|
|
3485
|
-
sources:
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3564
|
+
import_v418.z.object({
|
|
3565
|
+
type: import_v418.z.literal("web_search_call"),
|
|
3566
|
+
id: import_v418.z.string(),
|
|
3567
|
+
status: import_v418.z.string(),
|
|
3568
|
+
action: import_v418.z.discriminatedUnion("type", [
|
|
3569
|
+
import_v418.z.object({
|
|
3570
|
+
type: import_v418.z.literal("search"),
|
|
3571
|
+
query: import_v418.z.string().nullish(),
|
|
3572
|
+
sources: import_v418.z.array(
|
|
3573
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3574
|
+
import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() }),
|
|
3575
|
+
import_v418.z.object({ type: import_v418.z.literal("api"), name: import_v418.z.string() })
|
|
3489
3576
|
])
|
|
3490
3577
|
).nullish()
|
|
3491
3578
|
}),
|
|
3492
|
-
|
|
3493
|
-
type:
|
|
3494
|
-
url:
|
|
3579
|
+
import_v418.z.object({
|
|
3580
|
+
type: import_v418.z.literal("open_page"),
|
|
3581
|
+
url: import_v418.z.string().nullish()
|
|
3495
3582
|
}),
|
|
3496
|
-
|
|
3497
|
-
type:
|
|
3498
|
-
url:
|
|
3499
|
-
pattern:
|
|
3583
|
+
import_v418.z.object({
|
|
3584
|
+
type: import_v418.z.literal("find_in_page"),
|
|
3585
|
+
url: import_v418.z.string().nullish(),
|
|
3586
|
+
pattern: import_v418.z.string().nullish()
|
|
3500
3587
|
})
|
|
3501
3588
|
]).nullish()
|
|
3502
3589
|
}),
|
|
3503
|
-
|
|
3504
|
-
type:
|
|
3505
|
-
id:
|
|
3506
|
-
queries:
|
|
3507
|
-
results:
|
|
3508
|
-
|
|
3509
|
-
attributes:
|
|
3510
|
-
|
|
3511
|
-
|
|
3590
|
+
import_v418.z.object({
|
|
3591
|
+
type: import_v418.z.literal("file_search_call"),
|
|
3592
|
+
id: import_v418.z.string(),
|
|
3593
|
+
queries: import_v418.z.array(import_v418.z.string()),
|
|
3594
|
+
results: import_v418.z.array(
|
|
3595
|
+
import_v418.z.object({
|
|
3596
|
+
attributes: import_v418.z.record(
|
|
3597
|
+
import_v418.z.string(),
|
|
3598
|
+
import_v418.z.union([import_v418.z.string(), import_v418.z.number(), import_v418.z.boolean()])
|
|
3512
3599
|
),
|
|
3513
|
-
file_id:
|
|
3514
|
-
filename:
|
|
3515
|
-
score:
|
|
3516
|
-
text:
|
|
3600
|
+
file_id: import_v418.z.string(),
|
|
3601
|
+
filename: import_v418.z.string(),
|
|
3602
|
+
score: import_v418.z.number(),
|
|
3603
|
+
text: import_v418.z.string()
|
|
3517
3604
|
})
|
|
3518
3605
|
).nullish()
|
|
3519
3606
|
}),
|
|
3520
|
-
|
|
3521
|
-
type:
|
|
3522
|
-
id:
|
|
3523
|
-
call_id:
|
|
3524
|
-
action:
|
|
3525
|
-
type:
|
|
3526
|
-
command:
|
|
3527
|
-
timeout_ms:
|
|
3528
|
-
user:
|
|
3529
|
-
working_directory:
|
|
3530
|
-
env:
|
|
3607
|
+
import_v418.z.object({
|
|
3608
|
+
type: import_v418.z.literal("local_shell_call"),
|
|
3609
|
+
id: import_v418.z.string(),
|
|
3610
|
+
call_id: import_v418.z.string(),
|
|
3611
|
+
action: import_v418.z.object({
|
|
3612
|
+
type: import_v418.z.literal("exec"),
|
|
3613
|
+
command: import_v418.z.array(import_v418.z.string()),
|
|
3614
|
+
timeout_ms: import_v418.z.number().optional(),
|
|
3615
|
+
user: import_v418.z.string().optional(),
|
|
3616
|
+
working_directory: import_v418.z.string().optional(),
|
|
3617
|
+
env: import_v418.z.record(import_v418.z.string(), import_v418.z.string()).optional()
|
|
3531
3618
|
})
|
|
3532
3619
|
}),
|
|
3533
|
-
|
|
3534
|
-
type:
|
|
3535
|
-
id:
|
|
3536
|
-
status:
|
|
3620
|
+
import_v418.z.object({
|
|
3621
|
+
type: import_v418.z.literal("computer_call"),
|
|
3622
|
+
id: import_v418.z.string(),
|
|
3623
|
+
status: import_v418.z.literal("completed")
|
|
3537
3624
|
}),
|
|
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:
|
|
3625
|
+
import_v418.z.object({
|
|
3626
|
+
type: import_v418.z.literal("mcp_call"),
|
|
3627
|
+
id: import_v418.z.string(),
|
|
3628
|
+
status: import_v418.z.string(),
|
|
3629
|
+
arguments: import_v418.z.string(),
|
|
3630
|
+
name: import_v418.z.string(),
|
|
3631
|
+
server_label: import_v418.z.string(),
|
|
3632
|
+
output: import_v418.z.string().nullish(),
|
|
3633
|
+
error: import_v418.z.union([
|
|
3634
|
+
import_v418.z.string(),
|
|
3635
|
+
import_v418.z.object({
|
|
3636
|
+
type: import_v418.z.string().optional(),
|
|
3637
|
+
code: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).optional(),
|
|
3638
|
+
message: import_v418.z.string().optional()
|
|
3552
3639
|
}).loose()
|
|
3553
3640
|
]).nullish(),
|
|
3554
|
-
approval_request_id:
|
|
3641
|
+
approval_request_id: import_v418.z.string().nullish()
|
|
3555
3642
|
}),
|
|
3556
|
-
|
|
3557
|
-
type:
|
|
3558
|
-
id:
|
|
3559
|
-
server_label:
|
|
3560
|
-
tools:
|
|
3561
|
-
|
|
3562
|
-
name:
|
|
3563
|
-
description:
|
|
3564
|
-
input_schema:
|
|
3565
|
-
annotations:
|
|
3643
|
+
import_v418.z.object({
|
|
3644
|
+
type: import_v418.z.literal("mcp_list_tools"),
|
|
3645
|
+
id: import_v418.z.string(),
|
|
3646
|
+
server_label: import_v418.z.string(),
|
|
3647
|
+
tools: import_v418.z.array(
|
|
3648
|
+
import_v418.z.object({
|
|
3649
|
+
name: import_v418.z.string(),
|
|
3650
|
+
description: import_v418.z.string().optional(),
|
|
3651
|
+
input_schema: import_v418.z.any(),
|
|
3652
|
+
annotations: import_v418.z.record(import_v418.z.string(), import_v418.z.unknown()).optional()
|
|
3566
3653
|
})
|
|
3567
3654
|
),
|
|
3568
|
-
error:
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
type:
|
|
3572
|
-
code:
|
|
3573
|
-
message:
|
|
3655
|
+
error: import_v418.z.union([
|
|
3656
|
+
import_v418.z.string(),
|
|
3657
|
+
import_v418.z.object({
|
|
3658
|
+
type: import_v418.z.string().optional(),
|
|
3659
|
+
code: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).optional(),
|
|
3660
|
+
message: import_v418.z.string().optional()
|
|
3574
3661
|
}).loose()
|
|
3575
3662
|
]).optional()
|
|
3576
3663
|
}),
|
|
3577
|
-
|
|
3578
|
-
type:
|
|
3579
|
-
id:
|
|
3580
|
-
server_label:
|
|
3581
|
-
name:
|
|
3582
|
-
arguments:
|
|
3583
|
-
approval_request_id:
|
|
3664
|
+
import_v418.z.object({
|
|
3665
|
+
type: import_v418.z.literal("mcp_approval_request"),
|
|
3666
|
+
id: import_v418.z.string(),
|
|
3667
|
+
server_label: import_v418.z.string(),
|
|
3668
|
+
name: import_v418.z.string(),
|
|
3669
|
+
arguments: import_v418.z.string(),
|
|
3670
|
+
approval_request_id: import_v418.z.string().optional()
|
|
3584
3671
|
}),
|
|
3585
|
-
|
|
3586
|
-
type:
|
|
3587
|
-
id:
|
|
3588
|
-
call_id:
|
|
3589
|
-
status:
|
|
3590
|
-
operation:
|
|
3591
|
-
|
|
3592
|
-
type:
|
|
3593
|
-
path:
|
|
3594
|
-
diff:
|
|
3672
|
+
import_v418.z.object({
|
|
3673
|
+
type: import_v418.z.literal("apply_patch_call"),
|
|
3674
|
+
id: import_v418.z.string(),
|
|
3675
|
+
call_id: import_v418.z.string(),
|
|
3676
|
+
status: import_v418.z.enum(["in_progress", "completed"]),
|
|
3677
|
+
operation: import_v418.z.discriminatedUnion("type", [
|
|
3678
|
+
import_v418.z.object({
|
|
3679
|
+
type: import_v418.z.literal("create_file"),
|
|
3680
|
+
path: import_v418.z.string(),
|
|
3681
|
+
diff: import_v418.z.string()
|
|
3595
3682
|
}),
|
|
3596
|
-
|
|
3597
|
-
type:
|
|
3598
|
-
path:
|
|
3683
|
+
import_v418.z.object({
|
|
3684
|
+
type: import_v418.z.literal("delete_file"),
|
|
3685
|
+
path: import_v418.z.string()
|
|
3599
3686
|
}),
|
|
3600
|
-
|
|
3601
|
-
type:
|
|
3602
|
-
path:
|
|
3603
|
-
diff:
|
|
3687
|
+
import_v418.z.object({
|
|
3688
|
+
type: import_v418.z.literal("update_file"),
|
|
3689
|
+
path: import_v418.z.string(),
|
|
3690
|
+
diff: import_v418.z.string()
|
|
3604
3691
|
})
|
|
3605
3692
|
])
|
|
3606
3693
|
}),
|
|
3607
|
-
|
|
3608
|
-
type:
|
|
3609
|
-
id:
|
|
3610
|
-
call_id:
|
|
3611
|
-
status:
|
|
3612
|
-
action:
|
|
3613
|
-
commands:
|
|
3694
|
+
import_v418.z.object({
|
|
3695
|
+
type: import_v418.z.literal("shell_call"),
|
|
3696
|
+
id: import_v418.z.string(),
|
|
3697
|
+
call_id: import_v418.z.string(),
|
|
3698
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3699
|
+
action: import_v418.z.object({
|
|
3700
|
+
commands: import_v418.z.array(import_v418.z.string())
|
|
3614
3701
|
})
|
|
3615
3702
|
}),
|
|
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:
|
|
3703
|
+
import_v418.z.object({
|
|
3704
|
+
type: import_v418.z.literal("shell_call_output"),
|
|
3705
|
+
id: import_v418.z.string(),
|
|
3706
|
+
call_id: import_v418.z.string(),
|
|
3707
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3708
|
+
output: import_v418.z.array(
|
|
3709
|
+
import_v418.z.object({
|
|
3710
|
+
stdout: import_v418.z.string(),
|
|
3711
|
+
stderr: import_v418.z.string(),
|
|
3712
|
+
outcome: import_v418.z.discriminatedUnion("type", [
|
|
3713
|
+
import_v418.z.object({ type: import_v418.z.literal("timeout") }),
|
|
3714
|
+
import_v418.z.object({
|
|
3715
|
+
type: import_v418.z.literal("exit"),
|
|
3716
|
+
exit_code: import_v418.z.number()
|
|
3630
3717
|
})
|
|
3631
3718
|
])
|
|
3632
3719
|
})
|
|
3633
3720
|
)
|
|
3634
3721
|
}),
|
|
3635
|
-
|
|
3636
|
-
type:
|
|
3637
|
-
id:
|
|
3638
|
-
execution:
|
|
3639
|
-
call_id:
|
|
3640
|
-
status:
|
|
3641
|
-
arguments:
|
|
3722
|
+
import_v418.z.object({
|
|
3723
|
+
type: import_v418.z.literal("tool_search_call"),
|
|
3724
|
+
id: import_v418.z.string(),
|
|
3725
|
+
execution: import_v418.z.enum(["server", "client"]),
|
|
3726
|
+
call_id: import_v418.z.string().nullable(),
|
|
3727
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3728
|
+
arguments: import_v418.z.unknown()
|
|
3642
3729
|
}),
|
|
3643
|
-
|
|
3644
|
-
type:
|
|
3645
|
-
id:
|
|
3646
|
-
execution:
|
|
3647
|
-
call_id:
|
|
3648
|
-
status:
|
|
3649
|
-
tools:
|
|
3730
|
+
import_v418.z.object({
|
|
3731
|
+
type: import_v418.z.literal("tool_search_output"),
|
|
3732
|
+
id: import_v418.z.string(),
|
|
3733
|
+
execution: import_v418.z.enum(["server", "client"]),
|
|
3734
|
+
call_id: import_v418.z.string().nullable(),
|
|
3735
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3736
|
+
tools: import_v418.z.array(import_v418.z.record(import_v418.z.string(), jsonValueSchema.optional()))
|
|
3650
3737
|
})
|
|
3651
3738
|
])
|
|
3652
3739
|
}),
|
|
3653
|
-
|
|
3654
|
-
type:
|
|
3655
|
-
item_id:
|
|
3656
|
-
output_index:
|
|
3657
|
-
delta:
|
|
3740
|
+
import_v418.z.object({
|
|
3741
|
+
type: import_v418.z.literal("response.function_call_arguments.delta"),
|
|
3742
|
+
item_id: import_v418.z.string(),
|
|
3743
|
+
output_index: import_v418.z.number(),
|
|
3744
|
+
delta: import_v418.z.string()
|
|
3658
3745
|
}),
|
|
3659
|
-
|
|
3660
|
-
type:
|
|
3661
|
-
item_id:
|
|
3662
|
-
output_index:
|
|
3663
|
-
delta:
|
|
3746
|
+
import_v418.z.object({
|
|
3747
|
+
type: import_v418.z.literal("response.custom_tool_call_input.delta"),
|
|
3748
|
+
item_id: import_v418.z.string(),
|
|
3749
|
+
output_index: import_v418.z.number(),
|
|
3750
|
+
delta: import_v418.z.string()
|
|
3664
3751
|
}),
|
|
3665
|
-
|
|
3666
|
-
type:
|
|
3667
|
-
item_id:
|
|
3668
|
-
output_index:
|
|
3669
|
-
partial_image_b64:
|
|
3752
|
+
import_v418.z.object({
|
|
3753
|
+
type: import_v418.z.literal("response.image_generation_call.partial_image"),
|
|
3754
|
+
item_id: import_v418.z.string(),
|
|
3755
|
+
output_index: import_v418.z.number(),
|
|
3756
|
+
partial_image_b64: import_v418.z.string()
|
|
3670
3757
|
}),
|
|
3671
|
-
|
|
3672
|
-
type:
|
|
3673
|
-
item_id:
|
|
3674
|
-
output_index:
|
|
3675
|
-
delta:
|
|
3758
|
+
import_v418.z.object({
|
|
3759
|
+
type: import_v418.z.literal("response.code_interpreter_call_code.delta"),
|
|
3760
|
+
item_id: import_v418.z.string(),
|
|
3761
|
+
output_index: import_v418.z.number(),
|
|
3762
|
+
delta: import_v418.z.string()
|
|
3676
3763
|
}),
|
|
3677
|
-
|
|
3678
|
-
type:
|
|
3679
|
-
item_id:
|
|
3680
|
-
output_index:
|
|
3681
|
-
code:
|
|
3764
|
+
import_v418.z.object({
|
|
3765
|
+
type: import_v418.z.literal("response.code_interpreter_call_code.done"),
|
|
3766
|
+
item_id: import_v418.z.string(),
|
|
3767
|
+
output_index: import_v418.z.number(),
|
|
3768
|
+
code: import_v418.z.string()
|
|
3682
3769
|
}),
|
|
3683
|
-
|
|
3684
|
-
type:
|
|
3685
|
-
annotation:
|
|
3686
|
-
|
|
3687
|
-
type:
|
|
3688
|
-
start_index:
|
|
3689
|
-
end_index:
|
|
3690
|
-
url:
|
|
3691
|
-
title:
|
|
3770
|
+
import_v418.z.object({
|
|
3771
|
+
type: import_v418.z.literal("response.output_text.annotation.added"),
|
|
3772
|
+
annotation: import_v418.z.discriminatedUnion("type", [
|
|
3773
|
+
import_v418.z.object({
|
|
3774
|
+
type: import_v418.z.literal("url_citation"),
|
|
3775
|
+
start_index: import_v418.z.number(),
|
|
3776
|
+
end_index: import_v418.z.number(),
|
|
3777
|
+
url: import_v418.z.string(),
|
|
3778
|
+
title: import_v418.z.string()
|
|
3692
3779
|
}),
|
|
3693
|
-
|
|
3694
|
-
type:
|
|
3695
|
-
file_id:
|
|
3696
|
-
filename:
|
|
3697
|
-
index:
|
|
3780
|
+
import_v418.z.object({
|
|
3781
|
+
type: import_v418.z.literal("file_citation"),
|
|
3782
|
+
file_id: import_v418.z.string(),
|
|
3783
|
+
filename: import_v418.z.string(),
|
|
3784
|
+
index: import_v418.z.number()
|
|
3698
3785
|
}),
|
|
3699
|
-
|
|
3700
|
-
type:
|
|
3701
|
-
container_id:
|
|
3702
|
-
file_id:
|
|
3703
|
-
filename:
|
|
3704
|
-
start_index:
|
|
3705
|
-
end_index:
|
|
3786
|
+
import_v418.z.object({
|
|
3787
|
+
type: import_v418.z.literal("container_file_citation"),
|
|
3788
|
+
container_id: import_v418.z.string(),
|
|
3789
|
+
file_id: import_v418.z.string(),
|
|
3790
|
+
filename: import_v418.z.string(),
|
|
3791
|
+
start_index: import_v418.z.number(),
|
|
3792
|
+
end_index: import_v418.z.number()
|
|
3706
3793
|
}),
|
|
3707
|
-
|
|
3708
|
-
type:
|
|
3709
|
-
file_id:
|
|
3710
|
-
index:
|
|
3794
|
+
import_v418.z.object({
|
|
3795
|
+
type: import_v418.z.literal("file_path"),
|
|
3796
|
+
file_id: import_v418.z.string(),
|
|
3797
|
+
index: import_v418.z.number()
|
|
3711
3798
|
})
|
|
3712
3799
|
])
|
|
3713
3800
|
}),
|
|
3714
|
-
|
|
3715
|
-
type:
|
|
3716
|
-
item_id:
|
|
3717
|
-
summary_index:
|
|
3801
|
+
import_v418.z.object({
|
|
3802
|
+
type: import_v418.z.literal("response.reasoning_summary_part.added"),
|
|
3803
|
+
item_id: import_v418.z.string(),
|
|
3804
|
+
summary_index: import_v418.z.number()
|
|
3718
3805
|
}),
|
|
3719
|
-
|
|
3720
|
-
type:
|
|
3721
|
-
item_id:
|
|
3722
|
-
summary_index:
|
|
3723
|
-
delta:
|
|
3806
|
+
import_v418.z.object({
|
|
3807
|
+
type: import_v418.z.literal("response.reasoning_summary_text.delta"),
|
|
3808
|
+
item_id: import_v418.z.string(),
|
|
3809
|
+
summary_index: import_v418.z.number(),
|
|
3810
|
+
delta: import_v418.z.string()
|
|
3724
3811
|
}),
|
|
3725
|
-
|
|
3726
|
-
type:
|
|
3727
|
-
item_id:
|
|
3728
|
-
summary_index:
|
|
3812
|
+
import_v418.z.object({
|
|
3813
|
+
type: import_v418.z.literal("response.reasoning_summary_part.done"),
|
|
3814
|
+
item_id: import_v418.z.string(),
|
|
3815
|
+
summary_index: import_v418.z.number()
|
|
3729
3816
|
}),
|
|
3730
|
-
|
|
3731
|
-
type:
|
|
3732
|
-
item_id:
|
|
3733
|
-
output_index:
|
|
3734
|
-
delta:
|
|
3735
|
-
obfuscation:
|
|
3817
|
+
import_v418.z.object({
|
|
3818
|
+
type: import_v418.z.literal("response.apply_patch_call_operation_diff.delta"),
|
|
3819
|
+
item_id: import_v418.z.string(),
|
|
3820
|
+
output_index: import_v418.z.number(),
|
|
3821
|
+
delta: import_v418.z.string(),
|
|
3822
|
+
obfuscation: import_v418.z.string().nullish()
|
|
3736
3823
|
}),
|
|
3737
|
-
|
|
3738
|
-
type:
|
|
3739
|
-
item_id:
|
|
3740
|
-
output_index:
|
|
3741
|
-
diff:
|
|
3824
|
+
import_v418.z.object({
|
|
3825
|
+
type: import_v418.z.literal("response.apply_patch_call_operation_diff.done"),
|
|
3826
|
+
item_id: import_v418.z.string(),
|
|
3827
|
+
output_index: import_v418.z.number(),
|
|
3828
|
+
diff: import_v418.z.string()
|
|
3742
3829
|
}),
|
|
3743
|
-
|
|
3744
|
-
type:
|
|
3745
|
-
sequence_number:
|
|
3746
|
-
error:
|
|
3747
|
-
type:
|
|
3748
|
-
code:
|
|
3749
|
-
message:
|
|
3750
|
-
param:
|
|
3830
|
+
import_v418.z.object({
|
|
3831
|
+
type: import_v418.z.literal("error"),
|
|
3832
|
+
sequence_number: import_v418.z.number(),
|
|
3833
|
+
error: import_v418.z.object({
|
|
3834
|
+
type: import_v418.z.string(),
|
|
3835
|
+
code: import_v418.z.string(),
|
|
3836
|
+
message: import_v418.z.string(),
|
|
3837
|
+
param: import_v418.z.string().nullish()
|
|
3751
3838
|
})
|
|
3752
3839
|
}),
|
|
3753
|
-
|
|
3840
|
+
import_v418.z.object({ type: import_v418.z.string() }).loose().transform((value) => ({
|
|
3754
3841
|
type: "unknown_chunk",
|
|
3755
3842
|
message: value.type
|
|
3756
3843
|
}))
|
|
@@ -3758,310 +3845,311 @@ var openaiResponsesChunkSchema = (0, import_provider_utils24.lazySchema)(
|
|
|
3758
3845
|
])
|
|
3759
3846
|
)
|
|
3760
3847
|
);
|
|
3761
|
-
var openaiResponsesResponseSchema = (0,
|
|
3762
|
-
() => (0,
|
|
3763
|
-
|
|
3764
|
-
id:
|
|
3765
|
-
created_at:
|
|
3766
|
-
error:
|
|
3767
|
-
message:
|
|
3768
|
-
type:
|
|
3769
|
-
param:
|
|
3770
|
-
code:
|
|
3848
|
+
var openaiResponsesResponseSchema = (0, import_provider_utils25.lazySchema)(
|
|
3849
|
+
() => (0, import_provider_utils25.zodSchema)(
|
|
3850
|
+
import_v418.z.object({
|
|
3851
|
+
id: import_v418.z.string().optional(),
|
|
3852
|
+
created_at: import_v418.z.number().optional(),
|
|
3853
|
+
error: import_v418.z.object({
|
|
3854
|
+
message: import_v418.z.string(),
|
|
3855
|
+
type: import_v418.z.string(),
|
|
3856
|
+
param: import_v418.z.string().nullish(),
|
|
3857
|
+
code: import_v418.z.string()
|
|
3771
3858
|
}).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:
|
|
3859
|
+
model: import_v418.z.string().optional(),
|
|
3860
|
+
output: import_v418.z.array(
|
|
3861
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3862
|
+
import_v418.z.object({
|
|
3863
|
+
type: import_v418.z.literal("message"),
|
|
3864
|
+
role: import_v418.z.literal("assistant"),
|
|
3865
|
+
id: import_v418.z.string(),
|
|
3866
|
+
phase: import_v418.z.enum(["commentary", "final_answer"]).nullish(),
|
|
3867
|
+
content: import_v418.z.array(
|
|
3868
|
+
import_v418.z.object({
|
|
3869
|
+
type: import_v418.z.literal("output_text"),
|
|
3870
|
+
text: import_v418.z.string(),
|
|
3871
|
+
logprobs: import_v418.z.array(
|
|
3872
|
+
import_v418.z.object({
|
|
3873
|
+
token: import_v418.z.string(),
|
|
3874
|
+
logprob: import_v418.z.number(),
|
|
3875
|
+
top_logprobs: import_v418.z.array(
|
|
3876
|
+
import_v418.z.object({
|
|
3877
|
+
token: import_v418.z.string(),
|
|
3878
|
+
logprob: import_v418.z.number()
|
|
3792
3879
|
})
|
|
3793
3880
|
)
|
|
3794
3881
|
})
|
|
3795
3882
|
).nullish(),
|
|
3796
|
-
annotations:
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
type:
|
|
3800
|
-
start_index:
|
|
3801
|
-
end_index:
|
|
3802
|
-
url:
|
|
3803
|
-
title:
|
|
3883
|
+
annotations: import_v418.z.array(
|
|
3884
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3885
|
+
import_v418.z.object({
|
|
3886
|
+
type: import_v418.z.literal("url_citation"),
|
|
3887
|
+
start_index: import_v418.z.number(),
|
|
3888
|
+
end_index: import_v418.z.number(),
|
|
3889
|
+
url: import_v418.z.string(),
|
|
3890
|
+
title: import_v418.z.string()
|
|
3804
3891
|
}),
|
|
3805
|
-
|
|
3806
|
-
type:
|
|
3807
|
-
file_id:
|
|
3808
|
-
filename:
|
|
3809
|
-
index:
|
|
3892
|
+
import_v418.z.object({
|
|
3893
|
+
type: import_v418.z.literal("file_citation"),
|
|
3894
|
+
file_id: import_v418.z.string(),
|
|
3895
|
+
filename: import_v418.z.string(),
|
|
3896
|
+
index: import_v418.z.number()
|
|
3810
3897
|
}),
|
|
3811
|
-
|
|
3812
|
-
type:
|
|
3813
|
-
container_id:
|
|
3814
|
-
file_id:
|
|
3815
|
-
filename:
|
|
3816
|
-
start_index:
|
|
3817
|
-
end_index:
|
|
3898
|
+
import_v418.z.object({
|
|
3899
|
+
type: import_v418.z.literal("container_file_citation"),
|
|
3900
|
+
container_id: import_v418.z.string(),
|
|
3901
|
+
file_id: import_v418.z.string(),
|
|
3902
|
+
filename: import_v418.z.string(),
|
|
3903
|
+
start_index: import_v418.z.number(),
|
|
3904
|
+
end_index: import_v418.z.number()
|
|
3818
3905
|
}),
|
|
3819
|
-
|
|
3820
|
-
type:
|
|
3821
|
-
file_id:
|
|
3822
|
-
index:
|
|
3906
|
+
import_v418.z.object({
|
|
3907
|
+
type: import_v418.z.literal("file_path"),
|
|
3908
|
+
file_id: import_v418.z.string(),
|
|
3909
|
+
index: import_v418.z.number()
|
|
3823
3910
|
})
|
|
3824
3911
|
])
|
|
3825
3912
|
)
|
|
3826
3913
|
})
|
|
3827
3914
|
)
|
|
3828
3915
|
}),
|
|
3829
|
-
|
|
3830
|
-
type:
|
|
3831
|
-
id:
|
|
3832
|
-
status:
|
|
3833
|
-
action:
|
|
3834
|
-
|
|
3835
|
-
type:
|
|
3836
|
-
query:
|
|
3837
|
-
sources:
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
type:
|
|
3842
|
-
name:
|
|
3916
|
+
import_v418.z.object({
|
|
3917
|
+
type: import_v418.z.literal("web_search_call"),
|
|
3918
|
+
id: import_v418.z.string(),
|
|
3919
|
+
status: import_v418.z.string(),
|
|
3920
|
+
action: import_v418.z.discriminatedUnion("type", [
|
|
3921
|
+
import_v418.z.object({
|
|
3922
|
+
type: import_v418.z.literal("search"),
|
|
3923
|
+
query: import_v418.z.string().nullish(),
|
|
3924
|
+
sources: import_v418.z.array(
|
|
3925
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3926
|
+
import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() }),
|
|
3927
|
+
import_v418.z.object({
|
|
3928
|
+
type: import_v418.z.literal("api"),
|
|
3929
|
+
name: import_v418.z.string()
|
|
3843
3930
|
})
|
|
3844
3931
|
])
|
|
3845
3932
|
).nullish()
|
|
3846
3933
|
}),
|
|
3847
|
-
|
|
3848
|
-
type:
|
|
3849
|
-
url:
|
|
3934
|
+
import_v418.z.object({
|
|
3935
|
+
type: import_v418.z.literal("open_page"),
|
|
3936
|
+
url: import_v418.z.string().nullish()
|
|
3850
3937
|
}),
|
|
3851
|
-
|
|
3852
|
-
type:
|
|
3853
|
-
url:
|
|
3854
|
-
pattern:
|
|
3938
|
+
import_v418.z.object({
|
|
3939
|
+
type: import_v418.z.literal("find_in_page"),
|
|
3940
|
+
url: import_v418.z.string().nullish(),
|
|
3941
|
+
pattern: import_v418.z.string().nullish()
|
|
3855
3942
|
})
|
|
3856
3943
|
]).nullish()
|
|
3857
3944
|
}),
|
|
3858
|
-
|
|
3859
|
-
type:
|
|
3860
|
-
id:
|
|
3861
|
-
queries:
|
|
3862
|
-
results:
|
|
3863
|
-
|
|
3864
|
-
attributes:
|
|
3865
|
-
|
|
3866
|
-
|
|
3945
|
+
import_v418.z.object({
|
|
3946
|
+
type: import_v418.z.literal("file_search_call"),
|
|
3947
|
+
id: import_v418.z.string(),
|
|
3948
|
+
queries: import_v418.z.array(import_v418.z.string()),
|
|
3949
|
+
results: import_v418.z.array(
|
|
3950
|
+
import_v418.z.object({
|
|
3951
|
+
attributes: import_v418.z.record(
|
|
3952
|
+
import_v418.z.string(),
|
|
3953
|
+
import_v418.z.union([import_v418.z.string(), import_v418.z.number(), import_v418.z.boolean()])
|
|
3867
3954
|
),
|
|
3868
|
-
file_id:
|
|
3869
|
-
filename:
|
|
3870
|
-
score:
|
|
3871
|
-
text:
|
|
3955
|
+
file_id: import_v418.z.string(),
|
|
3956
|
+
filename: import_v418.z.string(),
|
|
3957
|
+
score: import_v418.z.number(),
|
|
3958
|
+
text: import_v418.z.string()
|
|
3872
3959
|
})
|
|
3873
3960
|
).nullish()
|
|
3874
3961
|
}),
|
|
3875
|
-
|
|
3876
|
-
type:
|
|
3877
|
-
id:
|
|
3878
|
-
code:
|
|
3879
|
-
container_id:
|
|
3880
|
-
outputs:
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3962
|
+
import_v418.z.object({
|
|
3963
|
+
type: import_v418.z.literal("code_interpreter_call"),
|
|
3964
|
+
id: import_v418.z.string(),
|
|
3965
|
+
code: import_v418.z.string().nullable(),
|
|
3966
|
+
container_id: import_v418.z.string(),
|
|
3967
|
+
outputs: import_v418.z.array(
|
|
3968
|
+
import_v418.z.discriminatedUnion("type", [
|
|
3969
|
+
import_v418.z.object({ type: import_v418.z.literal("logs"), logs: import_v418.z.string() }),
|
|
3970
|
+
import_v418.z.object({ type: import_v418.z.literal("image"), url: import_v418.z.string() })
|
|
3884
3971
|
])
|
|
3885
3972
|
).nullable()
|
|
3886
3973
|
}),
|
|
3887
|
-
|
|
3888
|
-
type:
|
|
3889
|
-
id:
|
|
3890
|
-
result:
|
|
3974
|
+
import_v418.z.object({
|
|
3975
|
+
type: import_v418.z.literal("image_generation_call"),
|
|
3976
|
+
id: import_v418.z.string(),
|
|
3977
|
+
result: import_v418.z.string()
|
|
3891
3978
|
}),
|
|
3892
|
-
|
|
3893
|
-
type:
|
|
3894
|
-
id:
|
|
3895
|
-
call_id:
|
|
3896
|
-
action:
|
|
3897
|
-
type:
|
|
3898
|
-
command:
|
|
3899
|
-
timeout_ms:
|
|
3900
|
-
user:
|
|
3901
|
-
working_directory:
|
|
3902
|
-
env:
|
|
3979
|
+
import_v418.z.object({
|
|
3980
|
+
type: import_v418.z.literal("local_shell_call"),
|
|
3981
|
+
id: import_v418.z.string(),
|
|
3982
|
+
call_id: import_v418.z.string(),
|
|
3983
|
+
action: import_v418.z.object({
|
|
3984
|
+
type: import_v418.z.literal("exec"),
|
|
3985
|
+
command: import_v418.z.array(import_v418.z.string()),
|
|
3986
|
+
timeout_ms: import_v418.z.number().optional(),
|
|
3987
|
+
user: import_v418.z.string().optional(),
|
|
3988
|
+
working_directory: import_v418.z.string().optional(),
|
|
3989
|
+
env: import_v418.z.record(import_v418.z.string(), import_v418.z.string()).optional()
|
|
3903
3990
|
})
|
|
3904
3991
|
}),
|
|
3905
|
-
|
|
3906
|
-
type:
|
|
3907
|
-
call_id:
|
|
3908
|
-
name:
|
|
3909
|
-
arguments:
|
|
3910
|
-
id:
|
|
3992
|
+
import_v418.z.object({
|
|
3993
|
+
type: import_v418.z.literal("function_call"),
|
|
3994
|
+
call_id: import_v418.z.string(),
|
|
3995
|
+
name: import_v418.z.string(),
|
|
3996
|
+
arguments: import_v418.z.string(),
|
|
3997
|
+
id: import_v418.z.string(),
|
|
3998
|
+
namespace: import_v418.z.string().nullish()
|
|
3911
3999
|
}),
|
|
3912
|
-
|
|
3913
|
-
type:
|
|
3914
|
-
call_id:
|
|
3915
|
-
name:
|
|
3916
|
-
input:
|
|
3917
|
-
id:
|
|
4000
|
+
import_v418.z.object({
|
|
4001
|
+
type: import_v418.z.literal("custom_tool_call"),
|
|
4002
|
+
call_id: import_v418.z.string(),
|
|
4003
|
+
name: import_v418.z.string(),
|
|
4004
|
+
input: import_v418.z.string(),
|
|
4005
|
+
id: import_v418.z.string()
|
|
3918
4006
|
}),
|
|
3919
|
-
|
|
3920
|
-
type:
|
|
3921
|
-
id:
|
|
3922
|
-
status:
|
|
4007
|
+
import_v418.z.object({
|
|
4008
|
+
type: import_v418.z.literal("computer_call"),
|
|
4009
|
+
id: import_v418.z.string(),
|
|
4010
|
+
status: import_v418.z.string().optional()
|
|
3923
4011
|
}),
|
|
3924
|
-
|
|
3925
|
-
type:
|
|
3926
|
-
id:
|
|
3927
|
-
encrypted_content:
|
|
3928
|
-
summary:
|
|
3929
|
-
|
|
3930
|
-
type:
|
|
3931
|
-
text:
|
|
4012
|
+
import_v418.z.object({
|
|
4013
|
+
type: import_v418.z.literal("reasoning"),
|
|
4014
|
+
id: import_v418.z.string(),
|
|
4015
|
+
encrypted_content: import_v418.z.string().nullish(),
|
|
4016
|
+
summary: import_v418.z.array(
|
|
4017
|
+
import_v418.z.object({
|
|
4018
|
+
type: import_v418.z.literal("summary_text"),
|
|
4019
|
+
text: import_v418.z.string()
|
|
3932
4020
|
})
|
|
3933
4021
|
)
|
|
3934
4022
|
}),
|
|
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:
|
|
4023
|
+
import_v418.z.object({
|
|
4024
|
+
type: import_v418.z.literal("mcp_call"),
|
|
4025
|
+
id: import_v418.z.string(),
|
|
4026
|
+
status: import_v418.z.string(),
|
|
4027
|
+
arguments: import_v418.z.string(),
|
|
4028
|
+
name: import_v418.z.string(),
|
|
4029
|
+
server_label: import_v418.z.string(),
|
|
4030
|
+
output: import_v418.z.string().nullish(),
|
|
4031
|
+
error: import_v418.z.union([
|
|
4032
|
+
import_v418.z.string(),
|
|
4033
|
+
import_v418.z.object({
|
|
4034
|
+
type: import_v418.z.string().optional(),
|
|
4035
|
+
code: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).optional(),
|
|
4036
|
+
message: import_v418.z.string().optional()
|
|
3949
4037
|
}).loose()
|
|
3950
4038
|
]).nullish(),
|
|
3951
|
-
approval_request_id:
|
|
4039
|
+
approval_request_id: import_v418.z.string().nullish()
|
|
3952
4040
|
}),
|
|
3953
|
-
|
|
3954
|
-
type:
|
|
3955
|
-
id:
|
|
3956
|
-
server_label:
|
|
3957
|
-
tools:
|
|
3958
|
-
|
|
3959
|
-
name:
|
|
3960
|
-
description:
|
|
3961
|
-
input_schema:
|
|
3962
|
-
annotations:
|
|
4041
|
+
import_v418.z.object({
|
|
4042
|
+
type: import_v418.z.literal("mcp_list_tools"),
|
|
4043
|
+
id: import_v418.z.string(),
|
|
4044
|
+
server_label: import_v418.z.string(),
|
|
4045
|
+
tools: import_v418.z.array(
|
|
4046
|
+
import_v418.z.object({
|
|
4047
|
+
name: import_v418.z.string(),
|
|
4048
|
+
description: import_v418.z.string().optional(),
|
|
4049
|
+
input_schema: import_v418.z.any(),
|
|
4050
|
+
annotations: import_v418.z.record(import_v418.z.string(), import_v418.z.unknown()).optional()
|
|
3963
4051
|
})
|
|
3964
4052
|
),
|
|
3965
|
-
error:
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
type:
|
|
3969
|
-
code:
|
|
3970
|
-
message:
|
|
4053
|
+
error: import_v418.z.union([
|
|
4054
|
+
import_v418.z.string(),
|
|
4055
|
+
import_v418.z.object({
|
|
4056
|
+
type: import_v418.z.string().optional(),
|
|
4057
|
+
code: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).optional(),
|
|
4058
|
+
message: import_v418.z.string().optional()
|
|
3971
4059
|
}).loose()
|
|
3972
4060
|
]).optional()
|
|
3973
4061
|
}),
|
|
3974
|
-
|
|
3975
|
-
type:
|
|
3976
|
-
id:
|
|
3977
|
-
server_label:
|
|
3978
|
-
name:
|
|
3979
|
-
arguments:
|
|
3980
|
-
approval_request_id:
|
|
4062
|
+
import_v418.z.object({
|
|
4063
|
+
type: import_v418.z.literal("mcp_approval_request"),
|
|
4064
|
+
id: import_v418.z.string(),
|
|
4065
|
+
server_label: import_v418.z.string(),
|
|
4066
|
+
name: import_v418.z.string(),
|
|
4067
|
+
arguments: import_v418.z.string(),
|
|
4068
|
+
approval_request_id: import_v418.z.string().optional()
|
|
3981
4069
|
}),
|
|
3982
|
-
|
|
3983
|
-
type:
|
|
3984
|
-
id:
|
|
3985
|
-
call_id:
|
|
3986
|
-
status:
|
|
3987
|
-
operation:
|
|
3988
|
-
|
|
3989
|
-
type:
|
|
3990
|
-
path:
|
|
3991
|
-
diff:
|
|
4070
|
+
import_v418.z.object({
|
|
4071
|
+
type: import_v418.z.literal("apply_patch_call"),
|
|
4072
|
+
id: import_v418.z.string(),
|
|
4073
|
+
call_id: import_v418.z.string(),
|
|
4074
|
+
status: import_v418.z.enum(["in_progress", "completed"]),
|
|
4075
|
+
operation: import_v418.z.discriminatedUnion("type", [
|
|
4076
|
+
import_v418.z.object({
|
|
4077
|
+
type: import_v418.z.literal("create_file"),
|
|
4078
|
+
path: import_v418.z.string(),
|
|
4079
|
+
diff: import_v418.z.string()
|
|
3992
4080
|
}),
|
|
3993
|
-
|
|
3994
|
-
type:
|
|
3995
|
-
path:
|
|
4081
|
+
import_v418.z.object({
|
|
4082
|
+
type: import_v418.z.literal("delete_file"),
|
|
4083
|
+
path: import_v418.z.string()
|
|
3996
4084
|
}),
|
|
3997
|
-
|
|
3998
|
-
type:
|
|
3999
|
-
path:
|
|
4000
|
-
diff:
|
|
4085
|
+
import_v418.z.object({
|
|
4086
|
+
type: import_v418.z.literal("update_file"),
|
|
4087
|
+
path: import_v418.z.string(),
|
|
4088
|
+
diff: import_v418.z.string()
|
|
4001
4089
|
})
|
|
4002
4090
|
])
|
|
4003
4091
|
}),
|
|
4004
|
-
|
|
4005
|
-
type:
|
|
4006
|
-
id:
|
|
4007
|
-
call_id:
|
|
4008
|
-
status:
|
|
4009
|
-
action:
|
|
4010
|
-
commands:
|
|
4092
|
+
import_v418.z.object({
|
|
4093
|
+
type: import_v418.z.literal("shell_call"),
|
|
4094
|
+
id: import_v418.z.string(),
|
|
4095
|
+
call_id: import_v418.z.string(),
|
|
4096
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4097
|
+
action: import_v418.z.object({
|
|
4098
|
+
commands: import_v418.z.array(import_v418.z.string())
|
|
4011
4099
|
})
|
|
4012
4100
|
}),
|
|
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:
|
|
4101
|
+
import_v418.z.object({
|
|
4102
|
+
type: import_v418.z.literal("shell_call_output"),
|
|
4103
|
+
id: import_v418.z.string(),
|
|
4104
|
+
call_id: import_v418.z.string(),
|
|
4105
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4106
|
+
output: import_v418.z.array(
|
|
4107
|
+
import_v418.z.object({
|
|
4108
|
+
stdout: import_v418.z.string(),
|
|
4109
|
+
stderr: import_v418.z.string(),
|
|
4110
|
+
outcome: import_v418.z.discriminatedUnion("type", [
|
|
4111
|
+
import_v418.z.object({ type: import_v418.z.literal("timeout") }),
|
|
4112
|
+
import_v418.z.object({
|
|
4113
|
+
type: import_v418.z.literal("exit"),
|
|
4114
|
+
exit_code: import_v418.z.number()
|
|
4027
4115
|
})
|
|
4028
4116
|
])
|
|
4029
4117
|
})
|
|
4030
4118
|
)
|
|
4031
4119
|
}),
|
|
4032
|
-
|
|
4033
|
-
type:
|
|
4034
|
-
id:
|
|
4035
|
-
execution:
|
|
4036
|
-
call_id:
|
|
4037
|
-
status:
|
|
4038
|
-
arguments:
|
|
4120
|
+
import_v418.z.object({
|
|
4121
|
+
type: import_v418.z.literal("tool_search_call"),
|
|
4122
|
+
id: import_v418.z.string(),
|
|
4123
|
+
execution: import_v418.z.enum(["server", "client"]),
|
|
4124
|
+
call_id: import_v418.z.string().nullable(),
|
|
4125
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4126
|
+
arguments: import_v418.z.unknown()
|
|
4039
4127
|
}),
|
|
4040
|
-
|
|
4041
|
-
type:
|
|
4042
|
-
id:
|
|
4043
|
-
execution:
|
|
4044
|
-
call_id:
|
|
4045
|
-
status:
|
|
4046
|
-
tools:
|
|
4128
|
+
import_v418.z.object({
|
|
4129
|
+
type: import_v418.z.literal("tool_search_output"),
|
|
4130
|
+
id: import_v418.z.string(),
|
|
4131
|
+
execution: import_v418.z.enum(["server", "client"]),
|
|
4132
|
+
call_id: import_v418.z.string().nullable(),
|
|
4133
|
+
status: import_v418.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4134
|
+
tools: import_v418.z.array(import_v418.z.record(import_v418.z.string(), jsonValueSchema.optional()))
|
|
4047
4135
|
})
|
|
4048
4136
|
])
|
|
4049
4137
|
).optional(),
|
|
4050
|
-
service_tier:
|
|
4051
|
-
incomplete_details:
|
|
4052
|
-
usage:
|
|
4053
|
-
input_tokens:
|
|
4054
|
-
input_tokens_details:
|
|
4055
|
-
output_tokens:
|
|
4056
|
-
output_tokens_details:
|
|
4138
|
+
service_tier: import_v418.z.string().nullish(),
|
|
4139
|
+
incomplete_details: import_v418.z.object({ reason: import_v418.z.string() }).nullish(),
|
|
4140
|
+
usage: import_v418.z.object({
|
|
4141
|
+
input_tokens: import_v418.z.number(),
|
|
4142
|
+
input_tokens_details: import_v418.z.object({ cached_tokens: import_v418.z.number().nullish() }).nullish(),
|
|
4143
|
+
output_tokens: import_v418.z.number(),
|
|
4144
|
+
output_tokens_details: import_v418.z.object({ reasoning_tokens: import_v418.z.number().nullish() }).nullish()
|
|
4057
4145
|
}).optional()
|
|
4058
4146
|
})
|
|
4059
4147
|
)
|
|
4060
4148
|
);
|
|
4061
4149
|
|
|
4062
4150
|
// src/responses/openai-responses-options.ts
|
|
4063
|
-
var
|
|
4064
|
-
var
|
|
4151
|
+
var import_provider_utils26 = require("@ai-sdk/provider-utils");
|
|
4152
|
+
var import_v419 = require("zod/v4");
|
|
4065
4153
|
var TOP_LOGPROBS_MAX = 20;
|
|
4066
4154
|
var openaiResponsesReasoningModelIds = [
|
|
4067
4155
|
"o1",
|
|
@@ -4126,9 +4214,9 @@ var openaiResponsesModelIds = [
|
|
|
4126
4214
|
"gpt-5-chat-latest",
|
|
4127
4215
|
...openaiResponsesReasoningModelIds
|
|
4128
4216
|
];
|
|
4129
|
-
var openaiLanguageModelResponsesOptionsSchema = (0,
|
|
4130
|
-
() => (0,
|
|
4131
|
-
|
|
4217
|
+
var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils26.lazySchema)(
|
|
4218
|
+
() => (0, import_provider_utils26.zodSchema)(
|
|
4219
|
+
import_v419.z.object({
|
|
4132
4220
|
/**
|
|
4133
4221
|
* The ID of the OpenAI Conversation to continue.
|
|
4134
4222
|
* You must create a conversation first via the OpenAI API.
|
|
@@ -4136,13 +4224,13 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
|
|
|
4136
4224
|
* Defaults to `undefined`.
|
|
4137
4225
|
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
4138
4226
|
*/
|
|
4139
|
-
conversation:
|
|
4227
|
+
conversation: import_v419.z.string().nullish(),
|
|
4140
4228
|
/**
|
|
4141
4229
|
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
4142
4230
|
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
|
|
4143
4231
|
*/
|
|
4144
|
-
include:
|
|
4145
|
-
|
|
4232
|
+
include: import_v419.z.array(
|
|
4233
|
+
import_v419.z.enum([
|
|
4146
4234
|
"reasoning.encrypted_content",
|
|
4147
4235
|
// handled internally by default, only needed for unknown reasoning models
|
|
4148
4236
|
"file_search_call.results",
|
|
@@ -4154,7 +4242,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
|
|
|
4154
4242
|
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
4155
4243
|
* Defaults to `undefined`.
|
|
4156
4244
|
*/
|
|
4157
|
-
instructions:
|
|
4245
|
+
instructions: import_v419.z.string().nullish(),
|
|
4158
4246
|
/**
|
|
4159
4247
|
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
4160
4248
|
* the response size and can slow down response times. However, it can
|
|
@@ -4169,30 +4257,30 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
|
|
|
4169
4257
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
4170
4258
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
4171
4259
|
*/
|
|
4172
|
-
logprobs:
|
|
4260
|
+
logprobs: import_v419.z.union([import_v419.z.boolean(), import_v419.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
4173
4261
|
/**
|
|
4174
4262
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
4175
4263
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
4176
4264
|
* Any further attempts to call a tool by the model will be ignored.
|
|
4177
4265
|
*/
|
|
4178
|
-
maxToolCalls:
|
|
4266
|
+
maxToolCalls: import_v419.z.number().nullish(),
|
|
4179
4267
|
/**
|
|
4180
4268
|
* Additional metadata to store with the generation.
|
|
4181
4269
|
*/
|
|
4182
|
-
metadata:
|
|
4270
|
+
metadata: import_v419.z.any().nullish(),
|
|
4183
4271
|
/**
|
|
4184
4272
|
* Whether to use parallel tool calls. Defaults to `true`.
|
|
4185
4273
|
*/
|
|
4186
|
-
parallelToolCalls:
|
|
4274
|
+
parallelToolCalls: import_v419.z.boolean().nullish(),
|
|
4187
4275
|
/**
|
|
4188
4276
|
* The ID of the previous response. You can use it to continue a conversation.
|
|
4189
4277
|
* Defaults to `undefined`.
|
|
4190
4278
|
*/
|
|
4191
|
-
previousResponseId:
|
|
4279
|
+
previousResponseId: import_v419.z.string().nullish(),
|
|
4192
4280
|
/**
|
|
4193
4281
|
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
4194
4282
|
*/
|
|
4195
|
-
promptCacheKey:
|
|
4283
|
+
promptCacheKey: import_v419.z.string().nullish(),
|
|
4196
4284
|
/**
|
|
4197
4285
|
* The retention policy for the prompt cache.
|
|
4198
4286
|
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
@@ -4201,7 +4289,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
|
|
|
4201
4289
|
*
|
|
4202
4290
|
* @default 'in_memory'
|
|
4203
4291
|
*/
|
|
4204
|
-
promptCacheRetention:
|
|
4292
|
+
promptCacheRetention: import_v419.z.enum(["in_memory", "24h"]).nullish(),
|
|
4205
4293
|
/**
|
|
4206
4294
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
4207
4295
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
@@ -4212,17 +4300,17 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
|
|
|
4212
4300
|
* OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
|
|
4213
4301
|
* an error.
|
|
4214
4302
|
*/
|
|
4215
|
-
reasoningEffort:
|
|
4303
|
+
reasoningEffort: import_v419.z.string().nullish(),
|
|
4216
4304
|
/**
|
|
4217
4305
|
* Controls reasoning summary output from the model.
|
|
4218
4306
|
* Set to "auto" to automatically receive the richest level available,
|
|
4219
4307
|
* or "detailed" for comprehensive summaries.
|
|
4220
4308
|
*/
|
|
4221
|
-
reasoningSummary:
|
|
4309
|
+
reasoningSummary: import_v419.z.string().nullish(),
|
|
4222
4310
|
/**
|
|
4223
4311
|
* The identifier for safety monitoring and tracking.
|
|
4224
4312
|
*/
|
|
4225
|
-
safetyIdentifier:
|
|
4313
|
+
safetyIdentifier: import_v419.z.string().nullish(),
|
|
4226
4314
|
/**
|
|
4227
4315
|
* Service tier for the request.
|
|
4228
4316
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
@@ -4230,34 +4318,34 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
|
|
|
4230
4318
|
*
|
|
4231
4319
|
* Defaults to 'auto'.
|
|
4232
4320
|
*/
|
|
4233
|
-
serviceTier:
|
|
4321
|
+
serviceTier: import_v419.z.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
4234
4322
|
/**
|
|
4235
4323
|
* Whether to store the generation. Defaults to `true`.
|
|
4236
4324
|
*/
|
|
4237
|
-
store:
|
|
4325
|
+
store: import_v419.z.boolean().nullish(),
|
|
4238
4326
|
/**
|
|
4239
4327
|
* Whether to use strict JSON schema validation.
|
|
4240
4328
|
* Defaults to `true`.
|
|
4241
4329
|
*/
|
|
4242
|
-
strictJsonSchema:
|
|
4330
|
+
strictJsonSchema: import_v419.z.boolean().nullish(),
|
|
4243
4331
|
/**
|
|
4244
4332
|
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
4245
4333
|
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
4246
4334
|
* Valid values: 'low', 'medium', 'high'.
|
|
4247
4335
|
*/
|
|
4248
|
-
textVerbosity:
|
|
4336
|
+
textVerbosity: import_v419.z.enum(["low", "medium", "high"]).nullish(),
|
|
4249
4337
|
/**
|
|
4250
4338
|
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
4251
4339
|
* 'disabled' turns truncation off.
|
|
4252
4340
|
*/
|
|
4253
|
-
truncation:
|
|
4341
|
+
truncation: import_v419.z.enum(["auto", "disabled"]).nullish(),
|
|
4254
4342
|
/**
|
|
4255
4343
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
4256
4344
|
* monitor and detect abuse.
|
|
4257
4345
|
* Defaults to `undefined`.
|
|
4258
4346
|
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
4259
4347
|
*/
|
|
4260
|
-
user:
|
|
4348
|
+
user: import_v419.z.string().nullish(),
|
|
4261
4349
|
/**
|
|
4262
4350
|
* Override the system message mode for this model.
|
|
4263
4351
|
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
@@ -4266,7 +4354,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
|
|
|
4266
4354
|
*
|
|
4267
4355
|
* If not specified, the mode is automatically determined based on the model.
|
|
4268
4356
|
*/
|
|
4269
|
-
systemMessageMode:
|
|
4357
|
+
systemMessageMode: import_v419.z.enum(["system", "developer", "remove"]).optional(),
|
|
4270
4358
|
/**
|
|
4271
4359
|
* Force treating this model as a reasoning model.
|
|
4272
4360
|
*
|
|
@@ -4276,51 +4364,51 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils25.lazy
|
|
|
4276
4364
|
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
4277
4365
|
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
4278
4366
|
*/
|
|
4279
|
-
forceReasoning:
|
|
4367
|
+
forceReasoning: import_v419.z.boolean().optional()
|
|
4280
4368
|
})
|
|
4281
4369
|
)
|
|
4282
4370
|
);
|
|
4283
4371
|
|
|
4284
4372
|
// src/responses/openai-responses-prepare-tools.ts
|
|
4285
4373
|
var import_provider7 = require("@ai-sdk/provider");
|
|
4286
|
-
var
|
|
4374
|
+
var import_provider_utils34 = require("@ai-sdk/provider-utils");
|
|
4287
4375
|
|
|
4288
4376
|
// src/tool/code-interpreter.ts
|
|
4289
|
-
var
|
|
4290
|
-
var
|
|
4291
|
-
var codeInterpreterInputSchema = (0,
|
|
4292
|
-
() => (0,
|
|
4293
|
-
|
|
4294
|
-
code:
|
|
4295
|
-
containerId:
|
|
4377
|
+
var import_provider_utils27 = require("@ai-sdk/provider-utils");
|
|
4378
|
+
var import_v420 = require("zod/v4");
|
|
4379
|
+
var codeInterpreterInputSchema = (0, import_provider_utils27.lazySchema)(
|
|
4380
|
+
() => (0, import_provider_utils27.zodSchema)(
|
|
4381
|
+
import_v420.z.object({
|
|
4382
|
+
code: import_v420.z.string().nullish(),
|
|
4383
|
+
containerId: import_v420.z.string()
|
|
4296
4384
|
})
|
|
4297
4385
|
)
|
|
4298
4386
|
);
|
|
4299
|
-
var codeInterpreterOutputSchema = (0,
|
|
4300
|
-
() => (0,
|
|
4301
|
-
|
|
4302
|
-
outputs:
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4387
|
+
var codeInterpreterOutputSchema = (0, import_provider_utils27.lazySchema)(
|
|
4388
|
+
() => (0, import_provider_utils27.zodSchema)(
|
|
4389
|
+
import_v420.z.object({
|
|
4390
|
+
outputs: import_v420.z.array(
|
|
4391
|
+
import_v420.z.discriminatedUnion("type", [
|
|
4392
|
+
import_v420.z.object({ type: import_v420.z.literal("logs"), logs: import_v420.z.string() }),
|
|
4393
|
+
import_v420.z.object({ type: import_v420.z.literal("image"), url: import_v420.z.string() })
|
|
4306
4394
|
])
|
|
4307
4395
|
).nullish()
|
|
4308
4396
|
})
|
|
4309
4397
|
)
|
|
4310
4398
|
);
|
|
4311
|
-
var codeInterpreterArgsSchema = (0,
|
|
4312
|
-
() => (0,
|
|
4313
|
-
|
|
4314
|
-
container:
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
fileIds:
|
|
4399
|
+
var codeInterpreterArgsSchema = (0, import_provider_utils27.lazySchema)(
|
|
4400
|
+
() => (0, import_provider_utils27.zodSchema)(
|
|
4401
|
+
import_v420.z.object({
|
|
4402
|
+
container: import_v420.z.union([
|
|
4403
|
+
import_v420.z.string(),
|
|
4404
|
+
import_v420.z.object({
|
|
4405
|
+
fileIds: import_v420.z.array(import_v420.z.string()).optional()
|
|
4318
4406
|
})
|
|
4319
4407
|
]).optional()
|
|
4320
4408
|
})
|
|
4321
4409
|
)
|
|
4322
4410
|
);
|
|
4323
|
-
var codeInterpreterToolFactory = (0,
|
|
4411
|
+
var codeInterpreterToolFactory = (0, import_provider_utils27.createProviderToolFactoryWithOutputSchema)({
|
|
4324
4412
|
id: "openai.code_interpreter",
|
|
4325
4413
|
inputSchema: codeInterpreterInputSchema,
|
|
4326
4414
|
outputSchema: codeInterpreterOutputSchema
|
|
@@ -4330,81 +4418,81 @@ var codeInterpreter = (args = {}) => {
|
|
|
4330
4418
|
};
|
|
4331
4419
|
|
|
4332
4420
|
// src/tool/file-search.ts
|
|
4333
|
-
var
|
|
4334
|
-
var
|
|
4335
|
-
var comparisonFilterSchema =
|
|
4336
|
-
key:
|
|
4337
|
-
type:
|
|
4338
|
-
value:
|
|
4421
|
+
var import_provider_utils28 = require("@ai-sdk/provider-utils");
|
|
4422
|
+
var import_v421 = require("zod/v4");
|
|
4423
|
+
var comparisonFilterSchema = import_v421.z.object({
|
|
4424
|
+
key: import_v421.z.string(),
|
|
4425
|
+
type: import_v421.z.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
4426
|
+
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
4427
|
});
|
|
4340
|
-
var compoundFilterSchema =
|
|
4341
|
-
type:
|
|
4342
|
-
filters:
|
|
4343
|
-
|
|
4428
|
+
var compoundFilterSchema = import_v421.z.object({
|
|
4429
|
+
type: import_v421.z.enum(["and", "or"]),
|
|
4430
|
+
filters: import_v421.z.array(
|
|
4431
|
+
import_v421.z.union([comparisonFilterSchema, import_v421.z.lazy(() => compoundFilterSchema)])
|
|
4344
4432
|
)
|
|
4345
4433
|
});
|
|
4346
|
-
var fileSearchArgsSchema = (0,
|
|
4347
|
-
() => (0,
|
|
4348
|
-
|
|
4349
|
-
vectorStoreIds:
|
|
4350
|
-
maxNumResults:
|
|
4351
|
-
ranking:
|
|
4352
|
-
ranker:
|
|
4353
|
-
scoreThreshold:
|
|
4434
|
+
var fileSearchArgsSchema = (0, import_provider_utils28.lazySchema)(
|
|
4435
|
+
() => (0, import_provider_utils28.zodSchema)(
|
|
4436
|
+
import_v421.z.object({
|
|
4437
|
+
vectorStoreIds: import_v421.z.array(import_v421.z.string()),
|
|
4438
|
+
maxNumResults: import_v421.z.number().optional(),
|
|
4439
|
+
ranking: import_v421.z.object({
|
|
4440
|
+
ranker: import_v421.z.string().optional(),
|
|
4441
|
+
scoreThreshold: import_v421.z.number().optional()
|
|
4354
4442
|
}).optional(),
|
|
4355
|
-
filters:
|
|
4443
|
+
filters: import_v421.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
4356
4444
|
})
|
|
4357
4445
|
)
|
|
4358
4446
|
);
|
|
4359
|
-
var fileSearchOutputSchema = (0,
|
|
4360
|
-
() => (0,
|
|
4361
|
-
|
|
4362
|
-
queries:
|
|
4363
|
-
results:
|
|
4364
|
-
|
|
4365
|
-
attributes:
|
|
4366
|
-
fileId:
|
|
4367
|
-
filename:
|
|
4368
|
-
score:
|
|
4369
|
-
text:
|
|
4447
|
+
var fileSearchOutputSchema = (0, import_provider_utils28.lazySchema)(
|
|
4448
|
+
() => (0, import_provider_utils28.zodSchema)(
|
|
4449
|
+
import_v421.z.object({
|
|
4450
|
+
queries: import_v421.z.array(import_v421.z.string()),
|
|
4451
|
+
results: import_v421.z.array(
|
|
4452
|
+
import_v421.z.object({
|
|
4453
|
+
attributes: import_v421.z.record(import_v421.z.string(), import_v421.z.unknown()),
|
|
4454
|
+
fileId: import_v421.z.string(),
|
|
4455
|
+
filename: import_v421.z.string(),
|
|
4456
|
+
score: import_v421.z.number(),
|
|
4457
|
+
text: import_v421.z.string()
|
|
4370
4458
|
})
|
|
4371
4459
|
).nullable()
|
|
4372
4460
|
})
|
|
4373
4461
|
)
|
|
4374
4462
|
);
|
|
4375
|
-
var fileSearch = (0,
|
|
4463
|
+
var fileSearch = (0, import_provider_utils28.createProviderToolFactoryWithOutputSchema)({
|
|
4376
4464
|
id: "openai.file_search",
|
|
4377
|
-
inputSchema:
|
|
4465
|
+
inputSchema: import_v421.z.object({}),
|
|
4378
4466
|
outputSchema: fileSearchOutputSchema
|
|
4379
4467
|
});
|
|
4380
4468
|
|
|
4381
4469
|
// 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:
|
|
4470
|
+
var import_provider_utils29 = require("@ai-sdk/provider-utils");
|
|
4471
|
+
var import_v422 = require("zod/v4");
|
|
4472
|
+
var imageGenerationArgsSchema = (0, import_provider_utils29.lazySchema)(
|
|
4473
|
+
() => (0, import_provider_utils29.zodSchema)(
|
|
4474
|
+
import_v422.z.object({
|
|
4475
|
+
background: import_v422.z.enum(["auto", "opaque", "transparent"]).optional(),
|
|
4476
|
+
inputFidelity: import_v422.z.enum(["low", "high"]).optional(),
|
|
4477
|
+
inputImageMask: import_v422.z.object({
|
|
4478
|
+
fileId: import_v422.z.string().optional(),
|
|
4479
|
+
imageUrl: import_v422.z.string().optional()
|
|
4392
4480
|
}).optional(),
|
|
4393
|
-
model:
|
|
4394
|
-
moderation:
|
|
4395
|
-
outputCompression:
|
|
4396
|
-
outputFormat:
|
|
4397
|
-
partialImages:
|
|
4398
|
-
quality:
|
|
4399
|
-
size:
|
|
4481
|
+
model: import_v422.z.string().optional(),
|
|
4482
|
+
moderation: import_v422.z.enum(["auto"]).optional(),
|
|
4483
|
+
outputCompression: import_v422.z.number().int().min(0).max(100).optional(),
|
|
4484
|
+
outputFormat: import_v422.z.enum(["png", "jpeg", "webp"]).optional(),
|
|
4485
|
+
partialImages: import_v422.z.number().int().min(0).max(3).optional(),
|
|
4486
|
+
quality: import_v422.z.enum(["auto", "low", "medium", "high"]).optional(),
|
|
4487
|
+
size: import_v422.z.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
4400
4488
|
}).strict()
|
|
4401
4489
|
)
|
|
4402
4490
|
);
|
|
4403
|
-
var imageGenerationInputSchema = (0,
|
|
4404
|
-
var imageGenerationOutputSchema = (0,
|
|
4405
|
-
() => (0,
|
|
4491
|
+
var imageGenerationInputSchema = (0, import_provider_utils29.lazySchema)(() => (0, import_provider_utils29.zodSchema)(import_v422.z.object({})));
|
|
4492
|
+
var imageGenerationOutputSchema = (0, import_provider_utils29.lazySchema)(
|
|
4493
|
+
() => (0, import_provider_utils29.zodSchema)(import_v422.z.object({ result: import_v422.z.string() }))
|
|
4406
4494
|
);
|
|
4407
|
-
var imageGenerationToolFactory = (0,
|
|
4495
|
+
var imageGenerationToolFactory = (0, import_provider_utils29.createProviderToolFactoryWithOutputSchema)({
|
|
4408
4496
|
id: "openai.image_generation",
|
|
4409
4497
|
inputSchema: imageGenerationInputSchema,
|
|
4410
4498
|
outputSchema: imageGenerationOutputSchema
|
|
@@ -4414,153 +4502,102 @@ var imageGeneration = (args = {}) => {
|
|
|
4414
4502
|
};
|
|
4415
4503
|
|
|
4416
4504
|
// 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:
|
|
4505
|
+
var import_provider_utils30 = require("@ai-sdk/provider-utils");
|
|
4506
|
+
var import_v423 = require("zod/v4");
|
|
4507
|
+
var customArgsSchema = (0, import_provider_utils30.lazySchema)(
|
|
4508
|
+
() => (0, import_provider_utils30.zodSchema)(
|
|
4509
|
+
import_v423.z.object({
|
|
4510
|
+
name: import_v423.z.string(),
|
|
4511
|
+
description: import_v423.z.string().optional(),
|
|
4512
|
+
format: import_v423.z.union([
|
|
4513
|
+
import_v423.z.object({
|
|
4514
|
+
type: import_v423.z.literal("grammar"),
|
|
4515
|
+
syntax: import_v423.z.enum(["regex", "lark"]),
|
|
4516
|
+
definition: import_v423.z.string()
|
|
4429
4517
|
}),
|
|
4430
|
-
|
|
4431
|
-
type:
|
|
4518
|
+
import_v423.z.object({
|
|
4519
|
+
type: import_v423.z.literal("text")
|
|
4432
4520
|
})
|
|
4433
4521
|
]).optional()
|
|
4434
4522
|
})
|
|
4435
4523
|
)
|
|
4436
4524
|
);
|
|
4437
|
-
var customInputSchema = (0,
|
|
4438
|
-
var customToolFactory = (0,
|
|
4525
|
+
var customInputSchema = (0, import_provider_utils30.lazySchema)(() => (0, import_provider_utils30.zodSchema)(import_v423.z.string()));
|
|
4526
|
+
var customToolFactory = (0, import_provider_utils30.createProviderToolFactory)({
|
|
4439
4527
|
id: "openai.custom",
|
|
4440
4528
|
inputSchema: customInputSchema
|
|
4441
4529
|
});
|
|
4442
4530
|
|
|
4443
4531
|
// src/tool/mcp.ts
|
|
4444
|
-
var
|
|
4445
|
-
var
|
|
4446
|
-
var jsonValueSchema2 =
|
|
4447
|
-
() =>
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4532
|
+
var import_provider_utils31 = require("@ai-sdk/provider-utils");
|
|
4533
|
+
var import_v424 = require("zod/v4");
|
|
4534
|
+
var jsonValueSchema2 = import_v424.z.lazy(
|
|
4535
|
+
() => import_v424.z.union([
|
|
4536
|
+
import_v424.z.string(),
|
|
4537
|
+
import_v424.z.number(),
|
|
4538
|
+
import_v424.z.boolean(),
|
|
4539
|
+
import_v424.z.null(),
|
|
4540
|
+
import_v424.z.array(jsonValueSchema2),
|
|
4541
|
+
import_v424.z.record(import_v424.z.string(), jsonValueSchema2)
|
|
4454
4542
|
])
|
|
4455
4543
|
);
|
|
4456
|
-
var mcpArgsSchema = (0,
|
|
4457
|
-
() => (0,
|
|
4458
|
-
|
|
4459
|
-
serverLabel:
|
|
4460
|
-
allowedTools:
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
readOnly:
|
|
4464
|
-
toolNames:
|
|
4544
|
+
var mcpArgsSchema = (0, import_provider_utils31.lazySchema)(
|
|
4545
|
+
() => (0, import_provider_utils31.zodSchema)(
|
|
4546
|
+
import_v424.z.object({
|
|
4547
|
+
serverLabel: import_v424.z.string(),
|
|
4548
|
+
allowedTools: import_v424.z.union([
|
|
4549
|
+
import_v424.z.array(import_v424.z.string()),
|
|
4550
|
+
import_v424.z.object({
|
|
4551
|
+
readOnly: import_v424.z.boolean().optional(),
|
|
4552
|
+
toolNames: import_v424.z.array(import_v424.z.string()).optional()
|
|
4465
4553
|
})
|
|
4466
4554
|
]).optional(),
|
|
4467
|
-
authorization:
|
|
4468
|
-
connectorId:
|
|
4469
|
-
headers:
|
|
4470
|
-
requireApproval:
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
never:
|
|
4474
|
-
toolNames:
|
|
4555
|
+
authorization: import_v424.z.string().optional(),
|
|
4556
|
+
connectorId: import_v424.z.string().optional(),
|
|
4557
|
+
headers: import_v424.z.record(import_v424.z.string(), import_v424.z.string()).optional(),
|
|
4558
|
+
requireApproval: import_v424.z.union([
|
|
4559
|
+
import_v424.z.enum(["always", "never"]),
|
|
4560
|
+
import_v424.z.object({
|
|
4561
|
+
never: import_v424.z.object({
|
|
4562
|
+
toolNames: import_v424.z.array(import_v424.z.string()).optional()
|
|
4475
4563
|
}).optional()
|
|
4476
4564
|
})
|
|
4477
4565
|
]).optional(),
|
|
4478
|
-
serverDescription:
|
|
4479
|
-
serverUrl:
|
|
4566
|
+
serverDescription: import_v424.z.string().optional(),
|
|
4567
|
+
serverUrl: import_v424.z.string().optional()
|
|
4480
4568
|
}).refine(
|
|
4481
4569
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
4482
4570
|
"One of serverUrl or connectorId must be provided."
|
|
4483
4571
|
)
|
|
4484
4572
|
)
|
|
4485
4573
|
);
|
|
4486
|
-
var mcpInputSchema = (0,
|
|
4487
|
-
var mcpOutputSchema = (0,
|
|
4488
|
-
() => (0,
|
|
4489
|
-
|
|
4490
|
-
type:
|
|
4491
|
-
serverLabel:
|
|
4492
|
-
name:
|
|
4493
|
-
arguments:
|
|
4494
|
-
output:
|
|
4495
|
-
error:
|
|
4574
|
+
var mcpInputSchema = (0, import_provider_utils31.lazySchema)(() => (0, import_provider_utils31.zodSchema)(import_v424.z.object({})));
|
|
4575
|
+
var mcpOutputSchema = (0, import_provider_utils31.lazySchema)(
|
|
4576
|
+
() => (0, import_provider_utils31.zodSchema)(
|
|
4577
|
+
import_v424.z.object({
|
|
4578
|
+
type: import_v424.z.literal("call"),
|
|
4579
|
+
serverLabel: import_v424.z.string(),
|
|
4580
|
+
name: import_v424.z.string(),
|
|
4581
|
+
arguments: import_v424.z.string(),
|
|
4582
|
+
output: import_v424.z.string().nullish(),
|
|
4583
|
+
error: import_v424.z.union([import_v424.z.string(), jsonValueSchema2]).optional()
|
|
4496
4584
|
})
|
|
4497
4585
|
)
|
|
4498
4586
|
);
|
|
4499
|
-
var mcpToolFactory = (0,
|
|
4587
|
+
var mcpToolFactory = (0, import_provider_utils31.createProviderToolFactoryWithOutputSchema)({
|
|
4500
4588
|
id: "openai.mcp",
|
|
4501
4589
|
inputSchema: mcpInputSchema,
|
|
4502
4590
|
outputSchema: mcpOutputSchema
|
|
4503
4591
|
});
|
|
4504
4592
|
|
|
4505
4593
|
// 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
4594
|
var import_provider_utils32 = require("@ai-sdk/provider-utils");
|
|
4560
4595
|
var import_v425 = require("zod/v4");
|
|
4561
|
-
var
|
|
4596
|
+
var webSearchArgsSchema = (0, import_provider_utils32.lazySchema)(
|
|
4562
4597
|
() => (0, import_provider_utils32.zodSchema)(
|
|
4563
4598
|
import_v425.z.object({
|
|
4599
|
+
externalWebAccess: import_v425.z.boolean().optional(),
|
|
4600
|
+
filters: import_v425.z.object({ allowedDomains: import_v425.z.array(import_v425.z.string()).optional() }).optional(),
|
|
4564
4601
|
searchContextSize: import_v425.z.enum(["low", "medium", "high"]).optional(),
|
|
4565
4602
|
userLocation: import_v425.z.object({
|
|
4566
4603
|
type: import_v425.z.literal("approximate"),
|
|
@@ -4572,10 +4609,8 @@ var webSearchPreviewArgsSchema = (0, import_provider_utils32.lazySchema)(
|
|
|
4572
4609
|
})
|
|
4573
4610
|
)
|
|
4574
4611
|
);
|
|
4575
|
-
var
|
|
4576
|
-
|
|
4577
|
-
);
|
|
4578
|
-
var webSearchPreviewOutputSchema = (0, import_provider_utils32.lazySchema)(
|
|
4612
|
+
var webSearchInputSchema = (0, import_provider_utils32.lazySchema)(() => (0, import_provider_utils32.zodSchema)(import_v425.z.object({})));
|
|
4613
|
+
var webSearchOutputSchema = (0, import_provider_utils32.lazySchema)(
|
|
4579
4614
|
() => (0, import_provider_utils32.zodSchema)(
|
|
4580
4615
|
import_v425.z.object({
|
|
4581
4616
|
action: import_v425.z.discriminatedUnion("type", [
|
|
@@ -4592,11 +4627,64 @@ var webSearchPreviewOutputSchema = (0, import_provider_utils32.lazySchema)(
|
|
|
4592
4627
|
url: import_v425.z.string().nullish(),
|
|
4593
4628
|
pattern: import_v425.z.string().nullish()
|
|
4594
4629
|
})
|
|
4630
|
+
]).optional(),
|
|
4631
|
+
sources: import_v425.z.array(
|
|
4632
|
+
import_v425.z.discriminatedUnion("type", [
|
|
4633
|
+
import_v425.z.object({ type: import_v425.z.literal("url"), url: import_v425.z.string() }),
|
|
4634
|
+
import_v425.z.object({ type: import_v425.z.literal("api"), name: import_v425.z.string() })
|
|
4635
|
+
])
|
|
4636
|
+
).optional()
|
|
4637
|
+
})
|
|
4638
|
+
)
|
|
4639
|
+
);
|
|
4640
|
+
var webSearchToolFactory = (0, import_provider_utils32.createProviderToolFactoryWithOutputSchema)({
|
|
4641
|
+
id: "openai.web_search",
|
|
4642
|
+
inputSchema: webSearchInputSchema,
|
|
4643
|
+
outputSchema: webSearchOutputSchema
|
|
4644
|
+
});
|
|
4645
|
+
|
|
4646
|
+
// src/tool/web-search-preview.ts
|
|
4647
|
+
var import_provider_utils33 = require("@ai-sdk/provider-utils");
|
|
4648
|
+
var import_v426 = require("zod/v4");
|
|
4649
|
+
var webSearchPreviewArgsSchema = (0, import_provider_utils33.lazySchema)(
|
|
4650
|
+
() => (0, import_provider_utils33.zodSchema)(
|
|
4651
|
+
import_v426.z.object({
|
|
4652
|
+
searchContextSize: import_v426.z.enum(["low", "medium", "high"]).optional(),
|
|
4653
|
+
userLocation: import_v426.z.object({
|
|
4654
|
+
type: import_v426.z.literal("approximate"),
|
|
4655
|
+
country: import_v426.z.string().optional(),
|
|
4656
|
+
city: import_v426.z.string().optional(),
|
|
4657
|
+
region: import_v426.z.string().optional(),
|
|
4658
|
+
timezone: import_v426.z.string().optional()
|
|
4659
|
+
}).optional()
|
|
4660
|
+
})
|
|
4661
|
+
)
|
|
4662
|
+
);
|
|
4663
|
+
var webSearchPreviewInputSchema = (0, import_provider_utils33.lazySchema)(
|
|
4664
|
+
() => (0, import_provider_utils33.zodSchema)(import_v426.z.object({}))
|
|
4665
|
+
);
|
|
4666
|
+
var webSearchPreviewOutputSchema = (0, import_provider_utils33.lazySchema)(
|
|
4667
|
+
() => (0, import_provider_utils33.zodSchema)(
|
|
4668
|
+
import_v426.z.object({
|
|
4669
|
+
action: import_v426.z.discriminatedUnion("type", [
|
|
4670
|
+
import_v426.z.object({
|
|
4671
|
+
type: import_v426.z.literal("search"),
|
|
4672
|
+
query: import_v426.z.string().optional()
|
|
4673
|
+
}),
|
|
4674
|
+
import_v426.z.object({
|
|
4675
|
+
type: import_v426.z.literal("openPage"),
|
|
4676
|
+
url: import_v426.z.string().nullish()
|
|
4677
|
+
}),
|
|
4678
|
+
import_v426.z.object({
|
|
4679
|
+
type: import_v426.z.literal("findInPage"),
|
|
4680
|
+
url: import_v426.z.string().nullish(),
|
|
4681
|
+
pattern: import_v426.z.string().nullish()
|
|
4682
|
+
})
|
|
4595
4683
|
]).optional()
|
|
4596
4684
|
})
|
|
4597
4685
|
)
|
|
4598
4686
|
);
|
|
4599
|
-
var webSearchPreview = (0,
|
|
4687
|
+
var webSearchPreview = (0, import_provider_utils33.createProviderToolFactoryWithOutputSchema)({
|
|
4600
4688
|
id: "openai.web_search_preview",
|
|
4601
4689
|
inputSchema: webSearchPreviewInputSchema,
|
|
4602
4690
|
outputSchema: webSearchPreviewOutputSchema
|
|
@@ -4635,7 +4723,7 @@ async function prepareResponsesTools({
|
|
|
4635
4723
|
case "provider": {
|
|
4636
4724
|
switch (tool.id) {
|
|
4637
4725
|
case "openai.file_search": {
|
|
4638
|
-
const args = await (0,
|
|
4726
|
+
const args = await (0, import_provider_utils34.validateTypes)({
|
|
4639
4727
|
value: tool.args,
|
|
4640
4728
|
schema: fileSearchArgsSchema
|
|
4641
4729
|
});
|
|
@@ -4658,7 +4746,7 @@ async function prepareResponsesTools({
|
|
|
4658
4746
|
break;
|
|
4659
4747
|
}
|
|
4660
4748
|
case "openai.shell": {
|
|
4661
|
-
const args = await (0,
|
|
4749
|
+
const args = await (0, import_provider_utils34.validateTypes)({
|
|
4662
4750
|
value: tool.args,
|
|
4663
4751
|
schema: shellArgsSchema
|
|
4664
4752
|
});
|
|
@@ -4677,7 +4765,7 @@ async function prepareResponsesTools({
|
|
|
4677
4765
|
break;
|
|
4678
4766
|
}
|
|
4679
4767
|
case "openai.web_search_preview": {
|
|
4680
|
-
const args = await (0,
|
|
4768
|
+
const args = await (0, import_provider_utils34.validateTypes)({
|
|
4681
4769
|
value: tool.args,
|
|
4682
4770
|
schema: webSearchPreviewArgsSchema
|
|
4683
4771
|
});
|
|
@@ -4689,7 +4777,7 @@ async function prepareResponsesTools({
|
|
|
4689
4777
|
break;
|
|
4690
4778
|
}
|
|
4691
4779
|
case "openai.web_search": {
|
|
4692
|
-
const args = await (0,
|
|
4780
|
+
const args = await (0, import_provider_utils34.validateTypes)({
|
|
4693
4781
|
value: tool.args,
|
|
4694
4782
|
schema: webSearchArgsSchema
|
|
4695
4783
|
});
|
|
@@ -4703,7 +4791,7 @@ async function prepareResponsesTools({
|
|
|
4703
4791
|
break;
|
|
4704
4792
|
}
|
|
4705
4793
|
case "openai.code_interpreter": {
|
|
4706
|
-
const args = await (0,
|
|
4794
|
+
const args = await (0, import_provider_utils34.validateTypes)({
|
|
4707
4795
|
value: tool.args,
|
|
4708
4796
|
schema: codeInterpreterArgsSchema
|
|
4709
4797
|
});
|
|
@@ -4714,7 +4802,7 @@ async function prepareResponsesTools({
|
|
|
4714
4802
|
break;
|
|
4715
4803
|
}
|
|
4716
4804
|
case "openai.image_generation": {
|
|
4717
|
-
const args = await (0,
|
|
4805
|
+
const args = await (0, import_provider_utils34.validateTypes)({
|
|
4718
4806
|
value: tool.args,
|
|
4719
4807
|
schema: imageGenerationArgsSchema
|
|
4720
4808
|
});
|
|
@@ -4737,7 +4825,7 @@ async function prepareResponsesTools({
|
|
|
4737
4825
|
break;
|
|
4738
4826
|
}
|
|
4739
4827
|
case "openai.mcp": {
|
|
4740
|
-
const args = await (0,
|
|
4828
|
+
const args = await (0, import_provider_utils34.validateTypes)({
|
|
4741
4829
|
value: tool.args,
|
|
4742
4830
|
schema: mcpArgsSchema
|
|
4743
4831
|
});
|
|
@@ -4763,7 +4851,7 @@ async function prepareResponsesTools({
|
|
|
4763
4851
|
break;
|
|
4764
4852
|
}
|
|
4765
4853
|
case "openai.custom": {
|
|
4766
|
-
const args = await (0,
|
|
4854
|
+
const args = await (0, import_provider_utils34.validateTypes)({
|
|
4767
4855
|
value: tool.args,
|
|
4768
4856
|
schema: customArgsSchema
|
|
4769
4857
|
});
|
|
@@ -4777,7 +4865,7 @@ async function prepareResponsesTools({
|
|
|
4777
4865
|
break;
|
|
4778
4866
|
}
|
|
4779
4867
|
case "openai.tool_search": {
|
|
4780
|
-
const args = await (0,
|
|
4868
|
+
const args = await (0, import_provider_utils34.validateTypes)({
|
|
4781
4869
|
value: tool.args,
|
|
4782
4870
|
schema: toolSearchArgsSchema
|
|
4783
4871
|
});
|
|
@@ -4935,13 +5023,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4935
5023
|
warnings.push({ type: "unsupported", feature: "stopSequences" });
|
|
4936
5024
|
}
|
|
4937
5025
|
const providerOptionsName = this.config.provider.includes("azure") ? "azure" : "openai";
|
|
4938
|
-
let openaiOptions = await (0,
|
|
5026
|
+
let openaiOptions = await (0, import_provider_utils35.parseProviderOptions)({
|
|
4939
5027
|
provider: providerOptionsName,
|
|
4940
5028
|
providerOptions,
|
|
4941
5029
|
schema: openaiLanguageModelResponsesOptionsSchema
|
|
4942
5030
|
});
|
|
4943
5031
|
if (openaiOptions == null && providerOptionsName !== "openai") {
|
|
4944
|
-
openaiOptions = await (0,
|
|
5032
|
+
openaiOptions = await (0, import_provider_utils35.parseProviderOptions)({
|
|
4945
5033
|
provider: "openai",
|
|
4946
5034
|
providerOptions,
|
|
4947
5035
|
schema: openaiLanguageModelResponsesOptionsSchema
|
|
@@ -4955,7 +5043,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4955
5043
|
details: "conversation and previousResponseId cannot be used together"
|
|
4956
5044
|
});
|
|
4957
5045
|
}
|
|
4958
|
-
const toolNameMapping = (0,
|
|
5046
|
+
const toolNameMapping = (0, import_provider_utils35.createToolNameMapping)({
|
|
4959
5047
|
tools,
|
|
4960
5048
|
providerToolNames: {
|
|
4961
5049
|
"openai.code_interpreter": "code_interpreter",
|
|
@@ -5163,12 +5251,12 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5163
5251
|
responseHeaders,
|
|
5164
5252
|
value: response,
|
|
5165
5253
|
rawValue: rawResponse
|
|
5166
|
-
} = await (0,
|
|
5254
|
+
} = await (0, import_provider_utils35.postJsonToApi)({
|
|
5167
5255
|
url,
|
|
5168
|
-
headers: (0,
|
|
5256
|
+
headers: (0, import_provider_utils35.combineHeaders)(this.config.headers(), options.headers),
|
|
5169
5257
|
body,
|
|
5170
5258
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
5171
|
-
successfulResponseHandler: (0,
|
|
5259
|
+
successfulResponseHandler: (0, import_provider_utils35.createJsonResponseHandler)(
|
|
5172
5260
|
openaiResponsesResponseSchema
|
|
5173
5261
|
),
|
|
5174
5262
|
abortSignal: options.abortSignal,
|
|
@@ -5344,7 +5432,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5344
5432
|
content.push({
|
|
5345
5433
|
type: "source",
|
|
5346
5434
|
sourceType: "url",
|
|
5347
|
-
id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0,
|
|
5435
|
+
id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0, import_provider_utils35.generateId)(),
|
|
5348
5436
|
url: annotation.url,
|
|
5349
5437
|
title: annotation.title
|
|
5350
5438
|
});
|
|
@@ -5352,7 +5440,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5352
5440
|
content.push({
|
|
5353
5441
|
type: "source",
|
|
5354
5442
|
sourceType: "document",
|
|
5355
|
-
id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : (0,
|
|
5443
|
+
id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : (0, import_provider_utils35.generateId)(),
|
|
5356
5444
|
mediaType: "text/plain",
|
|
5357
5445
|
title: annotation.filename,
|
|
5358
5446
|
filename: annotation.filename,
|
|
@@ -5368,7 +5456,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5368
5456
|
content.push({
|
|
5369
5457
|
type: "source",
|
|
5370
5458
|
sourceType: "document",
|
|
5371
|
-
id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0,
|
|
5459
|
+
id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils35.generateId)(),
|
|
5372
5460
|
mediaType: "text/plain",
|
|
5373
5461
|
title: annotation.filename,
|
|
5374
5462
|
filename: annotation.filename,
|
|
@@ -5384,7 +5472,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5384
5472
|
content.push({
|
|
5385
5473
|
type: "source",
|
|
5386
5474
|
sourceType: "document",
|
|
5387
|
-
id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : (0,
|
|
5475
|
+
id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : (0, import_provider_utils35.generateId)(),
|
|
5388
5476
|
mediaType: "application/octet-stream",
|
|
5389
5477
|
title: annotation.file_id,
|
|
5390
5478
|
filename: annotation.file_id,
|
|
@@ -5410,7 +5498,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5410
5498
|
input: part.arguments,
|
|
5411
5499
|
providerMetadata: {
|
|
5412
5500
|
[providerOptionsName]: {
|
|
5413
|
-
itemId: part.id
|
|
5501
|
+
itemId: part.id,
|
|
5502
|
+
...part.namespace != null && { namespace: part.namespace }
|
|
5414
5503
|
}
|
|
5415
5504
|
}
|
|
5416
5505
|
});
|
|
@@ -5488,7 +5577,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5488
5577
|
}
|
|
5489
5578
|
case "mcp_approval_request": {
|
|
5490
5579
|
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,
|
|
5580
|
+
const dummyToolCallId = (_w = (_v = (_u = this.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : (0, import_provider_utils35.generateId)();
|
|
5492
5581
|
const toolName = `mcp.${part.name}`;
|
|
5493
5582
|
content.push({
|
|
5494
5583
|
type: "tool-call",
|
|
@@ -5629,18 +5718,18 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5629
5718
|
providerOptionsName,
|
|
5630
5719
|
isShellProviderExecuted
|
|
5631
5720
|
} = await this.getArgs(options);
|
|
5632
|
-
const { responseHeaders, value: response } = await (0,
|
|
5721
|
+
const { responseHeaders, value: response } = await (0, import_provider_utils35.postJsonToApi)({
|
|
5633
5722
|
url: this.config.url({
|
|
5634
5723
|
path: "/responses",
|
|
5635
5724
|
modelId: this.modelId
|
|
5636
5725
|
}),
|
|
5637
|
-
headers: (0,
|
|
5726
|
+
headers: (0, import_provider_utils35.combineHeaders)(this.config.headers(), options.headers),
|
|
5638
5727
|
body: {
|
|
5639
5728
|
...body,
|
|
5640
5729
|
stream: true
|
|
5641
5730
|
},
|
|
5642
5731
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
5643
|
-
successfulResponseHandler: (0,
|
|
5732
|
+
successfulResponseHandler: (0, import_provider_utils35.createEventSourceResponseHandler)(
|
|
5644
5733
|
openaiResponsesChunkSchema
|
|
5645
5734
|
),
|
|
5646
5735
|
abortSignal: options.abortSignal,
|
|
@@ -5893,7 +5982,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5893
5982
|
hasFunctionCall = true;
|
|
5894
5983
|
controller.enqueue({
|
|
5895
5984
|
type: "tool-input-end",
|
|
5896
|
-
id: value.item.call_id
|
|
5985
|
+
id: value.item.call_id,
|
|
5986
|
+
...value.item.namespace != null && {
|
|
5987
|
+
providerMetadata: {
|
|
5988
|
+
[providerOptionsName]: {
|
|
5989
|
+
namespace: value.item.namespace
|
|
5990
|
+
}
|
|
5991
|
+
}
|
|
5992
|
+
}
|
|
5897
5993
|
});
|
|
5898
5994
|
controller.enqueue({
|
|
5899
5995
|
type: "tool-call",
|
|
@@ -5902,7 +5998,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5902
5998
|
input: value.item.arguments,
|
|
5903
5999
|
providerMetadata: {
|
|
5904
6000
|
[providerOptionsName]: {
|
|
5905
|
-
itemId: value.item.id
|
|
6001
|
+
itemId: value.item.id,
|
|
6002
|
+
...value.item.namespace != null && {
|
|
6003
|
+
namespace: value.item.namespace
|
|
6004
|
+
}
|
|
5906
6005
|
}
|
|
5907
6006
|
}
|
|
5908
6007
|
});
|
|
@@ -6120,7 +6219,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6120
6219
|
ongoingToolCalls[value.output_index] = void 0;
|
|
6121
6220
|
} else if (value.item.type === "mcp_approval_request") {
|
|
6122
6221
|
ongoingToolCalls[value.output_index] = void 0;
|
|
6123
|
-
const dummyToolCallId = (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0,
|
|
6222
|
+
const dummyToolCallId = (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils35.generateId)();
|
|
6124
6223
|
const approvalRequestId = (_p = value.item.approval_request_id) != null ? _p : value.item.id;
|
|
6125
6224
|
approvalRequestIdToDummyToolCallIdFromStream.set(
|
|
6126
6225
|
approvalRequestId,
|
|
@@ -6411,7 +6510,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6411
6510
|
controller.enqueue({
|
|
6412
6511
|
type: "source",
|
|
6413
6512
|
sourceType: "url",
|
|
6414
|
-
id: (_C = (_B = (_A = self.config).generateId) == null ? void 0 : _B.call(_A)) != null ? _C : (0,
|
|
6513
|
+
id: (_C = (_B = (_A = self.config).generateId) == null ? void 0 : _B.call(_A)) != null ? _C : (0, import_provider_utils35.generateId)(),
|
|
6415
6514
|
url: value.annotation.url,
|
|
6416
6515
|
title: value.annotation.title
|
|
6417
6516
|
});
|
|
@@ -6419,7 +6518,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6419
6518
|
controller.enqueue({
|
|
6420
6519
|
type: "source",
|
|
6421
6520
|
sourceType: "document",
|
|
6422
|
-
id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : (0,
|
|
6521
|
+
id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : (0, import_provider_utils35.generateId)(),
|
|
6423
6522
|
mediaType: "text/plain",
|
|
6424
6523
|
title: value.annotation.filename,
|
|
6425
6524
|
filename: value.annotation.filename,
|
|
@@ -6435,7 +6534,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6435
6534
|
controller.enqueue({
|
|
6436
6535
|
type: "source",
|
|
6437
6536
|
sourceType: "document",
|
|
6438
|
-
id: (_I = (_H = (_G = self.config).generateId) == null ? void 0 : _H.call(_G)) != null ? _I : (0,
|
|
6537
|
+
id: (_I = (_H = (_G = self.config).generateId) == null ? void 0 : _H.call(_G)) != null ? _I : (0, import_provider_utils35.generateId)(),
|
|
6439
6538
|
mediaType: "text/plain",
|
|
6440
6539
|
title: value.annotation.filename,
|
|
6441
6540
|
filename: value.annotation.filename,
|
|
@@ -6451,7 +6550,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6451
6550
|
controller.enqueue({
|
|
6452
6551
|
type: "source",
|
|
6453
6552
|
sourceType: "document",
|
|
6454
|
-
id: (_L = (_K = (_J = self.config).generateId) == null ? void 0 : _K.call(_J)) != null ? _L : (0,
|
|
6553
|
+
id: (_L = (_K = (_J = self.config).generateId) == null ? void 0 : _K.call(_J)) != null ? _L : (0, import_provider_utils35.generateId)(),
|
|
6455
6554
|
mediaType: "application/octet-stream",
|
|
6456
6555
|
title: value.annotation.file_id,
|
|
6457
6556
|
filename: value.annotation.file_id,
|
|
@@ -6591,6 +6690,9 @@ function escapeJSONDelta(delta) {
|
|
|
6591
6690
|
modelMaxImagesPerCall,
|
|
6592
6691
|
openAITranscriptionModelOptions,
|
|
6593
6692
|
openaiEmbeddingModelOptions,
|
|
6693
|
+
openaiImageModelEditOptions,
|
|
6694
|
+
openaiImageModelGenerationOptions,
|
|
6695
|
+
openaiImageModelOptions,
|
|
6594
6696
|
openaiLanguageModelChatOptions,
|
|
6595
6697
|
openaiLanguageModelCompletionOptions,
|
|
6596
6698
|
openaiSpeechModelOptionsSchema,
|