@ai-sdk/openai 3.0.54 → 3.0.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/index.d.mts +28 -1
- package/dist/index.d.ts +28 -1
- package/dist/index.js +1204 -1122
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1176 -1063
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +28 -1
- package/dist/internal/index.d.ts +28 -1
- package/dist/internal/index.js +1203 -1115
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +1177 -1061
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +12 -3
- package/package.json +4 -4
- package/src/chat/convert-openai-chat-usage.ts +1 -1
- package/src/chat/convert-to-openai-chat-messages.ts +3 -3
- package/src/chat/map-openai-finish-reason.ts +1 -1
- package/src/chat/openai-chat-api.ts +6 -2
- package/src/chat/openai-chat-language-model.ts +14 -14
- package/src/chat/openai-chat-options.ts +5 -1
- package/src/chat/openai-chat-prepare-tools.ts +3 -3
- package/src/completion/convert-openai-completion-usage.ts +1 -1
- package/src/completion/convert-to-openai-completion-prompt.ts +1 -1
- package/src/completion/map-openai-finish-reason.ts +1 -1
- package/src/completion/openai-completion-api.ts +5 -1
- package/src/completion/openai-completion-language-model.ts +6 -6
- package/src/completion/openai-completion-options.ts +5 -1
- package/src/embedding/openai-embedding-model.ts +3 -3
- package/src/embedding/openai-embedding-options.ts +5 -1
- package/src/image/openai-image-model-options.ts +123 -0
- package/src/image/openai-image-model.ts +43 -80
- package/src/index.ts +5 -0
- package/src/internal/index.ts +1 -1
- package/src/openai-config.ts +1 -1
- package/src/openai-provider.ts +9 -9
- package/src/responses/convert-openai-responses-usage.ts +1 -1
- package/src/responses/convert-to-openai-responses-input.ts +5 -5
- package/src/responses/map-openai-responses-finish-reason.ts +1 -1
- package/src/responses/openai-responses-api.ts +6 -2
- package/src/responses/openai-responses-language-model.ts +35 -35
- package/src/responses/openai-responses-options.ts +5 -1
- package/src/responses/openai-responses-prepare-tools.ts +4 -4
- package/src/responses/openai-responses-provider-metadata.ts +2 -2
- package/src/speech/openai-speech-model.ts +4 -4
- package/src/speech/openai-speech-options.ts +5 -1
- package/src/tool/file-search.ts +1 -1
- package/src/tool/mcp.ts +1 -1
- package/src/tool/tool-search.ts +2 -2
- package/src/transcription/openai-transcription-model.ts +4 -4
- package/src/transcription/openai-transcription-options.ts +5 -1
- package/src/image/openai-image-options.ts +0 -34
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ __export(index_exports, {
|
|
|
27
27
|
module.exports = __toCommonJS(index_exports);
|
|
28
28
|
|
|
29
29
|
// src/openai-provider.ts
|
|
30
|
-
var
|
|
30
|
+
var import_provider_utils36 = require("@ai-sdk/provider-utils");
|
|
31
31
|
|
|
32
32
|
// src/chat/openai-chat-language-model.ts
|
|
33
33
|
var import_provider3 = require("@ai-sdk/provider");
|
|
@@ -1714,7 +1714,7 @@ var OpenAIEmbeddingModel = class {
|
|
|
1714
1714
|
};
|
|
1715
1715
|
|
|
1716
1716
|
// src/image/openai-image-model.ts
|
|
1717
|
-
var
|
|
1717
|
+
var import_provider_utils14 = require("@ai-sdk/provider-utils");
|
|
1718
1718
|
|
|
1719
1719
|
// src/image/openai-image-api.ts
|
|
1720
1720
|
var import_provider_utils12 = require("@ai-sdk/provider-utils");
|
|
@@ -1746,7 +1746,9 @@ var openaiImageResponseSchema = (0, import_provider_utils12.lazySchema)(
|
|
|
1746
1746
|
)
|
|
1747
1747
|
);
|
|
1748
1748
|
|
|
1749
|
-
// src/image/openai-image-options.ts
|
|
1749
|
+
// src/image/openai-image-model-options.ts
|
|
1750
|
+
var import_provider_utils13 = require("@ai-sdk/provider-utils");
|
|
1751
|
+
var import_v49 = require("zod/v4");
|
|
1750
1752
|
var modelMaxImagesPerCall = {
|
|
1751
1753
|
"dall-e-3": 1,
|
|
1752
1754
|
"dall-e-2": 10,
|
|
@@ -1768,6 +1770,65 @@ function hasDefaultResponseFormat(modelId) {
|
|
|
1768
1770
|
(prefix) => modelId.startsWith(prefix)
|
|
1769
1771
|
);
|
|
1770
1772
|
}
|
|
1773
|
+
var baseImageModelOptionsObject = import_v49.z.object({
|
|
1774
|
+
/**
|
|
1775
|
+
* Quality of the generated image(s).
|
|
1776
|
+
*
|
|
1777
|
+
* Valid values: `standard`, `hd`, `low`, `medium`, `high`, `auto`.
|
|
1778
|
+
*/
|
|
1779
|
+
quality: import_v49.z.enum(["standard", "hd", "low", "medium", "high", "auto"]).optional(),
|
|
1780
|
+
/**
|
|
1781
|
+
* Background behavior for the generated image(s).
|
|
1782
|
+
*
|
|
1783
|
+
* If `transparent`, the output format must support transparency
|
|
1784
|
+
* (i.e. `png` or `webp`).
|
|
1785
|
+
*/
|
|
1786
|
+
background: import_v49.z.enum(["transparent", "opaque", "auto"]).optional(),
|
|
1787
|
+
/**
|
|
1788
|
+
* Format in which the generated image(s) are returned.
|
|
1789
|
+
*/
|
|
1790
|
+
outputFormat: import_v49.z.enum(["png", "jpeg", "webp"]).optional(),
|
|
1791
|
+
/**
|
|
1792
|
+
* Compression level (0-100) for the generated image(s). Applies to the
|
|
1793
|
+
* `jpeg` and `webp` output formats.
|
|
1794
|
+
*/
|
|
1795
|
+
outputCompression: import_v49.z.number().int().min(0).max(100).optional(),
|
|
1796
|
+
/**
|
|
1797
|
+
* A unique identifier representing your end-user, which can help OpenAI
|
|
1798
|
+
* to monitor and detect abuse.
|
|
1799
|
+
*/
|
|
1800
|
+
user: import_v49.z.string().optional()
|
|
1801
|
+
});
|
|
1802
|
+
var openaiImageModelOptions = (0, import_provider_utils13.lazySchema)(
|
|
1803
|
+
() => (0, import_provider_utils13.zodSchema)(baseImageModelOptionsObject)
|
|
1804
|
+
);
|
|
1805
|
+
var openaiImageModelGenerationOptions = (0, import_provider_utils13.lazySchema)(
|
|
1806
|
+
() => (0, import_provider_utils13.zodSchema)(
|
|
1807
|
+
baseImageModelOptionsObject.extend({
|
|
1808
|
+
/**
|
|
1809
|
+
* Style of the generated image. `vivid` produces hyper-real and
|
|
1810
|
+
* dramatic images; `natural` produces more subdued, less hyper-real
|
|
1811
|
+
* looking images.
|
|
1812
|
+
*/
|
|
1813
|
+
style: import_v49.z.enum(["vivid", "natural"]).optional(),
|
|
1814
|
+
/**
|
|
1815
|
+
* Content moderation level for the generated image(s). `low` applies
|
|
1816
|
+
* less restrictive filtering.
|
|
1817
|
+
*/
|
|
1818
|
+
moderation: import_v49.z.enum(["auto", "low"]).optional()
|
|
1819
|
+
})
|
|
1820
|
+
)
|
|
1821
|
+
);
|
|
1822
|
+
var openaiImageModelEditOptions = (0, import_provider_utils13.lazySchema)(
|
|
1823
|
+
() => (0, import_provider_utils13.zodSchema)(
|
|
1824
|
+
baseImageModelOptionsObject.extend({
|
|
1825
|
+
/**
|
|
1826
|
+
* Fidelity of the output image(s) to the input image(s).
|
|
1827
|
+
*/
|
|
1828
|
+
inputFidelity: import_v49.z.enum(["high", "low"]).optional()
|
|
1829
|
+
})
|
|
1830
|
+
)
|
|
1831
|
+
);
|
|
1771
1832
|
|
|
1772
1833
|
// src/image/openai-image-model.ts
|
|
1773
1834
|
var OpenAIImageModel = class {
|
|
@@ -1809,13 +1870,18 @@ var OpenAIImageModel = class {
|
|
|
1809
1870
|
}
|
|
1810
1871
|
const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
|
|
1811
1872
|
if (files != null) {
|
|
1812
|
-
const
|
|
1873
|
+
const openaiOptions2 = (_d = await (0, import_provider_utils14.parseProviderOptions)({
|
|
1874
|
+
provider: "openai",
|
|
1875
|
+
providerOptions,
|
|
1876
|
+
schema: openaiImageModelEditOptions
|
|
1877
|
+
})) != null ? _d : {};
|
|
1878
|
+
const { value: response2, responseHeaders: responseHeaders2 } = await (0, import_provider_utils14.postFormDataToApi)({
|
|
1813
1879
|
url: this.config.url({
|
|
1814
1880
|
path: "/images/edits",
|
|
1815
1881
|
modelId: this.modelId
|
|
1816
1882
|
}),
|
|
1817
|
-
headers: (0,
|
|
1818
|
-
formData: (0,
|
|
1883
|
+
headers: (0, import_provider_utils14.combineHeaders)(this.config.headers(), headers),
|
|
1884
|
+
formData: (0, import_provider_utils14.convertToFormData)({
|
|
1819
1885
|
model: this.modelId,
|
|
1820
1886
|
prompt,
|
|
1821
1887
|
image: await Promise.all(
|
|
@@ -1824,21 +1890,26 @@ var OpenAIImageModel = class {
|
|
|
1824
1890
|
[
|
|
1825
1891
|
file.data instanceof Uint8Array ? new Blob([file.data], {
|
|
1826
1892
|
type: file.mediaType
|
|
1827
|
-
}) : new Blob([(0,
|
|
1893
|
+
}) : new Blob([(0, import_provider_utils14.convertBase64ToUint8Array)(file.data)], {
|
|
1828
1894
|
type: file.mediaType
|
|
1829
1895
|
})
|
|
1830
1896
|
],
|
|
1831
1897
|
{ type: file.mediaType }
|
|
1832
|
-
) : (0,
|
|
1898
|
+
) : (0, import_provider_utils14.downloadBlob)(file.url)
|
|
1833
1899
|
)
|
|
1834
1900
|
),
|
|
1835
1901
|
mask: mask != null ? await fileToBlob(mask) : void 0,
|
|
1836
1902
|
n,
|
|
1837
1903
|
size,
|
|
1838
|
-
|
|
1904
|
+
quality: openaiOptions2.quality,
|
|
1905
|
+
background: openaiOptions2.background,
|
|
1906
|
+
output_format: openaiOptions2.outputFormat,
|
|
1907
|
+
output_compression: openaiOptions2.outputCompression,
|
|
1908
|
+
input_fidelity: openaiOptions2.inputFidelity,
|
|
1909
|
+
user: openaiOptions2.user
|
|
1839
1910
|
}),
|
|
1840
1911
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
1841
|
-
successfulResponseHandler: (0,
|
|
1912
|
+
successfulResponseHandler: (0, import_provider_utils14.createJsonResponseHandler)(
|
|
1842
1913
|
openaiImageResponseSchema
|
|
1843
1914
|
),
|
|
1844
1915
|
abortSignal,
|
|
@@ -1879,22 +1950,33 @@ var OpenAIImageModel = class {
|
|
|
1879
1950
|
}
|
|
1880
1951
|
};
|
|
1881
1952
|
}
|
|
1882
|
-
const
|
|
1953
|
+
const openaiOptions = (_h = await (0, import_provider_utils14.parseProviderOptions)({
|
|
1954
|
+
provider: "openai",
|
|
1955
|
+
providerOptions,
|
|
1956
|
+
schema: openaiImageModelGenerationOptions
|
|
1957
|
+
})) != null ? _h : {};
|
|
1958
|
+
const { value: response, responseHeaders } = await (0, import_provider_utils14.postJsonToApi)({
|
|
1883
1959
|
url: this.config.url({
|
|
1884
1960
|
path: "/images/generations",
|
|
1885
1961
|
modelId: this.modelId
|
|
1886
1962
|
}),
|
|
1887
|
-
headers: (0,
|
|
1963
|
+
headers: (0, import_provider_utils14.combineHeaders)(this.config.headers(), headers),
|
|
1888
1964
|
body: {
|
|
1889
1965
|
model: this.modelId,
|
|
1890
1966
|
prompt,
|
|
1891
1967
|
n,
|
|
1892
1968
|
size,
|
|
1893
|
-
|
|
1969
|
+
quality: openaiOptions.quality,
|
|
1970
|
+
style: openaiOptions.style,
|
|
1971
|
+
background: openaiOptions.background,
|
|
1972
|
+
moderation: openaiOptions.moderation,
|
|
1973
|
+
output_format: openaiOptions.outputFormat,
|
|
1974
|
+
output_compression: openaiOptions.outputCompression,
|
|
1975
|
+
user: openaiOptions.user,
|
|
1894
1976
|
...!hasDefaultResponseFormat(this.modelId) ? { response_format: "b64_json" } : {}
|
|
1895
1977
|
},
|
|
1896
1978
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
1897
|
-
successfulResponseHandler: (0,
|
|
1979
|
+
successfulResponseHandler: (0, import_provider_utils14.createJsonResponseHandler)(
|
|
1898
1980
|
openaiImageResponseSchema
|
|
1899
1981
|
),
|
|
1900
1982
|
abortSignal,
|
|
@@ -1956,48 +2038,48 @@ function distributeTokenDetails(details, index, total) {
|
|
|
1956
2038
|
async function fileToBlob(file) {
|
|
1957
2039
|
if (!file) return void 0;
|
|
1958
2040
|
if (file.type === "url") {
|
|
1959
|
-
return (0,
|
|
2041
|
+
return (0, import_provider_utils14.downloadBlob)(file.url);
|
|
1960
2042
|
}
|
|
1961
|
-
const data = file.data instanceof Uint8Array ? file.data : (0,
|
|
2043
|
+
const data = file.data instanceof Uint8Array ? file.data : (0, import_provider_utils14.convertBase64ToUint8Array)(file.data);
|
|
1962
2044
|
return new Blob([data], { type: file.mediaType });
|
|
1963
2045
|
}
|
|
1964
2046
|
|
|
1965
2047
|
// src/tool/apply-patch.ts
|
|
1966
|
-
var
|
|
1967
|
-
var
|
|
1968
|
-
var applyPatchInputSchema = (0,
|
|
1969
|
-
() => (0,
|
|
1970
|
-
|
|
1971
|
-
callId:
|
|
1972
|
-
operation:
|
|
1973
|
-
|
|
1974
|
-
type:
|
|
1975
|
-
path:
|
|
1976
|
-
diff:
|
|
2048
|
+
var import_provider_utils15 = require("@ai-sdk/provider-utils");
|
|
2049
|
+
var import_v410 = require("zod/v4");
|
|
2050
|
+
var applyPatchInputSchema = (0, import_provider_utils15.lazySchema)(
|
|
2051
|
+
() => (0, import_provider_utils15.zodSchema)(
|
|
2052
|
+
import_v410.z.object({
|
|
2053
|
+
callId: import_v410.z.string(),
|
|
2054
|
+
operation: import_v410.z.discriminatedUnion("type", [
|
|
2055
|
+
import_v410.z.object({
|
|
2056
|
+
type: import_v410.z.literal("create_file"),
|
|
2057
|
+
path: import_v410.z.string(),
|
|
2058
|
+
diff: import_v410.z.string()
|
|
1977
2059
|
}),
|
|
1978
|
-
|
|
1979
|
-
type:
|
|
1980
|
-
path:
|
|
2060
|
+
import_v410.z.object({
|
|
2061
|
+
type: import_v410.z.literal("delete_file"),
|
|
2062
|
+
path: import_v410.z.string()
|
|
1981
2063
|
}),
|
|
1982
|
-
|
|
1983
|
-
type:
|
|
1984
|
-
path:
|
|
1985
|
-
diff:
|
|
2064
|
+
import_v410.z.object({
|
|
2065
|
+
type: import_v410.z.literal("update_file"),
|
|
2066
|
+
path: import_v410.z.string(),
|
|
2067
|
+
diff: import_v410.z.string()
|
|
1986
2068
|
})
|
|
1987
2069
|
])
|
|
1988
2070
|
})
|
|
1989
2071
|
)
|
|
1990
2072
|
);
|
|
1991
|
-
var applyPatchOutputSchema = (0,
|
|
1992
|
-
() => (0,
|
|
1993
|
-
|
|
1994
|
-
status:
|
|
1995
|
-
output:
|
|
2073
|
+
var applyPatchOutputSchema = (0, import_provider_utils15.lazySchema)(
|
|
2074
|
+
() => (0, import_provider_utils15.zodSchema)(
|
|
2075
|
+
import_v410.z.object({
|
|
2076
|
+
status: import_v410.z.enum(["completed", "failed"]),
|
|
2077
|
+
output: import_v410.z.string().optional()
|
|
1996
2078
|
})
|
|
1997
2079
|
)
|
|
1998
2080
|
);
|
|
1999
|
-
var applyPatchArgsSchema = (0,
|
|
2000
|
-
var applyPatchToolFactory = (0,
|
|
2081
|
+
var applyPatchArgsSchema = (0, import_provider_utils15.lazySchema)(() => (0, import_provider_utils15.zodSchema)(import_v410.z.object({})));
|
|
2082
|
+
var applyPatchToolFactory = (0, import_provider_utils15.createProviderToolFactoryWithOutputSchema)({
|
|
2001
2083
|
id: "openai.apply_patch",
|
|
2002
2084
|
inputSchema: applyPatchInputSchema,
|
|
2003
2085
|
outputSchema: applyPatchOutputSchema
|
|
@@ -2005,41 +2087,41 @@ var applyPatchToolFactory = (0, import_provider_utils14.createProviderToolFactor
|
|
|
2005
2087
|
var applyPatch = applyPatchToolFactory;
|
|
2006
2088
|
|
|
2007
2089
|
// src/tool/code-interpreter.ts
|
|
2008
|
-
var
|
|
2009
|
-
var
|
|
2010
|
-
var codeInterpreterInputSchema = (0,
|
|
2011
|
-
() => (0,
|
|
2012
|
-
|
|
2013
|
-
code:
|
|
2014
|
-
containerId:
|
|
2090
|
+
var import_provider_utils16 = require("@ai-sdk/provider-utils");
|
|
2091
|
+
var import_v411 = require("zod/v4");
|
|
2092
|
+
var codeInterpreterInputSchema = (0, import_provider_utils16.lazySchema)(
|
|
2093
|
+
() => (0, import_provider_utils16.zodSchema)(
|
|
2094
|
+
import_v411.z.object({
|
|
2095
|
+
code: import_v411.z.string().nullish(),
|
|
2096
|
+
containerId: import_v411.z.string()
|
|
2015
2097
|
})
|
|
2016
2098
|
)
|
|
2017
2099
|
);
|
|
2018
|
-
var codeInterpreterOutputSchema = (0,
|
|
2019
|
-
() => (0,
|
|
2020
|
-
|
|
2021
|
-
outputs:
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2100
|
+
var codeInterpreterOutputSchema = (0, import_provider_utils16.lazySchema)(
|
|
2101
|
+
() => (0, import_provider_utils16.zodSchema)(
|
|
2102
|
+
import_v411.z.object({
|
|
2103
|
+
outputs: import_v411.z.array(
|
|
2104
|
+
import_v411.z.discriminatedUnion("type", [
|
|
2105
|
+
import_v411.z.object({ type: import_v411.z.literal("logs"), logs: import_v411.z.string() }),
|
|
2106
|
+
import_v411.z.object({ type: import_v411.z.literal("image"), url: import_v411.z.string() })
|
|
2025
2107
|
])
|
|
2026
2108
|
).nullish()
|
|
2027
2109
|
})
|
|
2028
2110
|
)
|
|
2029
2111
|
);
|
|
2030
|
-
var codeInterpreterArgsSchema = (0,
|
|
2031
|
-
() => (0,
|
|
2032
|
-
|
|
2033
|
-
container:
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
fileIds:
|
|
2112
|
+
var codeInterpreterArgsSchema = (0, import_provider_utils16.lazySchema)(
|
|
2113
|
+
() => (0, import_provider_utils16.zodSchema)(
|
|
2114
|
+
import_v411.z.object({
|
|
2115
|
+
container: import_v411.z.union([
|
|
2116
|
+
import_v411.z.string(),
|
|
2117
|
+
import_v411.z.object({
|
|
2118
|
+
fileIds: import_v411.z.array(import_v411.z.string()).optional()
|
|
2037
2119
|
})
|
|
2038
2120
|
]).optional()
|
|
2039
2121
|
})
|
|
2040
2122
|
)
|
|
2041
2123
|
);
|
|
2042
|
-
var codeInterpreterToolFactory = (0,
|
|
2124
|
+
var codeInterpreterToolFactory = (0, import_provider_utils16.createProviderToolFactoryWithOutputSchema)({
|
|
2043
2125
|
id: "openai.code_interpreter",
|
|
2044
2126
|
inputSchema: codeInterpreterInputSchema,
|
|
2045
2127
|
outputSchema: codeInterpreterOutputSchema
|
|
@@ -2049,109 +2131,109 @@ var codeInterpreter = (args = {}) => {
|
|
|
2049
2131
|
};
|
|
2050
2132
|
|
|
2051
2133
|
// src/tool/custom.ts
|
|
2052
|
-
var
|
|
2053
|
-
var
|
|
2054
|
-
var customArgsSchema = (0,
|
|
2055
|
-
() => (0,
|
|
2056
|
-
|
|
2057
|
-
name:
|
|
2058
|
-
description:
|
|
2059
|
-
format:
|
|
2060
|
-
|
|
2061
|
-
type:
|
|
2062
|
-
syntax:
|
|
2063
|
-
definition:
|
|
2134
|
+
var import_provider_utils17 = require("@ai-sdk/provider-utils");
|
|
2135
|
+
var import_v412 = require("zod/v4");
|
|
2136
|
+
var customArgsSchema = (0, import_provider_utils17.lazySchema)(
|
|
2137
|
+
() => (0, import_provider_utils17.zodSchema)(
|
|
2138
|
+
import_v412.z.object({
|
|
2139
|
+
name: import_v412.z.string(),
|
|
2140
|
+
description: import_v412.z.string().optional(),
|
|
2141
|
+
format: import_v412.z.union([
|
|
2142
|
+
import_v412.z.object({
|
|
2143
|
+
type: import_v412.z.literal("grammar"),
|
|
2144
|
+
syntax: import_v412.z.enum(["regex", "lark"]),
|
|
2145
|
+
definition: import_v412.z.string()
|
|
2064
2146
|
}),
|
|
2065
|
-
|
|
2066
|
-
type:
|
|
2147
|
+
import_v412.z.object({
|
|
2148
|
+
type: import_v412.z.literal("text")
|
|
2067
2149
|
})
|
|
2068
2150
|
]).optional()
|
|
2069
2151
|
})
|
|
2070
2152
|
)
|
|
2071
2153
|
);
|
|
2072
|
-
var customInputSchema = (0,
|
|
2073
|
-
var customToolFactory = (0,
|
|
2154
|
+
var customInputSchema = (0, import_provider_utils17.lazySchema)(() => (0, import_provider_utils17.zodSchema)(import_v412.z.string()));
|
|
2155
|
+
var customToolFactory = (0, import_provider_utils17.createProviderToolFactory)({
|
|
2074
2156
|
id: "openai.custom",
|
|
2075
2157
|
inputSchema: customInputSchema
|
|
2076
2158
|
});
|
|
2077
2159
|
var customTool = (args) => customToolFactory(args);
|
|
2078
2160
|
|
|
2079
2161
|
// src/tool/file-search.ts
|
|
2080
|
-
var
|
|
2081
|
-
var
|
|
2082
|
-
var comparisonFilterSchema =
|
|
2083
|
-
key:
|
|
2084
|
-
type:
|
|
2085
|
-
value:
|
|
2162
|
+
var import_provider_utils18 = require("@ai-sdk/provider-utils");
|
|
2163
|
+
var import_v413 = require("zod/v4");
|
|
2164
|
+
var comparisonFilterSchema = import_v413.z.object({
|
|
2165
|
+
key: import_v413.z.string(),
|
|
2166
|
+
type: import_v413.z.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
|
|
2167
|
+
value: import_v413.z.union([import_v413.z.string(), import_v413.z.number(), import_v413.z.boolean(), import_v413.z.array(import_v413.z.string())])
|
|
2086
2168
|
});
|
|
2087
|
-
var compoundFilterSchema =
|
|
2088
|
-
type:
|
|
2089
|
-
filters:
|
|
2090
|
-
|
|
2169
|
+
var compoundFilterSchema = import_v413.z.object({
|
|
2170
|
+
type: import_v413.z.enum(["and", "or"]),
|
|
2171
|
+
filters: import_v413.z.array(
|
|
2172
|
+
import_v413.z.union([comparisonFilterSchema, import_v413.z.lazy(() => compoundFilterSchema)])
|
|
2091
2173
|
)
|
|
2092
2174
|
});
|
|
2093
|
-
var fileSearchArgsSchema = (0,
|
|
2094
|
-
() => (0,
|
|
2095
|
-
|
|
2096
|
-
vectorStoreIds:
|
|
2097
|
-
maxNumResults:
|
|
2098
|
-
ranking:
|
|
2099
|
-
ranker:
|
|
2100
|
-
scoreThreshold:
|
|
2175
|
+
var fileSearchArgsSchema = (0, import_provider_utils18.lazySchema)(
|
|
2176
|
+
() => (0, import_provider_utils18.zodSchema)(
|
|
2177
|
+
import_v413.z.object({
|
|
2178
|
+
vectorStoreIds: import_v413.z.array(import_v413.z.string()),
|
|
2179
|
+
maxNumResults: import_v413.z.number().optional(),
|
|
2180
|
+
ranking: import_v413.z.object({
|
|
2181
|
+
ranker: import_v413.z.string().optional(),
|
|
2182
|
+
scoreThreshold: import_v413.z.number().optional()
|
|
2101
2183
|
}).optional(),
|
|
2102
|
-
filters:
|
|
2184
|
+
filters: import_v413.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
2103
2185
|
})
|
|
2104
2186
|
)
|
|
2105
2187
|
);
|
|
2106
|
-
var fileSearchOutputSchema = (0,
|
|
2107
|
-
() => (0,
|
|
2108
|
-
|
|
2109
|
-
queries:
|
|
2110
|
-
results:
|
|
2111
|
-
|
|
2112
|
-
attributes:
|
|
2113
|
-
fileId:
|
|
2114
|
-
filename:
|
|
2115
|
-
score:
|
|
2116
|
-
text:
|
|
2188
|
+
var fileSearchOutputSchema = (0, import_provider_utils18.lazySchema)(
|
|
2189
|
+
() => (0, import_provider_utils18.zodSchema)(
|
|
2190
|
+
import_v413.z.object({
|
|
2191
|
+
queries: import_v413.z.array(import_v413.z.string()),
|
|
2192
|
+
results: import_v413.z.array(
|
|
2193
|
+
import_v413.z.object({
|
|
2194
|
+
attributes: import_v413.z.record(import_v413.z.string(), import_v413.z.unknown()),
|
|
2195
|
+
fileId: import_v413.z.string(),
|
|
2196
|
+
filename: import_v413.z.string(),
|
|
2197
|
+
score: import_v413.z.number(),
|
|
2198
|
+
text: import_v413.z.string()
|
|
2117
2199
|
})
|
|
2118
2200
|
).nullable()
|
|
2119
2201
|
})
|
|
2120
2202
|
)
|
|
2121
2203
|
);
|
|
2122
|
-
var fileSearch = (0,
|
|
2204
|
+
var fileSearch = (0, import_provider_utils18.createProviderToolFactoryWithOutputSchema)({
|
|
2123
2205
|
id: "openai.file_search",
|
|
2124
|
-
inputSchema:
|
|
2206
|
+
inputSchema: import_v413.z.object({}),
|
|
2125
2207
|
outputSchema: fileSearchOutputSchema
|
|
2126
2208
|
});
|
|
2127
2209
|
|
|
2128
2210
|
// src/tool/image-generation.ts
|
|
2129
|
-
var
|
|
2130
|
-
var
|
|
2131
|
-
var imageGenerationArgsSchema = (0,
|
|
2132
|
-
() => (0,
|
|
2133
|
-
|
|
2134
|
-
background:
|
|
2135
|
-
inputFidelity:
|
|
2136
|
-
inputImageMask:
|
|
2137
|
-
fileId:
|
|
2138
|
-
imageUrl:
|
|
2211
|
+
var import_provider_utils19 = require("@ai-sdk/provider-utils");
|
|
2212
|
+
var import_v414 = require("zod/v4");
|
|
2213
|
+
var imageGenerationArgsSchema = (0, import_provider_utils19.lazySchema)(
|
|
2214
|
+
() => (0, import_provider_utils19.zodSchema)(
|
|
2215
|
+
import_v414.z.object({
|
|
2216
|
+
background: import_v414.z.enum(["auto", "opaque", "transparent"]).optional(),
|
|
2217
|
+
inputFidelity: import_v414.z.enum(["low", "high"]).optional(),
|
|
2218
|
+
inputImageMask: import_v414.z.object({
|
|
2219
|
+
fileId: import_v414.z.string().optional(),
|
|
2220
|
+
imageUrl: import_v414.z.string().optional()
|
|
2139
2221
|
}).optional(),
|
|
2140
|
-
model:
|
|
2141
|
-
moderation:
|
|
2142
|
-
outputCompression:
|
|
2143
|
-
outputFormat:
|
|
2144
|
-
partialImages:
|
|
2145
|
-
quality:
|
|
2146
|
-
size:
|
|
2222
|
+
model: import_v414.z.string().optional(),
|
|
2223
|
+
moderation: import_v414.z.enum(["auto"]).optional(),
|
|
2224
|
+
outputCompression: import_v414.z.number().int().min(0).max(100).optional(),
|
|
2225
|
+
outputFormat: import_v414.z.enum(["png", "jpeg", "webp"]).optional(),
|
|
2226
|
+
partialImages: import_v414.z.number().int().min(0).max(3).optional(),
|
|
2227
|
+
quality: import_v414.z.enum(["auto", "low", "medium", "high"]).optional(),
|
|
2228
|
+
size: import_v414.z.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
2147
2229
|
}).strict()
|
|
2148
2230
|
)
|
|
2149
2231
|
);
|
|
2150
|
-
var imageGenerationInputSchema = (0,
|
|
2151
|
-
var imageGenerationOutputSchema = (0,
|
|
2152
|
-
() => (0,
|
|
2232
|
+
var imageGenerationInputSchema = (0, import_provider_utils19.lazySchema)(() => (0, import_provider_utils19.zodSchema)(import_v414.z.object({})));
|
|
2233
|
+
var imageGenerationOutputSchema = (0, import_provider_utils19.lazySchema)(
|
|
2234
|
+
() => (0, import_provider_utils19.zodSchema)(import_v414.z.object({ result: import_v414.z.string() }))
|
|
2153
2235
|
);
|
|
2154
|
-
var imageGenerationToolFactory = (0,
|
|
2236
|
+
var imageGenerationToolFactory = (0, import_provider_utils19.createProviderToolFactoryWithOutputSchema)({
|
|
2155
2237
|
id: "openai.image_generation",
|
|
2156
2238
|
inputSchema: imageGenerationInputSchema,
|
|
2157
2239
|
outputSchema: imageGenerationOutputSchema
|
|
@@ -2161,115 +2243,115 @@ var imageGeneration = (args = {}) => {
|
|
|
2161
2243
|
};
|
|
2162
2244
|
|
|
2163
2245
|
// src/tool/local-shell.ts
|
|
2164
|
-
var
|
|
2165
|
-
var
|
|
2166
|
-
var localShellInputSchema = (0,
|
|
2167
|
-
() => (0,
|
|
2168
|
-
|
|
2169
|
-
action:
|
|
2170
|
-
type:
|
|
2171
|
-
command:
|
|
2172
|
-
timeoutMs:
|
|
2173
|
-
user:
|
|
2174
|
-
workingDirectory:
|
|
2175
|
-
env:
|
|
2246
|
+
var import_provider_utils20 = require("@ai-sdk/provider-utils");
|
|
2247
|
+
var import_v415 = require("zod/v4");
|
|
2248
|
+
var localShellInputSchema = (0, import_provider_utils20.lazySchema)(
|
|
2249
|
+
() => (0, import_provider_utils20.zodSchema)(
|
|
2250
|
+
import_v415.z.object({
|
|
2251
|
+
action: import_v415.z.object({
|
|
2252
|
+
type: import_v415.z.literal("exec"),
|
|
2253
|
+
command: import_v415.z.array(import_v415.z.string()),
|
|
2254
|
+
timeoutMs: import_v415.z.number().optional(),
|
|
2255
|
+
user: import_v415.z.string().optional(),
|
|
2256
|
+
workingDirectory: import_v415.z.string().optional(),
|
|
2257
|
+
env: import_v415.z.record(import_v415.z.string(), import_v415.z.string()).optional()
|
|
2176
2258
|
})
|
|
2177
2259
|
})
|
|
2178
2260
|
)
|
|
2179
2261
|
);
|
|
2180
|
-
var localShellOutputSchema = (0,
|
|
2181
|
-
() => (0,
|
|
2262
|
+
var localShellOutputSchema = (0, import_provider_utils20.lazySchema)(
|
|
2263
|
+
() => (0, import_provider_utils20.zodSchema)(import_v415.z.object({ output: import_v415.z.string() }))
|
|
2182
2264
|
);
|
|
2183
|
-
var localShell = (0,
|
|
2265
|
+
var localShell = (0, import_provider_utils20.createProviderToolFactoryWithOutputSchema)({
|
|
2184
2266
|
id: "openai.local_shell",
|
|
2185
2267
|
inputSchema: localShellInputSchema,
|
|
2186
2268
|
outputSchema: localShellOutputSchema
|
|
2187
2269
|
});
|
|
2188
2270
|
|
|
2189
2271
|
// src/tool/shell.ts
|
|
2190
|
-
var
|
|
2191
|
-
var
|
|
2192
|
-
var shellInputSchema = (0,
|
|
2193
|
-
() => (0,
|
|
2194
|
-
|
|
2195
|
-
action:
|
|
2196
|
-
commands:
|
|
2197
|
-
timeoutMs:
|
|
2198
|
-
maxOutputLength:
|
|
2272
|
+
var import_provider_utils21 = require("@ai-sdk/provider-utils");
|
|
2273
|
+
var import_v416 = require("zod/v4");
|
|
2274
|
+
var shellInputSchema = (0, import_provider_utils21.lazySchema)(
|
|
2275
|
+
() => (0, import_provider_utils21.zodSchema)(
|
|
2276
|
+
import_v416.z.object({
|
|
2277
|
+
action: import_v416.z.object({
|
|
2278
|
+
commands: import_v416.z.array(import_v416.z.string()),
|
|
2279
|
+
timeoutMs: import_v416.z.number().optional(),
|
|
2280
|
+
maxOutputLength: import_v416.z.number().optional()
|
|
2199
2281
|
})
|
|
2200
2282
|
})
|
|
2201
2283
|
)
|
|
2202
2284
|
);
|
|
2203
|
-
var shellOutputSchema = (0,
|
|
2204
|
-
() => (0,
|
|
2205
|
-
|
|
2206
|
-
output:
|
|
2207
|
-
|
|
2208
|
-
stdout:
|
|
2209
|
-
stderr:
|
|
2210
|
-
outcome:
|
|
2211
|
-
|
|
2212
|
-
|
|
2285
|
+
var shellOutputSchema = (0, import_provider_utils21.lazySchema)(
|
|
2286
|
+
() => (0, import_provider_utils21.zodSchema)(
|
|
2287
|
+
import_v416.z.object({
|
|
2288
|
+
output: import_v416.z.array(
|
|
2289
|
+
import_v416.z.object({
|
|
2290
|
+
stdout: import_v416.z.string(),
|
|
2291
|
+
stderr: import_v416.z.string(),
|
|
2292
|
+
outcome: import_v416.z.discriminatedUnion("type", [
|
|
2293
|
+
import_v416.z.object({ type: import_v416.z.literal("timeout") }),
|
|
2294
|
+
import_v416.z.object({ type: import_v416.z.literal("exit"), exitCode: import_v416.z.number() })
|
|
2213
2295
|
])
|
|
2214
2296
|
})
|
|
2215
2297
|
)
|
|
2216
2298
|
})
|
|
2217
2299
|
)
|
|
2218
2300
|
);
|
|
2219
|
-
var shellSkillsSchema =
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
type:
|
|
2223
|
-
skillId:
|
|
2224
|
-
version:
|
|
2301
|
+
var shellSkillsSchema = import_v416.z.array(
|
|
2302
|
+
import_v416.z.discriminatedUnion("type", [
|
|
2303
|
+
import_v416.z.object({
|
|
2304
|
+
type: import_v416.z.literal("skillReference"),
|
|
2305
|
+
skillId: import_v416.z.string(),
|
|
2306
|
+
version: import_v416.z.string().optional()
|
|
2225
2307
|
}),
|
|
2226
|
-
|
|
2227
|
-
type:
|
|
2228
|
-
name:
|
|
2229
|
-
description:
|
|
2230
|
-
source:
|
|
2231
|
-
type:
|
|
2232
|
-
mediaType:
|
|
2233
|
-
data:
|
|
2308
|
+
import_v416.z.object({
|
|
2309
|
+
type: import_v416.z.literal("inline"),
|
|
2310
|
+
name: import_v416.z.string(),
|
|
2311
|
+
description: import_v416.z.string(),
|
|
2312
|
+
source: import_v416.z.object({
|
|
2313
|
+
type: import_v416.z.literal("base64"),
|
|
2314
|
+
mediaType: import_v416.z.literal("application/zip"),
|
|
2315
|
+
data: import_v416.z.string()
|
|
2234
2316
|
})
|
|
2235
2317
|
})
|
|
2236
2318
|
])
|
|
2237
2319
|
).optional();
|
|
2238
|
-
var shellArgsSchema = (0,
|
|
2239
|
-
() => (0,
|
|
2240
|
-
|
|
2241
|
-
environment:
|
|
2242
|
-
|
|
2243
|
-
type:
|
|
2244
|
-
fileIds:
|
|
2245
|
-
memoryLimit:
|
|
2246
|
-
networkPolicy:
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
type:
|
|
2250
|
-
allowedDomains:
|
|
2251
|
-
domainSecrets:
|
|
2252
|
-
|
|
2253
|
-
domain:
|
|
2254
|
-
name:
|
|
2255
|
-
value:
|
|
2320
|
+
var shellArgsSchema = (0, import_provider_utils21.lazySchema)(
|
|
2321
|
+
() => (0, import_provider_utils21.zodSchema)(
|
|
2322
|
+
import_v416.z.object({
|
|
2323
|
+
environment: import_v416.z.union([
|
|
2324
|
+
import_v416.z.object({
|
|
2325
|
+
type: import_v416.z.literal("containerAuto"),
|
|
2326
|
+
fileIds: import_v416.z.array(import_v416.z.string()).optional(),
|
|
2327
|
+
memoryLimit: import_v416.z.enum(["1g", "4g", "16g", "64g"]).optional(),
|
|
2328
|
+
networkPolicy: import_v416.z.discriminatedUnion("type", [
|
|
2329
|
+
import_v416.z.object({ type: import_v416.z.literal("disabled") }),
|
|
2330
|
+
import_v416.z.object({
|
|
2331
|
+
type: import_v416.z.literal("allowlist"),
|
|
2332
|
+
allowedDomains: import_v416.z.array(import_v416.z.string()),
|
|
2333
|
+
domainSecrets: import_v416.z.array(
|
|
2334
|
+
import_v416.z.object({
|
|
2335
|
+
domain: import_v416.z.string(),
|
|
2336
|
+
name: import_v416.z.string(),
|
|
2337
|
+
value: import_v416.z.string()
|
|
2256
2338
|
})
|
|
2257
2339
|
).optional()
|
|
2258
2340
|
})
|
|
2259
2341
|
]).optional(),
|
|
2260
2342
|
skills: shellSkillsSchema
|
|
2261
2343
|
}),
|
|
2262
|
-
|
|
2263
|
-
type:
|
|
2264
|
-
containerId:
|
|
2344
|
+
import_v416.z.object({
|
|
2345
|
+
type: import_v416.z.literal("containerReference"),
|
|
2346
|
+
containerId: import_v416.z.string()
|
|
2265
2347
|
}),
|
|
2266
|
-
|
|
2267
|
-
type:
|
|
2268
|
-
skills:
|
|
2269
|
-
|
|
2270
|
-
name:
|
|
2271
|
-
description:
|
|
2272
|
-
path:
|
|
2348
|
+
import_v416.z.object({
|
|
2349
|
+
type: import_v416.z.literal("local").optional(),
|
|
2350
|
+
skills: import_v416.z.array(
|
|
2351
|
+
import_v416.z.object({
|
|
2352
|
+
name: import_v416.z.string(),
|
|
2353
|
+
description: import_v416.z.string(),
|
|
2354
|
+
path: import_v416.z.string()
|
|
2273
2355
|
})
|
|
2274
2356
|
).optional()
|
|
2275
2357
|
})
|
|
@@ -2277,40 +2359,40 @@ var shellArgsSchema = (0, import_provider_utils20.lazySchema)(
|
|
|
2277
2359
|
})
|
|
2278
2360
|
)
|
|
2279
2361
|
);
|
|
2280
|
-
var shell = (0,
|
|
2362
|
+
var shell = (0, import_provider_utils21.createProviderToolFactoryWithOutputSchema)({
|
|
2281
2363
|
id: "openai.shell",
|
|
2282
2364
|
inputSchema: shellInputSchema,
|
|
2283
2365
|
outputSchema: shellOutputSchema
|
|
2284
2366
|
});
|
|
2285
2367
|
|
|
2286
2368
|
// src/tool/tool-search.ts
|
|
2287
|
-
var
|
|
2288
|
-
var
|
|
2289
|
-
var toolSearchArgsSchema = (0,
|
|
2290
|
-
() => (0,
|
|
2291
|
-
|
|
2292
|
-
execution:
|
|
2293
|
-
description:
|
|
2294
|
-
parameters:
|
|
2369
|
+
var import_provider_utils22 = require("@ai-sdk/provider-utils");
|
|
2370
|
+
var import_v417 = require("zod/v4");
|
|
2371
|
+
var toolSearchArgsSchema = (0, import_provider_utils22.lazySchema)(
|
|
2372
|
+
() => (0, import_provider_utils22.zodSchema)(
|
|
2373
|
+
import_v417.z.object({
|
|
2374
|
+
execution: import_v417.z.enum(["server", "client"]).optional(),
|
|
2375
|
+
description: import_v417.z.string().optional(),
|
|
2376
|
+
parameters: import_v417.z.record(import_v417.z.string(), import_v417.z.unknown()).optional()
|
|
2295
2377
|
})
|
|
2296
2378
|
)
|
|
2297
2379
|
);
|
|
2298
|
-
var toolSearchInputSchema = (0,
|
|
2299
|
-
() => (0,
|
|
2300
|
-
|
|
2301
|
-
arguments:
|
|
2302
|
-
call_id:
|
|
2380
|
+
var toolSearchInputSchema = (0, import_provider_utils22.lazySchema)(
|
|
2381
|
+
() => (0, import_provider_utils22.zodSchema)(
|
|
2382
|
+
import_v417.z.object({
|
|
2383
|
+
arguments: import_v417.z.unknown().optional(),
|
|
2384
|
+
call_id: import_v417.z.string().nullish()
|
|
2303
2385
|
})
|
|
2304
2386
|
)
|
|
2305
2387
|
);
|
|
2306
|
-
var toolSearchOutputSchema = (0,
|
|
2307
|
-
() => (0,
|
|
2308
|
-
|
|
2309
|
-
tools:
|
|
2388
|
+
var toolSearchOutputSchema = (0, import_provider_utils22.lazySchema)(
|
|
2389
|
+
() => (0, import_provider_utils22.zodSchema)(
|
|
2390
|
+
import_v417.z.object({
|
|
2391
|
+
tools: import_v417.z.array(import_v417.z.record(import_v417.z.string(), import_v417.z.unknown()))
|
|
2310
2392
|
})
|
|
2311
2393
|
)
|
|
2312
2394
|
);
|
|
2313
|
-
var toolSearchToolFactory = (0,
|
|
2395
|
+
var toolSearchToolFactory = (0, import_provider_utils22.createProviderToolFactoryWithOutputSchema)({
|
|
2314
2396
|
id: "openai.tool_search",
|
|
2315
2397
|
inputSchema: toolSearchInputSchema,
|
|
2316
2398
|
outputSchema: toolSearchOutputSchema
|
|
@@ -2318,65 +2400,13 @@ var toolSearchToolFactory = (0, import_provider_utils21.createProviderToolFactor
|
|
|
2318
2400
|
var toolSearch = (args = {}) => toolSearchToolFactory(args);
|
|
2319
2401
|
|
|
2320
2402
|
// src/tool/web-search.ts
|
|
2321
|
-
var import_provider_utils22 = require("@ai-sdk/provider-utils");
|
|
2322
|
-
var import_v417 = require("zod/v4");
|
|
2323
|
-
var webSearchArgsSchema = (0, import_provider_utils22.lazySchema)(
|
|
2324
|
-
() => (0, import_provider_utils22.zodSchema)(
|
|
2325
|
-
import_v417.z.object({
|
|
2326
|
-
externalWebAccess: import_v417.z.boolean().optional(),
|
|
2327
|
-
filters: import_v417.z.object({ allowedDomains: import_v417.z.array(import_v417.z.string()).optional() }).optional(),
|
|
2328
|
-
searchContextSize: import_v417.z.enum(["low", "medium", "high"]).optional(),
|
|
2329
|
-
userLocation: import_v417.z.object({
|
|
2330
|
-
type: import_v417.z.literal("approximate"),
|
|
2331
|
-
country: import_v417.z.string().optional(),
|
|
2332
|
-
city: import_v417.z.string().optional(),
|
|
2333
|
-
region: import_v417.z.string().optional(),
|
|
2334
|
-
timezone: import_v417.z.string().optional()
|
|
2335
|
-
}).optional()
|
|
2336
|
-
})
|
|
2337
|
-
)
|
|
2338
|
-
);
|
|
2339
|
-
var webSearchInputSchema = (0, import_provider_utils22.lazySchema)(() => (0, import_provider_utils22.zodSchema)(import_v417.z.object({})));
|
|
2340
|
-
var webSearchOutputSchema = (0, import_provider_utils22.lazySchema)(
|
|
2341
|
-
() => (0, import_provider_utils22.zodSchema)(
|
|
2342
|
-
import_v417.z.object({
|
|
2343
|
-
action: import_v417.z.discriminatedUnion("type", [
|
|
2344
|
-
import_v417.z.object({
|
|
2345
|
-
type: import_v417.z.literal("search"),
|
|
2346
|
-
query: import_v417.z.string().optional()
|
|
2347
|
-
}),
|
|
2348
|
-
import_v417.z.object({
|
|
2349
|
-
type: import_v417.z.literal("openPage"),
|
|
2350
|
-
url: import_v417.z.string().nullish()
|
|
2351
|
-
}),
|
|
2352
|
-
import_v417.z.object({
|
|
2353
|
-
type: import_v417.z.literal("findInPage"),
|
|
2354
|
-
url: import_v417.z.string().nullish(),
|
|
2355
|
-
pattern: import_v417.z.string().nullish()
|
|
2356
|
-
})
|
|
2357
|
-
]).optional(),
|
|
2358
|
-
sources: import_v417.z.array(
|
|
2359
|
-
import_v417.z.discriminatedUnion("type", [
|
|
2360
|
-
import_v417.z.object({ type: import_v417.z.literal("url"), url: import_v417.z.string() }),
|
|
2361
|
-
import_v417.z.object({ type: import_v417.z.literal("api"), name: import_v417.z.string() })
|
|
2362
|
-
])
|
|
2363
|
-
).optional()
|
|
2364
|
-
})
|
|
2365
|
-
)
|
|
2366
|
-
);
|
|
2367
|
-
var webSearchToolFactory = (0, import_provider_utils22.createProviderToolFactoryWithOutputSchema)({
|
|
2368
|
-
id: "openai.web_search",
|
|
2369
|
-
inputSchema: webSearchInputSchema,
|
|
2370
|
-
outputSchema: webSearchOutputSchema
|
|
2371
|
-
});
|
|
2372
|
-
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
2373
|
-
|
|
2374
|
-
// src/tool/web-search-preview.ts
|
|
2375
2403
|
var import_provider_utils23 = require("@ai-sdk/provider-utils");
|
|
2376
2404
|
var import_v418 = require("zod/v4");
|
|
2377
|
-
var
|
|
2405
|
+
var webSearchArgsSchema = (0, import_provider_utils23.lazySchema)(
|
|
2378
2406
|
() => (0, import_provider_utils23.zodSchema)(
|
|
2379
2407
|
import_v418.z.object({
|
|
2408
|
+
externalWebAccess: import_v418.z.boolean().optional(),
|
|
2409
|
+
filters: import_v418.z.object({ allowedDomains: import_v418.z.array(import_v418.z.string()).optional() }).optional(),
|
|
2380
2410
|
searchContextSize: import_v418.z.enum(["low", "medium", "high"]).optional(),
|
|
2381
2411
|
userLocation: import_v418.z.object({
|
|
2382
2412
|
type: import_v418.z.literal("approximate"),
|
|
@@ -2388,10 +2418,8 @@ var webSearchPreviewArgsSchema = (0, import_provider_utils23.lazySchema)(
|
|
|
2388
2418
|
})
|
|
2389
2419
|
)
|
|
2390
2420
|
);
|
|
2391
|
-
var
|
|
2392
|
-
|
|
2393
|
-
);
|
|
2394
|
-
var webSearchPreviewOutputSchema = (0, import_provider_utils23.lazySchema)(
|
|
2421
|
+
var webSearchInputSchema = (0, import_provider_utils23.lazySchema)(() => (0, import_provider_utils23.zodSchema)(import_v418.z.object({})));
|
|
2422
|
+
var webSearchOutputSchema = (0, import_provider_utils23.lazySchema)(
|
|
2395
2423
|
() => (0, import_provider_utils23.zodSchema)(
|
|
2396
2424
|
import_v418.z.object({
|
|
2397
2425
|
action: import_v418.z.discriminatedUnion("type", [
|
|
@@ -2408,73 +2436,127 @@ var webSearchPreviewOutputSchema = (0, import_provider_utils23.lazySchema)(
|
|
|
2408
2436
|
url: import_v418.z.string().nullish(),
|
|
2409
2437
|
pattern: import_v418.z.string().nullish()
|
|
2410
2438
|
})
|
|
2439
|
+
]).optional(),
|
|
2440
|
+
sources: import_v418.z.array(
|
|
2441
|
+
import_v418.z.discriminatedUnion("type", [
|
|
2442
|
+
import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() }),
|
|
2443
|
+
import_v418.z.object({ type: import_v418.z.literal("api"), name: import_v418.z.string() })
|
|
2444
|
+
])
|
|
2445
|
+
).optional()
|
|
2446
|
+
})
|
|
2447
|
+
)
|
|
2448
|
+
);
|
|
2449
|
+
var webSearchToolFactory = (0, import_provider_utils23.createProviderToolFactoryWithOutputSchema)({
|
|
2450
|
+
id: "openai.web_search",
|
|
2451
|
+
inputSchema: webSearchInputSchema,
|
|
2452
|
+
outputSchema: webSearchOutputSchema
|
|
2453
|
+
});
|
|
2454
|
+
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
2455
|
+
|
|
2456
|
+
// src/tool/web-search-preview.ts
|
|
2457
|
+
var import_provider_utils24 = require("@ai-sdk/provider-utils");
|
|
2458
|
+
var import_v419 = require("zod/v4");
|
|
2459
|
+
var webSearchPreviewArgsSchema = (0, import_provider_utils24.lazySchema)(
|
|
2460
|
+
() => (0, import_provider_utils24.zodSchema)(
|
|
2461
|
+
import_v419.z.object({
|
|
2462
|
+
searchContextSize: import_v419.z.enum(["low", "medium", "high"]).optional(),
|
|
2463
|
+
userLocation: import_v419.z.object({
|
|
2464
|
+
type: import_v419.z.literal("approximate"),
|
|
2465
|
+
country: import_v419.z.string().optional(),
|
|
2466
|
+
city: import_v419.z.string().optional(),
|
|
2467
|
+
region: import_v419.z.string().optional(),
|
|
2468
|
+
timezone: import_v419.z.string().optional()
|
|
2469
|
+
}).optional()
|
|
2470
|
+
})
|
|
2471
|
+
)
|
|
2472
|
+
);
|
|
2473
|
+
var webSearchPreviewInputSchema = (0, import_provider_utils24.lazySchema)(
|
|
2474
|
+
() => (0, import_provider_utils24.zodSchema)(import_v419.z.object({}))
|
|
2475
|
+
);
|
|
2476
|
+
var webSearchPreviewOutputSchema = (0, import_provider_utils24.lazySchema)(
|
|
2477
|
+
() => (0, import_provider_utils24.zodSchema)(
|
|
2478
|
+
import_v419.z.object({
|
|
2479
|
+
action: import_v419.z.discriminatedUnion("type", [
|
|
2480
|
+
import_v419.z.object({
|
|
2481
|
+
type: import_v419.z.literal("search"),
|
|
2482
|
+
query: import_v419.z.string().optional()
|
|
2483
|
+
}),
|
|
2484
|
+
import_v419.z.object({
|
|
2485
|
+
type: import_v419.z.literal("openPage"),
|
|
2486
|
+
url: import_v419.z.string().nullish()
|
|
2487
|
+
}),
|
|
2488
|
+
import_v419.z.object({
|
|
2489
|
+
type: import_v419.z.literal("findInPage"),
|
|
2490
|
+
url: import_v419.z.string().nullish(),
|
|
2491
|
+
pattern: import_v419.z.string().nullish()
|
|
2492
|
+
})
|
|
2411
2493
|
]).optional()
|
|
2412
2494
|
})
|
|
2413
2495
|
)
|
|
2414
2496
|
);
|
|
2415
|
-
var webSearchPreview = (0,
|
|
2497
|
+
var webSearchPreview = (0, import_provider_utils24.createProviderToolFactoryWithOutputSchema)({
|
|
2416
2498
|
id: "openai.web_search_preview",
|
|
2417
2499
|
inputSchema: webSearchPreviewInputSchema,
|
|
2418
2500
|
outputSchema: webSearchPreviewOutputSchema
|
|
2419
2501
|
});
|
|
2420
2502
|
|
|
2421
2503
|
// src/tool/mcp.ts
|
|
2422
|
-
var
|
|
2423
|
-
var
|
|
2424
|
-
var jsonValueSchema =
|
|
2425
|
-
() =>
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2504
|
+
var import_provider_utils25 = require("@ai-sdk/provider-utils");
|
|
2505
|
+
var import_v420 = require("zod/v4");
|
|
2506
|
+
var jsonValueSchema = import_v420.z.lazy(
|
|
2507
|
+
() => import_v420.z.union([
|
|
2508
|
+
import_v420.z.string(),
|
|
2509
|
+
import_v420.z.number(),
|
|
2510
|
+
import_v420.z.boolean(),
|
|
2511
|
+
import_v420.z.null(),
|
|
2512
|
+
import_v420.z.array(jsonValueSchema),
|
|
2513
|
+
import_v420.z.record(import_v420.z.string(), jsonValueSchema)
|
|
2432
2514
|
])
|
|
2433
2515
|
);
|
|
2434
|
-
var mcpArgsSchema = (0,
|
|
2435
|
-
() => (0,
|
|
2436
|
-
|
|
2437
|
-
serverLabel:
|
|
2438
|
-
allowedTools:
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
readOnly:
|
|
2442
|
-
toolNames:
|
|
2516
|
+
var mcpArgsSchema = (0, import_provider_utils25.lazySchema)(
|
|
2517
|
+
() => (0, import_provider_utils25.zodSchema)(
|
|
2518
|
+
import_v420.z.object({
|
|
2519
|
+
serverLabel: import_v420.z.string(),
|
|
2520
|
+
allowedTools: import_v420.z.union([
|
|
2521
|
+
import_v420.z.array(import_v420.z.string()),
|
|
2522
|
+
import_v420.z.object({
|
|
2523
|
+
readOnly: import_v420.z.boolean().optional(),
|
|
2524
|
+
toolNames: import_v420.z.array(import_v420.z.string()).optional()
|
|
2443
2525
|
})
|
|
2444
2526
|
]).optional(),
|
|
2445
|
-
authorization:
|
|
2446
|
-
connectorId:
|
|
2447
|
-
headers:
|
|
2448
|
-
requireApproval:
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
never:
|
|
2452
|
-
toolNames:
|
|
2527
|
+
authorization: import_v420.z.string().optional(),
|
|
2528
|
+
connectorId: import_v420.z.string().optional(),
|
|
2529
|
+
headers: import_v420.z.record(import_v420.z.string(), import_v420.z.string()).optional(),
|
|
2530
|
+
requireApproval: import_v420.z.union([
|
|
2531
|
+
import_v420.z.enum(["always", "never"]),
|
|
2532
|
+
import_v420.z.object({
|
|
2533
|
+
never: import_v420.z.object({
|
|
2534
|
+
toolNames: import_v420.z.array(import_v420.z.string()).optional()
|
|
2453
2535
|
}).optional()
|
|
2454
2536
|
})
|
|
2455
2537
|
]).optional(),
|
|
2456
|
-
serverDescription:
|
|
2457
|
-
serverUrl:
|
|
2538
|
+
serverDescription: import_v420.z.string().optional(),
|
|
2539
|
+
serverUrl: import_v420.z.string().optional()
|
|
2458
2540
|
}).refine(
|
|
2459
2541
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
2460
2542
|
"One of serverUrl or connectorId must be provided."
|
|
2461
2543
|
)
|
|
2462
2544
|
)
|
|
2463
2545
|
);
|
|
2464
|
-
var mcpInputSchema = (0,
|
|
2465
|
-
var mcpOutputSchema = (0,
|
|
2466
|
-
() => (0,
|
|
2467
|
-
|
|
2468
|
-
type:
|
|
2469
|
-
serverLabel:
|
|
2470
|
-
name:
|
|
2471
|
-
arguments:
|
|
2472
|
-
output:
|
|
2473
|
-
error:
|
|
2546
|
+
var mcpInputSchema = (0, import_provider_utils25.lazySchema)(() => (0, import_provider_utils25.zodSchema)(import_v420.z.object({})));
|
|
2547
|
+
var mcpOutputSchema = (0, import_provider_utils25.lazySchema)(
|
|
2548
|
+
() => (0, import_provider_utils25.zodSchema)(
|
|
2549
|
+
import_v420.z.object({
|
|
2550
|
+
type: import_v420.z.literal("call"),
|
|
2551
|
+
serverLabel: import_v420.z.string(),
|
|
2552
|
+
name: import_v420.z.string(),
|
|
2553
|
+
arguments: import_v420.z.string(),
|
|
2554
|
+
output: import_v420.z.string().nullish(),
|
|
2555
|
+
error: import_v420.z.union([import_v420.z.string(), jsonValueSchema]).optional()
|
|
2474
2556
|
})
|
|
2475
2557
|
)
|
|
2476
2558
|
);
|
|
2477
|
-
var mcpToolFactory = (0,
|
|
2559
|
+
var mcpToolFactory = (0, import_provider_utils25.createProviderToolFactoryWithOutputSchema)({
|
|
2478
2560
|
id: "openai.mcp",
|
|
2479
2561
|
inputSchema: mcpInputSchema,
|
|
2480
2562
|
outputSchema: mcpOutputSchema
|
|
@@ -2601,7 +2683,7 @@ var openaiTools = {
|
|
|
2601
2683
|
|
|
2602
2684
|
// src/responses/openai-responses-language-model.ts
|
|
2603
2685
|
var import_provider8 = require("@ai-sdk/provider");
|
|
2604
|
-
var
|
|
2686
|
+
var import_provider_utils30 = require("@ai-sdk/provider-utils");
|
|
2605
2687
|
|
|
2606
2688
|
// src/responses/convert-openai-responses-usage.ts
|
|
2607
2689
|
function convertOpenAIResponsesUsage(usage) {
|
|
@@ -2644,8 +2726,8 @@ function convertOpenAIResponsesUsage(usage) {
|
|
|
2644
2726
|
|
|
2645
2727
|
// src/responses/convert-to-openai-responses-input.ts
|
|
2646
2728
|
var import_provider6 = require("@ai-sdk/provider");
|
|
2647
|
-
var
|
|
2648
|
-
var
|
|
2729
|
+
var import_provider_utils26 = require("@ai-sdk/provider-utils");
|
|
2730
|
+
var import_v421 = require("zod/v4");
|
|
2649
2731
|
function serializeToolCallArguments2(input) {
|
|
2650
2732
|
return JSON.stringify(input === void 0 ? {} : input);
|
|
2651
2733
|
}
|
|
@@ -2713,7 +2795,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2713
2795
|
return {
|
|
2714
2796
|
type: "input_image",
|
|
2715
2797
|
...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
2716
|
-
image_url: `data:${mediaType};base64,${(0,
|
|
2798
|
+
image_url: `data:${mediaType};base64,${(0, import_provider_utils26.convertToBase64)(part.data)}`
|
|
2717
2799
|
},
|
|
2718
2800
|
detail: (_b2 = (_a2 = part.providerOptions) == null ? void 0 : _a2[providerOptionsName]) == null ? void 0 : _b2.imageDetail
|
|
2719
2801
|
};
|
|
@@ -2728,7 +2810,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2728
2810
|
type: "input_file",
|
|
2729
2811
|
...typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
|
|
2730
2812
|
filename: (_c2 = part.filename) != null ? _c2 : `part-${index}.pdf`,
|
|
2731
|
-
file_data: `data:application/pdf;base64,${(0,
|
|
2813
|
+
file_data: `data:application/pdf;base64,${(0, import_provider_utils26.convertToBase64)(part.data)}`
|
|
2732
2814
|
}
|
|
2733
2815
|
};
|
|
2734
2816
|
} else {
|
|
@@ -2778,10 +2860,10 @@ async function convertToOpenAIResponsesInput({
|
|
|
2778
2860
|
input.push({ type: "item_reference", id });
|
|
2779
2861
|
break;
|
|
2780
2862
|
}
|
|
2781
|
-
const parsedInput = typeof part.input === "string" ? await (0,
|
|
2863
|
+
const parsedInput = typeof part.input === "string" ? await (0, import_provider_utils26.parseJSON)({
|
|
2782
2864
|
text: part.input,
|
|
2783
2865
|
schema: toolSearchInputSchema
|
|
2784
|
-
}) : await (0,
|
|
2866
|
+
}) : await (0, import_provider_utils26.validateTypes)({
|
|
2785
2867
|
value: part.input,
|
|
2786
2868
|
schema: toolSearchInputSchema
|
|
2787
2869
|
});
|
|
@@ -2807,7 +2889,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2807
2889
|
break;
|
|
2808
2890
|
}
|
|
2809
2891
|
if (hasLocalShellTool && resolvedToolName === "local_shell") {
|
|
2810
|
-
const parsedInput = await (0,
|
|
2892
|
+
const parsedInput = await (0, import_provider_utils26.validateTypes)({
|
|
2811
2893
|
value: part.input,
|
|
2812
2894
|
schema: localShellInputSchema
|
|
2813
2895
|
});
|
|
@@ -2827,7 +2909,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2827
2909
|
break;
|
|
2828
2910
|
}
|
|
2829
2911
|
if (hasShellTool && resolvedToolName === "shell") {
|
|
2830
|
-
const parsedInput = await (0,
|
|
2912
|
+
const parsedInput = await (0, import_provider_utils26.validateTypes)({
|
|
2831
2913
|
value: part.input,
|
|
2832
2914
|
schema: shellInputSchema
|
|
2833
2915
|
});
|
|
@@ -2845,7 +2927,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2845
2927
|
break;
|
|
2846
2928
|
}
|
|
2847
2929
|
if (hasApplyPatchTool && resolvedToolName === "apply_patch") {
|
|
2848
|
-
const parsedInput = await (0,
|
|
2930
|
+
const parsedInput = await (0, import_provider_utils26.validateTypes)({
|
|
2849
2931
|
value: part.input,
|
|
2850
2932
|
schema: applyPatchInputSchema
|
|
2851
2933
|
});
|
|
@@ -2893,7 +2975,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2893
2975
|
if (store) {
|
|
2894
2976
|
input.push({ type: "item_reference", id: itemId });
|
|
2895
2977
|
} else if (part.output.type === "json") {
|
|
2896
|
-
const parsedOutput = await (0,
|
|
2978
|
+
const parsedOutput = await (0, import_provider_utils26.validateTypes)({
|
|
2897
2979
|
value: part.output.value,
|
|
2898
2980
|
schema: toolSearchOutputSchema
|
|
2899
2981
|
});
|
|
@@ -2910,7 +2992,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2910
2992
|
}
|
|
2911
2993
|
if (hasShellTool && resolvedResultToolName === "shell") {
|
|
2912
2994
|
if (part.output.type === "json") {
|
|
2913
|
-
const parsedOutput = await (0,
|
|
2995
|
+
const parsedOutput = await (0, import_provider_utils26.validateTypes)({
|
|
2914
2996
|
value: part.output.value,
|
|
2915
2997
|
schema: shellOutputSchema
|
|
2916
2998
|
});
|
|
@@ -2941,7 +3023,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2941
3023
|
break;
|
|
2942
3024
|
}
|
|
2943
3025
|
case "reasoning": {
|
|
2944
|
-
const providerOptions = await (0,
|
|
3026
|
+
const providerOptions = await (0, import_provider_utils26.parseProviderOptions)({
|
|
2945
3027
|
provider: providerOptionsName,
|
|
2946
3028
|
providerOptions: part.providerOptions,
|
|
2947
3029
|
schema: openaiResponsesReasoningProviderOptionsSchema
|
|
@@ -3049,7 +3131,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3049
3131
|
part.toolName
|
|
3050
3132
|
);
|
|
3051
3133
|
if (resolvedToolName === "tool_search" && output.type === "json") {
|
|
3052
|
-
const parsedOutput = await (0,
|
|
3134
|
+
const parsedOutput = await (0, import_provider_utils26.validateTypes)({
|
|
3053
3135
|
value: output.value,
|
|
3054
3136
|
schema: toolSearchOutputSchema
|
|
3055
3137
|
});
|
|
@@ -3063,7 +3145,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3063
3145
|
continue;
|
|
3064
3146
|
}
|
|
3065
3147
|
if (hasLocalShellTool && resolvedToolName === "local_shell" && output.type === "json") {
|
|
3066
|
-
const parsedOutput = await (0,
|
|
3148
|
+
const parsedOutput = await (0, import_provider_utils26.validateTypes)({
|
|
3067
3149
|
value: output.value,
|
|
3068
3150
|
schema: localShellOutputSchema
|
|
3069
3151
|
});
|
|
@@ -3075,7 +3157,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3075
3157
|
continue;
|
|
3076
3158
|
}
|
|
3077
3159
|
if (hasShellTool && resolvedToolName === "shell" && output.type === "json") {
|
|
3078
|
-
const parsedOutput = await (0,
|
|
3160
|
+
const parsedOutput = await (0, import_provider_utils26.validateTypes)({
|
|
3079
3161
|
value: output.value,
|
|
3080
3162
|
schema: shellOutputSchema
|
|
3081
3163
|
});
|
|
@@ -3094,7 +3176,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3094
3176
|
continue;
|
|
3095
3177
|
}
|
|
3096
3178
|
if (hasApplyPatchTool && part.toolName === "apply_patch" && output.type === "json") {
|
|
3097
|
-
const parsedOutput = await (0,
|
|
3179
|
+
const parsedOutput = await (0, import_provider_utils26.validateTypes)({
|
|
3098
3180
|
value: output.value,
|
|
3099
3181
|
schema: applyPatchOutputSchema
|
|
3100
3182
|
});
|
|
@@ -3154,7 +3236,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3154
3236
|
});
|
|
3155
3237
|
return void 0;
|
|
3156
3238
|
}
|
|
3157
|
-
}).filter(
|
|
3239
|
+
}).filter(import_provider_utils26.isNonNullable);
|
|
3158
3240
|
break;
|
|
3159
3241
|
default:
|
|
3160
3242
|
outputValue = "";
|
|
@@ -3219,7 +3301,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3219
3301
|
return void 0;
|
|
3220
3302
|
}
|
|
3221
3303
|
}
|
|
3222
|
-
}).filter(
|
|
3304
|
+
}).filter(import_provider_utils26.isNonNullable);
|
|
3223
3305
|
break;
|
|
3224
3306
|
}
|
|
3225
3307
|
input.push({
|
|
@@ -3249,9 +3331,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
3249
3331
|
}
|
|
3250
3332
|
return { input, warnings };
|
|
3251
3333
|
}
|
|
3252
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
3253
|
-
itemId:
|
|
3254
|
-
reasoningEncryptedContent:
|
|
3334
|
+
var openaiResponsesReasoningProviderOptionsSchema = import_v421.z.object({
|
|
3335
|
+
itemId: import_v421.z.string().nullish(),
|
|
3336
|
+
reasoningEncryptedContent: import_v421.z.string().nullish()
|
|
3255
3337
|
});
|
|
3256
3338
|
|
|
3257
3339
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -3273,542 +3355,542 @@ function mapOpenAIResponseFinishReason({
|
|
|
3273
3355
|
}
|
|
3274
3356
|
|
|
3275
3357
|
// src/responses/openai-responses-api.ts
|
|
3276
|
-
var
|
|
3277
|
-
var
|
|
3278
|
-
var jsonValueSchema2 =
|
|
3279
|
-
() =>
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3358
|
+
var import_provider_utils27 = require("@ai-sdk/provider-utils");
|
|
3359
|
+
var import_v422 = require("zod/v4");
|
|
3360
|
+
var jsonValueSchema2 = import_v422.z.lazy(
|
|
3361
|
+
() => import_v422.z.union([
|
|
3362
|
+
import_v422.z.string(),
|
|
3363
|
+
import_v422.z.number(),
|
|
3364
|
+
import_v422.z.boolean(),
|
|
3365
|
+
import_v422.z.null(),
|
|
3366
|
+
import_v422.z.array(jsonValueSchema2),
|
|
3367
|
+
import_v422.z.record(import_v422.z.string(), jsonValueSchema2.optional())
|
|
3286
3368
|
])
|
|
3287
3369
|
);
|
|
3288
|
-
var openaiResponsesChunkSchema = (0,
|
|
3289
|
-
() => (0,
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
type:
|
|
3293
|
-
item_id:
|
|
3294
|
-
delta:
|
|
3295
|
-
logprobs:
|
|
3296
|
-
|
|
3297
|
-
token:
|
|
3298
|
-
logprob:
|
|
3299
|
-
top_logprobs:
|
|
3300
|
-
|
|
3301
|
-
token:
|
|
3302
|
-
logprob:
|
|
3370
|
+
var openaiResponsesChunkSchema = (0, import_provider_utils27.lazySchema)(
|
|
3371
|
+
() => (0, import_provider_utils27.zodSchema)(
|
|
3372
|
+
import_v422.z.union([
|
|
3373
|
+
import_v422.z.object({
|
|
3374
|
+
type: import_v422.z.literal("response.output_text.delta"),
|
|
3375
|
+
item_id: import_v422.z.string(),
|
|
3376
|
+
delta: import_v422.z.string(),
|
|
3377
|
+
logprobs: import_v422.z.array(
|
|
3378
|
+
import_v422.z.object({
|
|
3379
|
+
token: import_v422.z.string(),
|
|
3380
|
+
logprob: import_v422.z.number(),
|
|
3381
|
+
top_logprobs: import_v422.z.array(
|
|
3382
|
+
import_v422.z.object({
|
|
3383
|
+
token: import_v422.z.string(),
|
|
3384
|
+
logprob: import_v422.z.number()
|
|
3303
3385
|
})
|
|
3304
3386
|
)
|
|
3305
3387
|
})
|
|
3306
3388
|
).nullish()
|
|
3307
3389
|
}),
|
|
3308
|
-
|
|
3309
|
-
type:
|
|
3310
|
-
response:
|
|
3311
|
-
incomplete_details:
|
|
3312
|
-
usage:
|
|
3313
|
-
input_tokens:
|
|
3314
|
-
input_tokens_details:
|
|
3315
|
-
output_tokens:
|
|
3316
|
-
output_tokens_details:
|
|
3390
|
+
import_v422.z.object({
|
|
3391
|
+
type: import_v422.z.enum(["response.completed", "response.incomplete"]),
|
|
3392
|
+
response: import_v422.z.object({
|
|
3393
|
+
incomplete_details: import_v422.z.object({ reason: import_v422.z.string() }).nullish(),
|
|
3394
|
+
usage: import_v422.z.object({
|
|
3395
|
+
input_tokens: import_v422.z.number(),
|
|
3396
|
+
input_tokens_details: import_v422.z.object({ cached_tokens: import_v422.z.number().nullish() }).nullish(),
|
|
3397
|
+
output_tokens: import_v422.z.number(),
|
|
3398
|
+
output_tokens_details: import_v422.z.object({ reasoning_tokens: import_v422.z.number().nullish() }).nullish()
|
|
3317
3399
|
}),
|
|
3318
|
-
service_tier:
|
|
3400
|
+
service_tier: import_v422.z.string().nullish()
|
|
3319
3401
|
})
|
|
3320
3402
|
}),
|
|
3321
|
-
|
|
3322
|
-
type:
|
|
3323
|
-
response:
|
|
3324
|
-
error:
|
|
3325
|
-
code:
|
|
3326
|
-
message:
|
|
3403
|
+
import_v422.z.object({
|
|
3404
|
+
type: import_v422.z.literal("response.failed"),
|
|
3405
|
+
response: import_v422.z.object({
|
|
3406
|
+
error: import_v422.z.object({
|
|
3407
|
+
code: import_v422.z.string().nullish(),
|
|
3408
|
+
message: import_v422.z.string()
|
|
3327
3409
|
}).nullish(),
|
|
3328
|
-
incomplete_details:
|
|
3329
|
-
usage:
|
|
3330
|
-
input_tokens:
|
|
3331
|
-
input_tokens_details:
|
|
3332
|
-
output_tokens:
|
|
3333
|
-
output_tokens_details:
|
|
3410
|
+
incomplete_details: import_v422.z.object({ reason: import_v422.z.string() }).nullish(),
|
|
3411
|
+
usage: import_v422.z.object({
|
|
3412
|
+
input_tokens: import_v422.z.number(),
|
|
3413
|
+
input_tokens_details: import_v422.z.object({ cached_tokens: import_v422.z.number().nullish() }).nullish(),
|
|
3414
|
+
output_tokens: import_v422.z.number(),
|
|
3415
|
+
output_tokens_details: import_v422.z.object({ reasoning_tokens: import_v422.z.number().nullish() }).nullish()
|
|
3334
3416
|
}).nullish(),
|
|
3335
|
-
service_tier:
|
|
3417
|
+
service_tier: import_v422.z.string().nullish()
|
|
3336
3418
|
})
|
|
3337
3419
|
}),
|
|
3338
|
-
|
|
3339
|
-
type:
|
|
3340
|
-
response:
|
|
3341
|
-
id:
|
|
3342
|
-
created_at:
|
|
3343
|
-
model:
|
|
3344
|
-
service_tier:
|
|
3420
|
+
import_v422.z.object({
|
|
3421
|
+
type: import_v422.z.literal("response.created"),
|
|
3422
|
+
response: import_v422.z.object({
|
|
3423
|
+
id: import_v422.z.string(),
|
|
3424
|
+
created_at: import_v422.z.number(),
|
|
3425
|
+
model: import_v422.z.string(),
|
|
3426
|
+
service_tier: import_v422.z.string().nullish()
|
|
3345
3427
|
})
|
|
3346
3428
|
}),
|
|
3347
|
-
|
|
3348
|
-
type:
|
|
3349
|
-
output_index:
|
|
3350
|
-
item:
|
|
3351
|
-
|
|
3352
|
-
type:
|
|
3353
|
-
id:
|
|
3354
|
-
phase:
|
|
3429
|
+
import_v422.z.object({
|
|
3430
|
+
type: import_v422.z.literal("response.output_item.added"),
|
|
3431
|
+
output_index: import_v422.z.number(),
|
|
3432
|
+
item: import_v422.z.discriminatedUnion("type", [
|
|
3433
|
+
import_v422.z.object({
|
|
3434
|
+
type: import_v422.z.literal("message"),
|
|
3435
|
+
id: import_v422.z.string(),
|
|
3436
|
+
phase: import_v422.z.enum(["commentary", "final_answer"]).nullish()
|
|
3355
3437
|
}),
|
|
3356
|
-
|
|
3357
|
-
type:
|
|
3358
|
-
id:
|
|
3359
|
-
encrypted_content:
|
|
3438
|
+
import_v422.z.object({
|
|
3439
|
+
type: import_v422.z.literal("reasoning"),
|
|
3440
|
+
id: import_v422.z.string(),
|
|
3441
|
+
encrypted_content: import_v422.z.string().nullish()
|
|
3360
3442
|
}),
|
|
3361
|
-
|
|
3362
|
-
type:
|
|
3363
|
-
id:
|
|
3364
|
-
call_id:
|
|
3365
|
-
name:
|
|
3366
|
-
arguments:
|
|
3443
|
+
import_v422.z.object({
|
|
3444
|
+
type: import_v422.z.literal("function_call"),
|
|
3445
|
+
id: import_v422.z.string(),
|
|
3446
|
+
call_id: import_v422.z.string(),
|
|
3447
|
+
name: import_v422.z.string(),
|
|
3448
|
+
arguments: import_v422.z.string()
|
|
3367
3449
|
}),
|
|
3368
|
-
|
|
3369
|
-
type:
|
|
3370
|
-
id:
|
|
3371
|
-
status:
|
|
3450
|
+
import_v422.z.object({
|
|
3451
|
+
type: import_v422.z.literal("web_search_call"),
|
|
3452
|
+
id: import_v422.z.string(),
|
|
3453
|
+
status: import_v422.z.string()
|
|
3372
3454
|
}),
|
|
3373
|
-
|
|
3374
|
-
type:
|
|
3375
|
-
id:
|
|
3376
|
-
status:
|
|
3455
|
+
import_v422.z.object({
|
|
3456
|
+
type: import_v422.z.literal("computer_call"),
|
|
3457
|
+
id: import_v422.z.string(),
|
|
3458
|
+
status: import_v422.z.string()
|
|
3377
3459
|
}),
|
|
3378
|
-
|
|
3379
|
-
type:
|
|
3380
|
-
id:
|
|
3460
|
+
import_v422.z.object({
|
|
3461
|
+
type: import_v422.z.literal("file_search_call"),
|
|
3462
|
+
id: import_v422.z.string()
|
|
3381
3463
|
}),
|
|
3382
|
-
|
|
3383
|
-
type:
|
|
3384
|
-
id:
|
|
3464
|
+
import_v422.z.object({
|
|
3465
|
+
type: import_v422.z.literal("image_generation_call"),
|
|
3466
|
+
id: import_v422.z.string()
|
|
3385
3467
|
}),
|
|
3386
|
-
|
|
3387
|
-
type:
|
|
3388
|
-
id:
|
|
3389
|
-
container_id:
|
|
3390
|
-
code:
|
|
3391
|
-
outputs:
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3468
|
+
import_v422.z.object({
|
|
3469
|
+
type: import_v422.z.literal("code_interpreter_call"),
|
|
3470
|
+
id: import_v422.z.string(),
|
|
3471
|
+
container_id: import_v422.z.string(),
|
|
3472
|
+
code: import_v422.z.string().nullable(),
|
|
3473
|
+
outputs: import_v422.z.array(
|
|
3474
|
+
import_v422.z.discriminatedUnion("type", [
|
|
3475
|
+
import_v422.z.object({ type: import_v422.z.literal("logs"), logs: import_v422.z.string() }),
|
|
3476
|
+
import_v422.z.object({ type: import_v422.z.literal("image"), url: import_v422.z.string() })
|
|
3395
3477
|
])
|
|
3396
3478
|
).nullable(),
|
|
3397
|
-
status:
|
|
3479
|
+
status: import_v422.z.string()
|
|
3398
3480
|
}),
|
|
3399
|
-
|
|
3400
|
-
type:
|
|
3401
|
-
id:
|
|
3402
|
-
status:
|
|
3403
|
-
approval_request_id:
|
|
3481
|
+
import_v422.z.object({
|
|
3482
|
+
type: import_v422.z.literal("mcp_call"),
|
|
3483
|
+
id: import_v422.z.string(),
|
|
3484
|
+
status: import_v422.z.string(),
|
|
3485
|
+
approval_request_id: import_v422.z.string().nullish()
|
|
3404
3486
|
}),
|
|
3405
|
-
|
|
3406
|
-
type:
|
|
3407
|
-
id:
|
|
3487
|
+
import_v422.z.object({
|
|
3488
|
+
type: import_v422.z.literal("mcp_list_tools"),
|
|
3489
|
+
id: import_v422.z.string()
|
|
3408
3490
|
}),
|
|
3409
|
-
|
|
3410
|
-
type:
|
|
3411
|
-
id:
|
|
3491
|
+
import_v422.z.object({
|
|
3492
|
+
type: import_v422.z.literal("mcp_approval_request"),
|
|
3493
|
+
id: import_v422.z.string()
|
|
3412
3494
|
}),
|
|
3413
|
-
|
|
3414
|
-
type:
|
|
3415
|
-
id:
|
|
3416
|
-
call_id:
|
|
3417
|
-
status:
|
|
3418
|
-
operation:
|
|
3419
|
-
|
|
3420
|
-
type:
|
|
3421
|
-
path:
|
|
3422
|
-
diff:
|
|
3495
|
+
import_v422.z.object({
|
|
3496
|
+
type: import_v422.z.literal("apply_patch_call"),
|
|
3497
|
+
id: import_v422.z.string(),
|
|
3498
|
+
call_id: import_v422.z.string(),
|
|
3499
|
+
status: import_v422.z.enum(["in_progress", "completed"]),
|
|
3500
|
+
operation: import_v422.z.discriminatedUnion("type", [
|
|
3501
|
+
import_v422.z.object({
|
|
3502
|
+
type: import_v422.z.literal("create_file"),
|
|
3503
|
+
path: import_v422.z.string(),
|
|
3504
|
+
diff: import_v422.z.string()
|
|
3423
3505
|
}),
|
|
3424
|
-
|
|
3425
|
-
type:
|
|
3426
|
-
path:
|
|
3506
|
+
import_v422.z.object({
|
|
3507
|
+
type: import_v422.z.literal("delete_file"),
|
|
3508
|
+
path: import_v422.z.string()
|
|
3427
3509
|
}),
|
|
3428
|
-
|
|
3429
|
-
type:
|
|
3430
|
-
path:
|
|
3431
|
-
diff:
|
|
3510
|
+
import_v422.z.object({
|
|
3511
|
+
type: import_v422.z.literal("update_file"),
|
|
3512
|
+
path: import_v422.z.string(),
|
|
3513
|
+
diff: import_v422.z.string()
|
|
3432
3514
|
})
|
|
3433
3515
|
])
|
|
3434
3516
|
}),
|
|
3435
|
-
|
|
3436
|
-
type:
|
|
3437
|
-
id:
|
|
3438
|
-
call_id:
|
|
3439
|
-
name:
|
|
3440
|
-
input:
|
|
3517
|
+
import_v422.z.object({
|
|
3518
|
+
type: import_v422.z.literal("custom_tool_call"),
|
|
3519
|
+
id: import_v422.z.string(),
|
|
3520
|
+
call_id: import_v422.z.string(),
|
|
3521
|
+
name: import_v422.z.string(),
|
|
3522
|
+
input: import_v422.z.string()
|
|
3441
3523
|
}),
|
|
3442
|
-
|
|
3443
|
-
type:
|
|
3444
|
-
id:
|
|
3445
|
-
call_id:
|
|
3446
|
-
status:
|
|
3447
|
-
action:
|
|
3448
|
-
commands:
|
|
3524
|
+
import_v422.z.object({
|
|
3525
|
+
type: import_v422.z.literal("shell_call"),
|
|
3526
|
+
id: import_v422.z.string(),
|
|
3527
|
+
call_id: import_v422.z.string(),
|
|
3528
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3529
|
+
action: import_v422.z.object({
|
|
3530
|
+
commands: import_v422.z.array(import_v422.z.string())
|
|
3449
3531
|
})
|
|
3450
3532
|
}),
|
|
3451
|
-
|
|
3452
|
-
type:
|
|
3453
|
-
id:
|
|
3454
|
-
call_id:
|
|
3455
|
-
status:
|
|
3456
|
-
output:
|
|
3457
|
-
|
|
3458
|
-
stdout:
|
|
3459
|
-
stderr:
|
|
3460
|
-
outcome:
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
type:
|
|
3464
|
-
exit_code:
|
|
3533
|
+
import_v422.z.object({
|
|
3534
|
+
type: import_v422.z.literal("shell_call_output"),
|
|
3535
|
+
id: import_v422.z.string(),
|
|
3536
|
+
call_id: import_v422.z.string(),
|
|
3537
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3538
|
+
output: import_v422.z.array(
|
|
3539
|
+
import_v422.z.object({
|
|
3540
|
+
stdout: import_v422.z.string(),
|
|
3541
|
+
stderr: import_v422.z.string(),
|
|
3542
|
+
outcome: import_v422.z.discriminatedUnion("type", [
|
|
3543
|
+
import_v422.z.object({ type: import_v422.z.literal("timeout") }),
|
|
3544
|
+
import_v422.z.object({
|
|
3545
|
+
type: import_v422.z.literal("exit"),
|
|
3546
|
+
exit_code: import_v422.z.number()
|
|
3465
3547
|
})
|
|
3466
3548
|
])
|
|
3467
3549
|
})
|
|
3468
3550
|
)
|
|
3469
3551
|
}),
|
|
3470
|
-
|
|
3471
|
-
type:
|
|
3472
|
-
id:
|
|
3473
|
-
execution:
|
|
3474
|
-
call_id:
|
|
3475
|
-
status:
|
|
3476
|
-
arguments:
|
|
3552
|
+
import_v422.z.object({
|
|
3553
|
+
type: import_v422.z.literal("tool_search_call"),
|
|
3554
|
+
id: import_v422.z.string(),
|
|
3555
|
+
execution: import_v422.z.enum(["server", "client"]),
|
|
3556
|
+
call_id: import_v422.z.string().nullable(),
|
|
3557
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3558
|
+
arguments: import_v422.z.unknown()
|
|
3477
3559
|
}),
|
|
3478
|
-
|
|
3479
|
-
type:
|
|
3480
|
-
id:
|
|
3481
|
-
execution:
|
|
3482
|
-
call_id:
|
|
3483
|
-
status:
|
|
3484
|
-
tools:
|
|
3560
|
+
import_v422.z.object({
|
|
3561
|
+
type: import_v422.z.literal("tool_search_output"),
|
|
3562
|
+
id: import_v422.z.string(),
|
|
3563
|
+
execution: import_v422.z.enum(["server", "client"]),
|
|
3564
|
+
call_id: import_v422.z.string().nullable(),
|
|
3565
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3566
|
+
tools: import_v422.z.array(import_v422.z.record(import_v422.z.string(), jsonValueSchema2.optional()))
|
|
3485
3567
|
})
|
|
3486
3568
|
])
|
|
3487
3569
|
}),
|
|
3488
|
-
|
|
3489
|
-
type:
|
|
3490
|
-
output_index:
|
|
3491
|
-
item:
|
|
3492
|
-
|
|
3493
|
-
type:
|
|
3494
|
-
id:
|
|
3495
|
-
phase:
|
|
3570
|
+
import_v422.z.object({
|
|
3571
|
+
type: import_v422.z.literal("response.output_item.done"),
|
|
3572
|
+
output_index: import_v422.z.number(),
|
|
3573
|
+
item: import_v422.z.discriminatedUnion("type", [
|
|
3574
|
+
import_v422.z.object({
|
|
3575
|
+
type: import_v422.z.literal("message"),
|
|
3576
|
+
id: import_v422.z.string(),
|
|
3577
|
+
phase: import_v422.z.enum(["commentary", "final_answer"]).nullish()
|
|
3496
3578
|
}),
|
|
3497
|
-
|
|
3498
|
-
type:
|
|
3499
|
-
id:
|
|
3500
|
-
encrypted_content:
|
|
3579
|
+
import_v422.z.object({
|
|
3580
|
+
type: import_v422.z.literal("reasoning"),
|
|
3581
|
+
id: import_v422.z.string(),
|
|
3582
|
+
encrypted_content: import_v422.z.string().nullish()
|
|
3501
3583
|
}),
|
|
3502
|
-
|
|
3503
|
-
type:
|
|
3504
|
-
id:
|
|
3505
|
-
call_id:
|
|
3506
|
-
name:
|
|
3507
|
-
arguments:
|
|
3508
|
-
status:
|
|
3584
|
+
import_v422.z.object({
|
|
3585
|
+
type: import_v422.z.literal("function_call"),
|
|
3586
|
+
id: import_v422.z.string(),
|
|
3587
|
+
call_id: import_v422.z.string(),
|
|
3588
|
+
name: import_v422.z.string(),
|
|
3589
|
+
arguments: import_v422.z.string(),
|
|
3590
|
+
status: import_v422.z.literal("completed")
|
|
3509
3591
|
}),
|
|
3510
|
-
|
|
3511
|
-
type:
|
|
3512
|
-
id:
|
|
3513
|
-
call_id:
|
|
3514
|
-
name:
|
|
3515
|
-
input:
|
|
3516
|
-
status:
|
|
3592
|
+
import_v422.z.object({
|
|
3593
|
+
type: import_v422.z.literal("custom_tool_call"),
|
|
3594
|
+
id: import_v422.z.string(),
|
|
3595
|
+
call_id: import_v422.z.string(),
|
|
3596
|
+
name: import_v422.z.string(),
|
|
3597
|
+
input: import_v422.z.string(),
|
|
3598
|
+
status: import_v422.z.literal("completed")
|
|
3517
3599
|
}),
|
|
3518
|
-
|
|
3519
|
-
type:
|
|
3520
|
-
id:
|
|
3521
|
-
code:
|
|
3522
|
-
container_id:
|
|
3523
|
-
outputs:
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3600
|
+
import_v422.z.object({
|
|
3601
|
+
type: import_v422.z.literal("code_interpreter_call"),
|
|
3602
|
+
id: import_v422.z.string(),
|
|
3603
|
+
code: import_v422.z.string().nullable(),
|
|
3604
|
+
container_id: import_v422.z.string(),
|
|
3605
|
+
outputs: import_v422.z.array(
|
|
3606
|
+
import_v422.z.discriminatedUnion("type", [
|
|
3607
|
+
import_v422.z.object({ type: import_v422.z.literal("logs"), logs: import_v422.z.string() }),
|
|
3608
|
+
import_v422.z.object({ type: import_v422.z.literal("image"), url: import_v422.z.string() })
|
|
3527
3609
|
])
|
|
3528
3610
|
).nullable()
|
|
3529
3611
|
}),
|
|
3530
|
-
|
|
3531
|
-
type:
|
|
3532
|
-
id:
|
|
3533
|
-
result:
|
|
3612
|
+
import_v422.z.object({
|
|
3613
|
+
type: import_v422.z.literal("image_generation_call"),
|
|
3614
|
+
id: import_v422.z.string(),
|
|
3615
|
+
result: import_v422.z.string()
|
|
3534
3616
|
}),
|
|
3535
|
-
|
|
3536
|
-
type:
|
|
3537
|
-
id:
|
|
3538
|
-
status:
|
|
3539
|
-
action:
|
|
3540
|
-
|
|
3541
|
-
type:
|
|
3542
|
-
query:
|
|
3543
|
-
sources:
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3617
|
+
import_v422.z.object({
|
|
3618
|
+
type: import_v422.z.literal("web_search_call"),
|
|
3619
|
+
id: import_v422.z.string(),
|
|
3620
|
+
status: import_v422.z.string(),
|
|
3621
|
+
action: import_v422.z.discriminatedUnion("type", [
|
|
3622
|
+
import_v422.z.object({
|
|
3623
|
+
type: import_v422.z.literal("search"),
|
|
3624
|
+
query: import_v422.z.string().nullish(),
|
|
3625
|
+
sources: import_v422.z.array(
|
|
3626
|
+
import_v422.z.discriminatedUnion("type", [
|
|
3627
|
+
import_v422.z.object({ type: import_v422.z.literal("url"), url: import_v422.z.string() }),
|
|
3628
|
+
import_v422.z.object({ type: import_v422.z.literal("api"), name: import_v422.z.string() })
|
|
3547
3629
|
])
|
|
3548
3630
|
).nullish()
|
|
3549
3631
|
}),
|
|
3550
|
-
|
|
3551
|
-
type:
|
|
3552
|
-
url:
|
|
3632
|
+
import_v422.z.object({
|
|
3633
|
+
type: import_v422.z.literal("open_page"),
|
|
3634
|
+
url: import_v422.z.string().nullish()
|
|
3553
3635
|
}),
|
|
3554
|
-
|
|
3555
|
-
type:
|
|
3556
|
-
url:
|
|
3557
|
-
pattern:
|
|
3636
|
+
import_v422.z.object({
|
|
3637
|
+
type: import_v422.z.literal("find_in_page"),
|
|
3638
|
+
url: import_v422.z.string().nullish(),
|
|
3639
|
+
pattern: import_v422.z.string().nullish()
|
|
3558
3640
|
})
|
|
3559
3641
|
]).nullish()
|
|
3560
3642
|
}),
|
|
3561
|
-
|
|
3562
|
-
type:
|
|
3563
|
-
id:
|
|
3564
|
-
queries:
|
|
3565
|
-
results:
|
|
3566
|
-
|
|
3567
|
-
attributes:
|
|
3568
|
-
|
|
3569
|
-
|
|
3643
|
+
import_v422.z.object({
|
|
3644
|
+
type: import_v422.z.literal("file_search_call"),
|
|
3645
|
+
id: import_v422.z.string(),
|
|
3646
|
+
queries: import_v422.z.array(import_v422.z.string()),
|
|
3647
|
+
results: import_v422.z.array(
|
|
3648
|
+
import_v422.z.object({
|
|
3649
|
+
attributes: import_v422.z.record(
|
|
3650
|
+
import_v422.z.string(),
|
|
3651
|
+
import_v422.z.union([import_v422.z.string(), import_v422.z.number(), import_v422.z.boolean()])
|
|
3570
3652
|
),
|
|
3571
|
-
file_id:
|
|
3572
|
-
filename:
|
|
3573
|
-
score:
|
|
3574
|
-
text:
|
|
3653
|
+
file_id: import_v422.z.string(),
|
|
3654
|
+
filename: import_v422.z.string(),
|
|
3655
|
+
score: import_v422.z.number(),
|
|
3656
|
+
text: import_v422.z.string()
|
|
3575
3657
|
})
|
|
3576
3658
|
).nullish()
|
|
3577
3659
|
}),
|
|
3578
|
-
|
|
3579
|
-
type:
|
|
3580
|
-
id:
|
|
3581
|
-
call_id:
|
|
3582
|
-
action:
|
|
3583
|
-
type:
|
|
3584
|
-
command:
|
|
3585
|
-
timeout_ms:
|
|
3586
|
-
user:
|
|
3587
|
-
working_directory:
|
|
3588
|
-
env:
|
|
3660
|
+
import_v422.z.object({
|
|
3661
|
+
type: import_v422.z.literal("local_shell_call"),
|
|
3662
|
+
id: import_v422.z.string(),
|
|
3663
|
+
call_id: import_v422.z.string(),
|
|
3664
|
+
action: import_v422.z.object({
|
|
3665
|
+
type: import_v422.z.literal("exec"),
|
|
3666
|
+
command: import_v422.z.array(import_v422.z.string()),
|
|
3667
|
+
timeout_ms: import_v422.z.number().optional(),
|
|
3668
|
+
user: import_v422.z.string().optional(),
|
|
3669
|
+
working_directory: import_v422.z.string().optional(),
|
|
3670
|
+
env: import_v422.z.record(import_v422.z.string(), import_v422.z.string()).optional()
|
|
3589
3671
|
})
|
|
3590
3672
|
}),
|
|
3591
|
-
|
|
3592
|
-
type:
|
|
3593
|
-
id:
|
|
3594
|
-
status:
|
|
3673
|
+
import_v422.z.object({
|
|
3674
|
+
type: import_v422.z.literal("computer_call"),
|
|
3675
|
+
id: import_v422.z.string(),
|
|
3676
|
+
status: import_v422.z.literal("completed")
|
|
3595
3677
|
}),
|
|
3596
|
-
|
|
3597
|
-
type:
|
|
3598
|
-
id:
|
|
3599
|
-
status:
|
|
3600
|
-
arguments:
|
|
3601
|
-
name:
|
|
3602
|
-
server_label:
|
|
3603
|
-
output:
|
|
3604
|
-
error:
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
type:
|
|
3608
|
-
code:
|
|
3609
|
-
message:
|
|
3678
|
+
import_v422.z.object({
|
|
3679
|
+
type: import_v422.z.literal("mcp_call"),
|
|
3680
|
+
id: import_v422.z.string(),
|
|
3681
|
+
status: import_v422.z.string(),
|
|
3682
|
+
arguments: import_v422.z.string(),
|
|
3683
|
+
name: import_v422.z.string(),
|
|
3684
|
+
server_label: import_v422.z.string(),
|
|
3685
|
+
output: import_v422.z.string().nullish(),
|
|
3686
|
+
error: import_v422.z.union([
|
|
3687
|
+
import_v422.z.string(),
|
|
3688
|
+
import_v422.z.object({
|
|
3689
|
+
type: import_v422.z.string().optional(),
|
|
3690
|
+
code: import_v422.z.union([import_v422.z.number(), import_v422.z.string()]).optional(),
|
|
3691
|
+
message: import_v422.z.string().optional()
|
|
3610
3692
|
}).loose()
|
|
3611
3693
|
]).nullish(),
|
|
3612
|
-
approval_request_id:
|
|
3694
|
+
approval_request_id: import_v422.z.string().nullish()
|
|
3613
3695
|
}),
|
|
3614
|
-
|
|
3615
|
-
type:
|
|
3616
|
-
id:
|
|
3617
|
-
server_label:
|
|
3618
|
-
tools:
|
|
3619
|
-
|
|
3620
|
-
name:
|
|
3621
|
-
description:
|
|
3622
|
-
input_schema:
|
|
3623
|
-
annotations:
|
|
3696
|
+
import_v422.z.object({
|
|
3697
|
+
type: import_v422.z.literal("mcp_list_tools"),
|
|
3698
|
+
id: import_v422.z.string(),
|
|
3699
|
+
server_label: import_v422.z.string(),
|
|
3700
|
+
tools: import_v422.z.array(
|
|
3701
|
+
import_v422.z.object({
|
|
3702
|
+
name: import_v422.z.string(),
|
|
3703
|
+
description: import_v422.z.string().optional(),
|
|
3704
|
+
input_schema: import_v422.z.any(),
|
|
3705
|
+
annotations: import_v422.z.record(import_v422.z.string(), import_v422.z.unknown()).optional()
|
|
3624
3706
|
})
|
|
3625
3707
|
),
|
|
3626
|
-
error:
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
type:
|
|
3630
|
-
code:
|
|
3631
|
-
message:
|
|
3708
|
+
error: import_v422.z.union([
|
|
3709
|
+
import_v422.z.string(),
|
|
3710
|
+
import_v422.z.object({
|
|
3711
|
+
type: import_v422.z.string().optional(),
|
|
3712
|
+
code: import_v422.z.union([import_v422.z.number(), import_v422.z.string()]).optional(),
|
|
3713
|
+
message: import_v422.z.string().optional()
|
|
3632
3714
|
}).loose()
|
|
3633
3715
|
]).optional()
|
|
3634
3716
|
}),
|
|
3635
|
-
|
|
3636
|
-
type:
|
|
3637
|
-
id:
|
|
3638
|
-
server_label:
|
|
3639
|
-
name:
|
|
3640
|
-
arguments:
|
|
3641
|
-
approval_request_id:
|
|
3717
|
+
import_v422.z.object({
|
|
3718
|
+
type: import_v422.z.literal("mcp_approval_request"),
|
|
3719
|
+
id: import_v422.z.string(),
|
|
3720
|
+
server_label: import_v422.z.string(),
|
|
3721
|
+
name: import_v422.z.string(),
|
|
3722
|
+
arguments: import_v422.z.string(),
|
|
3723
|
+
approval_request_id: import_v422.z.string().optional()
|
|
3642
3724
|
}),
|
|
3643
|
-
|
|
3644
|
-
type:
|
|
3645
|
-
id:
|
|
3646
|
-
call_id:
|
|
3647
|
-
status:
|
|
3648
|
-
operation:
|
|
3649
|
-
|
|
3650
|
-
type:
|
|
3651
|
-
path:
|
|
3652
|
-
diff:
|
|
3725
|
+
import_v422.z.object({
|
|
3726
|
+
type: import_v422.z.literal("apply_patch_call"),
|
|
3727
|
+
id: import_v422.z.string(),
|
|
3728
|
+
call_id: import_v422.z.string(),
|
|
3729
|
+
status: import_v422.z.enum(["in_progress", "completed"]),
|
|
3730
|
+
operation: import_v422.z.discriminatedUnion("type", [
|
|
3731
|
+
import_v422.z.object({
|
|
3732
|
+
type: import_v422.z.literal("create_file"),
|
|
3733
|
+
path: import_v422.z.string(),
|
|
3734
|
+
diff: import_v422.z.string()
|
|
3653
3735
|
}),
|
|
3654
|
-
|
|
3655
|
-
type:
|
|
3656
|
-
path:
|
|
3736
|
+
import_v422.z.object({
|
|
3737
|
+
type: import_v422.z.literal("delete_file"),
|
|
3738
|
+
path: import_v422.z.string()
|
|
3657
3739
|
}),
|
|
3658
|
-
|
|
3659
|
-
type:
|
|
3660
|
-
path:
|
|
3661
|
-
diff:
|
|
3740
|
+
import_v422.z.object({
|
|
3741
|
+
type: import_v422.z.literal("update_file"),
|
|
3742
|
+
path: import_v422.z.string(),
|
|
3743
|
+
diff: import_v422.z.string()
|
|
3662
3744
|
})
|
|
3663
3745
|
])
|
|
3664
3746
|
}),
|
|
3665
|
-
|
|
3666
|
-
type:
|
|
3667
|
-
id:
|
|
3668
|
-
call_id:
|
|
3669
|
-
status:
|
|
3670
|
-
action:
|
|
3671
|
-
commands:
|
|
3747
|
+
import_v422.z.object({
|
|
3748
|
+
type: import_v422.z.literal("shell_call"),
|
|
3749
|
+
id: import_v422.z.string(),
|
|
3750
|
+
call_id: import_v422.z.string(),
|
|
3751
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3752
|
+
action: import_v422.z.object({
|
|
3753
|
+
commands: import_v422.z.array(import_v422.z.string())
|
|
3672
3754
|
})
|
|
3673
3755
|
}),
|
|
3674
|
-
|
|
3675
|
-
type:
|
|
3676
|
-
id:
|
|
3677
|
-
call_id:
|
|
3678
|
-
status:
|
|
3679
|
-
output:
|
|
3680
|
-
|
|
3681
|
-
stdout:
|
|
3682
|
-
stderr:
|
|
3683
|
-
outcome:
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
type:
|
|
3687
|
-
exit_code:
|
|
3756
|
+
import_v422.z.object({
|
|
3757
|
+
type: import_v422.z.literal("shell_call_output"),
|
|
3758
|
+
id: import_v422.z.string(),
|
|
3759
|
+
call_id: import_v422.z.string(),
|
|
3760
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3761
|
+
output: import_v422.z.array(
|
|
3762
|
+
import_v422.z.object({
|
|
3763
|
+
stdout: import_v422.z.string(),
|
|
3764
|
+
stderr: import_v422.z.string(),
|
|
3765
|
+
outcome: import_v422.z.discriminatedUnion("type", [
|
|
3766
|
+
import_v422.z.object({ type: import_v422.z.literal("timeout") }),
|
|
3767
|
+
import_v422.z.object({
|
|
3768
|
+
type: import_v422.z.literal("exit"),
|
|
3769
|
+
exit_code: import_v422.z.number()
|
|
3688
3770
|
})
|
|
3689
3771
|
])
|
|
3690
3772
|
})
|
|
3691
3773
|
)
|
|
3692
3774
|
}),
|
|
3693
|
-
|
|
3694
|
-
type:
|
|
3695
|
-
id:
|
|
3696
|
-
execution:
|
|
3697
|
-
call_id:
|
|
3698
|
-
status:
|
|
3699
|
-
arguments:
|
|
3775
|
+
import_v422.z.object({
|
|
3776
|
+
type: import_v422.z.literal("tool_search_call"),
|
|
3777
|
+
id: import_v422.z.string(),
|
|
3778
|
+
execution: import_v422.z.enum(["server", "client"]),
|
|
3779
|
+
call_id: import_v422.z.string().nullable(),
|
|
3780
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3781
|
+
arguments: import_v422.z.unknown()
|
|
3700
3782
|
}),
|
|
3701
|
-
|
|
3702
|
-
type:
|
|
3703
|
-
id:
|
|
3704
|
-
execution:
|
|
3705
|
-
call_id:
|
|
3706
|
-
status:
|
|
3707
|
-
tools:
|
|
3783
|
+
import_v422.z.object({
|
|
3784
|
+
type: import_v422.z.literal("tool_search_output"),
|
|
3785
|
+
id: import_v422.z.string(),
|
|
3786
|
+
execution: import_v422.z.enum(["server", "client"]),
|
|
3787
|
+
call_id: import_v422.z.string().nullable(),
|
|
3788
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3789
|
+
tools: import_v422.z.array(import_v422.z.record(import_v422.z.string(), jsonValueSchema2.optional()))
|
|
3708
3790
|
})
|
|
3709
3791
|
])
|
|
3710
3792
|
}),
|
|
3711
|
-
|
|
3712
|
-
type:
|
|
3713
|
-
item_id:
|
|
3714
|
-
output_index:
|
|
3715
|
-
delta:
|
|
3793
|
+
import_v422.z.object({
|
|
3794
|
+
type: import_v422.z.literal("response.function_call_arguments.delta"),
|
|
3795
|
+
item_id: import_v422.z.string(),
|
|
3796
|
+
output_index: import_v422.z.number(),
|
|
3797
|
+
delta: import_v422.z.string()
|
|
3716
3798
|
}),
|
|
3717
|
-
|
|
3718
|
-
type:
|
|
3719
|
-
item_id:
|
|
3720
|
-
output_index:
|
|
3721
|
-
delta:
|
|
3799
|
+
import_v422.z.object({
|
|
3800
|
+
type: import_v422.z.literal("response.custom_tool_call_input.delta"),
|
|
3801
|
+
item_id: import_v422.z.string(),
|
|
3802
|
+
output_index: import_v422.z.number(),
|
|
3803
|
+
delta: import_v422.z.string()
|
|
3722
3804
|
}),
|
|
3723
|
-
|
|
3724
|
-
type:
|
|
3725
|
-
item_id:
|
|
3726
|
-
output_index:
|
|
3727
|
-
partial_image_b64:
|
|
3805
|
+
import_v422.z.object({
|
|
3806
|
+
type: import_v422.z.literal("response.image_generation_call.partial_image"),
|
|
3807
|
+
item_id: import_v422.z.string(),
|
|
3808
|
+
output_index: import_v422.z.number(),
|
|
3809
|
+
partial_image_b64: import_v422.z.string()
|
|
3728
3810
|
}),
|
|
3729
|
-
|
|
3730
|
-
type:
|
|
3731
|
-
item_id:
|
|
3732
|
-
output_index:
|
|
3733
|
-
delta:
|
|
3811
|
+
import_v422.z.object({
|
|
3812
|
+
type: import_v422.z.literal("response.code_interpreter_call_code.delta"),
|
|
3813
|
+
item_id: import_v422.z.string(),
|
|
3814
|
+
output_index: import_v422.z.number(),
|
|
3815
|
+
delta: import_v422.z.string()
|
|
3734
3816
|
}),
|
|
3735
|
-
|
|
3736
|
-
type:
|
|
3737
|
-
item_id:
|
|
3738
|
-
output_index:
|
|
3739
|
-
code:
|
|
3817
|
+
import_v422.z.object({
|
|
3818
|
+
type: import_v422.z.literal("response.code_interpreter_call_code.done"),
|
|
3819
|
+
item_id: import_v422.z.string(),
|
|
3820
|
+
output_index: import_v422.z.number(),
|
|
3821
|
+
code: import_v422.z.string()
|
|
3740
3822
|
}),
|
|
3741
|
-
|
|
3742
|
-
type:
|
|
3743
|
-
annotation:
|
|
3744
|
-
|
|
3745
|
-
type:
|
|
3746
|
-
start_index:
|
|
3747
|
-
end_index:
|
|
3748
|
-
url:
|
|
3749
|
-
title:
|
|
3823
|
+
import_v422.z.object({
|
|
3824
|
+
type: import_v422.z.literal("response.output_text.annotation.added"),
|
|
3825
|
+
annotation: import_v422.z.discriminatedUnion("type", [
|
|
3826
|
+
import_v422.z.object({
|
|
3827
|
+
type: import_v422.z.literal("url_citation"),
|
|
3828
|
+
start_index: import_v422.z.number(),
|
|
3829
|
+
end_index: import_v422.z.number(),
|
|
3830
|
+
url: import_v422.z.string(),
|
|
3831
|
+
title: import_v422.z.string()
|
|
3750
3832
|
}),
|
|
3751
|
-
|
|
3752
|
-
type:
|
|
3753
|
-
file_id:
|
|
3754
|
-
filename:
|
|
3755
|
-
index:
|
|
3833
|
+
import_v422.z.object({
|
|
3834
|
+
type: import_v422.z.literal("file_citation"),
|
|
3835
|
+
file_id: import_v422.z.string(),
|
|
3836
|
+
filename: import_v422.z.string(),
|
|
3837
|
+
index: import_v422.z.number()
|
|
3756
3838
|
}),
|
|
3757
|
-
|
|
3758
|
-
type:
|
|
3759
|
-
container_id:
|
|
3760
|
-
file_id:
|
|
3761
|
-
filename:
|
|
3762
|
-
start_index:
|
|
3763
|
-
end_index:
|
|
3839
|
+
import_v422.z.object({
|
|
3840
|
+
type: import_v422.z.literal("container_file_citation"),
|
|
3841
|
+
container_id: import_v422.z.string(),
|
|
3842
|
+
file_id: import_v422.z.string(),
|
|
3843
|
+
filename: import_v422.z.string(),
|
|
3844
|
+
start_index: import_v422.z.number(),
|
|
3845
|
+
end_index: import_v422.z.number()
|
|
3764
3846
|
}),
|
|
3765
|
-
|
|
3766
|
-
type:
|
|
3767
|
-
file_id:
|
|
3768
|
-
index:
|
|
3847
|
+
import_v422.z.object({
|
|
3848
|
+
type: import_v422.z.literal("file_path"),
|
|
3849
|
+
file_id: import_v422.z.string(),
|
|
3850
|
+
index: import_v422.z.number()
|
|
3769
3851
|
})
|
|
3770
3852
|
])
|
|
3771
3853
|
}),
|
|
3772
|
-
|
|
3773
|
-
type:
|
|
3774
|
-
item_id:
|
|
3775
|
-
summary_index:
|
|
3854
|
+
import_v422.z.object({
|
|
3855
|
+
type: import_v422.z.literal("response.reasoning_summary_part.added"),
|
|
3856
|
+
item_id: import_v422.z.string(),
|
|
3857
|
+
summary_index: import_v422.z.number()
|
|
3776
3858
|
}),
|
|
3777
|
-
|
|
3778
|
-
type:
|
|
3779
|
-
item_id:
|
|
3780
|
-
summary_index:
|
|
3781
|
-
delta:
|
|
3859
|
+
import_v422.z.object({
|
|
3860
|
+
type: import_v422.z.literal("response.reasoning_summary_text.delta"),
|
|
3861
|
+
item_id: import_v422.z.string(),
|
|
3862
|
+
summary_index: import_v422.z.number(),
|
|
3863
|
+
delta: import_v422.z.string()
|
|
3782
3864
|
}),
|
|
3783
|
-
|
|
3784
|
-
type:
|
|
3785
|
-
item_id:
|
|
3786
|
-
summary_index:
|
|
3865
|
+
import_v422.z.object({
|
|
3866
|
+
type: import_v422.z.literal("response.reasoning_summary_part.done"),
|
|
3867
|
+
item_id: import_v422.z.string(),
|
|
3868
|
+
summary_index: import_v422.z.number()
|
|
3787
3869
|
}),
|
|
3788
|
-
|
|
3789
|
-
type:
|
|
3790
|
-
item_id:
|
|
3791
|
-
output_index:
|
|
3792
|
-
delta:
|
|
3793
|
-
obfuscation:
|
|
3870
|
+
import_v422.z.object({
|
|
3871
|
+
type: import_v422.z.literal("response.apply_patch_call_operation_diff.delta"),
|
|
3872
|
+
item_id: import_v422.z.string(),
|
|
3873
|
+
output_index: import_v422.z.number(),
|
|
3874
|
+
delta: import_v422.z.string(),
|
|
3875
|
+
obfuscation: import_v422.z.string().nullish()
|
|
3794
3876
|
}),
|
|
3795
|
-
|
|
3796
|
-
type:
|
|
3797
|
-
item_id:
|
|
3798
|
-
output_index:
|
|
3799
|
-
diff:
|
|
3877
|
+
import_v422.z.object({
|
|
3878
|
+
type: import_v422.z.literal("response.apply_patch_call_operation_diff.done"),
|
|
3879
|
+
item_id: import_v422.z.string(),
|
|
3880
|
+
output_index: import_v422.z.number(),
|
|
3881
|
+
diff: import_v422.z.string()
|
|
3800
3882
|
}),
|
|
3801
|
-
|
|
3802
|
-
type:
|
|
3803
|
-
sequence_number:
|
|
3804
|
-
error:
|
|
3805
|
-
type:
|
|
3806
|
-
code:
|
|
3807
|
-
message:
|
|
3808
|
-
param:
|
|
3883
|
+
import_v422.z.object({
|
|
3884
|
+
type: import_v422.z.literal("error"),
|
|
3885
|
+
sequence_number: import_v422.z.number(),
|
|
3886
|
+
error: import_v422.z.object({
|
|
3887
|
+
type: import_v422.z.string(),
|
|
3888
|
+
code: import_v422.z.string(),
|
|
3889
|
+
message: import_v422.z.string(),
|
|
3890
|
+
param: import_v422.z.string().nullish()
|
|
3809
3891
|
})
|
|
3810
3892
|
}),
|
|
3811
|
-
|
|
3893
|
+
import_v422.z.object({ type: import_v422.z.string() }).loose().transform((value) => ({
|
|
3812
3894
|
type: "unknown_chunk",
|
|
3813
3895
|
message: value.type
|
|
3814
3896
|
}))
|
|
@@ -3816,310 +3898,310 @@ var openaiResponsesChunkSchema = (0, import_provider_utils26.lazySchema)(
|
|
|
3816
3898
|
])
|
|
3817
3899
|
)
|
|
3818
3900
|
);
|
|
3819
|
-
var openaiResponsesResponseSchema = (0,
|
|
3820
|
-
() => (0,
|
|
3821
|
-
|
|
3822
|
-
id:
|
|
3823
|
-
created_at:
|
|
3824
|
-
error:
|
|
3825
|
-
message:
|
|
3826
|
-
type:
|
|
3827
|
-
param:
|
|
3828
|
-
code:
|
|
3901
|
+
var openaiResponsesResponseSchema = (0, import_provider_utils27.lazySchema)(
|
|
3902
|
+
() => (0, import_provider_utils27.zodSchema)(
|
|
3903
|
+
import_v422.z.object({
|
|
3904
|
+
id: import_v422.z.string().optional(),
|
|
3905
|
+
created_at: import_v422.z.number().optional(),
|
|
3906
|
+
error: import_v422.z.object({
|
|
3907
|
+
message: import_v422.z.string(),
|
|
3908
|
+
type: import_v422.z.string(),
|
|
3909
|
+
param: import_v422.z.string().nullish(),
|
|
3910
|
+
code: import_v422.z.string()
|
|
3829
3911
|
}).nullish(),
|
|
3830
|
-
model:
|
|
3831
|
-
output:
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
type:
|
|
3835
|
-
role:
|
|
3836
|
-
id:
|
|
3837
|
-
phase:
|
|
3838
|
-
content:
|
|
3839
|
-
|
|
3840
|
-
type:
|
|
3841
|
-
text:
|
|
3842
|
-
logprobs:
|
|
3843
|
-
|
|
3844
|
-
token:
|
|
3845
|
-
logprob:
|
|
3846
|
-
top_logprobs:
|
|
3847
|
-
|
|
3848
|
-
token:
|
|
3849
|
-
logprob:
|
|
3912
|
+
model: import_v422.z.string().optional(),
|
|
3913
|
+
output: import_v422.z.array(
|
|
3914
|
+
import_v422.z.discriminatedUnion("type", [
|
|
3915
|
+
import_v422.z.object({
|
|
3916
|
+
type: import_v422.z.literal("message"),
|
|
3917
|
+
role: import_v422.z.literal("assistant"),
|
|
3918
|
+
id: import_v422.z.string(),
|
|
3919
|
+
phase: import_v422.z.enum(["commentary", "final_answer"]).nullish(),
|
|
3920
|
+
content: import_v422.z.array(
|
|
3921
|
+
import_v422.z.object({
|
|
3922
|
+
type: import_v422.z.literal("output_text"),
|
|
3923
|
+
text: import_v422.z.string(),
|
|
3924
|
+
logprobs: import_v422.z.array(
|
|
3925
|
+
import_v422.z.object({
|
|
3926
|
+
token: import_v422.z.string(),
|
|
3927
|
+
logprob: import_v422.z.number(),
|
|
3928
|
+
top_logprobs: import_v422.z.array(
|
|
3929
|
+
import_v422.z.object({
|
|
3930
|
+
token: import_v422.z.string(),
|
|
3931
|
+
logprob: import_v422.z.number()
|
|
3850
3932
|
})
|
|
3851
3933
|
)
|
|
3852
3934
|
})
|
|
3853
3935
|
).nullish(),
|
|
3854
|
-
annotations:
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
type:
|
|
3858
|
-
start_index:
|
|
3859
|
-
end_index:
|
|
3860
|
-
url:
|
|
3861
|
-
title:
|
|
3936
|
+
annotations: import_v422.z.array(
|
|
3937
|
+
import_v422.z.discriminatedUnion("type", [
|
|
3938
|
+
import_v422.z.object({
|
|
3939
|
+
type: import_v422.z.literal("url_citation"),
|
|
3940
|
+
start_index: import_v422.z.number(),
|
|
3941
|
+
end_index: import_v422.z.number(),
|
|
3942
|
+
url: import_v422.z.string(),
|
|
3943
|
+
title: import_v422.z.string()
|
|
3862
3944
|
}),
|
|
3863
|
-
|
|
3864
|
-
type:
|
|
3865
|
-
file_id:
|
|
3866
|
-
filename:
|
|
3867
|
-
index:
|
|
3945
|
+
import_v422.z.object({
|
|
3946
|
+
type: import_v422.z.literal("file_citation"),
|
|
3947
|
+
file_id: import_v422.z.string(),
|
|
3948
|
+
filename: import_v422.z.string(),
|
|
3949
|
+
index: import_v422.z.number()
|
|
3868
3950
|
}),
|
|
3869
|
-
|
|
3870
|
-
type:
|
|
3871
|
-
container_id:
|
|
3872
|
-
file_id:
|
|
3873
|
-
filename:
|
|
3874
|
-
start_index:
|
|
3875
|
-
end_index:
|
|
3951
|
+
import_v422.z.object({
|
|
3952
|
+
type: import_v422.z.literal("container_file_citation"),
|
|
3953
|
+
container_id: import_v422.z.string(),
|
|
3954
|
+
file_id: import_v422.z.string(),
|
|
3955
|
+
filename: import_v422.z.string(),
|
|
3956
|
+
start_index: import_v422.z.number(),
|
|
3957
|
+
end_index: import_v422.z.number()
|
|
3876
3958
|
}),
|
|
3877
|
-
|
|
3878
|
-
type:
|
|
3879
|
-
file_id:
|
|
3880
|
-
index:
|
|
3959
|
+
import_v422.z.object({
|
|
3960
|
+
type: import_v422.z.literal("file_path"),
|
|
3961
|
+
file_id: import_v422.z.string(),
|
|
3962
|
+
index: import_v422.z.number()
|
|
3881
3963
|
})
|
|
3882
3964
|
])
|
|
3883
3965
|
)
|
|
3884
3966
|
})
|
|
3885
3967
|
)
|
|
3886
3968
|
}),
|
|
3887
|
-
|
|
3888
|
-
type:
|
|
3889
|
-
id:
|
|
3890
|
-
status:
|
|
3891
|
-
action:
|
|
3892
|
-
|
|
3893
|
-
type:
|
|
3894
|
-
query:
|
|
3895
|
-
sources:
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
type:
|
|
3900
|
-
name:
|
|
3969
|
+
import_v422.z.object({
|
|
3970
|
+
type: import_v422.z.literal("web_search_call"),
|
|
3971
|
+
id: import_v422.z.string(),
|
|
3972
|
+
status: import_v422.z.string(),
|
|
3973
|
+
action: import_v422.z.discriminatedUnion("type", [
|
|
3974
|
+
import_v422.z.object({
|
|
3975
|
+
type: import_v422.z.literal("search"),
|
|
3976
|
+
query: import_v422.z.string().nullish(),
|
|
3977
|
+
sources: import_v422.z.array(
|
|
3978
|
+
import_v422.z.discriminatedUnion("type", [
|
|
3979
|
+
import_v422.z.object({ type: import_v422.z.literal("url"), url: import_v422.z.string() }),
|
|
3980
|
+
import_v422.z.object({
|
|
3981
|
+
type: import_v422.z.literal("api"),
|
|
3982
|
+
name: import_v422.z.string()
|
|
3901
3983
|
})
|
|
3902
3984
|
])
|
|
3903
3985
|
).nullish()
|
|
3904
3986
|
}),
|
|
3905
|
-
|
|
3906
|
-
type:
|
|
3907
|
-
url:
|
|
3987
|
+
import_v422.z.object({
|
|
3988
|
+
type: import_v422.z.literal("open_page"),
|
|
3989
|
+
url: import_v422.z.string().nullish()
|
|
3908
3990
|
}),
|
|
3909
|
-
|
|
3910
|
-
type:
|
|
3911
|
-
url:
|
|
3912
|
-
pattern:
|
|
3991
|
+
import_v422.z.object({
|
|
3992
|
+
type: import_v422.z.literal("find_in_page"),
|
|
3993
|
+
url: import_v422.z.string().nullish(),
|
|
3994
|
+
pattern: import_v422.z.string().nullish()
|
|
3913
3995
|
})
|
|
3914
3996
|
]).nullish()
|
|
3915
3997
|
}),
|
|
3916
|
-
|
|
3917
|
-
type:
|
|
3918
|
-
id:
|
|
3919
|
-
queries:
|
|
3920
|
-
results:
|
|
3921
|
-
|
|
3922
|
-
attributes:
|
|
3923
|
-
|
|
3924
|
-
|
|
3998
|
+
import_v422.z.object({
|
|
3999
|
+
type: import_v422.z.literal("file_search_call"),
|
|
4000
|
+
id: import_v422.z.string(),
|
|
4001
|
+
queries: import_v422.z.array(import_v422.z.string()),
|
|
4002
|
+
results: import_v422.z.array(
|
|
4003
|
+
import_v422.z.object({
|
|
4004
|
+
attributes: import_v422.z.record(
|
|
4005
|
+
import_v422.z.string(),
|
|
4006
|
+
import_v422.z.union([import_v422.z.string(), import_v422.z.number(), import_v422.z.boolean()])
|
|
3925
4007
|
),
|
|
3926
|
-
file_id:
|
|
3927
|
-
filename:
|
|
3928
|
-
score:
|
|
3929
|
-
text:
|
|
4008
|
+
file_id: import_v422.z.string(),
|
|
4009
|
+
filename: import_v422.z.string(),
|
|
4010
|
+
score: import_v422.z.number(),
|
|
4011
|
+
text: import_v422.z.string()
|
|
3930
4012
|
})
|
|
3931
4013
|
).nullish()
|
|
3932
4014
|
}),
|
|
3933
|
-
|
|
3934
|
-
type:
|
|
3935
|
-
id:
|
|
3936
|
-
code:
|
|
3937
|
-
container_id:
|
|
3938
|
-
outputs:
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
4015
|
+
import_v422.z.object({
|
|
4016
|
+
type: import_v422.z.literal("code_interpreter_call"),
|
|
4017
|
+
id: import_v422.z.string(),
|
|
4018
|
+
code: import_v422.z.string().nullable(),
|
|
4019
|
+
container_id: import_v422.z.string(),
|
|
4020
|
+
outputs: import_v422.z.array(
|
|
4021
|
+
import_v422.z.discriminatedUnion("type", [
|
|
4022
|
+
import_v422.z.object({ type: import_v422.z.literal("logs"), logs: import_v422.z.string() }),
|
|
4023
|
+
import_v422.z.object({ type: import_v422.z.literal("image"), url: import_v422.z.string() })
|
|
3942
4024
|
])
|
|
3943
4025
|
).nullable()
|
|
3944
4026
|
}),
|
|
3945
|
-
|
|
3946
|
-
type:
|
|
3947
|
-
id:
|
|
3948
|
-
result:
|
|
4027
|
+
import_v422.z.object({
|
|
4028
|
+
type: import_v422.z.literal("image_generation_call"),
|
|
4029
|
+
id: import_v422.z.string(),
|
|
4030
|
+
result: import_v422.z.string()
|
|
3949
4031
|
}),
|
|
3950
|
-
|
|
3951
|
-
type:
|
|
3952
|
-
id:
|
|
3953
|
-
call_id:
|
|
3954
|
-
action:
|
|
3955
|
-
type:
|
|
3956
|
-
command:
|
|
3957
|
-
timeout_ms:
|
|
3958
|
-
user:
|
|
3959
|
-
working_directory:
|
|
3960
|
-
env:
|
|
4032
|
+
import_v422.z.object({
|
|
4033
|
+
type: import_v422.z.literal("local_shell_call"),
|
|
4034
|
+
id: import_v422.z.string(),
|
|
4035
|
+
call_id: import_v422.z.string(),
|
|
4036
|
+
action: import_v422.z.object({
|
|
4037
|
+
type: import_v422.z.literal("exec"),
|
|
4038
|
+
command: import_v422.z.array(import_v422.z.string()),
|
|
4039
|
+
timeout_ms: import_v422.z.number().optional(),
|
|
4040
|
+
user: import_v422.z.string().optional(),
|
|
4041
|
+
working_directory: import_v422.z.string().optional(),
|
|
4042
|
+
env: import_v422.z.record(import_v422.z.string(), import_v422.z.string()).optional()
|
|
3961
4043
|
})
|
|
3962
4044
|
}),
|
|
3963
|
-
|
|
3964
|
-
type:
|
|
3965
|
-
call_id:
|
|
3966
|
-
name:
|
|
3967
|
-
arguments:
|
|
3968
|
-
id:
|
|
4045
|
+
import_v422.z.object({
|
|
4046
|
+
type: import_v422.z.literal("function_call"),
|
|
4047
|
+
call_id: import_v422.z.string(),
|
|
4048
|
+
name: import_v422.z.string(),
|
|
4049
|
+
arguments: import_v422.z.string(),
|
|
4050
|
+
id: import_v422.z.string()
|
|
3969
4051
|
}),
|
|
3970
|
-
|
|
3971
|
-
type:
|
|
3972
|
-
call_id:
|
|
3973
|
-
name:
|
|
3974
|
-
input:
|
|
3975
|
-
id:
|
|
4052
|
+
import_v422.z.object({
|
|
4053
|
+
type: import_v422.z.literal("custom_tool_call"),
|
|
4054
|
+
call_id: import_v422.z.string(),
|
|
4055
|
+
name: import_v422.z.string(),
|
|
4056
|
+
input: import_v422.z.string(),
|
|
4057
|
+
id: import_v422.z.string()
|
|
3976
4058
|
}),
|
|
3977
|
-
|
|
3978
|
-
type:
|
|
3979
|
-
id:
|
|
3980
|
-
status:
|
|
4059
|
+
import_v422.z.object({
|
|
4060
|
+
type: import_v422.z.literal("computer_call"),
|
|
4061
|
+
id: import_v422.z.string(),
|
|
4062
|
+
status: import_v422.z.string().optional()
|
|
3981
4063
|
}),
|
|
3982
|
-
|
|
3983
|
-
type:
|
|
3984
|
-
id:
|
|
3985
|
-
encrypted_content:
|
|
3986
|
-
summary:
|
|
3987
|
-
|
|
3988
|
-
type:
|
|
3989
|
-
text:
|
|
4064
|
+
import_v422.z.object({
|
|
4065
|
+
type: import_v422.z.literal("reasoning"),
|
|
4066
|
+
id: import_v422.z.string(),
|
|
4067
|
+
encrypted_content: import_v422.z.string().nullish(),
|
|
4068
|
+
summary: import_v422.z.array(
|
|
4069
|
+
import_v422.z.object({
|
|
4070
|
+
type: import_v422.z.literal("summary_text"),
|
|
4071
|
+
text: import_v422.z.string()
|
|
3990
4072
|
})
|
|
3991
4073
|
)
|
|
3992
4074
|
}),
|
|
3993
|
-
|
|
3994
|
-
type:
|
|
3995
|
-
id:
|
|
3996
|
-
status:
|
|
3997
|
-
arguments:
|
|
3998
|
-
name:
|
|
3999
|
-
server_label:
|
|
4000
|
-
output:
|
|
4001
|
-
error:
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
type:
|
|
4005
|
-
code:
|
|
4006
|
-
message:
|
|
4075
|
+
import_v422.z.object({
|
|
4076
|
+
type: import_v422.z.literal("mcp_call"),
|
|
4077
|
+
id: import_v422.z.string(),
|
|
4078
|
+
status: import_v422.z.string(),
|
|
4079
|
+
arguments: import_v422.z.string(),
|
|
4080
|
+
name: import_v422.z.string(),
|
|
4081
|
+
server_label: import_v422.z.string(),
|
|
4082
|
+
output: import_v422.z.string().nullish(),
|
|
4083
|
+
error: import_v422.z.union([
|
|
4084
|
+
import_v422.z.string(),
|
|
4085
|
+
import_v422.z.object({
|
|
4086
|
+
type: import_v422.z.string().optional(),
|
|
4087
|
+
code: import_v422.z.union([import_v422.z.number(), import_v422.z.string()]).optional(),
|
|
4088
|
+
message: import_v422.z.string().optional()
|
|
4007
4089
|
}).loose()
|
|
4008
4090
|
]).nullish(),
|
|
4009
|
-
approval_request_id:
|
|
4091
|
+
approval_request_id: import_v422.z.string().nullish()
|
|
4010
4092
|
}),
|
|
4011
|
-
|
|
4012
|
-
type:
|
|
4013
|
-
id:
|
|
4014
|
-
server_label:
|
|
4015
|
-
tools:
|
|
4016
|
-
|
|
4017
|
-
name:
|
|
4018
|
-
description:
|
|
4019
|
-
input_schema:
|
|
4020
|
-
annotations:
|
|
4093
|
+
import_v422.z.object({
|
|
4094
|
+
type: import_v422.z.literal("mcp_list_tools"),
|
|
4095
|
+
id: import_v422.z.string(),
|
|
4096
|
+
server_label: import_v422.z.string(),
|
|
4097
|
+
tools: import_v422.z.array(
|
|
4098
|
+
import_v422.z.object({
|
|
4099
|
+
name: import_v422.z.string(),
|
|
4100
|
+
description: import_v422.z.string().optional(),
|
|
4101
|
+
input_schema: import_v422.z.any(),
|
|
4102
|
+
annotations: import_v422.z.record(import_v422.z.string(), import_v422.z.unknown()).optional()
|
|
4021
4103
|
})
|
|
4022
4104
|
),
|
|
4023
|
-
error:
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
type:
|
|
4027
|
-
code:
|
|
4028
|
-
message:
|
|
4105
|
+
error: import_v422.z.union([
|
|
4106
|
+
import_v422.z.string(),
|
|
4107
|
+
import_v422.z.object({
|
|
4108
|
+
type: import_v422.z.string().optional(),
|
|
4109
|
+
code: import_v422.z.union([import_v422.z.number(), import_v422.z.string()]).optional(),
|
|
4110
|
+
message: import_v422.z.string().optional()
|
|
4029
4111
|
}).loose()
|
|
4030
4112
|
]).optional()
|
|
4031
4113
|
}),
|
|
4032
|
-
|
|
4033
|
-
type:
|
|
4034
|
-
id:
|
|
4035
|
-
server_label:
|
|
4036
|
-
name:
|
|
4037
|
-
arguments:
|
|
4038
|
-
approval_request_id:
|
|
4114
|
+
import_v422.z.object({
|
|
4115
|
+
type: import_v422.z.literal("mcp_approval_request"),
|
|
4116
|
+
id: import_v422.z.string(),
|
|
4117
|
+
server_label: import_v422.z.string(),
|
|
4118
|
+
name: import_v422.z.string(),
|
|
4119
|
+
arguments: import_v422.z.string(),
|
|
4120
|
+
approval_request_id: import_v422.z.string().optional()
|
|
4039
4121
|
}),
|
|
4040
|
-
|
|
4041
|
-
type:
|
|
4042
|
-
id:
|
|
4043
|
-
call_id:
|
|
4044
|
-
status:
|
|
4045
|
-
operation:
|
|
4046
|
-
|
|
4047
|
-
type:
|
|
4048
|
-
path:
|
|
4049
|
-
diff:
|
|
4122
|
+
import_v422.z.object({
|
|
4123
|
+
type: import_v422.z.literal("apply_patch_call"),
|
|
4124
|
+
id: import_v422.z.string(),
|
|
4125
|
+
call_id: import_v422.z.string(),
|
|
4126
|
+
status: import_v422.z.enum(["in_progress", "completed"]),
|
|
4127
|
+
operation: import_v422.z.discriminatedUnion("type", [
|
|
4128
|
+
import_v422.z.object({
|
|
4129
|
+
type: import_v422.z.literal("create_file"),
|
|
4130
|
+
path: import_v422.z.string(),
|
|
4131
|
+
diff: import_v422.z.string()
|
|
4050
4132
|
}),
|
|
4051
|
-
|
|
4052
|
-
type:
|
|
4053
|
-
path:
|
|
4133
|
+
import_v422.z.object({
|
|
4134
|
+
type: import_v422.z.literal("delete_file"),
|
|
4135
|
+
path: import_v422.z.string()
|
|
4054
4136
|
}),
|
|
4055
|
-
|
|
4056
|
-
type:
|
|
4057
|
-
path:
|
|
4058
|
-
diff:
|
|
4137
|
+
import_v422.z.object({
|
|
4138
|
+
type: import_v422.z.literal("update_file"),
|
|
4139
|
+
path: import_v422.z.string(),
|
|
4140
|
+
diff: import_v422.z.string()
|
|
4059
4141
|
})
|
|
4060
4142
|
])
|
|
4061
4143
|
}),
|
|
4062
|
-
|
|
4063
|
-
type:
|
|
4064
|
-
id:
|
|
4065
|
-
call_id:
|
|
4066
|
-
status:
|
|
4067
|
-
action:
|
|
4068
|
-
commands:
|
|
4144
|
+
import_v422.z.object({
|
|
4145
|
+
type: import_v422.z.literal("shell_call"),
|
|
4146
|
+
id: import_v422.z.string(),
|
|
4147
|
+
call_id: import_v422.z.string(),
|
|
4148
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4149
|
+
action: import_v422.z.object({
|
|
4150
|
+
commands: import_v422.z.array(import_v422.z.string())
|
|
4069
4151
|
})
|
|
4070
4152
|
}),
|
|
4071
|
-
|
|
4072
|
-
type:
|
|
4073
|
-
id:
|
|
4074
|
-
call_id:
|
|
4075
|
-
status:
|
|
4076
|
-
output:
|
|
4077
|
-
|
|
4078
|
-
stdout:
|
|
4079
|
-
stderr:
|
|
4080
|
-
outcome:
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
type:
|
|
4084
|
-
exit_code:
|
|
4153
|
+
import_v422.z.object({
|
|
4154
|
+
type: import_v422.z.literal("shell_call_output"),
|
|
4155
|
+
id: import_v422.z.string(),
|
|
4156
|
+
call_id: import_v422.z.string(),
|
|
4157
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4158
|
+
output: import_v422.z.array(
|
|
4159
|
+
import_v422.z.object({
|
|
4160
|
+
stdout: import_v422.z.string(),
|
|
4161
|
+
stderr: import_v422.z.string(),
|
|
4162
|
+
outcome: import_v422.z.discriminatedUnion("type", [
|
|
4163
|
+
import_v422.z.object({ type: import_v422.z.literal("timeout") }),
|
|
4164
|
+
import_v422.z.object({
|
|
4165
|
+
type: import_v422.z.literal("exit"),
|
|
4166
|
+
exit_code: import_v422.z.number()
|
|
4085
4167
|
})
|
|
4086
4168
|
])
|
|
4087
4169
|
})
|
|
4088
4170
|
)
|
|
4089
4171
|
}),
|
|
4090
|
-
|
|
4091
|
-
type:
|
|
4092
|
-
id:
|
|
4093
|
-
execution:
|
|
4094
|
-
call_id:
|
|
4095
|
-
status:
|
|
4096
|
-
arguments:
|
|
4172
|
+
import_v422.z.object({
|
|
4173
|
+
type: import_v422.z.literal("tool_search_call"),
|
|
4174
|
+
id: import_v422.z.string(),
|
|
4175
|
+
execution: import_v422.z.enum(["server", "client"]),
|
|
4176
|
+
call_id: import_v422.z.string().nullable(),
|
|
4177
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4178
|
+
arguments: import_v422.z.unknown()
|
|
4097
4179
|
}),
|
|
4098
|
-
|
|
4099
|
-
type:
|
|
4100
|
-
id:
|
|
4101
|
-
execution:
|
|
4102
|
-
call_id:
|
|
4103
|
-
status:
|
|
4104
|
-
tools:
|
|
4180
|
+
import_v422.z.object({
|
|
4181
|
+
type: import_v422.z.literal("tool_search_output"),
|
|
4182
|
+
id: import_v422.z.string(),
|
|
4183
|
+
execution: import_v422.z.enum(["server", "client"]),
|
|
4184
|
+
call_id: import_v422.z.string().nullable(),
|
|
4185
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4186
|
+
tools: import_v422.z.array(import_v422.z.record(import_v422.z.string(), jsonValueSchema2.optional()))
|
|
4105
4187
|
})
|
|
4106
4188
|
])
|
|
4107
4189
|
).optional(),
|
|
4108
|
-
service_tier:
|
|
4109
|
-
incomplete_details:
|
|
4110
|
-
usage:
|
|
4111
|
-
input_tokens:
|
|
4112
|
-
input_tokens_details:
|
|
4113
|
-
output_tokens:
|
|
4114
|
-
output_tokens_details:
|
|
4190
|
+
service_tier: import_v422.z.string().nullish(),
|
|
4191
|
+
incomplete_details: import_v422.z.object({ reason: import_v422.z.string() }).nullish(),
|
|
4192
|
+
usage: import_v422.z.object({
|
|
4193
|
+
input_tokens: import_v422.z.number(),
|
|
4194
|
+
input_tokens_details: import_v422.z.object({ cached_tokens: import_v422.z.number().nullish() }).nullish(),
|
|
4195
|
+
output_tokens: import_v422.z.number(),
|
|
4196
|
+
output_tokens_details: import_v422.z.object({ reasoning_tokens: import_v422.z.number().nullish() }).nullish()
|
|
4115
4197
|
}).optional()
|
|
4116
4198
|
})
|
|
4117
4199
|
)
|
|
4118
4200
|
);
|
|
4119
4201
|
|
|
4120
4202
|
// src/responses/openai-responses-options.ts
|
|
4121
|
-
var
|
|
4122
|
-
var
|
|
4203
|
+
var import_provider_utils28 = require("@ai-sdk/provider-utils");
|
|
4204
|
+
var import_v423 = require("zod/v4");
|
|
4123
4205
|
var TOP_LOGPROBS_MAX = 20;
|
|
4124
4206
|
var openaiResponsesReasoningModelIds = [
|
|
4125
4207
|
"o1",
|
|
@@ -4184,9 +4266,9 @@ var openaiResponsesModelIds = [
|
|
|
4184
4266
|
"gpt-5-chat-latest",
|
|
4185
4267
|
...openaiResponsesReasoningModelIds
|
|
4186
4268
|
];
|
|
4187
|
-
var openaiLanguageModelResponsesOptionsSchema = (0,
|
|
4188
|
-
() => (0,
|
|
4189
|
-
|
|
4269
|
+
var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils28.lazySchema)(
|
|
4270
|
+
() => (0, import_provider_utils28.zodSchema)(
|
|
4271
|
+
import_v423.z.object({
|
|
4190
4272
|
/**
|
|
4191
4273
|
* The ID of the OpenAI Conversation to continue.
|
|
4192
4274
|
* You must create a conversation first via the OpenAI API.
|
|
@@ -4194,13 +4276,13 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils27.lazy
|
|
|
4194
4276
|
* Defaults to `undefined`.
|
|
4195
4277
|
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
4196
4278
|
*/
|
|
4197
|
-
conversation:
|
|
4279
|
+
conversation: import_v423.z.string().nullish(),
|
|
4198
4280
|
/**
|
|
4199
4281
|
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
4200
4282
|
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
|
|
4201
4283
|
*/
|
|
4202
|
-
include:
|
|
4203
|
-
|
|
4284
|
+
include: import_v423.z.array(
|
|
4285
|
+
import_v423.z.enum([
|
|
4204
4286
|
"reasoning.encrypted_content",
|
|
4205
4287
|
// handled internally by default, only needed for unknown reasoning models
|
|
4206
4288
|
"file_search_call.results",
|
|
@@ -4212,7 +4294,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils27.lazy
|
|
|
4212
4294
|
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
4213
4295
|
* Defaults to `undefined`.
|
|
4214
4296
|
*/
|
|
4215
|
-
instructions:
|
|
4297
|
+
instructions: import_v423.z.string().nullish(),
|
|
4216
4298
|
/**
|
|
4217
4299
|
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
4218
4300
|
* the response size and can slow down response times. However, it can
|
|
@@ -4227,30 +4309,30 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils27.lazy
|
|
|
4227
4309
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
4228
4310
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
4229
4311
|
*/
|
|
4230
|
-
logprobs:
|
|
4312
|
+
logprobs: import_v423.z.union([import_v423.z.boolean(), import_v423.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
4231
4313
|
/**
|
|
4232
4314
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
4233
4315
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
4234
4316
|
* Any further attempts to call a tool by the model will be ignored.
|
|
4235
4317
|
*/
|
|
4236
|
-
maxToolCalls:
|
|
4318
|
+
maxToolCalls: import_v423.z.number().nullish(),
|
|
4237
4319
|
/**
|
|
4238
4320
|
* Additional metadata to store with the generation.
|
|
4239
4321
|
*/
|
|
4240
|
-
metadata:
|
|
4322
|
+
metadata: import_v423.z.any().nullish(),
|
|
4241
4323
|
/**
|
|
4242
4324
|
* Whether to use parallel tool calls. Defaults to `true`.
|
|
4243
4325
|
*/
|
|
4244
|
-
parallelToolCalls:
|
|
4326
|
+
parallelToolCalls: import_v423.z.boolean().nullish(),
|
|
4245
4327
|
/**
|
|
4246
4328
|
* The ID of the previous response. You can use it to continue a conversation.
|
|
4247
4329
|
* Defaults to `undefined`.
|
|
4248
4330
|
*/
|
|
4249
|
-
previousResponseId:
|
|
4331
|
+
previousResponseId: import_v423.z.string().nullish(),
|
|
4250
4332
|
/**
|
|
4251
4333
|
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
4252
4334
|
*/
|
|
4253
|
-
promptCacheKey:
|
|
4335
|
+
promptCacheKey: import_v423.z.string().nullish(),
|
|
4254
4336
|
/**
|
|
4255
4337
|
* The retention policy for the prompt cache.
|
|
4256
4338
|
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
@@ -4259,7 +4341,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils27.lazy
|
|
|
4259
4341
|
*
|
|
4260
4342
|
* @default 'in_memory'
|
|
4261
4343
|
*/
|
|
4262
|
-
promptCacheRetention:
|
|
4344
|
+
promptCacheRetention: import_v423.z.enum(["in_memory", "24h"]).nullish(),
|
|
4263
4345
|
/**
|
|
4264
4346
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
4265
4347
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
@@ -4270,17 +4352,17 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils27.lazy
|
|
|
4270
4352
|
* OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
|
|
4271
4353
|
* an error.
|
|
4272
4354
|
*/
|
|
4273
|
-
reasoningEffort:
|
|
4355
|
+
reasoningEffort: import_v423.z.string().nullish(),
|
|
4274
4356
|
/**
|
|
4275
4357
|
* Controls reasoning summary output from the model.
|
|
4276
4358
|
* Set to "auto" to automatically receive the richest level available,
|
|
4277
4359
|
* or "detailed" for comprehensive summaries.
|
|
4278
4360
|
*/
|
|
4279
|
-
reasoningSummary:
|
|
4361
|
+
reasoningSummary: import_v423.z.string().nullish(),
|
|
4280
4362
|
/**
|
|
4281
4363
|
* The identifier for safety monitoring and tracking.
|
|
4282
4364
|
*/
|
|
4283
|
-
safetyIdentifier:
|
|
4365
|
+
safetyIdentifier: import_v423.z.string().nullish(),
|
|
4284
4366
|
/**
|
|
4285
4367
|
* Service tier for the request.
|
|
4286
4368
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
@@ -4288,34 +4370,34 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils27.lazy
|
|
|
4288
4370
|
*
|
|
4289
4371
|
* Defaults to 'auto'.
|
|
4290
4372
|
*/
|
|
4291
|
-
serviceTier:
|
|
4373
|
+
serviceTier: import_v423.z.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
4292
4374
|
/**
|
|
4293
4375
|
* Whether to store the generation. Defaults to `true`.
|
|
4294
4376
|
*/
|
|
4295
|
-
store:
|
|
4377
|
+
store: import_v423.z.boolean().nullish(),
|
|
4296
4378
|
/**
|
|
4297
4379
|
* Whether to use strict JSON schema validation.
|
|
4298
4380
|
* Defaults to `true`.
|
|
4299
4381
|
*/
|
|
4300
|
-
strictJsonSchema:
|
|
4382
|
+
strictJsonSchema: import_v423.z.boolean().nullish(),
|
|
4301
4383
|
/**
|
|
4302
4384
|
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
4303
4385
|
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
4304
4386
|
* Valid values: 'low', 'medium', 'high'.
|
|
4305
4387
|
*/
|
|
4306
|
-
textVerbosity:
|
|
4388
|
+
textVerbosity: import_v423.z.enum(["low", "medium", "high"]).nullish(),
|
|
4307
4389
|
/**
|
|
4308
4390
|
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
4309
4391
|
* 'disabled' turns truncation off.
|
|
4310
4392
|
*/
|
|
4311
|
-
truncation:
|
|
4393
|
+
truncation: import_v423.z.enum(["auto", "disabled"]).nullish(),
|
|
4312
4394
|
/**
|
|
4313
4395
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
4314
4396
|
* monitor and detect abuse.
|
|
4315
4397
|
* Defaults to `undefined`.
|
|
4316
4398
|
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
4317
4399
|
*/
|
|
4318
|
-
user:
|
|
4400
|
+
user: import_v423.z.string().nullish(),
|
|
4319
4401
|
/**
|
|
4320
4402
|
* Override the system message mode for this model.
|
|
4321
4403
|
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
@@ -4324,7 +4406,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils27.lazy
|
|
|
4324
4406
|
*
|
|
4325
4407
|
* If not specified, the mode is automatically determined based on the model.
|
|
4326
4408
|
*/
|
|
4327
|
-
systemMessageMode:
|
|
4409
|
+
systemMessageMode: import_v423.z.enum(["system", "developer", "remove"]).optional(),
|
|
4328
4410
|
/**
|
|
4329
4411
|
* Force treating this model as a reasoning model.
|
|
4330
4412
|
*
|
|
@@ -4334,14 +4416,14 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils27.lazy
|
|
|
4334
4416
|
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
4335
4417
|
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
4336
4418
|
*/
|
|
4337
|
-
forceReasoning:
|
|
4419
|
+
forceReasoning: import_v423.z.boolean().optional()
|
|
4338
4420
|
})
|
|
4339
4421
|
)
|
|
4340
4422
|
);
|
|
4341
4423
|
|
|
4342
4424
|
// src/responses/openai-responses-prepare-tools.ts
|
|
4343
4425
|
var import_provider7 = require("@ai-sdk/provider");
|
|
4344
|
-
var
|
|
4426
|
+
var import_provider_utils29 = require("@ai-sdk/provider-utils");
|
|
4345
4427
|
async function prepareResponsesTools({
|
|
4346
4428
|
tools,
|
|
4347
4429
|
toolChoice,
|
|
@@ -4374,7 +4456,7 @@ async function prepareResponsesTools({
|
|
|
4374
4456
|
case "provider": {
|
|
4375
4457
|
switch (tool.id) {
|
|
4376
4458
|
case "openai.file_search": {
|
|
4377
|
-
const args = await (0,
|
|
4459
|
+
const args = await (0, import_provider_utils29.validateTypes)({
|
|
4378
4460
|
value: tool.args,
|
|
4379
4461
|
schema: fileSearchArgsSchema
|
|
4380
4462
|
});
|
|
@@ -4397,7 +4479,7 @@ async function prepareResponsesTools({
|
|
|
4397
4479
|
break;
|
|
4398
4480
|
}
|
|
4399
4481
|
case "openai.shell": {
|
|
4400
|
-
const args = await (0,
|
|
4482
|
+
const args = await (0, import_provider_utils29.validateTypes)({
|
|
4401
4483
|
value: tool.args,
|
|
4402
4484
|
schema: shellArgsSchema
|
|
4403
4485
|
});
|
|
@@ -4416,7 +4498,7 @@ async function prepareResponsesTools({
|
|
|
4416
4498
|
break;
|
|
4417
4499
|
}
|
|
4418
4500
|
case "openai.web_search_preview": {
|
|
4419
|
-
const args = await (0,
|
|
4501
|
+
const args = await (0, import_provider_utils29.validateTypes)({
|
|
4420
4502
|
value: tool.args,
|
|
4421
4503
|
schema: webSearchPreviewArgsSchema
|
|
4422
4504
|
});
|
|
@@ -4428,7 +4510,7 @@ async function prepareResponsesTools({
|
|
|
4428
4510
|
break;
|
|
4429
4511
|
}
|
|
4430
4512
|
case "openai.web_search": {
|
|
4431
|
-
const args = await (0,
|
|
4513
|
+
const args = await (0, import_provider_utils29.validateTypes)({
|
|
4432
4514
|
value: tool.args,
|
|
4433
4515
|
schema: webSearchArgsSchema
|
|
4434
4516
|
});
|
|
@@ -4442,7 +4524,7 @@ async function prepareResponsesTools({
|
|
|
4442
4524
|
break;
|
|
4443
4525
|
}
|
|
4444
4526
|
case "openai.code_interpreter": {
|
|
4445
|
-
const args = await (0,
|
|
4527
|
+
const args = await (0, import_provider_utils29.validateTypes)({
|
|
4446
4528
|
value: tool.args,
|
|
4447
4529
|
schema: codeInterpreterArgsSchema
|
|
4448
4530
|
});
|
|
@@ -4453,7 +4535,7 @@ async function prepareResponsesTools({
|
|
|
4453
4535
|
break;
|
|
4454
4536
|
}
|
|
4455
4537
|
case "openai.image_generation": {
|
|
4456
|
-
const args = await (0,
|
|
4538
|
+
const args = await (0, import_provider_utils29.validateTypes)({
|
|
4457
4539
|
value: tool.args,
|
|
4458
4540
|
schema: imageGenerationArgsSchema
|
|
4459
4541
|
});
|
|
@@ -4476,7 +4558,7 @@ async function prepareResponsesTools({
|
|
|
4476
4558
|
break;
|
|
4477
4559
|
}
|
|
4478
4560
|
case "openai.mcp": {
|
|
4479
|
-
const args = await (0,
|
|
4561
|
+
const args = await (0, import_provider_utils29.validateTypes)({
|
|
4480
4562
|
value: tool.args,
|
|
4481
4563
|
schema: mcpArgsSchema
|
|
4482
4564
|
});
|
|
@@ -4502,7 +4584,7 @@ async function prepareResponsesTools({
|
|
|
4502
4584
|
break;
|
|
4503
4585
|
}
|
|
4504
4586
|
case "openai.custom": {
|
|
4505
|
-
const args = await (0,
|
|
4587
|
+
const args = await (0, import_provider_utils29.validateTypes)({
|
|
4506
4588
|
value: tool.args,
|
|
4507
4589
|
schema: customArgsSchema
|
|
4508
4590
|
});
|
|
@@ -4516,7 +4598,7 @@ async function prepareResponsesTools({
|
|
|
4516
4598
|
break;
|
|
4517
4599
|
}
|
|
4518
4600
|
case "openai.tool_search": {
|
|
4519
|
-
const args = await (0,
|
|
4601
|
+
const args = await (0, import_provider_utils29.validateTypes)({
|
|
4520
4602
|
value: tool.args,
|
|
4521
4603
|
schema: toolSearchArgsSchema
|
|
4522
4604
|
});
|
|
@@ -4674,13 +4756,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4674
4756
|
warnings.push({ type: "unsupported", feature: "stopSequences" });
|
|
4675
4757
|
}
|
|
4676
4758
|
const providerOptionsName = this.config.provider.includes("azure") ? "azure" : "openai";
|
|
4677
|
-
let openaiOptions = await (0,
|
|
4759
|
+
let openaiOptions = await (0, import_provider_utils30.parseProviderOptions)({
|
|
4678
4760
|
provider: providerOptionsName,
|
|
4679
4761
|
providerOptions,
|
|
4680
4762
|
schema: openaiLanguageModelResponsesOptionsSchema
|
|
4681
4763
|
});
|
|
4682
4764
|
if (openaiOptions == null && providerOptionsName !== "openai") {
|
|
4683
|
-
openaiOptions = await (0,
|
|
4765
|
+
openaiOptions = await (0, import_provider_utils30.parseProviderOptions)({
|
|
4684
4766
|
provider: "openai",
|
|
4685
4767
|
providerOptions,
|
|
4686
4768
|
schema: openaiLanguageModelResponsesOptionsSchema
|
|
@@ -4694,7 +4776,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4694
4776
|
details: "conversation and previousResponseId cannot be used together"
|
|
4695
4777
|
});
|
|
4696
4778
|
}
|
|
4697
|
-
const toolNameMapping = (0,
|
|
4779
|
+
const toolNameMapping = (0, import_provider_utils30.createToolNameMapping)({
|
|
4698
4780
|
tools,
|
|
4699
4781
|
providerToolNames: {
|
|
4700
4782
|
"openai.code_interpreter": "code_interpreter",
|
|
@@ -4902,12 +4984,12 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4902
4984
|
responseHeaders,
|
|
4903
4985
|
value: response,
|
|
4904
4986
|
rawValue: rawResponse
|
|
4905
|
-
} = await (0,
|
|
4987
|
+
} = await (0, import_provider_utils30.postJsonToApi)({
|
|
4906
4988
|
url,
|
|
4907
|
-
headers: (0,
|
|
4989
|
+
headers: (0, import_provider_utils30.combineHeaders)(this.config.headers(), options.headers),
|
|
4908
4990
|
body,
|
|
4909
4991
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
4910
|
-
successfulResponseHandler: (0,
|
|
4992
|
+
successfulResponseHandler: (0, import_provider_utils30.createJsonResponseHandler)(
|
|
4911
4993
|
openaiResponsesResponseSchema
|
|
4912
4994
|
),
|
|
4913
4995
|
abortSignal: options.abortSignal,
|
|
@@ -5083,7 +5165,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5083
5165
|
content.push({
|
|
5084
5166
|
type: "source",
|
|
5085
5167
|
sourceType: "url",
|
|
5086
|
-
id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0,
|
|
5168
|
+
id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0, import_provider_utils30.generateId)(),
|
|
5087
5169
|
url: annotation.url,
|
|
5088
5170
|
title: annotation.title
|
|
5089
5171
|
});
|
|
@@ -5091,7 +5173,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5091
5173
|
content.push({
|
|
5092
5174
|
type: "source",
|
|
5093
5175
|
sourceType: "document",
|
|
5094
|
-
id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : (0,
|
|
5176
|
+
id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : (0, import_provider_utils30.generateId)(),
|
|
5095
5177
|
mediaType: "text/plain",
|
|
5096
5178
|
title: annotation.filename,
|
|
5097
5179
|
filename: annotation.filename,
|
|
@@ -5107,7 +5189,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5107
5189
|
content.push({
|
|
5108
5190
|
type: "source",
|
|
5109
5191
|
sourceType: "document",
|
|
5110
|
-
id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0,
|
|
5192
|
+
id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils30.generateId)(),
|
|
5111
5193
|
mediaType: "text/plain",
|
|
5112
5194
|
title: annotation.filename,
|
|
5113
5195
|
filename: annotation.filename,
|
|
@@ -5123,7 +5205,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5123
5205
|
content.push({
|
|
5124
5206
|
type: "source",
|
|
5125
5207
|
sourceType: "document",
|
|
5126
|
-
id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : (0,
|
|
5208
|
+
id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : (0, import_provider_utils30.generateId)(),
|
|
5127
5209
|
mediaType: "application/octet-stream",
|
|
5128
5210
|
title: annotation.file_id,
|
|
5129
5211
|
filename: annotation.file_id,
|
|
@@ -5227,7 +5309,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5227
5309
|
}
|
|
5228
5310
|
case "mcp_approval_request": {
|
|
5229
5311
|
const approvalRequestId = (_t = part.approval_request_id) != null ? _t : part.id;
|
|
5230
|
-
const dummyToolCallId = (_w = (_v = (_u = this.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : (0,
|
|
5312
|
+
const dummyToolCallId = (_w = (_v = (_u = this.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : (0, import_provider_utils30.generateId)();
|
|
5231
5313
|
const toolName = `mcp.${part.name}`;
|
|
5232
5314
|
content.push({
|
|
5233
5315
|
type: "tool-call",
|
|
@@ -5368,18 +5450,18 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5368
5450
|
providerOptionsName,
|
|
5369
5451
|
isShellProviderExecuted
|
|
5370
5452
|
} = await this.getArgs(options);
|
|
5371
|
-
const { responseHeaders, value: response } = await (0,
|
|
5453
|
+
const { responseHeaders, value: response } = await (0, import_provider_utils30.postJsonToApi)({
|
|
5372
5454
|
url: this.config.url({
|
|
5373
5455
|
path: "/responses",
|
|
5374
5456
|
modelId: this.modelId
|
|
5375
5457
|
}),
|
|
5376
|
-
headers: (0,
|
|
5458
|
+
headers: (0, import_provider_utils30.combineHeaders)(this.config.headers(), options.headers),
|
|
5377
5459
|
body: {
|
|
5378
5460
|
...body,
|
|
5379
5461
|
stream: true
|
|
5380
5462
|
},
|
|
5381
5463
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
5382
|
-
successfulResponseHandler: (0,
|
|
5464
|
+
successfulResponseHandler: (0, import_provider_utils30.createEventSourceResponseHandler)(
|
|
5383
5465
|
openaiResponsesChunkSchema
|
|
5384
5466
|
),
|
|
5385
5467
|
abortSignal: options.abortSignal,
|
|
@@ -5859,7 +5941,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5859
5941
|
ongoingToolCalls[value.output_index] = void 0;
|
|
5860
5942
|
} else if (value.item.type === "mcp_approval_request") {
|
|
5861
5943
|
ongoingToolCalls[value.output_index] = void 0;
|
|
5862
|
-
const dummyToolCallId = (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0,
|
|
5944
|
+
const dummyToolCallId = (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils30.generateId)();
|
|
5863
5945
|
const approvalRequestId = (_p = value.item.approval_request_id) != null ? _p : value.item.id;
|
|
5864
5946
|
approvalRequestIdToDummyToolCallIdFromStream.set(
|
|
5865
5947
|
approvalRequestId,
|
|
@@ -6150,7 +6232,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6150
6232
|
controller.enqueue({
|
|
6151
6233
|
type: "source",
|
|
6152
6234
|
sourceType: "url",
|
|
6153
|
-
id: (_C = (_B = (_A = self.config).generateId) == null ? void 0 : _B.call(_A)) != null ? _C : (0,
|
|
6235
|
+
id: (_C = (_B = (_A = self.config).generateId) == null ? void 0 : _B.call(_A)) != null ? _C : (0, import_provider_utils30.generateId)(),
|
|
6154
6236
|
url: value.annotation.url,
|
|
6155
6237
|
title: value.annotation.title
|
|
6156
6238
|
});
|
|
@@ -6158,7 +6240,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6158
6240
|
controller.enqueue({
|
|
6159
6241
|
type: "source",
|
|
6160
6242
|
sourceType: "document",
|
|
6161
|
-
id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : (0,
|
|
6243
|
+
id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : (0, import_provider_utils30.generateId)(),
|
|
6162
6244
|
mediaType: "text/plain",
|
|
6163
6245
|
title: value.annotation.filename,
|
|
6164
6246
|
filename: value.annotation.filename,
|
|
@@ -6174,7 +6256,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6174
6256
|
controller.enqueue({
|
|
6175
6257
|
type: "source",
|
|
6176
6258
|
sourceType: "document",
|
|
6177
|
-
id: (_I = (_H = (_G = self.config).generateId) == null ? void 0 : _H.call(_G)) != null ? _I : (0,
|
|
6259
|
+
id: (_I = (_H = (_G = self.config).generateId) == null ? void 0 : _H.call(_G)) != null ? _I : (0, import_provider_utils30.generateId)(),
|
|
6178
6260
|
mediaType: "text/plain",
|
|
6179
6261
|
title: value.annotation.filename,
|
|
6180
6262
|
filename: value.annotation.filename,
|
|
@@ -6190,7 +6272,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6190
6272
|
controller.enqueue({
|
|
6191
6273
|
type: "source",
|
|
6192
6274
|
sourceType: "document",
|
|
6193
|
-
id: (_L = (_K = (_J = self.config).generateId) == null ? void 0 : _K.call(_J)) != null ? _L : (0,
|
|
6275
|
+
id: (_L = (_K = (_J = self.config).generateId) == null ? void 0 : _K.call(_J)) != null ? _L : (0, import_provider_utils30.generateId)(),
|
|
6194
6276
|
mediaType: "application/octet-stream",
|
|
6195
6277
|
title: value.annotation.file_id,
|
|
6196
6278
|
filename: value.annotation.file_id,
|
|
@@ -6303,16 +6385,16 @@ function escapeJSONDelta(delta) {
|
|
|
6303
6385
|
}
|
|
6304
6386
|
|
|
6305
6387
|
// src/speech/openai-speech-model.ts
|
|
6306
|
-
var
|
|
6388
|
+
var import_provider_utils32 = require("@ai-sdk/provider-utils");
|
|
6307
6389
|
|
|
6308
6390
|
// src/speech/openai-speech-options.ts
|
|
6309
|
-
var
|
|
6310
|
-
var
|
|
6311
|
-
var openaiSpeechModelOptionsSchema = (0,
|
|
6312
|
-
() => (0,
|
|
6313
|
-
|
|
6314
|
-
instructions:
|
|
6315
|
-
speed:
|
|
6391
|
+
var import_provider_utils31 = require("@ai-sdk/provider-utils");
|
|
6392
|
+
var import_v424 = require("zod/v4");
|
|
6393
|
+
var openaiSpeechModelOptionsSchema = (0, import_provider_utils31.lazySchema)(
|
|
6394
|
+
() => (0, import_provider_utils31.zodSchema)(
|
|
6395
|
+
import_v424.z.object({
|
|
6396
|
+
instructions: import_v424.z.string().nullish(),
|
|
6397
|
+
speed: import_v424.z.number().min(0.25).max(4).default(1).nullish()
|
|
6316
6398
|
})
|
|
6317
6399
|
)
|
|
6318
6400
|
);
|
|
@@ -6337,7 +6419,7 @@ var OpenAISpeechModel = class {
|
|
|
6337
6419
|
providerOptions
|
|
6338
6420
|
}) {
|
|
6339
6421
|
const warnings = [];
|
|
6340
|
-
const openAIOptions = await (0,
|
|
6422
|
+
const openAIOptions = await (0, import_provider_utils32.parseProviderOptions)({
|
|
6341
6423
|
provider: "openai",
|
|
6342
6424
|
providerOptions,
|
|
6343
6425
|
schema: openaiSpeechModelOptionsSchema
|
|
@@ -6390,15 +6472,15 @@ var OpenAISpeechModel = class {
|
|
|
6390
6472
|
value: audio,
|
|
6391
6473
|
responseHeaders,
|
|
6392
6474
|
rawValue: rawResponse
|
|
6393
|
-
} = await (0,
|
|
6475
|
+
} = await (0, import_provider_utils32.postJsonToApi)({
|
|
6394
6476
|
url: this.config.url({
|
|
6395
6477
|
path: "/audio/speech",
|
|
6396
6478
|
modelId: this.modelId
|
|
6397
6479
|
}),
|
|
6398
|
-
headers: (0,
|
|
6480
|
+
headers: (0, import_provider_utils32.combineHeaders)(this.config.headers(), options.headers),
|
|
6399
6481
|
body: requestBody,
|
|
6400
6482
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
6401
|
-
successfulResponseHandler: (0,
|
|
6483
|
+
successfulResponseHandler: (0, import_provider_utils32.createBinaryResponseHandler)(),
|
|
6402
6484
|
abortSignal: options.abortSignal,
|
|
6403
6485
|
fetch: this.config.fetch
|
|
6404
6486
|
});
|
|
@@ -6419,36 +6501,36 @@ var OpenAISpeechModel = class {
|
|
|
6419
6501
|
};
|
|
6420
6502
|
|
|
6421
6503
|
// src/transcription/openai-transcription-model.ts
|
|
6422
|
-
var
|
|
6504
|
+
var import_provider_utils35 = require("@ai-sdk/provider-utils");
|
|
6423
6505
|
|
|
6424
6506
|
// src/transcription/openai-transcription-api.ts
|
|
6425
|
-
var
|
|
6426
|
-
var
|
|
6427
|
-
var openaiTranscriptionResponseSchema = (0,
|
|
6428
|
-
() => (0,
|
|
6429
|
-
|
|
6430
|
-
text:
|
|
6431
|
-
language:
|
|
6432
|
-
duration:
|
|
6433
|
-
words:
|
|
6434
|
-
|
|
6435
|
-
word:
|
|
6436
|
-
start:
|
|
6437
|
-
end:
|
|
6507
|
+
var import_provider_utils33 = require("@ai-sdk/provider-utils");
|
|
6508
|
+
var import_v425 = require("zod/v4");
|
|
6509
|
+
var openaiTranscriptionResponseSchema = (0, import_provider_utils33.lazySchema)(
|
|
6510
|
+
() => (0, import_provider_utils33.zodSchema)(
|
|
6511
|
+
import_v425.z.object({
|
|
6512
|
+
text: import_v425.z.string(),
|
|
6513
|
+
language: import_v425.z.string().nullish(),
|
|
6514
|
+
duration: import_v425.z.number().nullish(),
|
|
6515
|
+
words: import_v425.z.array(
|
|
6516
|
+
import_v425.z.object({
|
|
6517
|
+
word: import_v425.z.string(),
|
|
6518
|
+
start: import_v425.z.number(),
|
|
6519
|
+
end: import_v425.z.number()
|
|
6438
6520
|
})
|
|
6439
6521
|
).nullish(),
|
|
6440
|
-
segments:
|
|
6441
|
-
|
|
6442
|
-
id:
|
|
6443
|
-
seek:
|
|
6444
|
-
start:
|
|
6445
|
-
end:
|
|
6446
|
-
text:
|
|
6447
|
-
tokens:
|
|
6448
|
-
temperature:
|
|
6449
|
-
avg_logprob:
|
|
6450
|
-
compression_ratio:
|
|
6451
|
-
no_speech_prob:
|
|
6522
|
+
segments: import_v425.z.array(
|
|
6523
|
+
import_v425.z.object({
|
|
6524
|
+
id: import_v425.z.number(),
|
|
6525
|
+
seek: import_v425.z.number(),
|
|
6526
|
+
start: import_v425.z.number(),
|
|
6527
|
+
end: import_v425.z.number(),
|
|
6528
|
+
text: import_v425.z.string(),
|
|
6529
|
+
tokens: import_v425.z.array(import_v425.z.number()),
|
|
6530
|
+
temperature: import_v425.z.number(),
|
|
6531
|
+
avg_logprob: import_v425.z.number(),
|
|
6532
|
+
compression_ratio: import_v425.z.number(),
|
|
6533
|
+
no_speech_prob: import_v425.z.number()
|
|
6452
6534
|
})
|
|
6453
6535
|
).nullish()
|
|
6454
6536
|
})
|
|
@@ -6456,33 +6538,33 @@ var openaiTranscriptionResponseSchema = (0, import_provider_utils32.lazySchema)(
|
|
|
6456
6538
|
);
|
|
6457
6539
|
|
|
6458
6540
|
// src/transcription/openai-transcription-options.ts
|
|
6459
|
-
var
|
|
6460
|
-
var
|
|
6461
|
-
var openAITranscriptionModelOptions = (0,
|
|
6462
|
-
() => (0,
|
|
6463
|
-
|
|
6541
|
+
var import_provider_utils34 = require("@ai-sdk/provider-utils");
|
|
6542
|
+
var import_v426 = require("zod/v4");
|
|
6543
|
+
var openAITranscriptionModelOptions = (0, import_provider_utils34.lazySchema)(
|
|
6544
|
+
() => (0, import_provider_utils34.zodSchema)(
|
|
6545
|
+
import_v426.z.object({
|
|
6464
6546
|
/**
|
|
6465
6547
|
* Additional information to include in the transcription response.
|
|
6466
6548
|
*/
|
|
6467
|
-
include:
|
|
6549
|
+
include: import_v426.z.array(import_v426.z.string()).optional(),
|
|
6468
6550
|
/**
|
|
6469
6551
|
* The language of the input audio in ISO-639-1 format.
|
|
6470
6552
|
*/
|
|
6471
|
-
language:
|
|
6553
|
+
language: import_v426.z.string().optional(),
|
|
6472
6554
|
/**
|
|
6473
6555
|
* An optional text to guide the model's style or continue a previous audio segment.
|
|
6474
6556
|
*/
|
|
6475
|
-
prompt:
|
|
6557
|
+
prompt: import_v426.z.string().optional(),
|
|
6476
6558
|
/**
|
|
6477
6559
|
* The sampling temperature, between 0 and 1.
|
|
6478
6560
|
* @default 0
|
|
6479
6561
|
*/
|
|
6480
|
-
temperature:
|
|
6562
|
+
temperature: import_v426.z.number().min(0).max(1).default(0).optional(),
|
|
6481
6563
|
/**
|
|
6482
6564
|
* The timestamp granularities to populate for this transcription.
|
|
6483
6565
|
* @default ['segment']
|
|
6484
6566
|
*/
|
|
6485
|
-
timestampGranularities:
|
|
6567
|
+
timestampGranularities: import_v426.z.array(import_v426.z.enum(["word", "segment"])).default(["segment"]).optional()
|
|
6486
6568
|
})
|
|
6487
6569
|
)
|
|
6488
6570
|
);
|
|
@@ -6562,15 +6644,15 @@ var OpenAITranscriptionModel = class {
|
|
|
6562
6644
|
providerOptions
|
|
6563
6645
|
}) {
|
|
6564
6646
|
const warnings = [];
|
|
6565
|
-
const openAIOptions = await (0,
|
|
6647
|
+
const openAIOptions = await (0, import_provider_utils35.parseProviderOptions)({
|
|
6566
6648
|
provider: "openai",
|
|
6567
6649
|
providerOptions,
|
|
6568
6650
|
schema: openAITranscriptionModelOptions
|
|
6569
6651
|
});
|
|
6570
6652
|
const formData = new FormData();
|
|
6571
|
-
const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([(0,
|
|
6653
|
+
const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([(0, import_provider_utils35.convertBase64ToUint8Array)(audio)]);
|
|
6572
6654
|
formData.append("model", this.modelId);
|
|
6573
|
-
const fileExtension = (0,
|
|
6655
|
+
const fileExtension = (0, import_provider_utils35.mediaTypeToExtension)(mediaType);
|
|
6574
6656
|
formData.append(
|
|
6575
6657
|
"file",
|
|
6576
6658
|
new File([blob], "audio", { type: mediaType }),
|
|
@@ -6615,15 +6697,15 @@ var OpenAITranscriptionModel = class {
|
|
|
6615
6697
|
value: response,
|
|
6616
6698
|
responseHeaders,
|
|
6617
6699
|
rawValue: rawResponse
|
|
6618
|
-
} = await (0,
|
|
6700
|
+
} = await (0, import_provider_utils35.postFormDataToApi)({
|
|
6619
6701
|
url: this.config.url({
|
|
6620
6702
|
path: "/audio/transcriptions",
|
|
6621
6703
|
modelId: this.modelId
|
|
6622
6704
|
}),
|
|
6623
|
-
headers: (0,
|
|
6705
|
+
headers: (0, import_provider_utils35.combineHeaders)(this.config.headers(), options.headers),
|
|
6624
6706
|
formData,
|
|
6625
6707
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
6626
|
-
successfulResponseHandler: (0,
|
|
6708
|
+
successfulResponseHandler: (0, import_provider_utils35.createJsonResponseHandler)(
|
|
6627
6709
|
openaiTranscriptionResponseSchema
|
|
6628
6710
|
),
|
|
6629
6711
|
abortSignal: options.abortSignal,
|
|
@@ -6655,21 +6737,21 @@ var OpenAITranscriptionModel = class {
|
|
|
6655
6737
|
};
|
|
6656
6738
|
|
|
6657
6739
|
// src/version.ts
|
|
6658
|
-
var VERSION = true ? "3.0.
|
|
6740
|
+
var VERSION = true ? "3.0.57" : "0.0.0-test";
|
|
6659
6741
|
|
|
6660
6742
|
// src/openai-provider.ts
|
|
6661
6743
|
function createOpenAI(options = {}) {
|
|
6662
6744
|
var _a, _b;
|
|
6663
|
-
const baseURL = (_a = (0,
|
|
6664
|
-
(0,
|
|
6745
|
+
const baseURL = (_a = (0, import_provider_utils36.withoutTrailingSlash)(
|
|
6746
|
+
(0, import_provider_utils36.loadOptionalSetting)({
|
|
6665
6747
|
settingValue: options.baseURL,
|
|
6666
6748
|
environmentVariableName: "OPENAI_BASE_URL"
|
|
6667
6749
|
})
|
|
6668
6750
|
)) != null ? _a : "https://api.openai.com/v1";
|
|
6669
6751
|
const providerName = (_b = options.name) != null ? _b : "openai";
|
|
6670
|
-
const getHeaders = () => (0,
|
|
6752
|
+
const getHeaders = () => (0, import_provider_utils36.withUserAgentSuffix)(
|
|
6671
6753
|
{
|
|
6672
|
-
Authorization: `Bearer ${(0,
|
|
6754
|
+
Authorization: `Bearer ${(0, import_provider_utils36.loadApiKey)({
|
|
6673
6755
|
apiKey: options.apiKey,
|
|
6674
6756
|
environmentVariableName: "OPENAI_API_KEY",
|
|
6675
6757
|
description: "OpenAI"
|