@ai-sdk/openai 3.0.55 → 3.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/index.d.mts +30 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js +1221 -1125
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1165 -1065
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +30 -1
- package/dist/internal/index.d.ts +30 -1
- package/dist/internal/index.js +1220 -1118
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +1166 -1063
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +12 -3
- package/package.json +2 -2
- package/src/image/openai-image-model-options.ts +123 -0
- package/src/image/openai-image-model.ts +40 -77
- package/src/index.ts +5 -0
- package/src/internal/index.ts +1 -1
- package/src/openai-provider.ts +1 -1
- package/src/responses/openai-responses-api.ts +3 -0
- package/src/responses/openai-responses-language-model.ts +11 -0
- package/src/image/openai-image-options.ts +0 -34
package/dist/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,544 @@ 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(),
|
|
3449
|
+
namespace: import_v422.z.string().nullish()
|
|
3367
3450
|
}),
|
|
3368
|
-
|
|
3369
|
-
type:
|
|
3370
|
-
id:
|
|
3371
|
-
status:
|
|
3451
|
+
import_v422.z.object({
|
|
3452
|
+
type: import_v422.z.literal("web_search_call"),
|
|
3453
|
+
id: import_v422.z.string(),
|
|
3454
|
+
status: import_v422.z.string()
|
|
3372
3455
|
}),
|
|
3373
|
-
|
|
3374
|
-
type:
|
|
3375
|
-
id:
|
|
3376
|
-
status:
|
|
3456
|
+
import_v422.z.object({
|
|
3457
|
+
type: import_v422.z.literal("computer_call"),
|
|
3458
|
+
id: import_v422.z.string(),
|
|
3459
|
+
status: import_v422.z.string()
|
|
3377
3460
|
}),
|
|
3378
|
-
|
|
3379
|
-
type:
|
|
3380
|
-
id:
|
|
3461
|
+
import_v422.z.object({
|
|
3462
|
+
type: import_v422.z.literal("file_search_call"),
|
|
3463
|
+
id: import_v422.z.string()
|
|
3381
3464
|
}),
|
|
3382
|
-
|
|
3383
|
-
type:
|
|
3384
|
-
id:
|
|
3465
|
+
import_v422.z.object({
|
|
3466
|
+
type: import_v422.z.literal("image_generation_call"),
|
|
3467
|
+
id: import_v422.z.string()
|
|
3385
3468
|
}),
|
|
3386
|
-
|
|
3387
|
-
type:
|
|
3388
|
-
id:
|
|
3389
|
-
container_id:
|
|
3390
|
-
code:
|
|
3391
|
-
outputs:
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3469
|
+
import_v422.z.object({
|
|
3470
|
+
type: import_v422.z.literal("code_interpreter_call"),
|
|
3471
|
+
id: import_v422.z.string(),
|
|
3472
|
+
container_id: import_v422.z.string(),
|
|
3473
|
+
code: import_v422.z.string().nullable(),
|
|
3474
|
+
outputs: import_v422.z.array(
|
|
3475
|
+
import_v422.z.discriminatedUnion("type", [
|
|
3476
|
+
import_v422.z.object({ type: import_v422.z.literal("logs"), logs: import_v422.z.string() }),
|
|
3477
|
+
import_v422.z.object({ type: import_v422.z.literal("image"), url: import_v422.z.string() })
|
|
3395
3478
|
])
|
|
3396
3479
|
).nullable(),
|
|
3397
|
-
status:
|
|
3480
|
+
status: import_v422.z.string()
|
|
3398
3481
|
}),
|
|
3399
|
-
|
|
3400
|
-
type:
|
|
3401
|
-
id:
|
|
3402
|
-
status:
|
|
3403
|
-
approval_request_id:
|
|
3482
|
+
import_v422.z.object({
|
|
3483
|
+
type: import_v422.z.literal("mcp_call"),
|
|
3484
|
+
id: import_v422.z.string(),
|
|
3485
|
+
status: import_v422.z.string(),
|
|
3486
|
+
approval_request_id: import_v422.z.string().nullish()
|
|
3404
3487
|
}),
|
|
3405
|
-
|
|
3406
|
-
type:
|
|
3407
|
-
id:
|
|
3488
|
+
import_v422.z.object({
|
|
3489
|
+
type: import_v422.z.literal("mcp_list_tools"),
|
|
3490
|
+
id: import_v422.z.string()
|
|
3408
3491
|
}),
|
|
3409
|
-
|
|
3410
|
-
type:
|
|
3411
|
-
id:
|
|
3492
|
+
import_v422.z.object({
|
|
3493
|
+
type: import_v422.z.literal("mcp_approval_request"),
|
|
3494
|
+
id: import_v422.z.string()
|
|
3412
3495
|
}),
|
|
3413
|
-
|
|
3414
|
-
type:
|
|
3415
|
-
id:
|
|
3416
|
-
call_id:
|
|
3417
|
-
status:
|
|
3418
|
-
operation:
|
|
3419
|
-
|
|
3420
|
-
type:
|
|
3421
|
-
path:
|
|
3422
|
-
diff:
|
|
3496
|
+
import_v422.z.object({
|
|
3497
|
+
type: import_v422.z.literal("apply_patch_call"),
|
|
3498
|
+
id: import_v422.z.string(),
|
|
3499
|
+
call_id: import_v422.z.string(),
|
|
3500
|
+
status: import_v422.z.enum(["in_progress", "completed"]),
|
|
3501
|
+
operation: import_v422.z.discriminatedUnion("type", [
|
|
3502
|
+
import_v422.z.object({
|
|
3503
|
+
type: import_v422.z.literal("create_file"),
|
|
3504
|
+
path: import_v422.z.string(),
|
|
3505
|
+
diff: import_v422.z.string()
|
|
3423
3506
|
}),
|
|
3424
|
-
|
|
3425
|
-
type:
|
|
3426
|
-
path:
|
|
3507
|
+
import_v422.z.object({
|
|
3508
|
+
type: import_v422.z.literal("delete_file"),
|
|
3509
|
+
path: import_v422.z.string()
|
|
3427
3510
|
}),
|
|
3428
|
-
|
|
3429
|
-
type:
|
|
3430
|
-
path:
|
|
3431
|
-
diff:
|
|
3511
|
+
import_v422.z.object({
|
|
3512
|
+
type: import_v422.z.literal("update_file"),
|
|
3513
|
+
path: import_v422.z.string(),
|
|
3514
|
+
diff: import_v422.z.string()
|
|
3432
3515
|
})
|
|
3433
3516
|
])
|
|
3434
3517
|
}),
|
|
3435
|
-
|
|
3436
|
-
type:
|
|
3437
|
-
id:
|
|
3438
|
-
call_id:
|
|
3439
|
-
name:
|
|
3440
|
-
input:
|
|
3518
|
+
import_v422.z.object({
|
|
3519
|
+
type: import_v422.z.literal("custom_tool_call"),
|
|
3520
|
+
id: import_v422.z.string(),
|
|
3521
|
+
call_id: import_v422.z.string(),
|
|
3522
|
+
name: import_v422.z.string(),
|
|
3523
|
+
input: import_v422.z.string()
|
|
3441
3524
|
}),
|
|
3442
|
-
|
|
3443
|
-
type:
|
|
3444
|
-
id:
|
|
3445
|
-
call_id:
|
|
3446
|
-
status:
|
|
3447
|
-
action:
|
|
3448
|
-
commands:
|
|
3525
|
+
import_v422.z.object({
|
|
3526
|
+
type: import_v422.z.literal("shell_call"),
|
|
3527
|
+
id: import_v422.z.string(),
|
|
3528
|
+
call_id: import_v422.z.string(),
|
|
3529
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3530
|
+
action: import_v422.z.object({
|
|
3531
|
+
commands: import_v422.z.array(import_v422.z.string())
|
|
3449
3532
|
})
|
|
3450
3533
|
}),
|
|
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:
|
|
3534
|
+
import_v422.z.object({
|
|
3535
|
+
type: import_v422.z.literal("shell_call_output"),
|
|
3536
|
+
id: import_v422.z.string(),
|
|
3537
|
+
call_id: import_v422.z.string(),
|
|
3538
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3539
|
+
output: import_v422.z.array(
|
|
3540
|
+
import_v422.z.object({
|
|
3541
|
+
stdout: import_v422.z.string(),
|
|
3542
|
+
stderr: import_v422.z.string(),
|
|
3543
|
+
outcome: import_v422.z.discriminatedUnion("type", [
|
|
3544
|
+
import_v422.z.object({ type: import_v422.z.literal("timeout") }),
|
|
3545
|
+
import_v422.z.object({
|
|
3546
|
+
type: import_v422.z.literal("exit"),
|
|
3547
|
+
exit_code: import_v422.z.number()
|
|
3465
3548
|
})
|
|
3466
3549
|
])
|
|
3467
3550
|
})
|
|
3468
3551
|
)
|
|
3469
3552
|
}),
|
|
3470
|
-
|
|
3471
|
-
type:
|
|
3472
|
-
id:
|
|
3473
|
-
execution:
|
|
3474
|
-
call_id:
|
|
3475
|
-
status:
|
|
3476
|
-
arguments:
|
|
3553
|
+
import_v422.z.object({
|
|
3554
|
+
type: import_v422.z.literal("tool_search_call"),
|
|
3555
|
+
id: import_v422.z.string(),
|
|
3556
|
+
execution: import_v422.z.enum(["server", "client"]),
|
|
3557
|
+
call_id: import_v422.z.string().nullable(),
|
|
3558
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3559
|
+
arguments: import_v422.z.unknown()
|
|
3477
3560
|
}),
|
|
3478
|
-
|
|
3479
|
-
type:
|
|
3480
|
-
id:
|
|
3481
|
-
execution:
|
|
3482
|
-
call_id:
|
|
3483
|
-
status:
|
|
3484
|
-
tools:
|
|
3561
|
+
import_v422.z.object({
|
|
3562
|
+
type: import_v422.z.literal("tool_search_output"),
|
|
3563
|
+
id: import_v422.z.string(),
|
|
3564
|
+
execution: import_v422.z.enum(["server", "client"]),
|
|
3565
|
+
call_id: import_v422.z.string().nullable(),
|
|
3566
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3567
|
+
tools: import_v422.z.array(import_v422.z.record(import_v422.z.string(), jsonValueSchema2.optional()))
|
|
3485
3568
|
})
|
|
3486
3569
|
])
|
|
3487
3570
|
}),
|
|
3488
|
-
|
|
3489
|
-
type:
|
|
3490
|
-
output_index:
|
|
3491
|
-
item:
|
|
3492
|
-
|
|
3493
|
-
type:
|
|
3494
|
-
id:
|
|
3495
|
-
phase:
|
|
3571
|
+
import_v422.z.object({
|
|
3572
|
+
type: import_v422.z.literal("response.output_item.done"),
|
|
3573
|
+
output_index: import_v422.z.number(),
|
|
3574
|
+
item: import_v422.z.discriminatedUnion("type", [
|
|
3575
|
+
import_v422.z.object({
|
|
3576
|
+
type: import_v422.z.literal("message"),
|
|
3577
|
+
id: import_v422.z.string(),
|
|
3578
|
+
phase: import_v422.z.enum(["commentary", "final_answer"]).nullish()
|
|
3496
3579
|
}),
|
|
3497
|
-
|
|
3498
|
-
type:
|
|
3499
|
-
id:
|
|
3500
|
-
encrypted_content:
|
|
3580
|
+
import_v422.z.object({
|
|
3581
|
+
type: import_v422.z.literal("reasoning"),
|
|
3582
|
+
id: import_v422.z.string(),
|
|
3583
|
+
encrypted_content: import_v422.z.string().nullish()
|
|
3501
3584
|
}),
|
|
3502
|
-
|
|
3503
|
-
type:
|
|
3504
|
-
id:
|
|
3505
|
-
call_id:
|
|
3506
|
-
name:
|
|
3507
|
-
arguments:
|
|
3508
|
-
status:
|
|
3585
|
+
import_v422.z.object({
|
|
3586
|
+
type: import_v422.z.literal("function_call"),
|
|
3587
|
+
id: import_v422.z.string(),
|
|
3588
|
+
call_id: import_v422.z.string(),
|
|
3589
|
+
name: import_v422.z.string(),
|
|
3590
|
+
arguments: import_v422.z.string(),
|
|
3591
|
+
status: import_v422.z.literal("completed"),
|
|
3592
|
+
namespace: import_v422.z.string().nullish()
|
|
3509
3593
|
}),
|
|
3510
|
-
|
|
3511
|
-
type:
|
|
3512
|
-
id:
|
|
3513
|
-
call_id:
|
|
3514
|
-
name:
|
|
3515
|
-
input:
|
|
3516
|
-
status:
|
|
3594
|
+
import_v422.z.object({
|
|
3595
|
+
type: import_v422.z.literal("custom_tool_call"),
|
|
3596
|
+
id: import_v422.z.string(),
|
|
3597
|
+
call_id: import_v422.z.string(),
|
|
3598
|
+
name: import_v422.z.string(),
|
|
3599
|
+
input: import_v422.z.string(),
|
|
3600
|
+
status: import_v422.z.literal("completed")
|
|
3517
3601
|
}),
|
|
3518
|
-
|
|
3519
|
-
type:
|
|
3520
|
-
id:
|
|
3521
|
-
code:
|
|
3522
|
-
container_id:
|
|
3523
|
-
outputs:
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3602
|
+
import_v422.z.object({
|
|
3603
|
+
type: import_v422.z.literal("code_interpreter_call"),
|
|
3604
|
+
id: import_v422.z.string(),
|
|
3605
|
+
code: import_v422.z.string().nullable(),
|
|
3606
|
+
container_id: import_v422.z.string(),
|
|
3607
|
+
outputs: import_v422.z.array(
|
|
3608
|
+
import_v422.z.discriminatedUnion("type", [
|
|
3609
|
+
import_v422.z.object({ type: import_v422.z.literal("logs"), logs: import_v422.z.string() }),
|
|
3610
|
+
import_v422.z.object({ type: import_v422.z.literal("image"), url: import_v422.z.string() })
|
|
3527
3611
|
])
|
|
3528
3612
|
).nullable()
|
|
3529
3613
|
}),
|
|
3530
|
-
|
|
3531
|
-
type:
|
|
3532
|
-
id:
|
|
3533
|
-
result:
|
|
3614
|
+
import_v422.z.object({
|
|
3615
|
+
type: import_v422.z.literal("image_generation_call"),
|
|
3616
|
+
id: import_v422.z.string(),
|
|
3617
|
+
result: import_v422.z.string()
|
|
3534
3618
|
}),
|
|
3535
|
-
|
|
3536
|
-
type:
|
|
3537
|
-
id:
|
|
3538
|
-
status:
|
|
3539
|
-
action:
|
|
3540
|
-
|
|
3541
|
-
type:
|
|
3542
|
-
query:
|
|
3543
|
-
sources:
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3619
|
+
import_v422.z.object({
|
|
3620
|
+
type: import_v422.z.literal("web_search_call"),
|
|
3621
|
+
id: import_v422.z.string(),
|
|
3622
|
+
status: import_v422.z.string(),
|
|
3623
|
+
action: import_v422.z.discriminatedUnion("type", [
|
|
3624
|
+
import_v422.z.object({
|
|
3625
|
+
type: import_v422.z.literal("search"),
|
|
3626
|
+
query: import_v422.z.string().nullish(),
|
|
3627
|
+
sources: import_v422.z.array(
|
|
3628
|
+
import_v422.z.discriminatedUnion("type", [
|
|
3629
|
+
import_v422.z.object({ type: import_v422.z.literal("url"), url: import_v422.z.string() }),
|
|
3630
|
+
import_v422.z.object({ type: import_v422.z.literal("api"), name: import_v422.z.string() })
|
|
3547
3631
|
])
|
|
3548
3632
|
).nullish()
|
|
3549
3633
|
}),
|
|
3550
|
-
|
|
3551
|
-
type:
|
|
3552
|
-
url:
|
|
3634
|
+
import_v422.z.object({
|
|
3635
|
+
type: import_v422.z.literal("open_page"),
|
|
3636
|
+
url: import_v422.z.string().nullish()
|
|
3553
3637
|
}),
|
|
3554
|
-
|
|
3555
|
-
type:
|
|
3556
|
-
url:
|
|
3557
|
-
pattern:
|
|
3638
|
+
import_v422.z.object({
|
|
3639
|
+
type: import_v422.z.literal("find_in_page"),
|
|
3640
|
+
url: import_v422.z.string().nullish(),
|
|
3641
|
+
pattern: import_v422.z.string().nullish()
|
|
3558
3642
|
})
|
|
3559
3643
|
]).nullish()
|
|
3560
3644
|
}),
|
|
3561
|
-
|
|
3562
|
-
type:
|
|
3563
|
-
id:
|
|
3564
|
-
queries:
|
|
3565
|
-
results:
|
|
3566
|
-
|
|
3567
|
-
attributes:
|
|
3568
|
-
|
|
3569
|
-
|
|
3645
|
+
import_v422.z.object({
|
|
3646
|
+
type: import_v422.z.literal("file_search_call"),
|
|
3647
|
+
id: import_v422.z.string(),
|
|
3648
|
+
queries: import_v422.z.array(import_v422.z.string()),
|
|
3649
|
+
results: import_v422.z.array(
|
|
3650
|
+
import_v422.z.object({
|
|
3651
|
+
attributes: import_v422.z.record(
|
|
3652
|
+
import_v422.z.string(),
|
|
3653
|
+
import_v422.z.union([import_v422.z.string(), import_v422.z.number(), import_v422.z.boolean()])
|
|
3570
3654
|
),
|
|
3571
|
-
file_id:
|
|
3572
|
-
filename:
|
|
3573
|
-
score:
|
|
3574
|
-
text:
|
|
3655
|
+
file_id: import_v422.z.string(),
|
|
3656
|
+
filename: import_v422.z.string(),
|
|
3657
|
+
score: import_v422.z.number(),
|
|
3658
|
+
text: import_v422.z.string()
|
|
3575
3659
|
})
|
|
3576
3660
|
).nullish()
|
|
3577
3661
|
}),
|
|
3578
|
-
|
|
3579
|
-
type:
|
|
3580
|
-
id:
|
|
3581
|
-
call_id:
|
|
3582
|
-
action:
|
|
3583
|
-
type:
|
|
3584
|
-
command:
|
|
3585
|
-
timeout_ms:
|
|
3586
|
-
user:
|
|
3587
|
-
working_directory:
|
|
3588
|
-
env:
|
|
3662
|
+
import_v422.z.object({
|
|
3663
|
+
type: import_v422.z.literal("local_shell_call"),
|
|
3664
|
+
id: import_v422.z.string(),
|
|
3665
|
+
call_id: import_v422.z.string(),
|
|
3666
|
+
action: import_v422.z.object({
|
|
3667
|
+
type: import_v422.z.literal("exec"),
|
|
3668
|
+
command: import_v422.z.array(import_v422.z.string()),
|
|
3669
|
+
timeout_ms: import_v422.z.number().optional(),
|
|
3670
|
+
user: import_v422.z.string().optional(),
|
|
3671
|
+
working_directory: import_v422.z.string().optional(),
|
|
3672
|
+
env: import_v422.z.record(import_v422.z.string(), import_v422.z.string()).optional()
|
|
3589
3673
|
})
|
|
3590
3674
|
}),
|
|
3591
|
-
|
|
3592
|
-
type:
|
|
3593
|
-
id:
|
|
3594
|
-
status:
|
|
3675
|
+
import_v422.z.object({
|
|
3676
|
+
type: import_v422.z.literal("computer_call"),
|
|
3677
|
+
id: import_v422.z.string(),
|
|
3678
|
+
status: import_v422.z.literal("completed")
|
|
3595
3679
|
}),
|
|
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:
|
|
3680
|
+
import_v422.z.object({
|
|
3681
|
+
type: import_v422.z.literal("mcp_call"),
|
|
3682
|
+
id: import_v422.z.string(),
|
|
3683
|
+
status: import_v422.z.string(),
|
|
3684
|
+
arguments: import_v422.z.string(),
|
|
3685
|
+
name: import_v422.z.string(),
|
|
3686
|
+
server_label: import_v422.z.string(),
|
|
3687
|
+
output: import_v422.z.string().nullish(),
|
|
3688
|
+
error: import_v422.z.union([
|
|
3689
|
+
import_v422.z.string(),
|
|
3690
|
+
import_v422.z.object({
|
|
3691
|
+
type: import_v422.z.string().optional(),
|
|
3692
|
+
code: import_v422.z.union([import_v422.z.number(), import_v422.z.string()]).optional(),
|
|
3693
|
+
message: import_v422.z.string().optional()
|
|
3610
3694
|
}).loose()
|
|
3611
3695
|
]).nullish(),
|
|
3612
|
-
approval_request_id:
|
|
3696
|
+
approval_request_id: import_v422.z.string().nullish()
|
|
3613
3697
|
}),
|
|
3614
|
-
|
|
3615
|
-
type:
|
|
3616
|
-
id:
|
|
3617
|
-
server_label:
|
|
3618
|
-
tools:
|
|
3619
|
-
|
|
3620
|
-
name:
|
|
3621
|
-
description:
|
|
3622
|
-
input_schema:
|
|
3623
|
-
annotations:
|
|
3698
|
+
import_v422.z.object({
|
|
3699
|
+
type: import_v422.z.literal("mcp_list_tools"),
|
|
3700
|
+
id: import_v422.z.string(),
|
|
3701
|
+
server_label: import_v422.z.string(),
|
|
3702
|
+
tools: import_v422.z.array(
|
|
3703
|
+
import_v422.z.object({
|
|
3704
|
+
name: import_v422.z.string(),
|
|
3705
|
+
description: import_v422.z.string().optional(),
|
|
3706
|
+
input_schema: import_v422.z.any(),
|
|
3707
|
+
annotations: import_v422.z.record(import_v422.z.string(), import_v422.z.unknown()).optional()
|
|
3624
3708
|
})
|
|
3625
3709
|
),
|
|
3626
|
-
error:
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
type:
|
|
3630
|
-
code:
|
|
3631
|
-
message:
|
|
3710
|
+
error: import_v422.z.union([
|
|
3711
|
+
import_v422.z.string(),
|
|
3712
|
+
import_v422.z.object({
|
|
3713
|
+
type: import_v422.z.string().optional(),
|
|
3714
|
+
code: import_v422.z.union([import_v422.z.number(), import_v422.z.string()]).optional(),
|
|
3715
|
+
message: import_v422.z.string().optional()
|
|
3632
3716
|
}).loose()
|
|
3633
3717
|
]).optional()
|
|
3634
3718
|
}),
|
|
3635
|
-
|
|
3636
|
-
type:
|
|
3637
|
-
id:
|
|
3638
|
-
server_label:
|
|
3639
|
-
name:
|
|
3640
|
-
arguments:
|
|
3641
|
-
approval_request_id:
|
|
3719
|
+
import_v422.z.object({
|
|
3720
|
+
type: import_v422.z.literal("mcp_approval_request"),
|
|
3721
|
+
id: import_v422.z.string(),
|
|
3722
|
+
server_label: import_v422.z.string(),
|
|
3723
|
+
name: import_v422.z.string(),
|
|
3724
|
+
arguments: import_v422.z.string(),
|
|
3725
|
+
approval_request_id: import_v422.z.string().optional()
|
|
3642
3726
|
}),
|
|
3643
|
-
|
|
3644
|
-
type:
|
|
3645
|
-
id:
|
|
3646
|
-
call_id:
|
|
3647
|
-
status:
|
|
3648
|
-
operation:
|
|
3649
|
-
|
|
3650
|
-
type:
|
|
3651
|
-
path:
|
|
3652
|
-
diff:
|
|
3727
|
+
import_v422.z.object({
|
|
3728
|
+
type: import_v422.z.literal("apply_patch_call"),
|
|
3729
|
+
id: import_v422.z.string(),
|
|
3730
|
+
call_id: import_v422.z.string(),
|
|
3731
|
+
status: import_v422.z.enum(["in_progress", "completed"]),
|
|
3732
|
+
operation: import_v422.z.discriminatedUnion("type", [
|
|
3733
|
+
import_v422.z.object({
|
|
3734
|
+
type: import_v422.z.literal("create_file"),
|
|
3735
|
+
path: import_v422.z.string(),
|
|
3736
|
+
diff: import_v422.z.string()
|
|
3653
3737
|
}),
|
|
3654
|
-
|
|
3655
|
-
type:
|
|
3656
|
-
path:
|
|
3738
|
+
import_v422.z.object({
|
|
3739
|
+
type: import_v422.z.literal("delete_file"),
|
|
3740
|
+
path: import_v422.z.string()
|
|
3657
3741
|
}),
|
|
3658
|
-
|
|
3659
|
-
type:
|
|
3660
|
-
path:
|
|
3661
|
-
diff:
|
|
3742
|
+
import_v422.z.object({
|
|
3743
|
+
type: import_v422.z.literal("update_file"),
|
|
3744
|
+
path: import_v422.z.string(),
|
|
3745
|
+
diff: import_v422.z.string()
|
|
3662
3746
|
})
|
|
3663
3747
|
])
|
|
3664
3748
|
}),
|
|
3665
|
-
|
|
3666
|
-
type:
|
|
3667
|
-
id:
|
|
3668
|
-
call_id:
|
|
3669
|
-
status:
|
|
3670
|
-
action:
|
|
3671
|
-
commands:
|
|
3749
|
+
import_v422.z.object({
|
|
3750
|
+
type: import_v422.z.literal("shell_call"),
|
|
3751
|
+
id: import_v422.z.string(),
|
|
3752
|
+
call_id: import_v422.z.string(),
|
|
3753
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3754
|
+
action: import_v422.z.object({
|
|
3755
|
+
commands: import_v422.z.array(import_v422.z.string())
|
|
3672
3756
|
})
|
|
3673
3757
|
}),
|
|
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:
|
|
3758
|
+
import_v422.z.object({
|
|
3759
|
+
type: import_v422.z.literal("shell_call_output"),
|
|
3760
|
+
id: import_v422.z.string(),
|
|
3761
|
+
call_id: import_v422.z.string(),
|
|
3762
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3763
|
+
output: import_v422.z.array(
|
|
3764
|
+
import_v422.z.object({
|
|
3765
|
+
stdout: import_v422.z.string(),
|
|
3766
|
+
stderr: import_v422.z.string(),
|
|
3767
|
+
outcome: import_v422.z.discriminatedUnion("type", [
|
|
3768
|
+
import_v422.z.object({ type: import_v422.z.literal("timeout") }),
|
|
3769
|
+
import_v422.z.object({
|
|
3770
|
+
type: import_v422.z.literal("exit"),
|
|
3771
|
+
exit_code: import_v422.z.number()
|
|
3688
3772
|
})
|
|
3689
3773
|
])
|
|
3690
3774
|
})
|
|
3691
3775
|
)
|
|
3692
3776
|
}),
|
|
3693
|
-
|
|
3694
|
-
type:
|
|
3695
|
-
id:
|
|
3696
|
-
execution:
|
|
3697
|
-
call_id:
|
|
3698
|
-
status:
|
|
3699
|
-
arguments:
|
|
3777
|
+
import_v422.z.object({
|
|
3778
|
+
type: import_v422.z.literal("tool_search_call"),
|
|
3779
|
+
id: import_v422.z.string(),
|
|
3780
|
+
execution: import_v422.z.enum(["server", "client"]),
|
|
3781
|
+
call_id: import_v422.z.string().nullable(),
|
|
3782
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3783
|
+
arguments: import_v422.z.unknown()
|
|
3700
3784
|
}),
|
|
3701
|
-
|
|
3702
|
-
type:
|
|
3703
|
-
id:
|
|
3704
|
-
execution:
|
|
3705
|
-
call_id:
|
|
3706
|
-
status:
|
|
3707
|
-
tools:
|
|
3785
|
+
import_v422.z.object({
|
|
3786
|
+
type: import_v422.z.literal("tool_search_output"),
|
|
3787
|
+
id: import_v422.z.string(),
|
|
3788
|
+
execution: import_v422.z.enum(["server", "client"]),
|
|
3789
|
+
call_id: import_v422.z.string().nullable(),
|
|
3790
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
3791
|
+
tools: import_v422.z.array(import_v422.z.record(import_v422.z.string(), jsonValueSchema2.optional()))
|
|
3708
3792
|
})
|
|
3709
3793
|
])
|
|
3710
3794
|
}),
|
|
3711
|
-
|
|
3712
|
-
type:
|
|
3713
|
-
item_id:
|
|
3714
|
-
output_index:
|
|
3715
|
-
delta:
|
|
3795
|
+
import_v422.z.object({
|
|
3796
|
+
type: import_v422.z.literal("response.function_call_arguments.delta"),
|
|
3797
|
+
item_id: import_v422.z.string(),
|
|
3798
|
+
output_index: import_v422.z.number(),
|
|
3799
|
+
delta: import_v422.z.string()
|
|
3716
3800
|
}),
|
|
3717
|
-
|
|
3718
|
-
type:
|
|
3719
|
-
item_id:
|
|
3720
|
-
output_index:
|
|
3721
|
-
delta:
|
|
3801
|
+
import_v422.z.object({
|
|
3802
|
+
type: import_v422.z.literal("response.custom_tool_call_input.delta"),
|
|
3803
|
+
item_id: import_v422.z.string(),
|
|
3804
|
+
output_index: import_v422.z.number(),
|
|
3805
|
+
delta: import_v422.z.string()
|
|
3722
3806
|
}),
|
|
3723
|
-
|
|
3724
|
-
type:
|
|
3725
|
-
item_id:
|
|
3726
|
-
output_index:
|
|
3727
|
-
partial_image_b64:
|
|
3807
|
+
import_v422.z.object({
|
|
3808
|
+
type: import_v422.z.literal("response.image_generation_call.partial_image"),
|
|
3809
|
+
item_id: import_v422.z.string(),
|
|
3810
|
+
output_index: import_v422.z.number(),
|
|
3811
|
+
partial_image_b64: import_v422.z.string()
|
|
3728
3812
|
}),
|
|
3729
|
-
|
|
3730
|
-
type:
|
|
3731
|
-
item_id:
|
|
3732
|
-
output_index:
|
|
3733
|
-
delta:
|
|
3813
|
+
import_v422.z.object({
|
|
3814
|
+
type: import_v422.z.literal("response.code_interpreter_call_code.delta"),
|
|
3815
|
+
item_id: import_v422.z.string(),
|
|
3816
|
+
output_index: import_v422.z.number(),
|
|
3817
|
+
delta: import_v422.z.string()
|
|
3734
3818
|
}),
|
|
3735
|
-
|
|
3736
|
-
type:
|
|
3737
|
-
item_id:
|
|
3738
|
-
output_index:
|
|
3739
|
-
code:
|
|
3819
|
+
import_v422.z.object({
|
|
3820
|
+
type: import_v422.z.literal("response.code_interpreter_call_code.done"),
|
|
3821
|
+
item_id: import_v422.z.string(),
|
|
3822
|
+
output_index: import_v422.z.number(),
|
|
3823
|
+
code: import_v422.z.string()
|
|
3740
3824
|
}),
|
|
3741
|
-
|
|
3742
|
-
type:
|
|
3743
|
-
annotation:
|
|
3744
|
-
|
|
3745
|
-
type:
|
|
3746
|
-
start_index:
|
|
3747
|
-
end_index:
|
|
3748
|
-
url:
|
|
3749
|
-
title:
|
|
3825
|
+
import_v422.z.object({
|
|
3826
|
+
type: import_v422.z.literal("response.output_text.annotation.added"),
|
|
3827
|
+
annotation: import_v422.z.discriminatedUnion("type", [
|
|
3828
|
+
import_v422.z.object({
|
|
3829
|
+
type: import_v422.z.literal("url_citation"),
|
|
3830
|
+
start_index: import_v422.z.number(),
|
|
3831
|
+
end_index: import_v422.z.number(),
|
|
3832
|
+
url: import_v422.z.string(),
|
|
3833
|
+
title: import_v422.z.string()
|
|
3750
3834
|
}),
|
|
3751
|
-
|
|
3752
|
-
type:
|
|
3753
|
-
file_id:
|
|
3754
|
-
filename:
|
|
3755
|
-
index:
|
|
3835
|
+
import_v422.z.object({
|
|
3836
|
+
type: import_v422.z.literal("file_citation"),
|
|
3837
|
+
file_id: import_v422.z.string(),
|
|
3838
|
+
filename: import_v422.z.string(),
|
|
3839
|
+
index: import_v422.z.number()
|
|
3756
3840
|
}),
|
|
3757
|
-
|
|
3758
|
-
type:
|
|
3759
|
-
container_id:
|
|
3760
|
-
file_id:
|
|
3761
|
-
filename:
|
|
3762
|
-
start_index:
|
|
3763
|
-
end_index:
|
|
3841
|
+
import_v422.z.object({
|
|
3842
|
+
type: import_v422.z.literal("container_file_citation"),
|
|
3843
|
+
container_id: import_v422.z.string(),
|
|
3844
|
+
file_id: import_v422.z.string(),
|
|
3845
|
+
filename: import_v422.z.string(),
|
|
3846
|
+
start_index: import_v422.z.number(),
|
|
3847
|
+
end_index: import_v422.z.number()
|
|
3764
3848
|
}),
|
|
3765
|
-
|
|
3766
|
-
type:
|
|
3767
|
-
file_id:
|
|
3768
|
-
index:
|
|
3849
|
+
import_v422.z.object({
|
|
3850
|
+
type: import_v422.z.literal("file_path"),
|
|
3851
|
+
file_id: import_v422.z.string(),
|
|
3852
|
+
index: import_v422.z.number()
|
|
3769
3853
|
})
|
|
3770
3854
|
])
|
|
3771
3855
|
}),
|
|
3772
|
-
|
|
3773
|
-
type:
|
|
3774
|
-
item_id:
|
|
3775
|
-
summary_index:
|
|
3856
|
+
import_v422.z.object({
|
|
3857
|
+
type: import_v422.z.literal("response.reasoning_summary_part.added"),
|
|
3858
|
+
item_id: import_v422.z.string(),
|
|
3859
|
+
summary_index: import_v422.z.number()
|
|
3776
3860
|
}),
|
|
3777
|
-
|
|
3778
|
-
type:
|
|
3779
|
-
item_id:
|
|
3780
|
-
summary_index:
|
|
3781
|
-
delta:
|
|
3861
|
+
import_v422.z.object({
|
|
3862
|
+
type: import_v422.z.literal("response.reasoning_summary_text.delta"),
|
|
3863
|
+
item_id: import_v422.z.string(),
|
|
3864
|
+
summary_index: import_v422.z.number(),
|
|
3865
|
+
delta: import_v422.z.string()
|
|
3782
3866
|
}),
|
|
3783
|
-
|
|
3784
|
-
type:
|
|
3785
|
-
item_id:
|
|
3786
|
-
summary_index:
|
|
3867
|
+
import_v422.z.object({
|
|
3868
|
+
type: import_v422.z.literal("response.reasoning_summary_part.done"),
|
|
3869
|
+
item_id: import_v422.z.string(),
|
|
3870
|
+
summary_index: import_v422.z.number()
|
|
3787
3871
|
}),
|
|
3788
|
-
|
|
3789
|
-
type:
|
|
3790
|
-
item_id:
|
|
3791
|
-
output_index:
|
|
3792
|
-
delta:
|
|
3793
|
-
obfuscation:
|
|
3872
|
+
import_v422.z.object({
|
|
3873
|
+
type: import_v422.z.literal("response.apply_patch_call_operation_diff.delta"),
|
|
3874
|
+
item_id: import_v422.z.string(),
|
|
3875
|
+
output_index: import_v422.z.number(),
|
|
3876
|
+
delta: import_v422.z.string(),
|
|
3877
|
+
obfuscation: import_v422.z.string().nullish()
|
|
3794
3878
|
}),
|
|
3795
|
-
|
|
3796
|
-
type:
|
|
3797
|
-
item_id:
|
|
3798
|
-
output_index:
|
|
3799
|
-
diff:
|
|
3879
|
+
import_v422.z.object({
|
|
3880
|
+
type: import_v422.z.literal("response.apply_patch_call_operation_diff.done"),
|
|
3881
|
+
item_id: import_v422.z.string(),
|
|
3882
|
+
output_index: import_v422.z.number(),
|
|
3883
|
+
diff: import_v422.z.string()
|
|
3800
3884
|
}),
|
|
3801
|
-
|
|
3802
|
-
type:
|
|
3803
|
-
sequence_number:
|
|
3804
|
-
error:
|
|
3805
|
-
type:
|
|
3806
|
-
code:
|
|
3807
|
-
message:
|
|
3808
|
-
param:
|
|
3885
|
+
import_v422.z.object({
|
|
3886
|
+
type: import_v422.z.literal("error"),
|
|
3887
|
+
sequence_number: import_v422.z.number(),
|
|
3888
|
+
error: import_v422.z.object({
|
|
3889
|
+
type: import_v422.z.string(),
|
|
3890
|
+
code: import_v422.z.string(),
|
|
3891
|
+
message: import_v422.z.string(),
|
|
3892
|
+
param: import_v422.z.string().nullish()
|
|
3809
3893
|
})
|
|
3810
3894
|
}),
|
|
3811
|
-
|
|
3895
|
+
import_v422.z.object({ type: import_v422.z.string() }).loose().transform((value) => ({
|
|
3812
3896
|
type: "unknown_chunk",
|
|
3813
3897
|
message: value.type
|
|
3814
3898
|
}))
|
|
@@ -3816,310 +3900,311 @@ var openaiResponsesChunkSchema = (0, import_provider_utils26.lazySchema)(
|
|
|
3816
3900
|
])
|
|
3817
3901
|
)
|
|
3818
3902
|
);
|
|
3819
|
-
var openaiResponsesResponseSchema = (0,
|
|
3820
|
-
() => (0,
|
|
3821
|
-
|
|
3822
|
-
id:
|
|
3823
|
-
created_at:
|
|
3824
|
-
error:
|
|
3825
|
-
message:
|
|
3826
|
-
type:
|
|
3827
|
-
param:
|
|
3828
|
-
code:
|
|
3903
|
+
var openaiResponsesResponseSchema = (0, import_provider_utils27.lazySchema)(
|
|
3904
|
+
() => (0, import_provider_utils27.zodSchema)(
|
|
3905
|
+
import_v422.z.object({
|
|
3906
|
+
id: import_v422.z.string().optional(),
|
|
3907
|
+
created_at: import_v422.z.number().optional(),
|
|
3908
|
+
error: import_v422.z.object({
|
|
3909
|
+
message: import_v422.z.string(),
|
|
3910
|
+
type: import_v422.z.string(),
|
|
3911
|
+
param: import_v422.z.string().nullish(),
|
|
3912
|
+
code: import_v422.z.string()
|
|
3829
3913
|
}).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:
|
|
3914
|
+
model: import_v422.z.string().optional(),
|
|
3915
|
+
output: import_v422.z.array(
|
|
3916
|
+
import_v422.z.discriminatedUnion("type", [
|
|
3917
|
+
import_v422.z.object({
|
|
3918
|
+
type: import_v422.z.literal("message"),
|
|
3919
|
+
role: import_v422.z.literal("assistant"),
|
|
3920
|
+
id: import_v422.z.string(),
|
|
3921
|
+
phase: import_v422.z.enum(["commentary", "final_answer"]).nullish(),
|
|
3922
|
+
content: import_v422.z.array(
|
|
3923
|
+
import_v422.z.object({
|
|
3924
|
+
type: import_v422.z.literal("output_text"),
|
|
3925
|
+
text: import_v422.z.string(),
|
|
3926
|
+
logprobs: import_v422.z.array(
|
|
3927
|
+
import_v422.z.object({
|
|
3928
|
+
token: import_v422.z.string(),
|
|
3929
|
+
logprob: import_v422.z.number(),
|
|
3930
|
+
top_logprobs: import_v422.z.array(
|
|
3931
|
+
import_v422.z.object({
|
|
3932
|
+
token: import_v422.z.string(),
|
|
3933
|
+
logprob: import_v422.z.number()
|
|
3850
3934
|
})
|
|
3851
3935
|
)
|
|
3852
3936
|
})
|
|
3853
3937
|
).nullish(),
|
|
3854
|
-
annotations:
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
type:
|
|
3858
|
-
start_index:
|
|
3859
|
-
end_index:
|
|
3860
|
-
url:
|
|
3861
|
-
title:
|
|
3938
|
+
annotations: import_v422.z.array(
|
|
3939
|
+
import_v422.z.discriminatedUnion("type", [
|
|
3940
|
+
import_v422.z.object({
|
|
3941
|
+
type: import_v422.z.literal("url_citation"),
|
|
3942
|
+
start_index: import_v422.z.number(),
|
|
3943
|
+
end_index: import_v422.z.number(),
|
|
3944
|
+
url: import_v422.z.string(),
|
|
3945
|
+
title: import_v422.z.string()
|
|
3862
3946
|
}),
|
|
3863
|
-
|
|
3864
|
-
type:
|
|
3865
|
-
file_id:
|
|
3866
|
-
filename:
|
|
3867
|
-
index:
|
|
3947
|
+
import_v422.z.object({
|
|
3948
|
+
type: import_v422.z.literal("file_citation"),
|
|
3949
|
+
file_id: import_v422.z.string(),
|
|
3950
|
+
filename: import_v422.z.string(),
|
|
3951
|
+
index: import_v422.z.number()
|
|
3868
3952
|
}),
|
|
3869
|
-
|
|
3870
|
-
type:
|
|
3871
|
-
container_id:
|
|
3872
|
-
file_id:
|
|
3873
|
-
filename:
|
|
3874
|
-
start_index:
|
|
3875
|
-
end_index:
|
|
3953
|
+
import_v422.z.object({
|
|
3954
|
+
type: import_v422.z.literal("container_file_citation"),
|
|
3955
|
+
container_id: import_v422.z.string(),
|
|
3956
|
+
file_id: import_v422.z.string(),
|
|
3957
|
+
filename: import_v422.z.string(),
|
|
3958
|
+
start_index: import_v422.z.number(),
|
|
3959
|
+
end_index: import_v422.z.number()
|
|
3876
3960
|
}),
|
|
3877
|
-
|
|
3878
|
-
type:
|
|
3879
|
-
file_id:
|
|
3880
|
-
index:
|
|
3961
|
+
import_v422.z.object({
|
|
3962
|
+
type: import_v422.z.literal("file_path"),
|
|
3963
|
+
file_id: import_v422.z.string(),
|
|
3964
|
+
index: import_v422.z.number()
|
|
3881
3965
|
})
|
|
3882
3966
|
])
|
|
3883
3967
|
)
|
|
3884
3968
|
})
|
|
3885
3969
|
)
|
|
3886
3970
|
}),
|
|
3887
|
-
|
|
3888
|
-
type:
|
|
3889
|
-
id:
|
|
3890
|
-
status:
|
|
3891
|
-
action:
|
|
3892
|
-
|
|
3893
|
-
type:
|
|
3894
|
-
query:
|
|
3895
|
-
sources:
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
type:
|
|
3900
|
-
name:
|
|
3971
|
+
import_v422.z.object({
|
|
3972
|
+
type: import_v422.z.literal("web_search_call"),
|
|
3973
|
+
id: import_v422.z.string(),
|
|
3974
|
+
status: import_v422.z.string(),
|
|
3975
|
+
action: import_v422.z.discriminatedUnion("type", [
|
|
3976
|
+
import_v422.z.object({
|
|
3977
|
+
type: import_v422.z.literal("search"),
|
|
3978
|
+
query: import_v422.z.string().nullish(),
|
|
3979
|
+
sources: import_v422.z.array(
|
|
3980
|
+
import_v422.z.discriminatedUnion("type", [
|
|
3981
|
+
import_v422.z.object({ type: import_v422.z.literal("url"), url: import_v422.z.string() }),
|
|
3982
|
+
import_v422.z.object({
|
|
3983
|
+
type: import_v422.z.literal("api"),
|
|
3984
|
+
name: import_v422.z.string()
|
|
3901
3985
|
})
|
|
3902
3986
|
])
|
|
3903
3987
|
).nullish()
|
|
3904
3988
|
}),
|
|
3905
|
-
|
|
3906
|
-
type:
|
|
3907
|
-
url:
|
|
3989
|
+
import_v422.z.object({
|
|
3990
|
+
type: import_v422.z.literal("open_page"),
|
|
3991
|
+
url: import_v422.z.string().nullish()
|
|
3908
3992
|
}),
|
|
3909
|
-
|
|
3910
|
-
type:
|
|
3911
|
-
url:
|
|
3912
|
-
pattern:
|
|
3993
|
+
import_v422.z.object({
|
|
3994
|
+
type: import_v422.z.literal("find_in_page"),
|
|
3995
|
+
url: import_v422.z.string().nullish(),
|
|
3996
|
+
pattern: import_v422.z.string().nullish()
|
|
3913
3997
|
})
|
|
3914
3998
|
]).nullish()
|
|
3915
3999
|
}),
|
|
3916
|
-
|
|
3917
|
-
type:
|
|
3918
|
-
id:
|
|
3919
|
-
queries:
|
|
3920
|
-
results:
|
|
3921
|
-
|
|
3922
|
-
attributes:
|
|
3923
|
-
|
|
3924
|
-
|
|
4000
|
+
import_v422.z.object({
|
|
4001
|
+
type: import_v422.z.literal("file_search_call"),
|
|
4002
|
+
id: import_v422.z.string(),
|
|
4003
|
+
queries: import_v422.z.array(import_v422.z.string()),
|
|
4004
|
+
results: import_v422.z.array(
|
|
4005
|
+
import_v422.z.object({
|
|
4006
|
+
attributes: import_v422.z.record(
|
|
4007
|
+
import_v422.z.string(),
|
|
4008
|
+
import_v422.z.union([import_v422.z.string(), import_v422.z.number(), import_v422.z.boolean()])
|
|
3925
4009
|
),
|
|
3926
|
-
file_id:
|
|
3927
|
-
filename:
|
|
3928
|
-
score:
|
|
3929
|
-
text:
|
|
4010
|
+
file_id: import_v422.z.string(),
|
|
4011
|
+
filename: import_v422.z.string(),
|
|
4012
|
+
score: import_v422.z.number(),
|
|
4013
|
+
text: import_v422.z.string()
|
|
3930
4014
|
})
|
|
3931
4015
|
).nullish()
|
|
3932
4016
|
}),
|
|
3933
|
-
|
|
3934
|
-
type:
|
|
3935
|
-
id:
|
|
3936
|
-
code:
|
|
3937
|
-
container_id:
|
|
3938
|
-
outputs:
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
4017
|
+
import_v422.z.object({
|
|
4018
|
+
type: import_v422.z.literal("code_interpreter_call"),
|
|
4019
|
+
id: import_v422.z.string(),
|
|
4020
|
+
code: import_v422.z.string().nullable(),
|
|
4021
|
+
container_id: import_v422.z.string(),
|
|
4022
|
+
outputs: import_v422.z.array(
|
|
4023
|
+
import_v422.z.discriminatedUnion("type", [
|
|
4024
|
+
import_v422.z.object({ type: import_v422.z.literal("logs"), logs: import_v422.z.string() }),
|
|
4025
|
+
import_v422.z.object({ type: import_v422.z.literal("image"), url: import_v422.z.string() })
|
|
3942
4026
|
])
|
|
3943
4027
|
).nullable()
|
|
3944
4028
|
}),
|
|
3945
|
-
|
|
3946
|
-
type:
|
|
3947
|
-
id:
|
|
3948
|
-
result:
|
|
4029
|
+
import_v422.z.object({
|
|
4030
|
+
type: import_v422.z.literal("image_generation_call"),
|
|
4031
|
+
id: import_v422.z.string(),
|
|
4032
|
+
result: import_v422.z.string()
|
|
3949
4033
|
}),
|
|
3950
|
-
|
|
3951
|
-
type:
|
|
3952
|
-
id:
|
|
3953
|
-
call_id:
|
|
3954
|
-
action:
|
|
3955
|
-
type:
|
|
3956
|
-
command:
|
|
3957
|
-
timeout_ms:
|
|
3958
|
-
user:
|
|
3959
|
-
working_directory:
|
|
3960
|
-
env:
|
|
4034
|
+
import_v422.z.object({
|
|
4035
|
+
type: import_v422.z.literal("local_shell_call"),
|
|
4036
|
+
id: import_v422.z.string(),
|
|
4037
|
+
call_id: import_v422.z.string(),
|
|
4038
|
+
action: import_v422.z.object({
|
|
4039
|
+
type: import_v422.z.literal("exec"),
|
|
4040
|
+
command: import_v422.z.array(import_v422.z.string()),
|
|
4041
|
+
timeout_ms: import_v422.z.number().optional(),
|
|
4042
|
+
user: import_v422.z.string().optional(),
|
|
4043
|
+
working_directory: import_v422.z.string().optional(),
|
|
4044
|
+
env: import_v422.z.record(import_v422.z.string(), import_v422.z.string()).optional()
|
|
3961
4045
|
})
|
|
3962
4046
|
}),
|
|
3963
|
-
|
|
3964
|
-
type:
|
|
3965
|
-
call_id:
|
|
3966
|
-
name:
|
|
3967
|
-
arguments:
|
|
3968
|
-
id:
|
|
4047
|
+
import_v422.z.object({
|
|
4048
|
+
type: import_v422.z.literal("function_call"),
|
|
4049
|
+
call_id: import_v422.z.string(),
|
|
4050
|
+
name: import_v422.z.string(),
|
|
4051
|
+
arguments: import_v422.z.string(),
|
|
4052
|
+
id: import_v422.z.string(),
|
|
4053
|
+
namespace: import_v422.z.string().nullish()
|
|
3969
4054
|
}),
|
|
3970
|
-
|
|
3971
|
-
type:
|
|
3972
|
-
call_id:
|
|
3973
|
-
name:
|
|
3974
|
-
input:
|
|
3975
|
-
id:
|
|
4055
|
+
import_v422.z.object({
|
|
4056
|
+
type: import_v422.z.literal("custom_tool_call"),
|
|
4057
|
+
call_id: import_v422.z.string(),
|
|
4058
|
+
name: import_v422.z.string(),
|
|
4059
|
+
input: import_v422.z.string(),
|
|
4060
|
+
id: import_v422.z.string()
|
|
3976
4061
|
}),
|
|
3977
|
-
|
|
3978
|
-
type:
|
|
3979
|
-
id:
|
|
3980
|
-
status:
|
|
4062
|
+
import_v422.z.object({
|
|
4063
|
+
type: import_v422.z.literal("computer_call"),
|
|
4064
|
+
id: import_v422.z.string(),
|
|
4065
|
+
status: import_v422.z.string().optional()
|
|
3981
4066
|
}),
|
|
3982
|
-
|
|
3983
|
-
type:
|
|
3984
|
-
id:
|
|
3985
|
-
encrypted_content:
|
|
3986
|
-
summary:
|
|
3987
|
-
|
|
3988
|
-
type:
|
|
3989
|
-
text:
|
|
4067
|
+
import_v422.z.object({
|
|
4068
|
+
type: import_v422.z.literal("reasoning"),
|
|
4069
|
+
id: import_v422.z.string(),
|
|
4070
|
+
encrypted_content: import_v422.z.string().nullish(),
|
|
4071
|
+
summary: import_v422.z.array(
|
|
4072
|
+
import_v422.z.object({
|
|
4073
|
+
type: import_v422.z.literal("summary_text"),
|
|
4074
|
+
text: import_v422.z.string()
|
|
3990
4075
|
})
|
|
3991
4076
|
)
|
|
3992
4077
|
}),
|
|
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:
|
|
4078
|
+
import_v422.z.object({
|
|
4079
|
+
type: import_v422.z.literal("mcp_call"),
|
|
4080
|
+
id: import_v422.z.string(),
|
|
4081
|
+
status: import_v422.z.string(),
|
|
4082
|
+
arguments: import_v422.z.string(),
|
|
4083
|
+
name: import_v422.z.string(),
|
|
4084
|
+
server_label: import_v422.z.string(),
|
|
4085
|
+
output: import_v422.z.string().nullish(),
|
|
4086
|
+
error: import_v422.z.union([
|
|
4087
|
+
import_v422.z.string(),
|
|
4088
|
+
import_v422.z.object({
|
|
4089
|
+
type: import_v422.z.string().optional(),
|
|
4090
|
+
code: import_v422.z.union([import_v422.z.number(), import_v422.z.string()]).optional(),
|
|
4091
|
+
message: import_v422.z.string().optional()
|
|
4007
4092
|
}).loose()
|
|
4008
4093
|
]).nullish(),
|
|
4009
|
-
approval_request_id:
|
|
4094
|
+
approval_request_id: import_v422.z.string().nullish()
|
|
4010
4095
|
}),
|
|
4011
|
-
|
|
4012
|
-
type:
|
|
4013
|
-
id:
|
|
4014
|
-
server_label:
|
|
4015
|
-
tools:
|
|
4016
|
-
|
|
4017
|
-
name:
|
|
4018
|
-
description:
|
|
4019
|
-
input_schema:
|
|
4020
|
-
annotations:
|
|
4096
|
+
import_v422.z.object({
|
|
4097
|
+
type: import_v422.z.literal("mcp_list_tools"),
|
|
4098
|
+
id: import_v422.z.string(),
|
|
4099
|
+
server_label: import_v422.z.string(),
|
|
4100
|
+
tools: import_v422.z.array(
|
|
4101
|
+
import_v422.z.object({
|
|
4102
|
+
name: import_v422.z.string(),
|
|
4103
|
+
description: import_v422.z.string().optional(),
|
|
4104
|
+
input_schema: import_v422.z.any(),
|
|
4105
|
+
annotations: import_v422.z.record(import_v422.z.string(), import_v422.z.unknown()).optional()
|
|
4021
4106
|
})
|
|
4022
4107
|
),
|
|
4023
|
-
error:
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
type:
|
|
4027
|
-
code:
|
|
4028
|
-
message:
|
|
4108
|
+
error: import_v422.z.union([
|
|
4109
|
+
import_v422.z.string(),
|
|
4110
|
+
import_v422.z.object({
|
|
4111
|
+
type: import_v422.z.string().optional(),
|
|
4112
|
+
code: import_v422.z.union([import_v422.z.number(), import_v422.z.string()]).optional(),
|
|
4113
|
+
message: import_v422.z.string().optional()
|
|
4029
4114
|
}).loose()
|
|
4030
4115
|
]).optional()
|
|
4031
4116
|
}),
|
|
4032
|
-
|
|
4033
|
-
type:
|
|
4034
|
-
id:
|
|
4035
|
-
server_label:
|
|
4036
|
-
name:
|
|
4037
|
-
arguments:
|
|
4038
|
-
approval_request_id:
|
|
4117
|
+
import_v422.z.object({
|
|
4118
|
+
type: import_v422.z.literal("mcp_approval_request"),
|
|
4119
|
+
id: import_v422.z.string(),
|
|
4120
|
+
server_label: import_v422.z.string(),
|
|
4121
|
+
name: import_v422.z.string(),
|
|
4122
|
+
arguments: import_v422.z.string(),
|
|
4123
|
+
approval_request_id: import_v422.z.string().optional()
|
|
4039
4124
|
}),
|
|
4040
|
-
|
|
4041
|
-
type:
|
|
4042
|
-
id:
|
|
4043
|
-
call_id:
|
|
4044
|
-
status:
|
|
4045
|
-
operation:
|
|
4046
|
-
|
|
4047
|
-
type:
|
|
4048
|
-
path:
|
|
4049
|
-
diff:
|
|
4125
|
+
import_v422.z.object({
|
|
4126
|
+
type: import_v422.z.literal("apply_patch_call"),
|
|
4127
|
+
id: import_v422.z.string(),
|
|
4128
|
+
call_id: import_v422.z.string(),
|
|
4129
|
+
status: import_v422.z.enum(["in_progress", "completed"]),
|
|
4130
|
+
operation: import_v422.z.discriminatedUnion("type", [
|
|
4131
|
+
import_v422.z.object({
|
|
4132
|
+
type: import_v422.z.literal("create_file"),
|
|
4133
|
+
path: import_v422.z.string(),
|
|
4134
|
+
diff: import_v422.z.string()
|
|
4050
4135
|
}),
|
|
4051
|
-
|
|
4052
|
-
type:
|
|
4053
|
-
path:
|
|
4136
|
+
import_v422.z.object({
|
|
4137
|
+
type: import_v422.z.literal("delete_file"),
|
|
4138
|
+
path: import_v422.z.string()
|
|
4054
4139
|
}),
|
|
4055
|
-
|
|
4056
|
-
type:
|
|
4057
|
-
path:
|
|
4058
|
-
diff:
|
|
4140
|
+
import_v422.z.object({
|
|
4141
|
+
type: import_v422.z.literal("update_file"),
|
|
4142
|
+
path: import_v422.z.string(),
|
|
4143
|
+
diff: import_v422.z.string()
|
|
4059
4144
|
})
|
|
4060
4145
|
])
|
|
4061
4146
|
}),
|
|
4062
|
-
|
|
4063
|
-
type:
|
|
4064
|
-
id:
|
|
4065
|
-
call_id:
|
|
4066
|
-
status:
|
|
4067
|
-
action:
|
|
4068
|
-
commands:
|
|
4147
|
+
import_v422.z.object({
|
|
4148
|
+
type: import_v422.z.literal("shell_call"),
|
|
4149
|
+
id: import_v422.z.string(),
|
|
4150
|
+
call_id: import_v422.z.string(),
|
|
4151
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4152
|
+
action: import_v422.z.object({
|
|
4153
|
+
commands: import_v422.z.array(import_v422.z.string())
|
|
4069
4154
|
})
|
|
4070
4155
|
}),
|
|
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:
|
|
4156
|
+
import_v422.z.object({
|
|
4157
|
+
type: import_v422.z.literal("shell_call_output"),
|
|
4158
|
+
id: import_v422.z.string(),
|
|
4159
|
+
call_id: import_v422.z.string(),
|
|
4160
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4161
|
+
output: import_v422.z.array(
|
|
4162
|
+
import_v422.z.object({
|
|
4163
|
+
stdout: import_v422.z.string(),
|
|
4164
|
+
stderr: import_v422.z.string(),
|
|
4165
|
+
outcome: import_v422.z.discriminatedUnion("type", [
|
|
4166
|
+
import_v422.z.object({ type: import_v422.z.literal("timeout") }),
|
|
4167
|
+
import_v422.z.object({
|
|
4168
|
+
type: import_v422.z.literal("exit"),
|
|
4169
|
+
exit_code: import_v422.z.number()
|
|
4085
4170
|
})
|
|
4086
4171
|
])
|
|
4087
4172
|
})
|
|
4088
4173
|
)
|
|
4089
4174
|
}),
|
|
4090
|
-
|
|
4091
|
-
type:
|
|
4092
|
-
id:
|
|
4093
|
-
execution:
|
|
4094
|
-
call_id:
|
|
4095
|
-
status:
|
|
4096
|
-
arguments:
|
|
4175
|
+
import_v422.z.object({
|
|
4176
|
+
type: import_v422.z.literal("tool_search_call"),
|
|
4177
|
+
id: import_v422.z.string(),
|
|
4178
|
+
execution: import_v422.z.enum(["server", "client"]),
|
|
4179
|
+
call_id: import_v422.z.string().nullable(),
|
|
4180
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4181
|
+
arguments: import_v422.z.unknown()
|
|
4097
4182
|
}),
|
|
4098
|
-
|
|
4099
|
-
type:
|
|
4100
|
-
id:
|
|
4101
|
-
execution:
|
|
4102
|
-
call_id:
|
|
4103
|
-
status:
|
|
4104
|
-
tools:
|
|
4183
|
+
import_v422.z.object({
|
|
4184
|
+
type: import_v422.z.literal("tool_search_output"),
|
|
4185
|
+
id: import_v422.z.string(),
|
|
4186
|
+
execution: import_v422.z.enum(["server", "client"]),
|
|
4187
|
+
call_id: import_v422.z.string().nullable(),
|
|
4188
|
+
status: import_v422.z.enum(["in_progress", "completed", "incomplete"]),
|
|
4189
|
+
tools: import_v422.z.array(import_v422.z.record(import_v422.z.string(), jsonValueSchema2.optional()))
|
|
4105
4190
|
})
|
|
4106
4191
|
])
|
|
4107
4192
|
).optional(),
|
|
4108
|
-
service_tier:
|
|
4109
|
-
incomplete_details:
|
|
4110
|
-
usage:
|
|
4111
|
-
input_tokens:
|
|
4112
|
-
input_tokens_details:
|
|
4113
|
-
output_tokens:
|
|
4114
|
-
output_tokens_details:
|
|
4193
|
+
service_tier: import_v422.z.string().nullish(),
|
|
4194
|
+
incomplete_details: import_v422.z.object({ reason: import_v422.z.string() }).nullish(),
|
|
4195
|
+
usage: import_v422.z.object({
|
|
4196
|
+
input_tokens: import_v422.z.number(),
|
|
4197
|
+
input_tokens_details: import_v422.z.object({ cached_tokens: import_v422.z.number().nullish() }).nullish(),
|
|
4198
|
+
output_tokens: import_v422.z.number(),
|
|
4199
|
+
output_tokens_details: import_v422.z.object({ reasoning_tokens: import_v422.z.number().nullish() }).nullish()
|
|
4115
4200
|
}).optional()
|
|
4116
4201
|
})
|
|
4117
4202
|
)
|
|
4118
4203
|
);
|
|
4119
4204
|
|
|
4120
4205
|
// src/responses/openai-responses-options.ts
|
|
4121
|
-
var
|
|
4122
|
-
var
|
|
4206
|
+
var import_provider_utils28 = require("@ai-sdk/provider-utils");
|
|
4207
|
+
var import_v423 = require("zod/v4");
|
|
4123
4208
|
var TOP_LOGPROBS_MAX = 20;
|
|
4124
4209
|
var openaiResponsesReasoningModelIds = [
|
|
4125
4210
|
"o1",
|
|
@@ -4184,9 +4269,9 @@ var openaiResponsesModelIds = [
|
|
|
4184
4269
|
"gpt-5-chat-latest",
|
|
4185
4270
|
...openaiResponsesReasoningModelIds
|
|
4186
4271
|
];
|
|
4187
|
-
var openaiLanguageModelResponsesOptionsSchema = (0,
|
|
4188
|
-
() => (0,
|
|
4189
|
-
|
|
4272
|
+
var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils28.lazySchema)(
|
|
4273
|
+
() => (0, import_provider_utils28.zodSchema)(
|
|
4274
|
+
import_v423.z.object({
|
|
4190
4275
|
/**
|
|
4191
4276
|
* The ID of the OpenAI Conversation to continue.
|
|
4192
4277
|
* You must create a conversation first via the OpenAI API.
|
|
@@ -4194,13 +4279,13 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils27.lazy
|
|
|
4194
4279
|
* Defaults to `undefined`.
|
|
4195
4280
|
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
4196
4281
|
*/
|
|
4197
|
-
conversation:
|
|
4282
|
+
conversation: import_v423.z.string().nullish(),
|
|
4198
4283
|
/**
|
|
4199
4284
|
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
4200
4285
|
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
|
|
4201
4286
|
*/
|
|
4202
|
-
include:
|
|
4203
|
-
|
|
4287
|
+
include: import_v423.z.array(
|
|
4288
|
+
import_v423.z.enum([
|
|
4204
4289
|
"reasoning.encrypted_content",
|
|
4205
4290
|
// handled internally by default, only needed for unknown reasoning models
|
|
4206
4291
|
"file_search_call.results",
|
|
@@ -4212,7 +4297,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils27.lazy
|
|
|
4212
4297
|
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
4213
4298
|
* Defaults to `undefined`.
|
|
4214
4299
|
*/
|
|
4215
|
-
instructions:
|
|
4300
|
+
instructions: import_v423.z.string().nullish(),
|
|
4216
4301
|
/**
|
|
4217
4302
|
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
4218
4303
|
* the response size and can slow down response times. However, it can
|
|
@@ -4227,30 +4312,30 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils27.lazy
|
|
|
4227
4312
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
4228
4313
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
4229
4314
|
*/
|
|
4230
|
-
logprobs:
|
|
4315
|
+
logprobs: import_v423.z.union([import_v423.z.boolean(), import_v423.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
4231
4316
|
/**
|
|
4232
4317
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
4233
4318
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
4234
4319
|
* Any further attempts to call a tool by the model will be ignored.
|
|
4235
4320
|
*/
|
|
4236
|
-
maxToolCalls:
|
|
4321
|
+
maxToolCalls: import_v423.z.number().nullish(),
|
|
4237
4322
|
/**
|
|
4238
4323
|
* Additional metadata to store with the generation.
|
|
4239
4324
|
*/
|
|
4240
|
-
metadata:
|
|
4325
|
+
metadata: import_v423.z.any().nullish(),
|
|
4241
4326
|
/**
|
|
4242
4327
|
* Whether to use parallel tool calls. Defaults to `true`.
|
|
4243
4328
|
*/
|
|
4244
|
-
parallelToolCalls:
|
|
4329
|
+
parallelToolCalls: import_v423.z.boolean().nullish(),
|
|
4245
4330
|
/**
|
|
4246
4331
|
* The ID of the previous response. You can use it to continue a conversation.
|
|
4247
4332
|
* Defaults to `undefined`.
|
|
4248
4333
|
*/
|
|
4249
|
-
previousResponseId:
|
|
4334
|
+
previousResponseId: import_v423.z.string().nullish(),
|
|
4250
4335
|
/**
|
|
4251
4336
|
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
4252
4337
|
*/
|
|
4253
|
-
promptCacheKey:
|
|
4338
|
+
promptCacheKey: import_v423.z.string().nullish(),
|
|
4254
4339
|
/**
|
|
4255
4340
|
* The retention policy for the prompt cache.
|
|
4256
4341
|
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
@@ -4259,7 +4344,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils27.lazy
|
|
|
4259
4344
|
*
|
|
4260
4345
|
* @default 'in_memory'
|
|
4261
4346
|
*/
|
|
4262
|
-
promptCacheRetention:
|
|
4347
|
+
promptCacheRetention: import_v423.z.enum(["in_memory", "24h"]).nullish(),
|
|
4263
4348
|
/**
|
|
4264
4349
|
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
4265
4350
|
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
@@ -4270,17 +4355,17 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils27.lazy
|
|
|
4270
4355
|
* OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
|
|
4271
4356
|
* an error.
|
|
4272
4357
|
*/
|
|
4273
|
-
reasoningEffort:
|
|
4358
|
+
reasoningEffort: import_v423.z.string().nullish(),
|
|
4274
4359
|
/**
|
|
4275
4360
|
* Controls reasoning summary output from the model.
|
|
4276
4361
|
* Set to "auto" to automatically receive the richest level available,
|
|
4277
4362
|
* or "detailed" for comprehensive summaries.
|
|
4278
4363
|
*/
|
|
4279
|
-
reasoningSummary:
|
|
4364
|
+
reasoningSummary: import_v423.z.string().nullish(),
|
|
4280
4365
|
/**
|
|
4281
4366
|
* The identifier for safety monitoring and tracking.
|
|
4282
4367
|
*/
|
|
4283
|
-
safetyIdentifier:
|
|
4368
|
+
safetyIdentifier: import_v423.z.string().nullish(),
|
|
4284
4369
|
/**
|
|
4285
4370
|
* Service tier for the request.
|
|
4286
4371
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
@@ -4288,34 +4373,34 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils27.lazy
|
|
|
4288
4373
|
*
|
|
4289
4374
|
* Defaults to 'auto'.
|
|
4290
4375
|
*/
|
|
4291
|
-
serviceTier:
|
|
4376
|
+
serviceTier: import_v423.z.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
4292
4377
|
/**
|
|
4293
4378
|
* Whether to store the generation. Defaults to `true`.
|
|
4294
4379
|
*/
|
|
4295
|
-
store:
|
|
4380
|
+
store: import_v423.z.boolean().nullish(),
|
|
4296
4381
|
/**
|
|
4297
4382
|
* Whether to use strict JSON schema validation.
|
|
4298
4383
|
* Defaults to `true`.
|
|
4299
4384
|
*/
|
|
4300
|
-
strictJsonSchema:
|
|
4385
|
+
strictJsonSchema: import_v423.z.boolean().nullish(),
|
|
4301
4386
|
/**
|
|
4302
4387
|
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
4303
4388
|
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
4304
4389
|
* Valid values: 'low', 'medium', 'high'.
|
|
4305
4390
|
*/
|
|
4306
|
-
textVerbosity:
|
|
4391
|
+
textVerbosity: import_v423.z.enum(["low", "medium", "high"]).nullish(),
|
|
4307
4392
|
/**
|
|
4308
4393
|
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
4309
4394
|
* 'disabled' turns truncation off.
|
|
4310
4395
|
*/
|
|
4311
|
-
truncation:
|
|
4396
|
+
truncation: import_v423.z.enum(["auto", "disabled"]).nullish(),
|
|
4312
4397
|
/**
|
|
4313
4398
|
* A unique identifier representing your end-user, which can help OpenAI to
|
|
4314
4399
|
* monitor and detect abuse.
|
|
4315
4400
|
* Defaults to `undefined`.
|
|
4316
4401
|
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
4317
4402
|
*/
|
|
4318
|
-
user:
|
|
4403
|
+
user: import_v423.z.string().nullish(),
|
|
4319
4404
|
/**
|
|
4320
4405
|
* Override the system message mode for this model.
|
|
4321
4406
|
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
@@ -4324,7 +4409,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils27.lazy
|
|
|
4324
4409
|
*
|
|
4325
4410
|
* If not specified, the mode is automatically determined based on the model.
|
|
4326
4411
|
*/
|
|
4327
|
-
systemMessageMode:
|
|
4412
|
+
systemMessageMode: import_v423.z.enum(["system", "developer", "remove"]).optional(),
|
|
4328
4413
|
/**
|
|
4329
4414
|
* Force treating this model as a reasoning model.
|
|
4330
4415
|
*
|
|
@@ -4334,14 +4419,14 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils27.lazy
|
|
|
4334
4419
|
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
4335
4420
|
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
4336
4421
|
*/
|
|
4337
|
-
forceReasoning:
|
|
4422
|
+
forceReasoning: import_v423.z.boolean().optional()
|
|
4338
4423
|
})
|
|
4339
4424
|
)
|
|
4340
4425
|
);
|
|
4341
4426
|
|
|
4342
4427
|
// src/responses/openai-responses-prepare-tools.ts
|
|
4343
4428
|
var import_provider7 = require("@ai-sdk/provider");
|
|
4344
|
-
var
|
|
4429
|
+
var import_provider_utils29 = require("@ai-sdk/provider-utils");
|
|
4345
4430
|
async function prepareResponsesTools({
|
|
4346
4431
|
tools,
|
|
4347
4432
|
toolChoice,
|
|
@@ -4374,7 +4459,7 @@ async function prepareResponsesTools({
|
|
|
4374
4459
|
case "provider": {
|
|
4375
4460
|
switch (tool.id) {
|
|
4376
4461
|
case "openai.file_search": {
|
|
4377
|
-
const args = await (0,
|
|
4462
|
+
const args = await (0, import_provider_utils29.validateTypes)({
|
|
4378
4463
|
value: tool.args,
|
|
4379
4464
|
schema: fileSearchArgsSchema
|
|
4380
4465
|
});
|
|
@@ -4397,7 +4482,7 @@ async function prepareResponsesTools({
|
|
|
4397
4482
|
break;
|
|
4398
4483
|
}
|
|
4399
4484
|
case "openai.shell": {
|
|
4400
|
-
const args = await (0,
|
|
4485
|
+
const args = await (0, import_provider_utils29.validateTypes)({
|
|
4401
4486
|
value: tool.args,
|
|
4402
4487
|
schema: shellArgsSchema
|
|
4403
4488
|
});
|
|
@@ -4416,7 +4501,7 @@ async function prepareResponsesTools({
|
|
|
4416
4501
|
break;
|
|
4417
4502
|
}
|
|
4418
4503
|
case "openai.web_search_preview": {
|
|
4419
|
-
const args = await (0,
|
|
4504
|
+
const args = await (0, import_provider_utils29.validateTypes)({
|
|
4420
4505
|
value: tool.args,
|
|
4421
4506
|
schema: webSearchPreviewArgsSchema
|
|
4422
4507
|
});
|
|
@@ -4428,7 +4513,7 @@ async function prepareResponsesTools({
|
|
|
4428
4513
|
break;
|
|
4429
4514
|
}
|
|
4430
4515
|
case "openai.web_search": {
|
|
4431
|
-
const args = await (0,
|
|
4516
|
+
const args = await (0, import_provider_utils29.validateTypes)({
|
|
4432
4517
|
value: tool.args,
|
|
4433
4518
|
schema: webSearchArgsSchema
|
|
4434
4519
|
});
|
|
@@ -4442,7 +4527,7 @@ async function prepareResponsesTools({
|
|
|
4442
4527
|
break;
|
|
4443
4528
|
}
|
|
4444
4529
|
case "openai.code_interpreter": {
|
|
4445
|
-
const args = await (0,
|
|
4530
|
+
const args = await (0, import_provider_utils29.validateTypes)({
|
|
4446
4531
|
value: tool.args,
|
|
4447
4532
|
schema: codeInterpreterArgsSchema
|
|
4448
4533
|
});
|
|
@@ -4453,7 +4538,7 @@ async function prepareResponsesTools({
|
|
|
4453
4538
|
break;
|
|
4454
4539
|
}
|
|
4455
4540
|
case "openai.image_generation": {
|
|
4456
|
-
const args = await (0,
|
|
4541
|
+
const args = await (0, import_provider_utils29.validateTypes)({
|
|
4457
4542
|
value: tool.args,
|
|
4458
4543
|
schema: imageGenerationArgsSchema
|
|
4459
4544
|
});
|
|
@@ -4476,7 +4561,7 @@ async function prepareResponsesTools({
|
|
|
4476
4561
|
break;
|
|
4477
4562
|
}
|
|
4478
4563
|
case "openai.mcp": {
|
|
4479
|
-
const args = await (0,
|
|
4564
|
+
const args = await (0, import_provider_utils29.validateTypes)({
|
|
4480
4565
|
value: tool.args,
|
|
4481
4566
|
schema: mcpArgsSchema
|
|
4482
4567
|
});
|
|
@@ -4502,7 +4587,7 @@ async function prepareResponsesTools({
|
|
|
4502
4587
|
break;
|
|
4503
4588
|
}
|
|
4504
4589
|
case "openai.custom": {
|
|
4505
|
-
const args = await (0,
|
|
4590
|
+
const args = await (0, import_provider_utils29.validateTypes)({
|
|
4506
4591
|
value: tool.args,
|
|
4507
4592
|
schema: customArgsSchema
|
|
4508
4593
|
});
|
|
@@ -4516,7 +4601,7 @@ async function prepareResponsesTools({
|
|
|
4516
4601
|
break;
|
|
4517
4602
|
}
|
|
4518
4603
|
case "openai.tool_search": {
|
|
4519
|
-
const args = await (0,
|
|
4604
|
+
const args = await (0, import_provider_utils29.validateTypes)({
|
|
4520
4605
|
value: tool.args,
|
|
4521
4606
|
schema: toolSearchArgsSchema
|
|
4522
4607
|
});
|
|
@@ -4674,13 +4759,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4674
4759
|
warnings.push({ type: "unsupported", feature: "stopSequences" });
|
|
4675
4760
|
}
|
|
4676
4761
|
const providerOptionsName = this.config.provider.includes("azure") ? "azure" : "openai";
|
|
4677
|
-
let openaiOptions = await (0,
|
|
4762
|
+
let openaiOptions = await (0, import_provider_utils30.parseProviderOptions)({
|
|
4678
4763
|
provider: providerOptionsName,
|
|
4679
4764
|
providerOptions,
|
|
4680
4765
|
schema: openaiLanguageModelResponsesOptionsSchema
|
|
4681
4766
|
});
|
|
4682
4767
|
if (openaiOptions == null && providerOptionsName !== "openai") {
|
|
4683
|
-
openaiOptions = await (0,
|
|
4768
|
+
openaiOptions = await (0, import_provider_utils30.parseProviderOptions)({
|
|
4684
4769
|
provider: "openai",
|
|
4685
4770
|
providerOptions,
|
|
4686
4771
|
schema: openaiLanguageModelResponsesOptionsSchema
|
|
@@ -4694,7 +4779,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4694
4779
|
details: "conversation and previousResponseId cannot be used together"
|
|
4695
4780
|
});
|
|
4696
4781
|
}
|
|
4697
|
-
const toolNameMapping = (0,
|
|
4782
|
+
const toolNameMapping = (0, import_provider_utils30.createToolNameMapping)({
|
|
4698
4783
|
tools,
|
|
4699
4784
|
providerToolNames: {
|
|
4700
4785
|
"openai.code_interpreter": "code_interpreter",
|
|
@@ -4902,12 +4987,12 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4902
4987
|
responseHeaders,
|
|
4903
4988
|
value: response,
|
|
4904
4989
|
rawValue: rawResponse
|
|
4905
|
-
} = await (0,
|
|
4990
|
+
} = await (0, import_provider_utils30.postJsonToApi)({
|
|
4906
4991
|
url,
|
|
4907
|
-
headers: (0,
|
|
4992
|
+
headers: (0, import_provider_utils30.combineHeaders)(this.config.headers(), options.headers),
|
|
4908
4993
|
body,
|
|
4909
4994
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
4910
|
-
successfulResponseHandler: (0,
|
|
4995
|
+
successfulResponseHandler: (0, import_provider_utils30.createJsonResponseHandler)(
|
|
4911
4996
|
openaiResponsesResponseSchema
|
|
4912
4997
|
),
|
|
4913
4998
|
abortSignal: options.abortSignal,
|
|
@@ -5083,7 +5168,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5083
5168
|
content.push({
|
|
5084
5169
|
type: "source",
|
|
5085
5170
|
sourceType: "url",
|
|
5086
|
-
id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0,
|
|
5171
|
+
id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0, import_provider_utils30.generateId)(),
|
|
5087
5172
|
url: annotation.url,
|
|
5088
5173
|
title: annotation.title
|
|
5089
5174
|
});
|
|
@@ -5091,7 +5176,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5091
5176
|
content.push({
|
|
5092
5177
|
type: "source",
|
|
5093
5178
|
sourceType: "document",
|
|
5094
|
-
id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : (0,
|
|
5179
|
+
id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : (0, import_provider_utils30.generateId)(),
|
|
5095
5180
|
mediaType: "text/plain",
|
|
5096
5181
|
title: annotation.filename,
|
|
5097
5182
|
filename: annotation.filename,
|
|
@@ -5107,7 +5192,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5107
5192
|
content.push({
|
|
5108
5193
|
type: "source",
|
|
5109
5194
|
sourceType: "document",
|
|
5110
|
-
id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0,
|
|
5195
|
+
id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils30.generateId)(),
|
|
5111
5196
|
mediaType: "text/plain",
|
|
5112
5197
|
title: annotation.filename,
|
|
5113
5198
|
filename: annotation.filename,
|
|
@@ -5123,7 +5208,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5123
5208
|
content.push({
|
|
5124
5209
|
type: "source",
|
|
5125
5210
|
sourceType: "document",
|
|
5126
|
-
id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : (0,
|
|
5211
|
+
id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : (0, import_provider_utils30.generateId)(),
|
|
5127
5212
|
mediaType: "application/octet-stream",
|
|
5128
5213
|
title: annotation.file_id,
|
|
5129
5214
|
filename: annotation.file_id,
|
|
@@ -5149,7 +5234,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5149
5234
|
input: part.arguments,
|
|
5150
5235
|
providerMetadata: {
|
|
5151
5236
|
[providerOptionsName]: {
|
|
5152
|
-
itemId: part.id
|
|
5237
|
+
itemId: part.id,
|
|
5238
|
+
...part.namespace != null && { namespace: part.namespace }
|
|
5153
5239
|
}
|
|
5154
5240
|
}
|
|
5155
5241
|
});
|
|
@@ -5227,7 +5313,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5227
5313
|
}
|
|
5228
5314
|
case "mcp_approval_request": {
|
|
5229
5315
|
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,
|
|
5316
|
+
const dummyToolCallId = (_w = (_v = (_u = this.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : (0, import_provider_utils30.generateId)();
|
|
5231
5317
|
const toolName = `mcp.${part.name}`;
|
|
5232
5318
|
content.push({
|
|
5233
5319
|
type: "tool-call",
|
|
@@ -5368,18 +5454,18 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5368
5454
|
providerOptionsName,
|
|
5369
5455
|
isShellProviderExecuted
|
|
5370
5456
|
} = await this.getArgs(options);
|
|
5371
|
-
const { responseHeaders, value: response } = await (0,
|
|
5457
|
+
const { responseHeaders, value: response } = await (0, import_provider_utils30.postJsonToApi)({
|
|
5372
5458
|
url: this.config.url({
|
|
5373
5459
|
path: "/responses",
|
|
5374
5460
|
modelId: this.modelId
|
|
5375
5461
|
}),
|
|
5376
|
-
headers: (0,
|
|
5462
|
+
headers: (0, import_provider_utils30.combineHeaders)(this.config.headers(), options.headers),
|
|
5377
5463
|
body: {
|
|
5378
5464
|
...body,
|
|
5379
5465
|
stream: true
|
|
5380
5466
|
},
|
|
5381
5467
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
5382
|
-
successfulResponseHandler: (0,
|
|
5468
|
+
successfulResponseHandler: (0, import_provider_utils30.createEventSourceResponseHandler)(
|
|
5383
5469
|
openaiResponsesChunkSchema
|
|
5384
5470
|
),
|
|
5385
5471
|
abortSignal: options.abortSignal,
|
|
@@ -5632,7 +5718,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5632
5718
|
hasFunctionCall = true;
|
|
5633
5719
|
controller.enqueue({
|
|
5634
5720
|
type: "tool-input-end",
|
|
5635
|
-
id: value.item.call_id
|
|
5721
|
+
id: value.item.call_id,
|
|
5722
|
+
...value.item.namespace != null && {
|
|
5723
|
+
providerMetadata: {
|
|
5724
|
+
[providerOptionsName]: {
|
|
5725
|
+
namespace: value.item.namespace
|
|
5726
|
+
}
|
|
5727
|
+
}
|
|
5728
|
+
}
|
|
5636
5729
|
});
|
|
5637
5730
|
controller.enqueue({
|
|
5638
5731
|
type: "tool-call",
|
|
@@ -5641,7 +5734,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5641
5734
|
input: value.item.arguments,
|
|
5642
5735
|
providerMetadata: {
|
|
5643
5736
|
[providerOptionsName]: {
|
|
5644
|
-
itemId: value.item.id
|
|
5737
|
+
itemId: value.item.id,
|
|
5738
|
+
...value.item.namespace != null && {
|
|
5739
|
+
namespace: value.item.namespace
|
|
5740
|
+
}
|
|
5645
5741
|
}
|
|
5646
5742
|
}
|
|
5647
5743
|
});
|
|
@@ -5859,7 +5955,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
5859
5955
|
ongoingToolCalls[value.output_index] = void 0;
|
|
5860
5956
|
} else if (value.item.type === "mcp_approval_request") {
|
|
5861
5957
|
ongoingToolCalls[value.output_index] = void 0;
|
|
5862
|
-
const dummyToolCallId = (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0,
|
|
5958
|
+
const dummyToolCallId = (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils30.generateId)();
|
|
5863
5959
|
const approvalRequestId = (_p = value.item.approval_request_id) != null ? _p : value.item.id;
|
|
5864
5960
|
approvalRequestIdToDummyToolCallIdFromStream.set(
|
|
5865
5961
|
approvalRequestId,
|
|
@@ -6150,7 +6246,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6150
6246
|
controller.enqueue({
|
|
6151
6247
|
type: "source",
|
|
6152
6248
|
sourceType: "url",
|
|
6153
|
-
id: (_C = (_B = (_A = self.config).generateId) == null ? void 0 : _B.call(_A)) != null ? _C : (0,
|
|
6249
|
+
id: (_C = (_B = (_A = self.config).generateId) == null ? void 0 : _B.call(_A)) != null ? _C : (0, import_provider_utils30.generateId)(),
|
|
6154
6250
|
url: value.annotation.url,
|
|
6155
6251
|
title: value.annotation.title
|
|
6156
6252
|
});
|
|
@@ -6158,7 +6254,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6158
6254
|
controller.enqueue({
|
|
6159
6255
|
type: "source",
|
|
6160
6256
|
sourceType: "document",
|
|
6161
|
-
id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : (0,
|
|
6257
|
+
id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : (0, import_provider_utils30.generateId)(),
|
|
6162
6258
|
mediaType: "text/plain",
|
|
6163
6259
|
title: value.annotation.filename,
|
|
6164
6260
|
filename: value.annotation.filename,
|
|
@@ -6174,7 +6270,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6174
6270
|
controller.enqueue({
|
|
6175
6271
|
type: "source",
|
|
6176
6272
|
sourceType: "document",
|
|
6177
|
-
id: (_I = (_H = (_G = self.config).generateId) == null ? void 0 : _H.call(_G)) != null ? _I : (0,
|
|
6273
|
+
id: (_I = (_H = (_G = self.config).generateId) == null ? void 0 : _H.call(_G)) != null ? _I : (0, import_provider_utils30.generateId)(),
|
|
6178
6274
|
mediaType: "text/plain",
|
|
6179
6275
|
title: value.annotation.filename,
|
|
6180
6276
|
filename: value.annotation.filename,
|
|
@@ -6190,7 +6286,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6190
6286
|
controller.enqueue({
|
|
6191
6287
|
type: "source",
|
|
6192
6288
|
sourceType: "document",
|
|
6193
|
-
id: (_L = (_K = (_J = self.config).generateId) == null ? void 0 : _K.call(_J)) != null ? _L : (0,
|
|
6289
|
+
id: (_L = (_K = (_J = self.config).generateId) == null ? void 0 : _K.call(_J)) != null ? _L : (0, import_provider_utils30.generateId)(),
|
|
6194
6290
|
mediaType: "application/octet-stream",
|
|
6195
6291
|
title: value.annotation.file_id,
|
|
6196
6292
|
filename: value.annotation.file_id,
|
|
@@ -6303,16 +6399,16 @@ function escapeJSONDelta(delta) {
|
|
|
6303
6399
|
}
|
|
6304
6400
|
|
|
6305
6401
|
// src/speech/openai-speech-model.ts
|
|
6306
|
-
var
|
|
6402
|
+
var import_provider_utils32 = require("@ai-sdk/provider-utils");
|
|
6307
6403
|
|
|
6308
6404
|
// src/speech/openai-speech-options.ts
|
|
6309
|
-
var
|
|
6310
|
-
var
|
|
6311
|
-
var openaiSpeechModelOptionsSchema = (0,
|
|
6312
|
-
() => (0,
|
|
6313
|
-
|
|
6314
|
-
instructions:
|
|
6315
|
-
speed:
|
|
6405
|
+
var import_provider_utils31 = require("@ai-sdk/provider-utils");
|
|
6406
|
+
var import_v424 = require("zod/v4");
|
|
6407
|
+
var openaiSpeechModelOptionsSchema = (0, import_provider_utils31.lazySchema)(
|
|
6408
|
+
() => (0, import_provider_utils31.zodSchema)(
|
|
6409
|
+
import_v424.z.object({
|
|
6410
|
+
instructions: import_v424.z.string().nullish(),
|
|
6411
|
+
speed: import_v424.z.number().min(0.25).max(4).default(1).nullish()
|
|
6316
6412
|
})
|
|
6317
6413
|
)
|
|
6318
6414
|
);
|
|
@@ -6337,7 +6433,7 @@ var OpenAISpeechModel = class {
|
|
|
6337
6433
|
providerOptions
|
|
6338
6434
|
}) {
|
|
6339
6435
|
const warnings = [];
|
|
6340
|
-
const openAIOptions = await (0,
|
|
6436
|
+
const openAIOptions = await (0, import_provider_utils32.parseProviderOptions)({
|
|
6341
6437
|
provider: "openai",
|
|
6342
6438
|
providerOptions,
|
|
6343
6439
|
schema: openaiSpeechModelOptionsSchema
|
|
@@ -6390,15 +6486,15 @@ var OpenAISpeechModel = class {
|
|
|
6390
6486
|
value: audio,
|
|
6391
6487
|
responseHeaders,
|
|
6392
6488
|
rawValue: rawResponse
|
|
6393
|
-
} = await (0,
|
|
6489
|
+
} = await (0, import_provider_utils32.postJsonToApi)({
|
|
6394
6490
|
url: this.config.url({
|
|
6395
6491
|
path: "/audio/speech",
|
|
6396
6492
|
modelId: this.modelId
|
|
6397
6493
|
}),
|
|
6398
|
-
headers: (0,
|
|
6494
|
+
headers: (0, import_provider_utils32.combineHeaders)(this.config.headers(), options.headers),
|
|
6399
6495
|
body: requestBody,
|
|
6400
6496
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
6401
|
-
successfulResponseHandler: (0,
|
|
6497
|
+
successfulResponseHandler: (0, import_provider_utils32.createBinaryResponseHandler)(),
|
|
6402
6498
|
abortSignal: options.abortSignal,
|
|
6403
6499
|
fetch: this.config.fetch
|
|
6404
6500
|
});
|
|
@@ -6419,36 +6515,36 @@ var OpenAISpeechModel = class {
|
|
|
6419
6515
|
};
|
|
6420
6516
|
|
|
6421
6517
|
// src/transcription/openai-transcription-model.ts
|
|
6422
|
-
var
|
|
6518
|
+
var import_provider_utils35 = require("@ai-sdk/provider-utils");
|
|
6423
6519
|
|
|
6424
6520
|
// 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:
|
|
6521
|
+
var import_provider_utils33 = require("@ai-sdk/provider-utils");
|
|
6522
|
+
var import_v425 = require("zod/v4");
|
|
6523
|
+
var openaiTranscriptionResponseSchema = (0, import_provider_utils33.lazySchema)(
|
|
6524
|
+
() => (0, import_provider_utils33.zodSchema)(
|
|
6525
|
+
import_v425.z.object({
|
|
6526
|
+
text: import_v425.z.string(),
|
|
6527
|
+
language: import_v425.z.string().nullish(),
|
|
6528
|
+
duration: import_v425.z.number().nullish(),
|
|
6529
|
+
words: import_v425.z.array(
|
|
6530
|
+
import_v425.z.object({
|
|
6531
|
+
word: import_v425.z.string(),
|
|
6532
|
+
start: import_v425.z.number(),
|
|
6533
|
+
end: import_v425.z.number()
|
|
6438
6534
|
})
|
|
6439
6535
|
).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:
|
|
6536
|
+
segments: import_v425.z.array(
|
|
6537
|
+
import_v425.z.object({
|
|
6538
|
+
id: import_v425.z.number(),
|
|
6539
|
+
seek: import_v425.z.number(),
|
|
6540
|
+
start: import_v425.z.number(),
|
|
6541
|
+
end: import_v425.z.number(),
|
|
6542
|
+
text: import_v425.z.string(),
|
|
6543
|
+
tokens: import_v425.z.array(import_v425.z.number()),
|
|
6544
|
+
temperature: import_v425.z.number(),
|
|
6545
|
+
avg_logprob: import_v425.z.number(),
|
|
6546
|
+
compression_ratio: import_v425.z.number(),
|
|
6547
|
+
no_speech_prob: import_v425.z.number()
|
|
6452
6548
|
})
|
|
6453
6549
|
).nullish()
|
|
6454
6550
|
})
|
|
@@ -6456,33 +6552,33 @@ var openaiTranscriptionResponseSchema = (0, import_provider_utils32.lazySchema)(
|
|
|
6456
6552
|
);
|
|
6457
6553
|
|
|
6458
6554
|
// src/transcription/openai-transcription-options.ts
|
|
6459
|
-
var
|
|
6460
|
-
var
|
|
6461
|
-
var openAITranscriptionModelOptions = (0,
|
|
6462
|
-
() => (0,
|
|
6463
|
-
|
|
6555
|
+
var import_provider_utils34 = require("@ai-sdk/provider-utils");
|
|
6556
|
+
var import_v426 = require("zod/v4");
|
|
6557
|
+
var openAITranscriptionModelOptions = (0, import_provider_utils34.lazySchema)(
|
|
6558
|
+
() => (0, import_provider_utils34.zodSchema)(
|
|
6559
|
+
import_v426.z.object({
|
|
6464
6560
|
/**
|
|
6465
6561
|
* Additional information to include in the transcription response.
|
|
6466
6562
|
*/
|
|
6467
|
-
include:
|
|
6563
|
+
include: import_v426.z.array(import_v426.z.string()).optional(),
|
|
6468
6564
|
/**
|
|
6469
6565
|
* The language of the input audio in ISO-639-1 format.
|
|
6470
6566
|
*/
|
|
6471
|
-
language:
|
|
6567
|
+
language: import_v426.z.string().optional(),
|
|
6472
6568
|
/**
|
|
6473
6569
|
* An optional text to guide the model's style or continue a previous audio segment.
|
|
6474
6570
|
*/
|
|
6475
|
-
prompt:
|
|
6571
|
+
prompt: import_v426.z.string().optional(),
|
|
6476
6572
|
/**
|
|
6477
6573
|
* The sampling temperature, between 0 and 1.
|
|
6478
6574
|
* @default 0
|
|
6479
6575
|
*/
|
|
6480
|
-
temperature:
|
|
6576
|
+
temperature: import_v426.z.number().min(0).max(1).default(0).optional(),
|
|
6481
6577
|
/**
|
|
6482
6578
|
* The timestamp granularities to populate for this transcription.
|
|
6483
6579
|
* @default ['segment']
|
|
6484
6580
|
*/
|
|
6485
|
-
timestampGranularities:
|
|
6581
|
+
timestampGranularities: import_v426.z.array(import_v426.z.enum(["word", "segment"])).default(["segment"]).optional()
|
|
6486
6582
|
})
|
|
6487
6583
|
)
|
|
6488
6584
|
);
|
|
@@ -6562,15 +6658,15 @@ var OpenAITranscriptionModel = class {
|
|
|
6562
6658
|
providerOptions
|
|
6563
6659
|
}) {
|
|
6564
6660
|
const warnings = [];
|
|
6565
|
-
const openAIOptions = await (0,
|
|
6661
|
+
const openAIOptions = await (0, import_provider_utils35.parseProviderOptions)({
|
|
6566
6662
|
provider: "openai",
|
|
6567
6663
|
providerOptions,
|
|
6568
6664
|
schema: openAITranscriptionModelOptions
|
|
6569
6665
|
});
|
|
6570
6666
|
const formData = new FormData();
|
|
6571
|
-
const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([(0,
|
|
6667
|
+
const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([(0, import_provider_utils35.convertBase64ToUint8Array)(audio)]);
|
|
6572
6668
|
formData.append("model", this.modelId);
|
|
6573
|
-
const fileExtension = (0,
|
|
6669
|
+
const fileExtension = (0, import_provider_utils35.mediaTypeToExtension)(mediaType);
|
|
6574
6670
|
formData.append(
|
|
6575
6671
|
"file",
|
|
6576
6672
|
new File([blob], "audio", { type: mediaType }),
|
|
@@ -6615,15 +6711,15 @@ var OpenAITranscriptionModel = class {
|
|
|
6615
6711
|
value: response,
|
|
6616
6712
|
responseHeaders,
|
|
6617
6713
|
rawValue: rawResponse
|
|
6618
|
-
} = await (0,
|
|
6714
|
+
} = await (0, import_provider_utils35.postFormDataToApi)({
|
|
6619
6715
|
url: this.config.url({
|
|
6620
6716
|
path: "/audio/transcriptions",
|
|
6621
6717
|
modelId: this.modelId
|
|
6622
6718
|
}),
|
|
6623
|
-
headers: (0,
|
|
6719
|
+
headers: (0, import_provider_utils35.combineHeaders)(this.config.headers(), options.headers),
|
|
6624
6720
|
formData,
|
|
6625
6721
|
failedResponseHandler: openaiFailedResponseHandler,
|
|
6626
|
-
successfulResponseHandler: (0,
|
|
6722
|
+
successfulResponseHandler: (0, import_provider_utils35.createJsonResponseHandler)(
|
|
6627
6723
|
openaiTranscriptionResponseSchema
|
|
6628
6724
|
),
|
|
6629
6725
|
abortSignal: options.abortSignal,
|
|
@@ -6655,21 +6751,21 @@ var OpenAITranscriptionModel = class {
|
|
|
6655
6751
|
};
|
|
6656
6752
|
|
|
6657
6753
|
// src/version.ts
|
|
6658
|
-
var VERSION = true ? "3.0.
|
|
6754
|
+
var VERSION = true ? "3.0.58" : "0.0.0-test";
|
|
6659
6755
|
|
|
6660
6756
|
// src/openai-provider.ts
|
|
6661
6757
|
function createOpenAI(options = {}) {
|
|
6662
6758
|
var _a, _b;
|
|
6663
|
-
const baseURL = (_a = (0,
|
|
6664
|
-
(0,
|
|
6759
|
+
const baseURL = (_a = (0, import_provider_utils36.withoutTrailingSlash)(
|
|
6760
|
+
(0, import_provider_utils36.loadOptionalSetting)({
|
|
6665
6761
|
settingValue: options.baseURL,
|
|
6666
6762
|
environmentVariableName: "OPENAI_BASE_URL"
|
|
6667
6763
|
})
|
|
6668
6764
|
)) != null ? _a : "https://api.openai.com/v1";
|
|
6669
6765
|
const providerName = (_b = options.name) != null ? _b : "openai";
|
|
6670
|
-
const getHeaders = () => (0,
|
|
6766
|
+
const getHeaders = () => (0, import_provider_utils36.withUserAgentSuffix)(
|
|
6671
6767
|
{
|
|
6672
|
-
Authorization: `Bearer ${(0,
|
|
6768
|
+
Authorization: `Bearer ${(0, import_provider_utils36.loadApiKey)({
|
|
6673
6769
|
apiKey: options.apiKey,
|
|
6674
6770
|
environmentVariableName: "OPENAI_API_KEY",
|
|
6675
6771
|
description: "OpenAI"
|