@ai-sdk/openai 3.0.0-beta.73 → 3.0.0-beta.74
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 +6 -0
- package/dist/index.d.mts +55 -1
- package/dist/index.d.ts +55 -1
- package/dist/index.js +960 -766
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +926 -728
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +128 -1
- package/dist/internal/index.d.ts +128 -1
- package/dist/internal/index.js +903 -707
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +883 -688
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1764,46 +1764,92 @@ var OpenAIImageModel = class {
|
|
|
1764
1764
|
}
|
|
1765
1765
|
};
|
|
1766
1766
|
|
|
1767
|
-
// src/tool/
|
|
1767
|
+
// src/tool/apply-patch.ts
|
|
1768
1768
|
import {
|
|
1769
1769
|
createProviderToolFactoryWithOutputSchema,
|
|
1770
1770
|
lazySchema as lazySchema8,
|
|
1771
1771
|
zodSchema as zodSchema8
|
|
1772
1772
|
} from "@ai-sdk/provider-utils";
|
|
1773
1773
|
import { z as z9 } from "zod/v4";
|
|
1774
|
-
var
|
|
1774
|
+
var applyPatchInputSchema = lazySchema8(
|
|
1775
1775
|
() => zodSchema8(
|
|
1776
1776
|
z9.object({
|
|
1777
|
-
|
|
1778
|
-
|
|
1777
|
+
callId: z9.string(),
|
|
1778
|
+
operation: z9.discriminatedUnion("type", [
|
|
1779
|
+
z9.object({
|
|
1780
|
+
type: z9.literal("create_file"),
|
|
1781
|
+
path: z9.string(),
|
|
1782
|
+
diff: z9.string()
|
|
1783
|
+
}),
|
|
1784
|
+
z9.object({
|
|
1785
|
+
type: z9.literal("delete_file"),
|
|
1786
|
+
path: z9.string()
|
|
1787
|
+
}),
|
|
1788
|
+
z9.object({
|
|
1789
|
+
type: z9.literal("update_file"),
|
|
1790
|
+
path: z9.string(),
|
|
1791
|
+
diff: z9.string()
|
|
1792
|
+
})
|
|
1793
|
+
])
|
|
1779
1794
|
})
|
|
1780
1795
|
)
|
|
1781
1796
|
);
|
|
1782
|
-
var
|
|
1797
|
+
var applyPatchOutputSchema = lazySchema8(
|
|
1783
1798
|
() => zodSchema8(
|
|
1784
1799
|
z9.object({
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1800
|
+
status: z9.enum(["completed", "failed"]),
|
|
1801
|
+
output: z9.string().optional()
|
|
1802
|
+
})
|
|
1803
|
+
)
|
|
1804
|
+
);
|
|
1805
|
+
var applyPatchArgsSchema = lazySchema8(() => zodSchema8(z9.object({})));
|
|
1806
|
+
var applyPatchToolFactory = createProviderToolFactoryWithOutputSchema({
|
|
1807
|
+
id: "openai.apply_patch",
|
|
1808
|
+
inputSchema: applyPatchInputSchema,
|
|
1809
|
+
outputSchema: applyPatchOutputSchema
|
|
1810
|
+
});
|
|
1811
|
+
var applyPatch = () => applyPatchToolFactory({});
|
|
1812
|
+
|
|
1813
|
+
// src/tool/code-interpreter.ts
|
|
1814
|
+
import {
|
|
1815
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
|
|
1816
|
+
lazySchema as lazySchema9,
|
|
1817
|
+
zodSchema as zodSchema9
|
|
1818
|
+
} from "@ai-sdk/provider-utils";
|
|
1819
|
+
import { z as z10 } from "zod/v4";
|
|
1820
|
+
var codeInterpreterInputSchema = lazySchema9(
|
|
1821
|
+
() => zodSchema9(
|
|
1822
|
+
z10.object({
|
|
1823
|
+
code: z10.string().nullish(),
|
|
1824
|
+
containerId: z10.string()
|
|
1825
|
+
})
|
|
1826
|
+
)
|
|
1827
|
+
);
|
|
1828
|
+
var codeInterpreterOutputSchema = lazySchema9(
|
|
1829
|
+
() => zodSchema9(
|
|
1830
|
+
z10.object({
|
|
1831
|
+
outputs: z10.array(
|
|
1832
|
+
z10.discriminatedUnion("type", [
|
|
1833
|
+
z10.object({ type: z10.literal("logs"), logs: z10.string() }),
|
|
1834
|
+
z10.object({ type: z10.literal("image"), url: z10.string() })
|
|
1789
1835
|
])
|
|
1790
1836
|
).nullish()
|
|
1791
1837
|
})
|
|
1792
1838
|
)
|
|
1793
1839
|
);
|
|
1794
|
-
var codeInterpreterArgsSchema =
|
|
1795
|
-
() =>
|
|
1796
|
-
|
|
1797
|
-
container:
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
fileIds:
|
|
1840
|
+
var codeInterpreterArgsSchema = lazySchema9(
|
|
1841
|
+
() => zodSchema9(
|
|
1842
|
+
z10.object({
|
|
1843
|
+
container: z10.union([
|
|
1844
|
+
z10.string(),
|
|
1845
|
+
z10.object({
|
|
1846
|
+
fileIds: z10.array(z10.string()).optional()
|
|
1801
1847
|
})
|
|
1802
1848
|
]).optional()
|
|
1803
1849
|
})
|
|
1804
1850
|
)
|
|
1805
1851
|
);
|
|
1806
|
-
var codeInterpreterToolFactory =
|
|
1852
|
+
var codeInterpreterToolFactory = createProviderToolFactoryWithOutputSchema2({
|
|
1807
1853
|
id: "openai.code_interpreter",
|
|
1808
1854
|
inputSchema: codeInterpreterInputSchema,
|
|
1809
1855
|
outputSchema: codeInterpreterOutputSchema
|
|
@@ -1814,88 +1860,88 @@ var codeInterpreter = (args = {}) => {
|
|
|
1814
1860
|
|
|
1815
1861
|
// src/tool/file-search.ts
|
|
1816
1862
|
import {
|
|
1817
|
-
createProviderToolFactoryWithOutputSchema as
|
|
1818
|
-
lazySchema as
|
|
1819
|
-
zodSchema as
|
|
1863
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
|
|
1864
|
+
lazySchema as lazySchema10,
|
|
1865
|
+
zodSchema as zodSchema10
|
|
1820
1866
|
} from "@ai-sdk/provider-utils";
|
|
1821
|
-
import { z as
|
|
1822
|
-
var comparisonFilterSchema =
|
|
1823
|
-
key:
|
|
1824
|
-
type:
|
|
1825
|
-
value:
|
|
1867
|
+
import { z as z11 } from "zod/v4";
|
|
1868
|
+
var comparisonFilterSchema = z11.object({
|
|
1869
|
+
key: z11.string(),
|
|
1870
|
+
type: z11.enum(["eq", "ne", "gt", "gte", "lt", "lte"]),
|
|
1871
|
+
value: z11.union([z11.string(), z11.number(), z11.boolean()])
|
|
1826
1872
|
});
|
|
1827
|
-
var compoundFilterSchema =
|
|
1828
|
-
type:
|
|
1829
|
-
filters:
|
|
1830
|
-
|
|
1873
|
+
var compoundFilterSchema = z11.object({
|
|
1874
|
+
type: z11.enum(["and", "or"]),
|
|
1875
|
+
filters: z11.array(
|
|
1876
|
+
z11.union([comparisonFilterSchema, z11.lazy(() => compoundFilterSchema)])
|
|
1831
1877
|
)
|
|
1832
1878
|
});
|
|
1833
|
-
var fileSearchArgsSchema =
|
|
1834
|
-
() =>
|
|
1835
|
-
|
|
1836
|
-
vectorStoreIds:
|
|
1837
|
-
maxNumResults:
|
|
1838
|
-
ranking:
|
|
1839
|
-
ranker:
|
|
1840
|
-
scoreThreshold:
|
|
1879
|
+
var fileSearchArgsSchema = lazySchema10(
|
|
1880
|
+
() => zodSchema10(
|
|
1881
|
+
z11.object({
|
|
1882
|
+
vectorStoreIds: z11.array(z11.string()),
|
|
1883
|
+
maxNumResults: z11.number().optional(),
|
|
1884
|
+
ranking: z11.object({
|
|
1885
|
+
ranker: z11.string().optional(),
|
|
1886
|
+
scoreThreshold: z11.number().optional()
|
|
1841
1887
|
}).optional(),
|
|
1842
|
-
filters:
|
|
1888
|
+
filters: z11.union([comparisonFilterSchema, compoundFilterSchema]).optional()
|
|
1843
1889
|
})
|
|
1844
1890
|
)
|
|
1845
1891
|
);
|
|
1846
|
-
var fileSearchOutputSchema =
|
|
1847
|
-
() =>
|
|
1848
|
-
|
|
1849
|
-
queries:
|
|
1850
|
-
results:
|
|
1851
|
-
|
|
1852
|
-
attributes:
|
|
1853
|
-
fileId:
|
|
1854
|
-
filename:
|
|
1855
|
-
score:
|
|
1856
|
-
text:
|
|
1892
|
+
var fileSearchOutputSchema = lazySchema10(
|
|
1893
|
+
() => zodSchema10(
|
|
1894
|
+
z11.object({
|
|
1895
|
+
queries: z11.array(z11.string()),
|
|
1896
|
+
results: z11.array(
|
|
1897
|
+
z11.object({
|
|
1898
|
+
attributes: z11.record(z11.string(), z11.unknown()),
|
|
1899
|
+
fileId: z11.string(),
|
|
1900
|
+
filename: z11.string(),
|
|
1901
|
+
score: z11.number(),
|
|
1902
|
+
text: z11.string()
|
|
1857
1903
|
})
|
|
1858
1904
|
).nullable()
|
|
1859
1905
|
})
|
|
1860
1906
|
)
|
|
1861
1907
|
);
|
|
1862
|
-
var fileSearch =
|
|
1908
|
+
var fileSearch = createProviderToolFactoryWithOutputSchema3({
|
|
1863
1909
|
id: "openai.file_search",
|
|
1864
|
-
inputSchema:
|
|
1910
|
+
inputSchema: z11.object({}),
|
|
1865
1911
|
outputSchema: fileSearchOutputSchema
|
|
1866
1912
|
});
|
|
1867
1913
|
|
|
1868
1914
|
// src/tool/image-generation.ts
|
|
1869
1915
|
import {
|
|
1870
|
-
createProviderToolFactoryWithOutputSchema as
|
|
1871
|
-
lazySchema as
|
|
1872
|
-
zodSchema as
|
|
1916
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
|
|
1917
|
+
lazySchema as lazySchema11,
|
|
1918
|
+
zodSchema as zodSchema11
|
|
1873
1919
|
} from "@ai-sdk/provider-utils";
|
|
1874
|
-
import { z as
|
|
1875
|
-
var imageGenerationArgsSchema =
|
|
1876
|
-
() =>
|
|
1877
|
-
|
|
1878
|
-
background:
|
|
1879
|
-
inputFidelity:
|
|
1880
|
-
inputImageMask:
|
|
1881
|
-
fileId:
|
|
1882
|
-
imageUrl:
|
|
1920
|
+
import { z as z12 } from "zod/v4";
|
|
1921
|
+
var imageGenerationArgsSchema = lazySchema11(
|
|
1922
|
+
() => zodSchema11(
|
|
1923
|
+
z12.object({
|
|
1924
|
+
background: z12.enum(["auto", "opaque", "transparent"]).optional(),
|
|
1925
|
+
inputFidelity: z12.enum(["low", "high"]).optional(),
|
|
1926
|
+
inputImageMask: z12.object({
|
|
1927
|
+
fileId: z12.string().optional(),
|
|
1928
|
+
imageUrl: z12.string().optional()
|
|
1883
1929
|
}).optional(),
|
|
1884
|
-
model:
|
|
1885
|
-
moderation:
|
|
1886
|
-
outputCompression:
|
|
1887
|
-
outputFormat:
|
|
1888
|
-
partialImages:
|
|
1889
|
-
quality:
|
|
1890
|
-
size:
|
|
1930
|
+
model: z12.string().optional(),
|
|
1931
|
+
moderation: z12.enum(["auto"]).optional(),
|
|
1932
|
+
outputCompression: z12.number().int().min(0).max(100).optional(),
|
|
1933
|
+
outputFormat: z12.enum(["png", "jpeg", "webp"]).optional(),
|
|
1934
|
+
partialImages: z12.number().int().min(0).max(3).optional(),
|
|
1935
|
+
quality: z12.enum(["auto", "low", "medium", "high"]).optional(),
|
|
1936
|
+
size: z12.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
1891
1937
|
}).strict()
|
|
1892
1938
|
)
|
|
1893
1939
|
);
|
|
1894
|
-
var imageGenerationInputSchema =
|
|
1895
|
-
var imageGenerationOutputSchema =
|
|
1896
|
-
() =>
|
|
1940
|
+
var imageGenerationInputSchema = lazySchema11(() => zodSchema11(z12.object({})));
|
|
1941
|
+
var imageGenerationOutputSchema = lazySchema11(
|
|
1942
|
+
() => zodSchema11(z12.object({ result: z12.string() }))
|
|
1897
1943
|
);
|
|
1898
|
-
var imageGenerationToolFactory =
|
|
1944
|
+
var imageGenerationToolFactory = createProviderToolFactoryWithOutputSchema4({
|
|
1899
1945
|
id: "openai.image_generation",
|
|
1900
1946
|
inputSchema: imageGenerationInputSchema,
|
|
1901
1947
|
outputSchema: imageGenerationOutputSchema
|
|
@@ -1905,103 +1951,47 @@ var imageGeneration = (args = {}) => {
|
|
|
1905
1951
|
};
|
|
1906
1952
|
|
|
1907
1953
|
// src/tool/local-shell.ts
|
|
1908
|
-
import {
|
|
1909
|
-
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
|
|
1910
|
-
lazySchema as lazySchema11,
|
|
1911
|
-
zodSchema as zodSchema11
|
|
1912
|
-
} from "@ai-sdk/provider-utils";
|
|
1913
|
-
import { z as z12 } from "zod/v4";
|
|
1914
|
-
var localShellInputSchema = lazySchema11(
|
|
1915
|
-
() => zodSchema11(
|
|
1916
|
-
z12.object({
|
|
1917
|
-
action: z12.object({
|
|
1918
|
-
type: z12.literal("exec"),
|
|
1919
|
-
command: z12.array(z12.string()),
|
|
1920
|
-
timeoutMs: z12.number().optional(),
|
|
1921
|
-
user: z12.string().optional(),
|
|
1922
|
-
workingDirectory: z12.string().optional(),
|
|
1923
|
-
env: z12.record(z12.string(), z12.string()).optional()
|
|
1924
|
-
})
|
|
1925
|
-
})
|
|
1926
|
-
)
|
|
1927
|
-
);
|
|
1928
|
-
var localShellOutputSchema = lazySchema11(
|
|
1929
|
-
() => zodSchema11(z12.object({ output: z12.string() }))
|
|
1930
|
-
);
|
|
1931
|
-
var localShell = createProviderToolFactoryWithOutputSchema4({
|
|
1932
|
-
id: "openai.local_shell",
|
|
1933
|
-
inputSchema: localShellInputSchema,
|
|
1934
|
-
outputSchema: localShellOutputSchema
|
|
1935
|
-
});
|
|
1936
|
-
|
|
1937
|
-
// src/tool/web-search.ts
|
|
1938
1954
|
import {
|
|
1939
1955
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
|
|
1940
1956
|
lazySchema as lazySchema12,
|
|
1941
1957
|
zodSchema as zodSchema12
|
|
1942
1958
|
} from "@ai-sdk/provider-utils";
|
|
1943
1959
|
import { z as z13 } from "zod/v4";
|
|
1944
|
-
var
|
|
1960
|
+
var localShellInputSchema = lazySchema12(
|
|
1945
1961
|
() => zodSchema12(
|
|
1946
1962
|
z13.object({
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
timezone: z13.string().optional()
|
|
1956
|
-
}).optional()
|
|
1963
|
+
action: z13.object({
|
|
1964
|
+
type: z13.literal("exec"),
|
|
1965
|
+
command: z13.array(z13.string()),
|
|
1966
|
+
timeoutMs: z13.number().optional(),
|
|
1967
|
+
user: z13.string().optional(),
|
|
1968
|
+
workingDirectory: z13.string().optional(),
|
|
1969
|
+
env: z13.record(z13.string(), z13.string()).optional()
|
|
1970
|
+
})
|
|
1957
1971
|
})
|
|
1958
1972
|
)
|
|
1959
1973
|
);
|
|
1960
|
-
var
|
|
1961
|
-
|
|
1962
|
-
() => zodSchema12(
|
|
1963
|
-
z13.object({
|
|
1964
|
-
action: z13.discriminatedUnion("type", [
|
|
1965
|
-
z13.object({
|
|
1966
|
-
type: z13.literal("search"),
|
|
1967
|
-
query: z13.string().optional()
|
|
1968
|
-
}),
|
|
1969
|
-
z13.object({
|
|
1970
|
-
type: z13.literal("openPage"),
|
|
1971
|
-
url: z13.string()
|
|
1972
|
-
}),
|
|
1973
|
-
z13.object({
|
|
1974
|
-
type: z13.literal("find"),
|
|
1975
|
-
url: z13.string(),
|
|
1976
|
-
pattern: z13.string()
|
|
1977
|
-
})
|
|
1978
|
-
]),
|
|
1979
|
-
sources: z13.array(
|
|
1980
|
-
z13.discriminatedUnion("type", [
|
|
1981
|
-
z13.object({ type: z13.literal("url"), url: z13.string() }),
|
|
1982
|
-
z13.object({ type: z13.literal("api"), name: z13.string() })
|
|
1983
|
-
])
|
|
1984
|
-
).optional()
|
|
1985
|
-
})
|
|
1986
|
-
)
|
|
1974
|
+
var localShellOutputSchema = lazySchema12(
|
|
1975
|
+
() => zodSchema12(z13.object({ output: z13.string() }))
|
|
1987
1976
|
);
|
|
1988
|
-
var
|
|
1989
|
-
id: "openai.
|
|
1990
|
-
inputSchema:
|
|
1991
|
-
outputSchema:
|
|
1977
|
+
var localShell = createProviderToolFactoryWithOutputSchema5({
|
|
1978
|
+
id: "openai.local_shell",
|
|
1979
|
+
inputSchema: localShellInputSchema,
|
|
1980
|
+
outputSchema: localShellOutputSchema
|
|
1992
1981
|
});
|
|
1993
|
-
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
1994
1982
|
|
|
1995
|
-
// src/tool/web-search
|
|
1983
|
+
// src/tool/web-search.ts
|
|
1996
1984
|
import {
|
|
1997
1985
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
|
|
1998
1986
|
lazySchema as lazySchema13,
|
|
1999
1987
|
zodSchema as zodSchema13
|
|
2000
1988
|
} from "@ai-sdk/provider-utils";
|
|
2001
1989
|
import { z as z14 } from "zod/v4";
|
|
2002
|
-
var
|
|
1990
|
+
var webSearchArgsSchema = lazySchema13(
|
|
2003
1991
|
() => zodSchema13(
|
|
2004
1992
|
z14.object({
|
|
1993
|
+
externalWebAccess: z14.boolean().optional(),
|
|
1994
|
+
filters: z14.object({ allowedDomains: z14.array(z14.string()).optional() }).optional(),
|
|
2005
1995
|
searchContextSize: z14.enum(["low", "medium", "high"]).optional(),
|
|
2006
1996
|
userLocation: z14.object({
|
|
2007
1997
|
type: z14.literal("approximate"),
|
|
@@ -2013,10 +2003,8 @@ var webSearchPreviewArgsSchema = lazySchema13(
|
|
|
2013
2003
|
})
|
|
2014
2004
|
)
|
|
2015
2005
|
);
|
|
2016
|
-
var
|
|
2017
|
-
|
|
2018
|
-
);
|
|
2019
|
-
var webSearchPreviewOutputSchema = lazySchema13(
|
|
2006
|
+
var webSearchInputSchema = lazySchema13(() => zodSchema13(z14.object({})));
|
|
2007
|
+
var webSearchOutputSchema = lazySchema13(
|
|
2020
2008
|
() => zodSchema13(
|
|
2021
2009
|
z14.object({
|
|
2022
2010
|
action: z14.discriminatedUnion("type", [
|
|
@@ -2033,47 +2021,105 @@ var webSearchPreviewOutputSchema = lazySchema13(
|
|
|
2033
2021
|
url: z14.string(),
|
|
2034
2022
|
pattern: z14.string()
|
|
2035
2023
|
})
|
|
2036
|
-
])
|
|
2024
|
+
]),
|
|
2025
|
+
sources: z14.array(
|
|
2026
|
+
z14.discriminatedUnion("type", [
|
|
2027
|
+
z14.object({ type: z14.literal("url"), url: z14.string() }),
|
|
2028
|
+
z14.object({ type: z14.literal("api"), name: z14.string() })
|
|
2029
|
+
])
|
|
2030
|
+
).optional()
|
|
2037
2031
|
})
|
|
2038
2032
|
)
|
|
2039
2033
|
);
|
|
2040
|
-
var
|
|
2041
|
-
id: "openai.
|
|
2042
|
-
inputSchema:
|
|
2043
|
-
outputSchema:
|
|
2034
|
+
var webSearchToolFactory = createProviderToolFactoryWithOutputSchema6({
|
|
2035
|
+
id: "openai.web_search",
|
|
2036
|
+
inputSchema: webSearchInputSchema,
|
|
2037
|
+
outputSchema: webSearchOutputSchema
|
|
2044
2038
|
});
|
|
2039
|
+
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
2045
2040
|
|
|
2046
|
-
// src/tool/
|
|
2041
|
+
// src/tool/web-search-preview.ts
|
|
2047
2042
|
import {
|
|
2048
2043
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
|
|
2049
2044
|
lazySchema as lazySchema14,
|
|
2050
2045
|
zodSchema as zodSchema14
|
|
2051
2046
|
} from "@ai-sdk/provider-utils";
|
|
2052
2047
|
import { z as z15 } from "zod/v4";
|
|
2053
|
-
var
|
|
2054
|
-
() =>
|
|
2055
|
-
z15.
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2048
|
+
var webSearchPreviewArgsSchema = lazySchema14(
|
|
2049
|
+
() => zodSchema14(
|
|
2050
|
+
z15.object({
|
|
2051
|
+
searchContextSize: z15.enum(["low", "medium", "high"]).optional(),
|
|
2052
|
+
userLocation: z15.object({
|
|
2053
|
+
type: z15.literal("approximate"),
|
|
2054
|
+
country: z15.string().optional(),
|
|
2055
|
+
city: z15.string().optional(),
|
|
2056
|
+
region: z15.string().optional(),
|
|
2057
|
+
timezone: z15.string().optional()
|
|
2058
|
+
}).optional()
|
|
2059
|
+
})
|
|
2060
|
+
)
|
|
2061
|
+
);
|
|
2062
|
+
var webSearchPreviewInputSchema = lazySchema14(
|
|
2063
|
+
() => zodSchema14(z15.object({}))
|
|
2062
2064
|
);
|
|
2063
|
-
var
|
|
2065
|
+
var webSearchPreviewOutputSchema = lazySchema14(
|
|
2064
2066
|
() => zodSchema14(
|
|
2065
2067
|
z15.object({
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2068
|
+
action: z15.discriminatedUnion("type", [
|
|
2069
|
+
z15.object({
|
|
2070
|
+
type: z15.literal("search"),
|
|
2071
|
+
query: z15.string().optional()
|
|
2072
|
+
}),
|
|
2073
|
+
z15.object({
|
|
2074
|
+
type: z15.literal("openPage"),
|
|
2075
|
+
url: z15.string()
|
|
2076
|
+
}),
|
|
2069
2077
|
z15.object({
|
|
2070
|
-
|
|
2071
|
-
|
|
2078
|
+
type: z15.literal("find"),
|
|
2079
|
+
url: z15.string(),
|
|
2080
|
+
pattern: z15.string()
|
|
2081
|
+
})
|
|
2082
|
+
])
|
|
2083
|
+
})
|
|
2084
|
+
)
|
|
2085
|
+
);
|
|
2086
|
+
var webSearchPreview = createProviderToolFactoryWithOutputSchema7({
|
|
2087
|
+
id: "openai.web_search_preview",
|
|
2088
|
+
inputSchema: webSearchPreviewInputSchema,
|
|
2089
|
+
outputSchema: webSearchPreviewOutputSchema
|
|
2090
|
+
});
|
|
2091
|
+
|
|
2092
|
+
// src/tool/mcp.ts
|
|
2093
|
+
import {
|
|
2094
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
|
|
2095
|
+
lazySchema as lazySchema15,
|
|
2096
|
+
zodSchema as zodSchema15
|
|
2097
|
+
} from "@ai-sdk/provider-utils";
|
|
2098
|
+
import { z as z16 } from "zod/v4";
|
|
2099
|
+
var jsonValueSchema = z16.lazy(
|
|
2100
|
+
() => z16.union([
|
|
2101
|
+
z16.string(),
|
|
2102
|
+
z16.number(),
|
|
2103
|
+
z16.boolean(),
|
|
2104
|
+
z16.null(),
|
|
2105
|
+
z16.array(jsonValueSchema),
|
|
2106
|
+
z16.record(z16.string(), jsonValueSchema)
|
|
2107
|
+
])
|
|
2108
|
+
);
|
|
2109
|
+
var mcpArgsSchema = lazySchema15(
|
|
2110
|
+
() => zodSchema15(
|
|
2111
|
+
z16.object({
|
|
2112
|
+
serverLabel: z16.string(),
|
|
2113
|
+
allowedTools: z16.union([
|
|
2114
|
+
z16.array(z16.string()),
|
|
2115
|
+
z16.object({
|
|
2116
|
+
readOnly: z16.boolean().optional(),
|
|
2117
|
+
toolNames: z16.array(z16.string()).optional()
|
|
2072
2118
|
})
|
|
2073
2119
|
]).optional(),
|
|
2074
|
-
authorization:
|
|
2075
|
-
connectorId:
|
|
2076
|
-
headers:
|
|
2120
|
+
authorization: z16.string().optional(),
|
|
2121
|
+
connectorId: z16.string().optional(),
|
|
2122
|
+
headers: z16.record(z16.string(), z16.string()).optional(),
|
|
2077
2123
|
// TODO: Integrate this MCP tool approval with our SDK's existing tool approval architecture
|
|
2078
2124
|
// requireApproval: z
|
|
2079
2125
|
// .union([
|
|
@@ -2084,50 +2130,50 @@ var mcpArgsSchema = lazySchema14(
|
|
|
2084
2130
|
// }),
|
|
2085
2131
|
// ])
|
|
2086
2132
|
// .optional(),
|
|
2087
|
-
serverDescription:
|
|
2088
|
-
serverUrl:
|
|
2133
|
+
serverDescription: z16.string().optional(),
|
|
2134
|
+
serverUrl: z16.string().optional()
|
|
2089
2135
|
}).refine(
|
|
2090
2136
|
(v) => v.serverUrl != null || v.connectorId != null,
|
|
2091
2137
|
"One of serverUrl or connectorId must be provided."
|
|
2092
2138
|
)
|
|
2093
2139
|
)
|
|
2094
2140
|
);
|
|
2095
|
-
var mcpInputSchema =
|
|
2096
|
-
var mcpOutputSchema =
|
|
2097
|
-
() =>
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
type:
|
|
2101
|
-
serverLabel:
|
|
2102
|
-
name:
|
|
2103
|
-
arguments:
|
|
2104
|
-
output:
|
|
2105
|
-
error:
|
|
2141
|
+
var mcpInputSchema = lazySchema15(() => zodSchema15(z16.object({})));
|
|
2142
|
+
var mcpOutputSchema = lazySchema15(
|
|
2143
|
+
() => zodSchema15(
|
|
2144
|
+
z16.discriminatedUnion("type", [
|
|
2145
|
+
z16.object({
|
|
2146
|
+
type: z16.literal("call"),
|
|
2147
|
+
serverLabel: z16.string(),
|
|
2148
|
+
name: z16.string(),
|
|
2149
|
+
arguments: z16.string(),
|
|
2150
|
+
output: z16.string().nullable().optional(),
|
|
2151
|
+
error: z16.union([z16.string(), jsonValueSchema]).optional()
|
|
2106
2152
|
}),
|
|
2107
|
-
|
|
2108
|
-
type:
|
|
2109
|
-
serverLabel:
|
|
2110
|
-
tools:
|
|
2111
|
-
|
|
2112
|
-
name:
|
|
2113
|
-
description:
|
|
2153
|
+
z16.object({
|
|
2154
|
+
type: z16.literal("listTools"),
|
|
2155
|
+
serverLabel: z16.string(),
|
|
2156
|
+
tools: z16.array(
|
|
2157
|
+
z16.object({
|
|
2158
|
+
name: z16.string(),
|
|
2159
|
+
description: z16.string().optional(),
|
|
2114
2160
|
inputSchema: jsonValueSchema,
|
|
2115
|
-
annotations:
|
|
2161
|
+
annotations: z16.record(z16.string(), jsonValueSchema).optional()
|
|
2116
2162
|
})
|
|
2117
2163
|
),
|
|
2118
|
-
error:
|
|
2164
|
+
error: z16.union([z16.string(), jsonValueSchema]).optional()
|
|
2119
2165
|
}),
|
|
2120
|
-
|
|
2121
|
-
type:
|
|
2122
|
-
serverLabel:
|
|
2123
|
-
name:
|
|
2124
|
-
arguments:
|
|
2125
|
-
approvalRequestId:
|
|
2166
|
+
z16.object({
|
|
2167
|
+
type: z16.literal("approvalRequest"),
|
|
2168
|
+
serverLabel: z16.string(),
|
|
2169
|
+
name: z16.string(),
|
|
2170
|
+
arguments: z16.string(),
|
|
2171
|
+
approvalRequestId: z16.string()
|
|
2126
2172
|
})
|
|
2127
2173
|
])
|
|
2128
2174
|
)
|
|
2129
2175
|
);
|
|
2130
|
-
var mcpToolFactory =
|
|
2176
|
+
var mcpToolFactory = createProviderToolFactoryWithOutputSchema8({
|
|
2131
2177
|
id: "openai.mcp",
|
|
2132
2178
|
inputSchema: mcpInputSchema,
|
|
2133
2179
|
outputSchema: mcpOutputSchema
|
|
@@ -2136,6 +2182,14 @@ var mcp = (args) => mcpToolFactory(args);
|
|
|
2136
2182
|
|
|
2137
2183
|
// src/openai-tools.ts
|
|
2138
2184
|
var openaiTools = {
|
|
2185
|
+
/**
|
|
2186
|
+
* The apply_patch tool lets GPT-5.1 create, update, and delete files in your
|
|
2187
|
+
* codebase using structured diffs. Instead of just suggesting edits, the model
|
|
2188
|
+
* emits patch operations that your application applies and then reports back on,
|
|
2189
|
+
* enabling iterative, multi-step code editing workflows.
|
|
2190
|
+
*
|
|
2191
|
+
*/
|
|
2192
|
+
applyPatch,
|
|
2139
2193
|
/**
|
|
2140
2194
|
* The Code Interpreter tool allows models to write and run Python code in a
|
|
2141
2195
|
* sandboxed environment to solve complex problems in domains like data analysis,
|
|
@@ -2236,7 +2290,7 @@ import {
|
|
|
2236
2290
|
parseProviderOptions as parseProviderOptions4,
|
|
2237
2291
|
validateTypes
|
|
2238
2292
|
} from "@ai-sdk/provider-utils";
|
|
2239
|
-
import { z as
|
|
2293
|
+
import { z as z17 } from "zod/v4";
|
|
2240
2294
|
function isFileId(data, prefixes) {
|
|
2241
2295
|
if (!prefixes) return false;
|
|
2242
2296
|
return prefixes.some((prefix) => data.startsWith(prefix));
|
|
@@ -2247,7 +2301,8 @@ async function convertToOpenAIResponsesInput({
|
|
|
2247
2301
|
systemMessageMode,
|
|
2248
2302
|
fileIdPrefixes,
|
|
2249
2303
|
store,
|
|
2250
|
-
hasLocalShellTool = false
|
|
2304
|
+
hasLocalShellTool = false,
|
|
2305
|
+
hasApplyPatchTool = false
|
|
2251
2306
|
}) {
|
|
2252
2307
|
var _a, _b, _c, _d, _e;
|
|
2253
2308
|
const input = [];
|
|
@@ -2470,6 +2525,19 @@ async function convertToOpenAIResponsesInput({
|
|
|
2470
2525
|
});
|
|
2471
2526
|
break;
|
|
2472
2527
|
}
|
|
2528
|
+
if (hasApplyPatchTool && part.toolName === "apply_patch" && output.type === "json") {
|
|
2529
|
+
const parsedOutput = await validateTypes({
|
|
2530
|
+
value: output.value,
|
|
2531
|
+
schema: applyPatchOutputSchema
|
|
2532
|
+
});
|
|
2533
|
+
input.push({
|
|
2534
|
+
type: "apply_patch_call_output",
|
|
2535
|
+
call_id: part.toolCallId,
|
|
2536
|
+
status: parsedOutput.status,
|
|
2537
|
+
output: parsedOutput.output
|
|
2538
|
+
});
|
|
2539
|
+
break;
|
|
2540
|
+
}
|
|
2473
2541
|
let contentValue;
|
|
2474
2542
|
switch (output.type) {
|
|
2475
2543
|
case "text":
|
|
@@ -2530,9 +2598,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
2530
2598
|
}
|
|
2531
2599
|
return { input, warnings };
|
|
2532
2600
|
}
|
|
2533
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
2534
|
-
itemId:
|
|
2535
|
-
reasoningEncryptedContent:
|
|
2601
|
+
var openaiResponsesReasoningProviderOptionsSchema = z17.object({
|
|
2602
|
+
itemId: z17.string().nullish(),
|
|
2603
|
+
reasoningEncryptedContent: z17.string().nullish()
|
|
2536
2604
|
});
|
|
2537
2605
|
|
|
2538
2606
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -2554,349 +2622,393 @@ function mapOpenAIResponseFinishReason({
|
|
|
2554
2622
|
}
|
|
2555
2623
|
|
|
2556
2624
|
// src/responses/openai-responses-api.ts
|
|
2557
|
-
import { lazySchema as
|
|
2558
|
-
import { z as
|
|
2559
|
-
var openaiResponsesChunkSchema =
|
|
2560
|
-
() =>
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
type:
|
|
2564
|
-
item_id:
|
|
2565
|
-
delta:
|
|
2566
|
-
logprobs:
|
|
2567
|
-
|
|
2568
|
-
token:
|
|
2569
|
-
logprob:
|
|
2570
|
-
top_logprobs:
|
|
2571
|
-
|
|
2572
|
-
token:
|
|
2573
|
-
logprob:
|
|
2625
|
+
import { lazySchema as lazySchema16, zodSchema as zodSchema16 } from "@ai-sdk/provider-utils";
|
|
2626
|
+
import { z as z18 } from "zod/v4";
|
|
2627
|
+
var openaiResponsesChunkSchema = lazySchema16(
|
|
2628
|
+
() => zodSchema16(
|
|
2629
|
+
z18.union([
|
|
2630
|
+
z18.object({
|
|
2631
|
+
type: z18.literal("response.output_text.delta"),
|
|
2632
|
+
item_id: z18.string(),
|
|
2633
|
+
delta: z18.string(),
|
|
2634
|
+
logprobs: z18.array(
|
|
2635
|
+
z18.object({
|
|
2636
|
+
token: z18.string(),
|
|
2637
|
+
logprob: z18.number(),
|
|
2638
|
+
top_logprobs: z18.array(
|
|
2639
|
+
z18.object({
|
|
2640
|
+
token: z18.string(),
|
|
2641
|
+
logprob: z18.number()
|
|
2574
2642
|
})
|
|
2575
2643
|
)
|
|
2576
2644
|
})
|
|
2577
2645
|
).nullish()
|
|
2578
2646
|
}),
|
|
2579
|
-
|
|
2580
|
-
type:
|
|
2581
|
-
response:
|
|
2582
|
-
incomplete_details:
|
|
2583
|
-
usage:
|
|
2584
|
-
input_tokens:
|
|
2585
|
-
input_tokens_details:
|
|
2586
|
-
output_tokens:
|
|
2587
|
-
output_tokens_details:
|
|
2647
|
+
z18.object({
|
|
2648
|
+
type: z18.enum(["response.completed", "response.incomplete"]),
|
|
2649
|
+
response: z18.object({
|
|
2650
|
+
incomplete_details: z18.object({ reason: z18.string() }).nullish(),
|
|
2651
|
+
usage: z18.object({
|
|
2652
|
+
input_tokens: z18.number(),
|
|
2653
|
+
input_tokens_details: z18.object({ cached_tokens: z18.number().nullish() }).nullish(),
|
|
2654
|
+
output_tokens: z18.number(),
|
|
2655
|
+
output_tokens_details: z18.object({ reasoning_tokens: z18.number().nullish() }).nullish()
|
|
2588
2656
|
}),
|
|
2589
|
-
service_tier:
|
|
2657
|
+
service_tier: z18.string().nullish()
|
|
2590
2658
|
})
|
|
2591
2659
|
}),
|
|
2592
|
-
|
|
2593
|
-
type:
|
|
2594
|
-
response:
|
|
2595
|
-
id:
|
|
2596
|
-
created_at:
|
|
2597
|
-
model:
|
|
2598
|
-
service_tier:
|
|
2660
|
+
z18.object({
|
|
2661
|
+
type: z18.literal("response.created"),
|
|
2662
|
+
response: z18.object({
|
|
2663
|
+
id: z18.string(),
|
|
2664
|
+
created_at: z18.number(),
|
|
2665
|
+
model: z18.string(),
|
|
2666
|
+
service_tier: z18.string().nullish()
|
|
2599
2667
|
})
|
|
2600
2668
|
}),
|
|
2601
|
-
|
|
2602
|
-
type:
|
|
2603
|
-
output_index:
|
|
2604
|
-
item:
|
|
2605
|
-
|
|
2606
|
-
type:
|
|
2607
|
-
id:
|
|
2669
|
+
z18.object({
|
|
2670
|
+
type: z18.literal("response.output_item.added"),
|
|
2671
|
+
output_index: z18.number(),
|
|
2672
|
+
item: z18.discriminatedUnion("type", [
|
|
2673
|
+
z18.object({
|
|
2674
|
+
type: z18.literal("message"),
|
|
2675
|
+
id: z18.string()
|
|
2608
2676
|
}),
|
|
2609
|
-
|
|
2610
|
-
type:
|
|
2611
|
-
id:
|
|
2612
|
-
encrypted_content:
|
|
2677
|
+
z18.object({
|
|
2678
|
+
type: z18.literal("reasoning"),
|
|
2679
|
+
id: z18.string(),
|
|
2680
|
+
encrypted_content: z18.string().nullish()
|
|
2613
2681
|
}),
|
|
2614
|
-
|
|
2615
|
-
type:
|
|
2616
|
-
id:
|
|
2617
|
-
call_id:
|
|
2618
|
-
name:
|
|
2619
|
-
arguments:
|
|
2682
|
+
z18.object({
|
|
2683
|
+
type: z18.literal("function_call"),
|
|
2684
|
+
id: z18.string(),
|
|
2685
|
+
call_id: z18.string(),
|
|
2686
|
+
name: z18.string(),
|
|
2687
|
+
arguments: z18.string()
|
|
2620
2688
|
}),
|
|
2621
|
-
|
|
2622
|
-
type:
|
|
2623
|
-
id:
|
|
2624
|
-
status:
|
|
2689
|
+
z18.object({
|
|
2690
|
+
type: z18.literal("web_search_call"),
|
|
2691
|
+
id: z18.string(),
|
|
2692
|
+
status: z18.string()
|
|
2625
2693
|
}),
|
|
2626
|
-
|
|
2627
|
-
type:
|
|
2628
|
-
id:
|
|
2629
|
-
status:
|
|
2694
|
+
z18.object({
|
|
2695
|
+
type: z18.literal("computer_call"),
|
|
2696
|
+
id: z18.string(),
|
|
2697
|
+
status: z18.string()
|
|
2630
2698
|
}),
|
|
2631
|
-
|
|
2632
|
-
type:
|
|
2633
|
-
id:
|
|
2699
|
+
z18.object({
|
|
2700
|
+
type: z18.literal("file_search_call"),
|
|
2701
|
+
id: z18.string()
|
|
2634
2702
|
}),
|
|
2635
|
-
|
|
2636
|
-
type:
|
|
2637
|
-
id:
|
|
2703
|
+
z18.object({
|
|
2704
|
+
type: z18.literal("image_generation_call"),
|
|
2705
|
+
id: z18.string()
|
|
2638
2706
|
}),
|
|
2639
|
-
|
|
2640
|
-
type:
|
|
2641
|
-
id:
|
|
2642
|
-
container_id:
|
|
2643
|
-
code:
|
|
2644
|
-
outputs:
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2707
|
+
z18.object({
|
|
2708
|
+
type: z18.literal("code_interpreter_call"),
|
|
2709
|
+
id: z18.string(),
|
|
2710
|
+
container_id: z18.string(),
|
|
2711
|
+
code: z18.string().nullable(),
|
|
2712
|
+
outputs: z18.array(
|
|
2713
|
+
z18.discriminatedUnion("type", [
|
|
2714
|
+
z18.object({ type: z18.literal("logs"), logs: z18.string() }),
|
|
2715
|
+
z18.object({ type: z18.literal("image"), url: z18.string() })
|
|
2648
2716
|
])
|
|
2649
2717
|
).nullable(),
|
|
2650
|
-
status:
|
|
2718
|
+
status: z18.string()
|
|
2719
|
+
}),
|
|
2720
|
+
z18.object({
|
|
2721
|
+
type: z18.literal("mcp_call"),
|
|
2722
|
+
id: z18.string(),
|
|
2723
|
+
status: z18.string()
|
|
2651
2724
|
}),
|
|
2652
|
-
|
|
2653
|
-
type:
|
|
2654
|
-
id:
|
|
2655
|
-
status: z17.string()
|
|
2725
|
+
z18.object({
|
|
2726
|
+
type: z18.literal("mcp_list_tools"),
|
|
2727
|
+
id: z18.string()
|
|
2656
2728
|
}),
|
|
2657
|
-
|
|
2658
|
-
type:
|
|
2659
|
-
id:
|
|
2729
|
+
z18.object({
|
|
2730
|
+
type: z18.literal("mcp_approval_request"),
|
|
2731
|
+
id: z18.string()
|
|
2660
2732
|
}),
|
|
2661
|
-
|
|
2662
|
-
type:
|
|
2663
|
-
id:
|
|
2733
|
+
z18.object({
|
|
2734
|
+
type: z18.literal("apply_patch_call"),
|
|
2735
|
+
id: z18.string(),
|
|
2736
|
+
call_id: z18.string(),
|
|
2737
|
+
status: z18.enum(["in_progress", "completed"]),
|
|
2738
|
+
operation: z18.discriminatedUnion("type", [
|
|
2739
|
+
z18.object({
|
|
2740
|
+
type: z18.literal("create_file"),
|
|
2741
|
+
path: z18.string(),
|
|
2742
|
+
diff: z18.string()
|
|
2743
|
+
}),
|
|
2744
|
+
z18.object({
|
|
2745
|
+
type: z18.literal("delete_file"),
|
|
2746
|
+
path: z18.string()
|
|
2747
|
+
}),
|
|
2748
|
+
z18.object({
|
|
2749
|
+
type: z18.literal("update_file"),
|
|
2750
|
+
path: z18.string(),
|
|
2751
|
+
diff: z18.string()
|
|
2752
|
+
})
|
|
2753
|
+
])
|
|
2664
2754
|
})
|
|
2665
2755
|
])
|
|
2666
2756
|
}),
|
|
2667
|
-
|
|
2668
|
-
type:
|
|
2669
|
-
output_index:
|
|
2670
|
-
item:
|
|
2671
|
-
|
|
2672
|
-
type:
|
|
2673
|
-
id:
|
|
2757
|
+
z18.object({
|
|
2758
|
+
type: z18.literal("response.output_item.done"),
|
|
2759
|
+
output_index: z18.number(),
|
|
2760
|
+
item: z18.discriminatedUnion("type", [
|
|
2761
|
+
z18.object({
|
|
2762
|
+
type: z18.literal("message"),
|
|
2763
|
+
id: z18.string()
|
|
2674
2764
|
}),
|
|
2675
|
-
|
|
2676
|
-
type:
|
|
2677
|
-
id:
|
|
2678
|
-
encrypted_content:
|
|
2765
|
+
z18.object({
|
|
2766
|
+
type: z18.literal("reasoning"),
|
|
2767
|
+
id: z18.string(),
|
|
2768
|
+
encrypted_content: z18.string().nullish()
|
|
2679
2769
|
}),
|
|
2680
|
-
|
|
2681
|
-
type:
|
|
2682
|
-
id:
|
|
2683
|
-
call_id:
|
|
2684
|
-
name:
|
|
2685
|
-
arguments:
|
|
2686
|
-
status:
|
|
2770
|
+
z18.object({
|
|
2771
|
+
type: z18.literal("function_call"),
|
|
2772
|
+
id: z18.string(),
|
|
2773
|
+
call_id: z18.string(),
|
|
2774
|
+
name: z18.string(),
|
|
2775
|
+
arguments: z18.string(),
|
|
2776
|
+
status: z18.literal("completed")
|
|
2687
2777
|
}),
|
|
2688
|
-
|
|
2689
|
-
type:
|
|
2690
|
-
id:
|
|
2691
|
-
code:
|
|
2692
|
-
container_id:
|
|
2693
|
-
outputs:
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2778
|
+
z18.object({
|
|
2779
|
+
type: z18.literal("code_interpreter_call"),
|
|
2780
|
+
id: z18.string(),
|
|
2781
|
+
code: z18.string().nullable(),
|
|
2782
|
+
container_id: z18.string(),
|
|
2783
|
+
outputs: z18.array(
|
|
2784
|
+
z18.discriminatedUnion("type", [
|
|
2785
|
+
z18.object({ type: z18.literal("logs"), logs: z18.string() }),
|
|
2786
|
+
z18.object({ type: z18.literal("image"), url: z18.string() })
|
|
2697
2787
|
])
|
|
2698
2788
|
).nullable()
|
|
2699
2789
|
}),
|
|
2700
|
-
|
|
2701
|
-
type:
|
|
2702
|
-
id:
|
|
2703
|
-
result:
|
|
2790
|
+
z18.object({
|
|
2791
|
+
type: z18.literal("image_generation_call"),
|
|
2792
|
+
id: z18.string(),
|
|
2793
|
+
result: z18.string()
|
|
2704
2794
|
}),
|
|
2705
|
-
|
|
2706
|
-
type:
|
|
2707
|
-
id:
|
|
2708
|
-
status:
|
|
2709
|
-
action:
|
|
2710
|
-
|
|
2711
|
-
type:
|
|
2712
|
-
query:
|
|
2713
|
-
sources:
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2795
|
+
z18.object({
|
|
2796
|
+
type: z18.literal("web_search_call"),
|
|
2797
|
+
id: z18.string(),
|
|
2798
|
+
status: z18.string(),
|
|
2799
|
+
action: z18.discriminatedUnion("type", [
|
|
2800
|
+
z18.object({
|
|
2801
|
+
type: z18.literal("search"),
|
|
2802
|
+
query: z18.string().nullish(),
|
|
2803
|
+
sources: z18.array(
|
|
2804
|
+
z18.discriminatedUnion("type", [
|
|
2805
|
+
z18.object({ type: z18.literal("url"), url: z18.string() }),
|
|
2806
|
+
z18.object({ type: z18.literal("api"), name: z18.string() })
|
|
2717
2807
|
])
|
|
2718
2808
|
).nullish()
|
|
2719
2809
|
}),
|
|
2720
|
-
|
|
2721
|
-
type:
|
|
2722
|
-
url:
|
|
2810
|
+
z18.object({
|
|
2811
|
+
type: z18.literal("open_page"),
|
|
2812
|
+
url: z18.string()
|
|
2723
2813
|
}),
|
|
2724
|
-
|
|
2725
|
-
type:
|
|
2726
|
-
url:
|
|
2727
|
-
pattern:
|
|
2814
|
+
z18.object({
|
|
2815
|
+
type: z18.literal("find"),
|
|
2816
|
+
url: z18.string(),
|
|
2817
|
+
pattern: z18.string()
|
|
2728
2818
|
})
|
|
2729
2819
|
])
|
|
2730
2820
|
}),
|
|
2731
|
-
|
|
2732
|
-
type:
|
|
2733
|
-
id:
|
|
2734
|
-
queries:
|
|
2735
|
-
results:
|
|
2736
|
-
|
|
2737
|
-
attributes:
|
|
2738
|
-
|
|
2739
|
-
|
|
2821
|
+
z18.object({
|
|
2822
|
+
type: z18.literal("file_search_call"),
|
|
2823
|
+
id: z18.string(),
|
|
2824
|
+
queries: z18.array(z18.string()),
|
|
2825
|
+
results: z18.array(
|
|
2826
|
+
z18.object({
|
|
2827
|
+
attributes: z18.record(
|
|
2828
|
+
z18.string(),
|
|
2829
|
+
z18.union([z18.string(), z18.number(), z18.boolean()])
|
|
2740
2830
|
),
|
|
2741
|
-
file_id:
|
|
2742
|
-
filename:
|
|
2743
|
-
score:
|
|
2744
|
-
text:
|
|
2831
|
+
file_id: z18.string(),
|
|
2832
|
+
filename: z18.string(),
|
|
2833
|
+
score: z18.number(),
|
|
2834
|
+
text: z18.string()
|
|
2745
2835
|
})
|
|
2746
2836
|
).nullish()
|
|
2747
2837
|
}),
|
|
2748
|
-
|
|
2749
|
-
type:
|
|
2750
|
-
id:
|
|
2751
|
-
call_id:
|
|
2752
|
-
action:
|
|
2753
|
-
type:
|
|
2754
|
-
command:
|
|
2755
|
-
timeout_ms:
|
|
2756
|
-
user:
|
|
2757
|
-
working_directory:
|
|
2758
|
-
env:
|
|
2838
|
+
z18.object({
|
|
2839
|
+
type: z18.literal("local_shell_call"),
|
|
2840
|
+
id: z18.string(),
|
|
2841
|
+
call_id: z18.string(),
|
|
2842
|
+
action: z18.object({
|
|
2843
|
+
type: z18.literal("exec"),
|
|
2844
|
+
command: z18.array(z18.string()),
|
|
2845
|
+
timeout_ms: z18.number().optional(),
|
|
2846
|
+
user: z18.string().optional(),
|
|
2847
|
+
working_directory: z18.string().optional(),
|
|
2848
|
+
env: z18.record(z18.string(), z18.string()).optional()
|
|
2759
2849
|
})
|
|
2760
2850
|
}),
|
|
2761
|
-
|
|
2762
|
-
type:
|
|
2763
|
-
id:
|
|
2764
|
-
status:
|
|
2851
|
+
z18.object({
|
|
2852
|
+
type: z18.literal("computer_call"),
|
|
2853
|
+
id: z18.string(),
|
|
2854
|
+
status: z18.literal("completed")
|
|
2765
2855
|
}),
|
|
2766
|
-
|
|
2767
|
-
type:
|
|
2768
|
-
id:
|
|
2769
|
-
status:
|
|
2770
|
-
arguments:
|
|
2771
|
-
name:
|
|
2772
|
-
server_label:
|
|
2773
|
-
output:
|
|
2774
|
-
error:
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
type:
|
|
2778
|
-
code:
|
|
2779
|
-
message:
|
|
2856
|
+
z18.object({
|
|
2857
|
+
type: z18.literal("mcp_call"),
|
|
2858
|
+
id: z18.string(),
|
|
2859
|
+
status: z18.string(),
|
|
2860
|
+
arguments: z18.string(),
|
|
2861
|
+
name: z18.string(),
|
|
2862
|
+
server_label: z18.string(),
|
|
2863
|
+
output: z18.string().nullish(),
|
|
2864
|
+
error: z18.union([
|
|
2865
|
+
z18.string(),
|
|
2866
|
+
z18.object({
|
|
2867
|
+
type: z18.string().optional(),
|
|
2868
|
+
code: z18.union([z18.number(), z18.string()]).optional(),
|
|
2869
|
+
message: z18.string().optional()
|
|
2780
2870
|
}).loose()
|
|
2781
2871
|
]).nullish()
|
|
2782
2872
|
}),
|
|
2783
|
-
|
|
2784
|
-
type:
|
|
2785
|
-
id:
|
|
2786
|
-
server_label:
|
|
2787
|
-
tools:
|
|
2788
|
-
|
|
2789
|
-
name:
|
|
2790
|
-
description:
|
|
2791
|
-
input_schema:
|
|
2792
|
-
annotations:
|
|
2873
|
+
z18.object({
|
|
2874
|
+
type: z18.literal("mcp_list_tools"),
|
|
2875
|
+
id: z18.string(),
|
|
2876
|
+
server_label: z18.string(),
|
|
2877
|
+
tools: z18.array(
|
|
2878
|
+
z18.object({
|
|
2879
|
+
name: z18.string(),
|
|
2880
|
+
description: z18.string().optional(),
|
|
2881
|
+
input_schema: z18.any(),
|
|
2882
|
+
annotations: z18.record(z18.string(), z18.unknown()).optional()
|
|
2793
2883
|
})
|
|
2794
2884
|
),
|
|
2795
|
-
error:
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
type:
|
|
2799
|
-
code:
|
|
2800
|
-
message:
|
|
2885
|
+
error: z18.union([
|
|
2886
|
+
z18.string(),
|
|
2887
|
+
z18.object({
|
|
2888
|
+
type: z18.string().optional(),
|
|
2889
|
+
code: z18.union([z18.number(), z18.string()]).optional(),
|
|
2890
|
+
message: z18.string().optional()
|
|
2801
2891
|
}).loose()
|
|
2802
2892
|
]).optional()
|
|
2803
2893
|
}),
|
|
2804
|
-
|
|
2805
|
-
type:
|
|
2806
|
-
id:
|
|
2807
|
-
server_label:
|
|
2808
|
-
name:
|
|
2809
|
-
arguments:
|
|
2810
|
-
approval_request_id:
|
|
2894
|
+
z18.object({
|
|
2895
|
+
type: z18.literal("mcp_approval_request"),
|
|
2896
|
+
id: z18.string(),
|
|
2897
|
+
server_label: z18.string(),
|
|
2898
|
+
name: z18.string(),
|
|
2899
|
+
arguments: z18.string(),
|
|
2900
|
+
approval_request_id: z18.string()
|
|
2901
|
+
}),
|
|
2902
|
+
z18.object({
|
|
2903
|
+
type: z18.literal("apply_patch_call"),
|
|
2904
|
+
id: z18.string(),
|
|
2905
|
+
call_id: z18.string(),
|
|
2906
|
+
status: z18.enum(["in_progress", "completed"]),
|
|
2907
|
+
operation: z18.discriminatedUnion("type", [
|
|
2908
|
+
z18.object({
|
|
2909
|
+
type: z18.literal("create_file"),
|
|
2910
|
+
path: z18.string(),
|
|
2911
|
+
diff: z18.string()
|
|
2912
|
+
}),
|
|
2913
|
+
z18.object({
|
|
2914
|
+
type: z18.literal("delete_file"),
|
|
2915
|
+
path: z18.string()
|
|
2916
|
+
}),
|
|
2917
|
+
z18.object({
|
|
2918
|
+
type: z18.literal("update_file"),
|
|
2919
|
+
path: z18.string(),
|
|
2920
|
+
diff: z18.string()
|
|
2921
|
+
})
|
|
2922
|
+
])
|
|
2811
2923
|
})
|
|
2812
2924
|
])
|
|
2813
2925
|
}),
|
|
2814
|
-
|
|
2815
|
-
type:
|
|
2816
|
-
item_id:
|
|
2817
|
-
output_index:
|
|
2818
|
-
delta:
|
|
2926
|
+
z18.object({
|
|
2927
|
+
type: z18.literal("response.function_call_arguments.delta"),
|
|
2928
|
+
item_id: z18.string(),
|
|
2929
|
+
output_index: z18.number(),
|
|
2930
|
+
delta: z18.string()
|
|
2819
2931
|
}),
|
|
2820
|
-
|
|
2821
|
-
type:
|
|
2822
|
-
item_id:
|
|
2823
|
-
output_index:
|
|
2824
|
-
partial_image_b64:
|
|
2932
|
+
z18.object({
|
|
2933
|
+
type: z18.literal("response.image_generation_call.partial_image"),
|
|
2934
|
+
item_id: z18.string(),
|
|
2935
|
+
output_index: z18.number(),
|
|
2936
|
+
partial_image_b64: z18.string()
|
|
2825
2937
|
}),
|
|
2826
|
-
|
|
2827
|
-
type:
|
|
2828
|
-
item_id:
|
|
2829
|
-
output_index:
|
|
2830
|
-
delta:
|
|
2938
|
+
z18.object({
|
|
2939
|
+
type: z18.literal("response.code_interpreter_call_code.delta"),
|
|
2940
|
+
item_id: z18.string(),
|
|
2941
|
+
output_index: z18.number(),
|
|
2942
|
+
delta: z18.string()
|
|
2831
2943
|
}),
|
|
2832
|
-
|
|
2833
|
-
type:
|
|
2834
|
-
item_id:
|
|
2835
|
-
output_index:
|
|
2836
|
-
code:
|
|
2944
|
+
z18.object({
|
|
2945
|
+
type: z18.literal("response.code_interpreter_call_code.done"),
|
|
2946
|
+
item_id: z18.string(),
|
|
2947
|
+
output_index: z18.number(),
|
|
2948
|
+
code: z18.string()
|
|
2837
2949
|
}),
|
|
2838
|
-
|
|
2839
|
-
type:
|
|
2840
|
-
annotation:
|
|
2841
|
-
|
|
2842
|
-
type:
|
|
2843
|
-
start_index:
|
|
2844
|
-
end_index:
|
|
2845
|
-
url:
|
|
2846
|
-
title:
|
|
2950
|
+
z18.object({
|
|
2951
|
+
type: z18.literal("response.output_text.annotation.added"),
|
|
2952
|
+
annotation: z18.discriminatedUnion("type", [
|
|
2953
|
+
z18.object({
|
|
2954
|
+
type: z18.literal("url_citation"),
|
|
2955
|
+
start_index: z18.number(),
|
|
2956
|
+
end_index: z18.number(),
|
|
2957
|
+
url: z18.string(),
|
|
2958
|
+
title: z18.string()
|
|
2847
2959
|
}),
|
|
2848
|
-
|
|
2849
|
-
type:
|
|
2850
|
-
file_id:
|
|
2851
|
-
filename:
|
|
2852
|
-
index:
|
|
2853
|
-
start_index:
|
|
2854
|
-
end_index:
|
|
2855
|
-
quote:
|
|
2960
|
+
z18.object({
|
|
2961
|
+
type: z18.literal("file_citation"),
|
|
2962
|
+
file_id: z18.string(),
|
|
2963
|
+
filename: z18.string().nullish(),
|
|
2964
|
+
index: z18.number().nullish(),
|
|
2965
|
+
start_index: z18.number().nullish(),
|
|
2966
|
+
end_index: z18.number().nullish(),
|
|
2967
|
+
quote: z18.string().nullish()
|
|
2856
2968
|
}),
|
|
2857
|
-
|
|
2858
|
-
type:
|
|
2859
|
-
container_id:
|
|
2860
|
-
file_id:
|
|
2861
|
-
filename:
|
|
2862
|
-
start_index:
|
|
2863
|
-
end_index:
|
|
2864
|
-
index:
|
|
2969
|
+
z18.object({
|
|
2970
|
+
type: z18.literal("container_file_citation"),
|
|
2971
|
+
container_id: z18.string(),
|
|
2972
|
+
file_id: z18.string(),
|
|
2973
|
+
filename: z18.string().nullish(),
|
|
2974
|
+
start_index: z18.number().nullish(),
|
|
2975
|
+
end_index: z18.number().nullish(),
|
|
2976
|
+
index: z18.number().nullish()
|
|
2865
2977
|
}),
|
|
2866
|
-
|
|
2867
|
-
type:
|
|
2868
|
-
file_id:
|
|
2869
|
-
index:
|
|
2978
|
+
z18.object({
|
|
2979
|
+
type: z18.literal("file_path"),
|
|
2980
|
+
file_id: z18.string(),
|
|
2981
|
+
index: z18.number().nullish()
|
|
2870
2982
|
})
|
|
2871
2983
|
])
|
|
2872
2984
|
}),
|
|
2873
|
-
|
|
2874
|
-
type:
|
|
2875
|
-
item_id:
|
|
2876
|
-
summary_index:
|
|
2985
|
+
z18.object({
|
|
2986
|
+
type: z18.literal("response.reasoning_summary_part.added"),
|
|
2987
|
+
item_id: z18.string(),
|
|
2988
|
+
summary_index: z18.number()
|
|
2877
2989
|
}),
|
|
2878
|
-
|
|
2879
|
-
type:
|
|
2880
|
-
item_id:
|
|
2881
|
-
summary_index:
|
|
2882
|
-
delta:
|
|
2990
|
+
z18.object({
|
|
2991
|
+
type: z18.literal("response.reasoning_summary_text.delta"),
|
|
2992
|
+
item_id: z18.string(),
|
|
2993
|
+
summary_index: z18.number(),
|
|
2994
|
+
delta: z18.string()
|
|
2883
2995
|
}),
|
|
2884
|
-
|
|
2885
|
-
type:
|
|
2886
|
-
item_id:
|
|
2887
|
-
summary_index:
|
|
2996
|
+
z18.object({
|
|
2997
|
+
type: z18.literal("response.reasoning_summary_part.done"),
|
|
2998
|
+
item_id: z18.string(),
|
|
2999
|
+
summary_index: z18.number()
|
|
2888
3000
|
}),
|
|
2889
|
-
|
|
2890
|
-
type:
|
|
2891
|
-
sequence_number:
|
|
2892
|
-
error:
|
|
2893
|
-
type:
|
|
2894
|
-
code:
|
|
2895
|
-
message:
|
|
2896
|
-
param:
|
|
3001
|
+
z18.object({
|
|
3002
|
+
type: z18.literal("error"),
|
|
3003
|
+
sequence_number: z18.number(),
|
|
3004
|
+
error: z18.object({
|
|
3005
|
+
type: z18.string(),
|
|
3006
|
+
code: z18.string(),
|
|
3007
|
+
message: z18.string(),
|
|
3008
|
+
param: z18.string().nullish()
|
|
2897
3009
|
})
|
|
2898
3010
|
}),
|
|
2899
|
-
|
|
3011
|
+
z18.object({ type: z18.string() }).loose().transform((value) => ({
|
|
2900
3012
|
type: "unknown_chunk",
|
|
2901
3013
|
message: value.type
|
|
2902
3014
|
}))
|
|
@@ -2904,236 +3016,258 @@ var openaiResponsesChunkSchema = lazySchema15(
|
|
|
2904
3016
|
])
|
|
2905
3017
|
)
|
|
2906
3018
|
);
|
|
2907
|
-
var openaiResponsesResponseSchema =
|
|
2908
|
-
() =>
|
|
2909
|
-
|
|
2910
|
-
id:
|
|
2911
|
-
created_at:
|
|
2912
|
-
error:
|
|
2913
|
-
message:
|
|
2914
|
-
type:
|
|
2915
|
-
param:
|
|
2916
|
-
code:
|
|
3019
|
+
var openaiResponsesResponseSchema = lazySchema16(
|
|
3020
|
+
() => zodSchema16(
|
|
3021
|
+
z18.object({
|
|
3022
|
+
id: z18.string().optional(),
|
|
3023
|
+
created_at: z18.number().optional(),
|
|
3024
|
+
error: z18.object({
|
|
3025
|
+
message: z18.string(),
|
|
3026
|
+
type: z18.string(),
|
|
3027
|
+
param: z18.string().nullish(),
|
|
3028
|
+
code: z18.string()
|
|
2917
3029
|
}).nullish(),
|
|
2918
|
-
model:
|
|
2919
|
-
output:
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
type:
|
|
2923
|
-
role:
|
|
2924
|
-
id:
|
|
2925
|
-
content:
|
|
2926
|
-
|
|
2927
|
-
type:
|
|
2928
|
-
text:
|
|
2929
|
-
logprobs:
|
|
2930
|
-
|
|
2931
|
-
token:
|
|
2932
|
-
logprob:
|
|
2933
|
-
top_logprobs:
|
|
2934
|
-
|
|
2935
|
-
token:
|
|
2936
|
-
logprob:
|
|
3030
|
+
model: z18.string().optional(),
|
|
3031
|
+
output: z18.array(
|
|
3032
|
+
z18.discriminatedUnion("type", [
|
|
3033
|
+
z18.object({
|
|
3034
|
+
type: z18.literal("message"),
|
|
3035
|
+
role: z18.literal("assistant"),
|
|
3036
|
+
id: z18.string(),
|
|
3037
|
+
content: z18.array(
|
|
3038
|
+
z18.object({
|
|
3039
|
+
type: z18.literal("output_text"),
|
|
3040
|
+
text: z18.string(),
|
|
3041
|
+
logprobs: z18.array(
|
|
3042
|
+
z18.object({
|
|
3043
|
+
token: z18.string(),
|
|
3044
|
+
logprob: z18.number(),
|
|
3045
|
+
top_logprobs: z18.array(
|
|
3046
|
+
z18.object({
|
|
3047
|
+
token: z18.string(),
|
|
3048
|
+
logprob: z18.number()
|
|
2937
3049
|
})
|
|
2938
3050
|
)
|
|
2939
3051
|
})
|
|
2940
3052
|
).nullish(),
|
|
2941
|
-
annotations:
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
type:
|
|
2945
|
-
start_index:
|
|
2946
|
-
end_index:
|
|
2947
|
-
url:
|
|
2948
|
-
title:
|
|
3053
|
+
annotations: z18.array(
|
|
3054
|
+
z18.discriminatedUnion("type", [
|
|
3055
|
+
z18.object({
|
|
3056
|
+
type: z18.literal("url_citation"),
|
|
3057
|
+
start_index: z18.number(),
|
|
3058
|
+
end_index: z18.number(),
|
|
3059
|
+
url: z18.string(),
|
|
3060
|
+
title: z18.string()
|
|
2949
3061
|
}),
|
|
2950
|
-
|
|
2951
|
-
type:
|
|
2952
|
-
file_id:
|
|
2953
|
-
filename:
|
|
2954
|
-
index:
|
|
2955
|
-
start_index:
|
|
2956
|
-
end_index:
|
|
2957
|
-
quote:
|
|
3062
|
+
z18.object({
|
|
3063
|
+
type: z18.literal("file_citation"),
|
|
3064
|
+
file_id: z18.string(),
|
|
3065
|
+
filename: z18.string().nullish(),
|
|
3066
|
+
index: z18.number().nullish(),
|
|
3067
|
+
start_index: z18.number().nullish(),
|
|
3068
|
+
end_index: z18.number().nullish(),
|
|
3069
|
+
quote: z18.string().nullish()
|
|
2958
3070
|
}),
|
|
2959
|
-
|
|
2960
|
-
type:
|
|
2961
|
-
container_id:
|
|
2962
|
-
file_id:
|
|
2963
|
-
filename:
|
|
2964
|
-
start_index:
|
|
2965
|
-
end_index:
|
|
2966
|
-
index:
|
|
3071
|
+
z18.object({
|
|
3072
|
+
type: z18.literal("container_file_citation"),
|
|
3073
|
+
container_id: z18.string(),
|
|
3074
|
+
file_id: z18.string(),
|
|
3075
|
+
filename: z18.string().nullish(),
|
|
3076
|
+
start_index: z18.number().nullish(),
|
|
3077
|
+
end_index: z18.number().nullish(),
|
|
3078
|
+
index: z18.number().nullish()
|
|
2967
3079
|
}),
|
|
2968
|
-
|
|
2969
|
-
type:
|
|
2970
|
-
file_id:
|
|
2971
|
-
index:
|
|
3080
|
+
z18.object({
|
|
3081
|
+
type: z18.literal("file_path"),
|
|
3082
|
+
file_id: z18.string(),
|
|
3083
|
+
index: z18.number().nullish()
|
|
2972
3084
|
})
|
|
2973
3085
|
])
|
|
2974
3086
|
)
|
|
2975
3087
|
})
|
|
2976
3088
|
)
|
|
2977
3089
|
}),
|
|
2978
|
-
|
|
2979
|
-
type:
|
|
2980
|
-
id:
|
|
2981
|
-
status:
|
|
2982
|
-
action:
|
|
2983
|
-
|
|
2984
|
-
type:
|
|
2985
|
-
query:
|
|
2986
|
-
sources:
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
3090
|
+
z18.object({
|
|
3091
|
+
type: z18.literal("web_search_call"),
|
|
3092
|
+
id: z18.string(),
|
|
3093
|
+
status: z18.string(),
|
|
3094
|
+
action: z18.discriminatedUnion("type", [
|
|
3095
|
+
z18.object({
|
|
3096
|
+
type: z18.literal("search"),
|
|
3097
|
+
query: z18.string().nullish(),
|
|
3098
|
+
sources: z18.array(
|
|
3099
|
+
z18.discriminatedUnion("type", [
|
|
3100
|
+
z18.object({ type: z18.literal("url"), url: z18.string() }),
|
|
3101
|
+
z18.object({ type: z18.literal("api"), name: z18.string() })
|
|
2990
3102
|
])
|
|
2991
3103
|
).nullish()
|
|
2992
3104
|
}),
|
|
2993
|
-
|
|
2994
|
-
type:
|
|
2995
|
-
url:
|
|
3105
|
+
z18.object({
|
|
3106
|
+
type: z18.literal("open_page"),
|
|
3107
|
+
url: z18.string()
|
|
2996
3108
|
}),
|
|
2997
|
-
|
|
2998
|
-
type:
|
|
2999
|
-
url:
|
|
3000
|
-
pattern:
|
|
3109
|
+
z18.object({
|
|
3110
|
+
type: z18.literal("find"),
|
|
3111
|
+
url: z18.string(),
|
|
3112
|
+
pattern: z18.string()
|
|
3001
3113
|
})
|
|
3002
3114
|
])
|
|
3003
3115
|
}),
|
|
3004
|
-
|
|
3005
|
-
type:
|
|
3006
|
-
id:
|
|
3007
|
-
queries:
|
|
3008
|
-
results:
|
|
3009
|
-
|
|
3010
|
-
attributes:
|
|
3011
|
-
|
|
3012
|
-
|
|
3116
|
+
z18.object({
|
|
3117
|
+
type: z18.literal("file_search_call"),
|
|
3118
|
+
id: z18.string(),
|
|
3119
|
+
queries: z18.array(z18.string()),
|
|
3120
|
+
results: z18.array(
|
|
3121
|
+
z18.object({
|
|
3122
|
+
attributes: z18.record(
|
|
3123
|
+
z18.string(),
|
|
3124
|
+
z18.union([z18.string(), z18.number(), z18.boolean()])
|
|
3013
3125
|
),
|
|
3014
|
-
file_id:
|
|
3015
|
-
filename:
|
|
3016
|
-
score:
|
|
3017
|
-
text:
|
|
3126
|
+
file_id: z18.string(),
|
|
3127
|
+
filename: z18.string(),
|
|
3128
|
+
score: z18.number(),
|
|
3129
|
+
text: z18.string()
|
|
3018
3130
|
})
|
|
3019
3131
|
).nullish()
|
|
3020
3132
|
}),
|
|
3021
|
-
|
|
3022
|
-
type:
|
|
3023
|
-
id:
|
|
3024
|
-
code:
|
|
3025
|
-
container_id:
|
|
3026
|
-
outputs:
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3133
|
+
z18.object({
|
|
3134
|
+
type: z18.literal("code_interpreter_call"),
|
|
3135
|
+
id: z18.string(),
|
|
3136
|
+
code: z18.string().nullable(),
|
|
3137
|
+
container_id: z18.string(),
|
|
3138
|
+
outputs: z18.array(
|
|
3139
|
+
z18.discriminatedUnion("type", [
|
|
3140
|
+
z18.object({ type: z18.literal("logs"), logs: z18.string() }),
|
|
3141
|
+
z18.object({ type: z18.literal("image"), url: z18.string() })
|
|
3030
3142
|
])
|
|
3031
3143
|
).nullable()
|
|
3032
3144
|
}),
|
|
3033
|
-
|
|
3034
|
-
type:
|
|
3035
|
-
id:
|
|
3036
|
-
result:
|
|
3145
|
+
z18.object({
|
|
3146
|
+
type: z18.literal("image_generation_call"),
|
|
3147
|
+
id: z18.string(),
|
|
3148
|
+
result: z18.string()
|
|
3037
3149
|
}),
|
|
3038
|
-
|
|
3039
|
-
type:
|
|
3040
|
-
id:
|
|
3041
|
-
call_id:
|
|
3042
|
-
action:
|
|
3043
|
-
type:
|
|
3044
|
-
command:
|
|
3045
|
-
timeout_ms:
|
|
3046
|
-
user:
|
|
3047
|
-
working_directory:
|
|
3048
|
-
env:
|
|
3150
|
+
z18.object({
|
|
3151
|
+
type: z18.literal("local_shell_call"),
|
|
3152
|
+
id: z18.string(),
|
|
3153
|
+
call_id: z18.string(),
|
|
3154
|
+
action: z18.object({
|
|
3155
|
+
type: z18.literal("exec"),
|
|
3156
|
+
command: z18.array(z18.string()),
|
|
3157
|
+
timeout_ms: z18.number().optional(),
|
|
3158
|
+
user: z18.string().optional(),
|
|
3159
|
+
working_directory: z18.string().optional(),
|
|
3160
|
+
env: z18.record(z18.string(), z18.string()).optional()
|
|
3049
3161
|
})
|
|
3050
3162
|
}),
|
|
3051
|
-
|
|
3052
|
-
type:
|
|
3053
|
-
call_id:
|
|
3054
|
-
name:
|
|
3055
|
-
arguments:
|
|
3056
|
-
id:
|
|
3163
|
+
z18.object({
|
|
3164
|
+
type: z18.literal("function_call"),
|
|
3165
|
+
call_id: z18.string(),
|
|
3166
|
+
name: z18.string(),
|
|
3167
|
+
arguments: z18.string(),
|
|
3168
|
+
id: z18.string()
|
|
3057
3169
|
}),
|
|
3058
|
-
|
|
3059
|
-
type:
|
|
3060
|
-
id:
|
|
3061
|
-
status:
|
|
3170
|
+
z18.object({
|
|
3171
|
+
type: z18.literal("computer_call"),
|
|
3172
|
+
id: z18.string(),
|
|
3173
|
+
status: z18.string().optional()
|
|
3062
3174
|
}),
|
|
3063
|
-
|
|
3064
|
-
type:
|
|
3065
|
-
id:
|
|
3066
|
-
encrypted_content:
|
|
3067
|
-
summary:
|
|
3068
|
-
|
|
3069
|
-
type:
|
|
3070
|
-
text:
|
|
3175
|
+
z18.object({
|
|
3176
|
+
type: z18.literal("reasoning"),
|
|
3177
|
+
id: z18.string(),
|
|
3178
|
+
encrypted_content: z18.string().nullish(),
|
|
3179
|
+
summary: z18.array(
|
|
3180
|
+
z18.object({
|
|
3181
|
+
type: z18.literal("summary_text"),
|
|
3182
|
+
text: z18.string()
|
|
3071
3183
|
})
|
|
3072
3184
|
)
|
|
3073
3185
|
}),
|
|
3074
|
-
|
|
3075
|
-
type:
|
|
3076
|
-
id:
|
|
3077
|
-
status:
|
|
3078
|
-
arguments:
|
|
3079
|
-
name:
|
|
3080
|
-
server_label:
|
|
3081
|
-
output:
|
|
3082
|
-
error:
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
type:
|
|
3086
|
-
code:
|
|
3087
|
-
message:
|
|
3186
|
+
z18.object({
|
|
3187
|
+
type: z18.literal("mcp_call"),
|
|
3188
|
+
id: z18.string(),
|
|
3189
|
+
status: z18.string(),
|
|
3190
|
+
arguments: z18.string(),
|
|
3191
|
+
name: z18.string(),
|
|
3192
|
+
server_label: z18.string(),
|
|
3193
|
+
output: z18.string().nullish(),
|
|
3194
|
+
error: z18.union([
|
|
3195
|
+
z18.string(),
|
|
3196
|
+
z18.object({
|
|
3197
|
+
type: z18.string().optional(),
|
|
3198
|
+
code: z18.union([z18.number(), z18.string()]).optional(),
|
|
3199
|
+
message: z18.string().optional()
|
|
3088
3200
|
}).loose()
|
|
3089
3201
|
]).nullish()
|
|
3090
3202
|
}),
|
|
3091
|
-
|
|
3092
|
-
type:
|
|
3093
|
-
id:
|
|
3094
|
-
server_label:
|
|
3095
|
-
tools:
|
|
3096
|
-
|
|
3097
|
-
name:
|
|
3098
|
-
description:
|
|
3099
|
-
input_schema:
|
|
3100
|
-
annotations:
|
|
3203
|
+
z18.object({
|
|
3204
|
+
type: z18.literal("mcp_list_tools"),
|
|
3205
|
+
id: z18.string(),
|
|
3206
|
+
server_label: z18.string(),
|
|
3207
|
+
tools: z18.array(
|
|
3208
|
+
z18.object({
|
|
3209
|
+
name: z18.string(),
|
|
3210
|
+
description: z18.string().optional(),
|
|
3211
|
+
input_schema: z18.any(),
|
|
3212
|
+
annotations: z18.record(z18.string(), z18.unknown()).optional()
|
|
3101
3213
|
})
|
|
3102
3214
|
),
|
|
3103
|
-
error:
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
type:
|
|
3107
|
-
code:
|
|
3108
|
-
message:
|
|
3215
|
+
error: z18.union([
|
|
3216
|
+
z18.string(),
|
|
3217
|
+
z18.object({
|
|
3218
|
+
type: z18.string().optional(),
|
|
3219
|
+
code: z18.union([z18.number(), z18.string()]).optional(),
|
|
3220
|
+
message: z18.string().optional()
|
|
3109
3221
|
}).loose()
|
|
3110
3222
|
]).optional()
|
|
3111
3223
|
}),
|
|
3112
|
-
|
|
3113
|
-
type:
|
|
3114
|
-
id:
|
|
3115
|
-
server_label:
|
|
3116
|
-
name:
|
|
3117
|
-
arguments:
|
|
3118
|
-
approval_request_id:
|
|
3224
|
+
z18.object({
|
|
3225
|
+
type: z18.literal("mcp_approval_request"),
|
|
3226
|
+
id: z18.string(),
|
|
3227
|
+
server_label: z18.string(),
|
|
3228
|
+
name: z18.string(),
|
|
3229
|
+
arguments: z18.string(),
|
|
3230
|
+
approval_request_id: z18.string()
|
|
3231
|
+
}),
|
|
3232
|
+
z18.object({
|
|
3233
|
+
type: z18.literal("apply_patch_call"),
|
|
3234
|
+
id: z18.string(),
|
|
3235
|
+
call_id: z18.string(),
|
|
3236
|
+
status: z18.enum(["in_progress", "completed"]),
|
|
3237
|
+
operation: z18.discriminatedUnion("type", [
|
|
3238
|
+
z18.object({
|
|
3239
|
+
type: z18.literal("create_file"),
|
|
3240
|
+
path: z18.string(),
|
|
3241
|
+
diff: z18.string()
|
|
3242
|
+
}),
|
|
3243
|
+
z18.object({
|
|
3244
|
+
type: z18.literal("delete_file"),
|
|
3245
|
+
path: z18.string()
|
|
3246
|
+
}),
|
|
3247
|
+
z18.object({
|
|
3248
|
+
type: z18.literal("update_file"),
|
|
3249
|
+
path: z18.string(),
|
|
3250
|
+
diff: z18.string()
|
|
3251
|
+
})
|
|
3252
|
+
])
|
|
3119
3253
|
})
|
|
3120
3254
|
])
|
|
3121
3255
|
).optional(),
|
|
3122
|
-
service_tier:
|
|
3123
|
-
incomplete_details:
|
|
3124
|
-
usage:
|
|
3125
|
-
input_tokens:
|
|
3126
|
-
input_tokens_details:
|
|
3127
|
-
output_tokens:
|
|
3128
|
-
output_tokens_details:
|
|
3256
|
+
service_tier: z18.string().nullish(),
|
|
3257
|
+
incomplete_details: z18.object({ reason: z18.string() }).nullish(),
|
|
3258
|
+
usage: z18.object({
|
|
3259
|
+
input_tokens: z18.number(),
|
|
3260
|
+
input_tokens_details: z18.object({ cached_tokens: z18.number().nullish() }).nullish(),
|
|
3261
|
+
output_tokens: z18.number(),
|
|
3262
|
+
output_tokens_details: z18.object({ reasoning_tokens: z18.number().nullish() }).nullish()
|
|
3129
3263
|
}).optional()
|
|
3130
3264
|
})
|
|
3131
3265
|
)
|
|
3132
3266
|
);
|
|
3133
3267
|
|
|
3134
3268
|
// src/responses/openai-responses-options.ts
|
|
3135
|
-
import { lazySchema as
|
|
3136
|
-
import { z as
|
|
3269
|
+
import { lazySchema as lazySchema17, zodSchema as zodSchema17 } from "@ai-sdk/provider-utils";
|
|
3270
|
+
import { z as z19 } from "zod/v4";
|
|
3137
3271
|
var TOP_LOGPROBS_MAX = 20;
|
|
3138
3272
|
var openaiResponsesReasoningModelIds = [
|
|
3139
3273
|
"o1",
|
|
@@ -3200,19 +3334,19 @@ var openaiResponsesModelIds = [
|
|
|
3200
3334
|
"gpt-5-chat-latest",
|
|
3201
3335
|
...openaiResponsesReasoningModelIds
|
|
3202
3336
|
];
|
|
3203
|
-
var openaiResponsesProviderOptionsSchema =
|
|
3204
|
-
() =>
|
|
3205
|
-
|
|
3206
|
-
conversation:
|
|
3207
|
-
include:
|
|
3208
|
-
|
|
3337
|
+
var openaiResponsesProviderOptionsSchema = lazySchema17(
|
|
3338
|
+
() => zodSchema17(
|
|
3339
|
+
z19.object({
|
|
3340
|
+
conversation: z19.string().nullish(),
|
|
3341
|
+
include: z19.array(
|
|
3342
|
+
z19.enum([
|
|
3209
3343
|
"reasoning.encrypted_content",
|
|
3210
3344
|
// handled internally by default, only needed for unknown reasoning models
|
|
3211
3345
|
"file_search_call.results",
|
|
3212
3346
|
"message.output_text.logprobs"
|
|
3213
3347
|
])
|
|
3214
3348
|
).nullish(),
|
|
3215
|
-
instructions:
|
|
3349
|
+
instructions: z19.string().nullish(),
|
|
3216
3350
|
/**
|
|
3217
3351
|
* Return the log probabilities of the tokens.
|
|
3218
3352
|
*
|
|
@@ -3225,17 +3359,17 @@ var openaiResponsesProviderOptionsSchema = lazySchema16(
|
|
|
3225
3359
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
3226
3360
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
3227
3361
|
*/
|
|
3228
|
-
logprobs:
|
|
3362
|
+
logprobs: z19.union([z19.boolean(), z19.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
3229
3363
|
/**
|
|
3230
3364
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
3231
3365
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
3232
3366
|
* Any further attempts to call a tool by the model will be ignored.
|
|
3233
3367
|
*/
|
|
3234
|
-
maxToolCalls:
|
|
3235
|
-
metadata:
|
|
3236
|
-
parallelToolCalls:
|
|
3237
|
-
previousResponseId:
|
|
3238
|
-
promptCacheKey:
|
|
3368
|
+
maxToolCalls: z19.number().nullish(),
|
|
3369
|
+
metadata: z19.any().nullish(),
|
|
3370
|
+
parallelToolCalls: z19.boolean().nullish(),
|
|
3371
|
+
previousResponseId: z19.string().nullish(),
|
|
3372
|
+
promptCacheKey: z19.string().nullish(),
|
|
3239
3373
|
/**
|
|
3240
3374
|
* The retention policy for the prompt cache.
|
|
3241
3375
|
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
@@ -3244,16 +3378,16 @@ var openaiResponsesProviderOptionsSchema = lazySchema16(
|
|
|
3244
3378
|
*
|
|
3245
3379
|
* @default 'in_memory'
|
|
3246
3380
|
*/
|
|
3247
|
-
promptCacheRetention:
|
|
3248
|
-
reasoningEffort:
|
|
3249
|
-
reasoningSummary:
|
|
3250
|
-
safetyIdentifier:
|
|
3251
|
-
serviceTier:
|
|
3252
|
-
store:
|
|
3253
|
-
strictJsonSchema:
|
|
3254
|
-
textVerbosity:
|
|
3255
|
-
truncation:
|
|
3256
|
-
user:
|
|
3381
|
+
promptCacheRetention: z19.enum(["in_memory", "24h"]).nullish(),
|
|
3382
|
+
reasoningEffort: z19.string().nullish(),
|
|
3383
|
+
reasoningSummary: z19.string().nullish(),
|
|
3384
|
+
safetyIdentifier: z19.string().nullish(),
|
|
3385
|
+
serviceTier: z19.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
3386
|
+
store: z19.boolean().nullish(),
|
|
3387
|
+
strictJsonSchema: z19.boolean().nullish(),
|
|
3388
|
+
textVerbosity: z19.enum(["low", "medium", "high"]).nullish(),
|
|
3389
|
+
truncation: z19.enum(["auto", "disabled"]).nullish(),
|
|
3390
|
+
user: z19.string().nullish()
|
|
3257
3391
|
})
|
|
3258
3392
|
)
|
|
3259
3393
|
);
|
|
@@ -3310,6 +3444,12 @@ async function prepareResponsesTools({
|
|
|
3310
3444
|
});
|
|
3311
3445
|
break;
|
|
3312
3446
|
}
|
|
3447
|
+
case "openai.apply_patch": {
|
|
3448
|
+
openaiTools2.push({
|
|
3449
|
+
type: "apply_patch"
|
|
3450
|
+
});
|
|
3451
|
+
break;
|
|
3452
|
+
}
|
|
3313
3453
|
case "openai.web_search_preview": {
|
|
3314
3454
|
const args = await validateTypes2({
|
|
3315
3455
|
value: tool.args,
|
|
@@ -3414,7 +3554,7 @@ async function prepareResponsesTools({
|
|
|
3414
3554
|
case "tool":
|
|
3415
3555
|
return {
|
|
3416
3556
|
tools: openaiTools2,
|
|
3417
|
-
toolChoice: toolChoice.toolName === "code_interpreter" || toolChoice.toolName === "file_search" || toolChoice.toolName === "image_generation" || toolChoice.toolName === "web_search_preview" || toolChoice.toolName === "web_search" || toolChoice.toolName === "mcp" ? { type: toolChoice.toolName } : { type: "function", name: toolChoice.toolName },
|
|
3557
|
+
toolChoice: toolChoice.toolName === "code_interpreter" || toolChoice.toolName === "file_search" || toolChoice.toolName === "image_generation" || toolChoice.toolName === "web_search_preview" || toolChoice.toolName === "web_search" || toolChoice.toolName === "mcp" || toolChoice.toolName === "apply_patch" ? { type: toolChoice.toolName } : { type: "function", name: toolChoice.toolName },
|
|
3418
3558
|
toolWarnings
|
|
3419
3559
|
};
|
|
3420
3560
|
default: {
|
|
@@ -3494,7 +3634,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3494
3634
|
"openai.local_shell": "local_shell",
|
|
3495
3635
|
"openai.web_search": "web_search",
|
|
3496
3636
|
"openai.web_search_preview": "web_search_preview",
|
|
3497
|
-
"openai.mcp": "mcp"
|
|
3637
|
+
"openai.mcp": "mcp",
|
|
3638
|
+
"openai.apply_patch": "apply_patch"
|
|
3498
3639
|
}
|
|
3499
3640
|
});
|
|
3500
3641
|
const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({
|
|
@@ -3503,7 +3644,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3503
3644
|
systemMessageMode: modelConfig.systemMessageMode,
|
|
3504
3645
|
fileIdPrefixes: this.config.fileIdPrefixes,
|
|
3505
3646
|
store: (_a = openaiOptions == null ? void 0 : openaiOptions.store) != null ? _a : true,
|
|
3506
|
-
hasLocalShellTool: hasOpenAITool("openai.local_shell")
|
|
3647
|
+
hasLocalShellTool: hasOpenAITool("openai.local_shell"),
|
|
3648
|
+
hasApplyPatchTool: hasOpenAITool("openai.apply_patch")
|
|
3507
3649
|
});
|
|
3508
3650
|
warnings.push(...inputWarnings);
|
|
3509
3651
|
const strictJsonSchema = (_b = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _b : false;
|
|
@@ -4004,6 +4146,23 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4004
4146
|
});
|
|
4005
4147
|
break;
|
|
4006
4148
|
}
|
|
4149
|
+
case "apply_patch_call": {
|
|
4150
|
+
content.push({
|
|
4151
|
+
type: "tool-call",
|
|
4152
|
+
toolCallId: part.call_id,
|
|
4153
|
+
toolName: toolNameMapping.toCustomToolName("apply_patch"),
|
|
4154
|
+
input: JSON.stringify({
|
|
4155
|
+
callId: part.call_id,
|
|
4156
|
+
operation: part.operation
|
|
4157
|
+
}),
|
|
4158
|
+
providerMetadata: {
|
|
4159
|
+
[providerKey]: {
|
|
4160
|
+
itemId: part.id
|
|
4161
|
+
}
|
|
4162
|
+
}
|
|
4163
|
+
});
|
|
4164
|
+
break;
|
|
4165
|
+
}
|
|
4007
4166
|
}
|
|
4008
4167
|
}
|
|
4009
4168
|
const providerMetadata = {
|
|
@@ -4191,6 +4350,27 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4191
4350
|
input: "{}",
|
|
4192
4351
|
providerExecuted: true
|
|
4193
4352
|
});
|
|
4353
|
+
} else if (value.item.type === "apply_patch_call") {
|
|
4354
|
+
ongoingToolCalls[value.output_index] = {
|
|
4355
|
+
toolName: toolNameMapping.toCustomToolName("apply_patch"),
|
|
4356
|
+
toolCallId: value.item.call_id
|
|
4357
|
+
};
|
|
4358
|
+
if (value.item.status === "completed") {
|
|
4359
|
+
controller.enqueue({
|
|
4360
|
+
type: "tool-call",
|
|
4361
|
+
toolCallId: value.item.call_id,
|
|
4362
|
+
toolName: toolNameMapping.toCustomToolName("apply_patch"),
|
|
4363
|
+
input: JSON.stringify({
|
|
4364
|
+
callId: value.item.call_id,
|
|
4365
|
+
operation: value.item.operation
|
|
4366
|
+
}),
|
|
4367
|
+
providerMetadata: {
|
|
4368
|
+
[providerKey]: {
|
|
4369
|
+
itemId: value.item.id
|
|
4370
|
+
}
|
|
4371
|
+
}
|
|
4372
|
+
});
|
|
4373
|
+
}
|
|
4194
4374
|
} else if (value.item.type === "message") {
|
|
4195
4375
|
ongoingAnnotations.splice(0, ongoingAnnotations.length);
|
|
4196
4376
|
controller.enqueue({
|
|
@@ -4354,6 +4534,24 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4354
4534
|
...value.item.error != null ? { error: value.item.error } : {}
|
|
4355
4535
|
}
|
|
4356
4536
|
});
|
|
4537
|
+
} else if (value.item.type === "apply_patch_call") {
|
|
4538
|
+
ongoingToolCalls[value.output_index] = void 0;
|
|
4539
|
+
if (value.item.status === "completed") {
|
|
4540
|
+
controller.enqueue({
|
|
4541
|
+
type: "tool-call",
|
|
4542
|
+
toolCallId: value.item.call_id,
|
|
4543
|
+
toolName: toolNameMapping.toCustomToolName("apply_patch"),
|
|
4544
|
+
input: JSON.stringify({
|
|
4545
|
+
callId: value.item.call_id,
|
|
4546
|
+
operation: value.item.operation
|
|
4547
|
+
}),
|
|
4548
|
+
providerMetadata: {
|
|
4549
|
+
[providerKey]: {
|
|
4550
|
+
itemId: value.item.id
|
|
4551
|
+
}
|
|
4552
|
+
}
|
|
4553
|
+
});
|
|
4554
|
+
}
|
|
4357
4555
|
} else if (value.item.type === "mcp_approval_request") {
|
|
4358
4556
|
ongoingToolCalls[value.output_index] = void 0;
|
|
4359
4557
|
controller.enqueue({
|
|
@@ -4705,13 +4903,13 @@ import {
|
|
|
4705
4903
|
} from "@ai-sdk/provider-utils";
|
|
4706
4904
|
|
|
4707
4905
|
// src/speech/openai-speech-options.ts
|
|
4708
|
-
import { lazySchema as
|
|
4709
|
-
import { z as
|
|
4710
|
-
var openaiSpeechProviderOptionsSchema =
|
|
4711
|
-
() =>
|
|
4712
|
-
|
|
4713
|
-
instructions:
|
|
4714
|
-
speed:
|
|
4906
|
+
import { lazySchema as lazySchema18, zodSchema as zodSchema18 } from "@ai-sdk/provider-utils";
|
|
4907
|
+
import { z as z20 } from "zod/v4";
|
|
4908
|
+
var openaiSpeechProviderOptionsSchema = lazySchema18(
|
|
4909
|
+
() => zodSchema18(
|
|
4910
|
+
z20.object({
|
|
4911
|
+
instructions: z20.string().nullish(),
|
|
4912
|
+
speed: z20.number().min(0.25).max(4).default(1).nullish()
|
|
4715
4913
|
})
|
|
4716
4914
|
)
|
|
4717
4915
|
);
|
|
@@ -4828,33 +5026,33 @@ import {
|
|
|
4828
5026
|
} from "@ai-sdk/provider-utils";
|
|
4829
5027
|
|
|
4830
5028
|
// src/transcription/openai-transcription-api.ts
|
|
4831
|
-
import { lazySchema as
|
|
4832
|
-
import { z as
|
|
4833
|
-
var openaiTranscriptionResponseSchema =
|
|
4834
|
-
() =>
|
|
4835
|
-
|
|
4836
|
-
text:
|
|
4837
|
-
language:
|
|
4838
|
-
duration:
|
|
4839
|
-
words:
|
|
4840
|
-
|
|
4841
|
-
word:
|
|
4842
|
-
start:
|
|
4843
|
-
end:
|
|
5029
|
+
import { lazySchema as lazySchema19, zodSchema as zodSchema19 } from "@ai-sdk/provider-utils";
|
|
5030
|
+
import { z as z21 } from "zod/v4";
|
|
5031
|
+
var openaiTranscriptionResponseSchema = lazySchema19(
|
|
5032
|
+
() => zodSchema19(
|
|
5033
|
+
z21.object({
|
|
5034
|
+
text: z21.string(),
|
|
5035
|
+
language: z21.string().nullish(),
|
|
5036
|
+
duration: z21.number().nullish(),
|
|
5037
|
+
words: z21.array(
|
|
5038
|
+
z21.object({
|
|
5039
|
+
word: z21.string(),
|
|
5040
|
+
start: z21.number(),
|
|
5041
|
+
end: z21.number()
|
|
4844
5042
|
})
|
|
4845
5043
|
).nullish(),
|
|
4846
|
-
segments:
|
|
4847
|
-
|
|
4848
|
-
id:
|
|
4849
|
-
seek:
|
|
4850
|
-
start:
|
|
4851
|
-
end:
|
|
4852
|
-
text:
|
|
4853
|
-
tokens:
|
|
4854
|
-
temperature:
|
|
4855
|
-
avg_logprob:
|
|
4856
|
-
compression_ratio:
|
|
4857
|
-
no_speech_prob:
|
|
5044
|
+
segments: z21.array(
|
|
5045
|
+
z21.object({
|
|
5046
|
+
id: z21.number(),
|
|
5047
|
+
seek: z21.number(),
|
|
5048
|
+
start: z21.number(),
|
|
5049
|
+
end: z21.number(),
|
|
5050
|
+
text: z21.string(),
|
|
5051
|
+
tokens: z21.array(z21.number()),
|
|
5052
|
+
temperature: z21.number(),
|
|
5053
|
+
avg_logprob: z21.number(),
|
|
5054
|
+
compression_ratio: z21.number(),
|
|
5055
|
+
no_speech_prob: z21.number()
|
|
4858
5056
|
})
|
|
4859
5057
|
).nullish()
|
|
4860
5058
|
})
|
|
@@ -4862,33 +5060,33 @@ var openaiTranscriptionResponseSchema = lazySchema18(
|
|
|
4862
5060
|
);
|
|
4863
5061
|
|
|
4864
5062
|
// src/transcription/openai-transcription-options.ts
|
|
4865
|
-
import { lazySchema as
|
|
4866
|
-
import { z as
|
|
4867
|
-
var openAITranscriptionProviderOptions =
|
|
4868
|
-
() =>
|
|
4869
|
-
|
|
5063
|
+
import { lazySchema as lazySchema20, zodSchema as zodSchema20 } from "@ai-sdk/provider-utils";
|
|
5064
|
+
import { z as z22 } from "zod/v4";
|
|
5065
|
+
var openAITranscriptionProviderOptions = lazySchema20(
|
|
5066
|
+
() => zodSchema20(
|
|
5067
|
+
z22.object({
|
|
4870
5068
|
/**
|
|
4871
5069
|
* Additional information to include in the transcription response.
|
|
4872
5070
|
*/
|
|
4873
|
-
include:
|
|
5071
|
+
include: z22.array(z22.string()).optional(),
|
|
4874
5072
|
/**
|
|
4875
5073
|
* The language of the input audio in ISO-639-1 format.
|
|
4876
5074
|
*/
|
|
4877
|
-
language:
|
|
5075
|
+
language: z22.string().optional(),
|
|
4878
5076
|
/**
|
|
4879
5077
|
* An optional text to guide the model's style or continue a previous audio segment.
|
|
4880
5078
|
*/
|
|
4881
|
-
prompt:
|
|
5079
|
+
prompt: z22.string().optional(),
|
|
4882
5080
|
/**
|
|
4883
5081
|
* The sampling temperature, between 0 and 1.
|
|
4884
5082
|
* @default 0
|
|
4885
5083
|
*/
|
|
4886
|
-
temperature:
|
|
5084
|
+
temperature: z22.number().min(0).max(1).default(0).optional(),
|
|
4887
5085
|
/**
|
|
4888
5086
|
* The timestamp granularities to populate for this transcription.
|
|
4889
5087
|
* @default ['segment']
|
|
4890
5088
|
*/
|
|
4891
|
-
timestampGranularities:
|
|
5089
|
+
timestampGranularities: z22.array(z22.enum(["word", "segment"])).default(["segment"]).optional()
|
|
4892
5090
|
})
|
|
4893
5091
|
)
|
|
4894
5092
|
);
|
|
@@ -5061,7 +5259,7 @@ var OpenAITranscriptionModel = class {
|
|
|
5061
5259
|
};
|
|
5062
5260
|
|
|
5063
5261
|
// src/version.ts
|
|
5064
|
-
var VERSION = true ? "3.0.0-beta.
|
|
5262
|
+
var VERSION = true ? "3.0.0-beta.74" : "0.0.0-test";
|
|
5065
5263
|
|
|
5066
5264
|
// src/openai-provider.ts
|
|
5067
5265
|
function createOpenAI(options = {}) {
|