@ai-sdk/openai 4.0.53 → 4.0.55
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 +16 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +340 -75
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +213 -207
- package/dist/internal/index.js +15 -14
- package/dist/internal/index.js.map +1 -1
- package/package.json +3 -3
- package/src/files/openai-files-api.ts +10 -0
- package/src/files/openai-files.ts +250 -46
- package/src/openai-responses-batch.ts +127 -9
- package/src/responses/openai-responses-api.ts +21 -19
- package/src/responses/openai-responses-language-model.ts +2 -2
package/dist/internal/index.d.ts
CHANGED
|
@@ -903,7 +903,10 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
903
903
|
} | {
|
|
904
904
|
type: "response.completed" | "response.incomplete";
|
|
905
905
|
response: {
|
|
906
|
-
|
|
906
|
+
incomplete_details?: {
|
|
907
|
+
reason: string;
|
|
908
|
+
} | null | undefined;
|
|
909
|
+
usage?: {
|
|
907
910
|
input_tokens: number;
|
|
908
911
|
output_tokens: number;
|
|
909
912
|
input_tokens_details?: {
|
|
@@ -916,9 +919,6 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
916
919
|
reasoning_tokens?: number | null | undefined;
|
|
917
920
|
orchestration_output_tokens?: number | null | undefined;
|
|
918
921
|
} | null | undefined;
|
|
919
|
-
};
|
|
920
|
-
incomplete_details?: {
|
|
921
|
-
reason: string;
|
|
922
922
|
} | null | undefined;
|
|
923
923
|
reasoning?: {
|
|
924
924
|
context?: string | null | undefined;
|
|
@@ -1592,6 +1592,213 @@ type OpenAIResponsesChunk = InferSchema<typeof openaiResponsesChunkSchema>;
|
|
|
1592
1592
|
type OpenAIResponsesLogprobs = NonNullable<(OpenAIResponsesChunk & {
|
|
1593
1593
|
type: 'response.output_text.delta';
|
|
1594
1594
|
})['logprobs']> | null;
|
|
1595
|
+
type OpenAIResponsesWebSearchAction = NonNullable<((OpenAIResponsesChunk & {
|
|
1596
|
+
type: 'response.output_item.done';
|
|
1597
|
+
})['item'] & {
|
|
1598
|
+
type: 'web_search_call';
|
|
1599
|
+
})['action']>;
|
|
1600
|
+
|
|
1601
|
+
declare const webSearchArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1602
|
+
externalWebAccess?: boolean | undefined;
|
|
1603
|
+
filters?: {
|
|
1604
|
+
allowedDomains?: string[] | undefined;
|
|
1605
|
+
blockedDomains?: string[] | undefined;
|
|
1606
|
+
} | undefined;
|
|
1607
|
+
searchContextSize?: "low" | "medium" | "high" | undefined;
|
|
1608
|
+
userLocation?: {
|
|
1609
|
+
type: "approximate";
|
|
1610
|
+
country?: string | undefined;
|
|
1611
|
+
city?: string | undefined;
|
|
1612
|
+
region?: string | undefined;
|
|
1613
|
+
timezone?: string | undefined;
|
|
1614
|
+
} | undefined;
|
|
1615
|
+
}>;
|
|
1616
|
+
declare const webSearchOutputSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1617
|
+
action?: {
|
|
1618
|
+
type: "search";
|
|
1619
|
+
query?: string | undefined;
|
|
1620
|
+
queries?: string[] | undefined;
|
|
1621
|
+
} | {
|
|
1622
|
+
type: "openPage";
|
|
1623
|
+
url?: string | null | undefined;
|
|
1624
|
+
} | {
|
|
1625
|
+
type: "findInPage";
|
|
1626
|
+
url?: string | null | undefined;
|
|
1627
|
+
pattern?: string | null | undefined;
|
|
1628
|
+
} | undefined;
|
|
1629
|
+
sources?: ({
|
|
1630
|
+
type: "url";
|
|
1631
|
+
url: string;
|
|
1632
|
+
} | {
|
|
1633
|
+
type: "api";
|
|
1634
|
+
name: string;
|
|
1635
|
+
})[] | undefined;
|
|
1636
|
+
}>;
|
|
1637
|
+
declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {
|
|
1638
|
+
/**
|
|
1639
|
+
* An object describing the specific action taken in this web search call.
|
|
1640
|
+
* Includes details on how the model used the web (search, open_page, find_in_page).
|
|
1641
|
+
*/
|
|
1642
|
+
action?: {
|
|
1643
|
+
/**
|
|
1644
|
+
* Action type "search" - Performs a web search query.
|
|
1645
|
+
*/
|
|
1646
|
+
type: "search";
|
|
1647
|
+
/**
|
|
1648
|
+
* The search query.
|
|
1649
|
+
*
|
|
1650
|
+
* @deprecated Use `queries` instead.
|
|
1651
|
+
*/
|
|
1652
|
+
query?: string;
|
|
1653
|
+
/**
|
|
1654
|
+
* The search queries the model used.
|
|
1655
|
+
*/
|
|
1656
|
+
queries?: string[];
|
|
1657
|
+
} | {
|
|
1658
|
+
/**
|
|
1659
|
+
* Action type "openPage" - Opens a specific URL from search results.
|
|
1660
|
+
*/
|
|
1661
|
+
type: "openPage";
|
|
1662
|
+
/**
|
|
1663
|
+
* The URL opened by the model.
|
|
1664
|
+
*/
|
|
1665
|
+
url?: string | null;
|
|
1666
|
+
} | {
|
|
1667
|
+
/**
|
|
1668
|
+
* Action type "findInPage": Searches for a pattern within a loaded page.
|
|
1669
|
+
*/
|
|
1670
|
+
type: "findInPage";
|
|
1671
|
+
/**
|
|
1672
|
+
* The URL of the page searched for the pattern.
|
|
1673
|
+
*/
|
|
1674
|
+
url?: string | null;
|
|
1675
|
+
/**
|
|
1676
|
+
* The pattern or text to search for within the page.
|
|
1677
|
+
*/
|
|
1678
|
+
pattern?: string | null;
|
|
1679
|
+
};
|
|
1680
|
+
/**
|
|
1681
|
+
* Optional sources cited by the model for the web search call.
|
|
1682
|
+
*/
|
|
1683
|
+
sources?: Array<{
|
|
1684
|
+
type: "url";
|
|
1685
|
+
url: string;
|
|
1686
|
+
} | {
|
|
1687
|
+
type: "api";
|
|
1688
|
+
name: string;
|
|
1689
|
+
}>;
|
|
1690
|
+
}, {
|
|
1691
|
+
/**
|
|
1692
|
+
* Whether to use external web access for fetching live content.
|
|
1693
|
+
* - true: Fetch live web content (default)
|
|
1694
|
+
* - false: Use cached/indexed results
|
|
1695
|
+
*/
|
|
1696
|
+
externalWebAccess?: boolean;
|
|
1697
|
+
/**
|
|
1698
|
+
* Filters for the search.
|
|
1699
|
+
*/
|
|
1700
|
+
filters?: {
|
|
1701
|
+
/**
|
|
1702
|
+
* Allowed domains for the search.
|
|
1703
|
+
* If not provided, all domains are allowed.
|
|
1704
|
+
* Subdomains of the provided domains are allowed as well.
|
|
1705
|
+
* Omit the HTTP or HTTPS prefix. Maximum 100 domains.
|
|
1706
|
+
*/
|
|
1707
|
+
allowedDomains?: string[];
|
|
1708
|
+
/**
|
|
1709
|
+
* Blocked domains for the search.
|
|
1710
|
+
* Subdomains of the provided domains are blocked as well.
|
|
1711
|
+
* Omit the HTTP or HTTPS prefix. Maximum 100 domains.
|
|
1712
|
+
*/
|
|
1713
|
+
blockedDomains?: string[];
|
|
1714
|
+
};
|
|
1715
|
+
/**
|
|
1716
|
+
* Search context size to use for the web search.
|
|
1717
|
+
* - high: Most comprehensive context, highest cost, slower response
|
|
1718
|
+
* - medium: Balanced context, cost, and latency (default)
|
|
1719
|
+
* - low: Least context, lowest cost, fastest response
|
|
1720
|
+
*/
|
|
1721
|
+
searchContextSize?: "low" | "medium" | "high";
|
|
1722
|
+
/**
|
|
1723
|
+
* User location information to provide geographically relevant search results.
|
|
1724
|
+
*/
|
|
1725
|
+
userLocation?: {
|
|
1726
|
+
/**
|
|
1727
|
+
* Type of location (always 'approximate')
|
|
1728
|
+
*/
|
|
1729
|
+
type: "approximate";
|
|
1730
|
+
/**
|
|
1731
|
+
* Two-letter ISO country code (e.g., 'US', 'GB')
|
|
1732
|
+
*/
|
|
1733
|
+
country?: string;
|
|
1734
|
+
/**
|
|
1735
|
+
* City name (free text, e.g., 'Minneapolis')
|
|
1736
|
+
*/
|
|
1737
|
+
city?: string;
|
|
1738
|
+
/**
|
|
1739
|
+
* Region name (free text, e.g., 'Minnesota')
|
|
1740
|
+
*/
|
|
1741
|
+
region?: string;
|
|
1742
|
+
/**
|
|
1743
|
+
* IANA timezone (e.g., 'America/Chicago')
|
|
1744
|
+
*/
|
|
1745
|
+
timezone?: string;
|
|
1746
|
+
};
|
|
1747
|
+
}, {}>;
|
|
1748
|
+
declare const webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{}, {
|
|
1749
|
+
/**
|
|
1750
|
+
* An object describing the specific action taken in this web search call.
|
|
1751
|
+
* Includes details on how the model used the web (search, open_page, find_in_page).
|
|
1752
|
+
*/
|
|
1753
|
+
action?: {
|
|
1754
|
+
/**
|
|
1755
|
+
* Action type "search" - Performs a web search query.
|
|
1756
|
+
*/
|
|
1757
|
+
type: "search";
|
|
1758
|
+
/**
|
|
1759
|
+
* The search query.
|
|
1760
|
+
*
|
|
1761
|
+
* @deprecated Use `queries` instead.
|
|
1762
|
+
*/
|
|
1763
|
+
query?: string;
|
|
1764
|
+
/**
|
|
1765
|
+
* The search queries the model used.
|
|
1766
|
+
*/
|
|
1767
|
+
queries?: string[];
|
|
1768
|
+
} | {
|
|
1769
|
+
/**
|
|
1770
|
+
* Action type "openPage" - Opens a specific URL from search results.
|
|
1771
|
+
*/
|
|
1772
|
+
type: "openPage";
|
|
1773
|
+
/**
|
|
1774
|
+
* The URL opened by the model.
|
|
1775
|
+
*/
|
|
1776
|
+
url?: string | null;
|
|
1777
|
+
} | {
|
|
1778
|
+
/**
|
|
1779
|
+
* Action type "findInPage": Searches for a pattern within a loaded page.
|
|
1780
|
+
*/
|
|
1781
|
+
type: "findInPage";
|
|
1782
|
+
/**
|
|
1783
|
+
* The URL of the page searched for the pattern.
|
|
1784
|
+
*/
|
|
1785
|
+
url?: string | null;
|
|
1786
|
+
/**
|
|
1787
|
+
* The pattern or text to search for within the page.
|
|
1788
|
+
*/
|
|
1789
|
+
pattern?: string | null;
|
|
1790
|
+
};
|
|
1791
|
+
/**
|
|
1792
|
+
* Optional sources cited by the model for the web search call.
|
|
1793
|
+
*/
|
|
1794
|
+
sources?: Array<{
|
|
1795
|
+
type: "url";
|
|
1796
|
+
url: string;
|
|
1797
|
+
} | {
|
|
1798
|
+
type: "api";
|
|
1799
|
+
name: string;
|
|
1800
|
+
}>;
|
|
1801
|
+
}, {}>;
|
|
1595
1802
|
|
|
1596
1803
|
type OpenAIResponsesModelId = 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.2-codex' | 'gpt-5.3-chat-latest' | 'gpt-5.3-codex' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | 'gpt-5.5' | 'gpt-5.5-2026-04-23' | 'gpt-5.6' | 'gpt-5.6-luna' | 'gpt-5.6-sol' | 'gpt-5.6-terra' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | 'o4-mini' | 'o4-mini-2025-04-16' | (string & {});
|
|
1597
1804
|
|
|
@@ -1703,6 +1910,7 @@ declare class OpenAIResponsesLanguageModel implements LanguageModelV4 {
|
|
|
1703
1910
|
doGenerate(options: LanguageModelV4CallOptions): Promise<LanguageModelV4GenerateResult>;
|
|
1704
1911
|
doStream(options: LanguageModelV4CallOptions): Promise<LanguageModelV4StreamResult>;
|
|
1705
1912
|
}
|
|
1913
|
+
declare function mapWebSearchOutput(action: OpenAIResponsesWebSearchAction | null | undefined): InferSchema<typeof webSearchOutputSchema>;
|
|
1706
1914
|
|
|
1707
1915
|
type OpenaiResponsesChunk = InferSchema<typeof openaiResponsesChunkSchema>;
|
|
1708
1916
|
type ResponsesOutputTextAnnotationProviderMetadata = Extract<OpenaiResponsesChunk, {
|
|
@@ -2159,208 +2367,6 @@ declare const programmaticToolCalling: () => _ai_sdk_provider_utils.Experimental
|
|
|
2159
2367
|
status: "completed" | "incomplete";
|
|
2160
2368
|
}, {}>>;
|
|
2161
2369
|
|
|
2162
|
-
declare const webSearchArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
2163
|
-
externalWebAccess?: boolean | undefined;
|
|
2164
|
-
filters?: {
|
|
2165
|
-
allowedDomains?: string[] | undefined;
|
|
2166
|
-
blockedDomains?: string[] | undefined;
|
|
2167
|
-
} | undefined;
|
|
2168
|
-
searchContextSize?: "low" | "medium" | "high" | undefined;
|
|
2169
|
-
userLocation?: {
|
|
2170
|
-
type: "approximate";
|
|
2171
|
-
country?: string | undefined;
|
|
2172
|
-
city?: string | undefined;
|
|
2173
|
-
region?: string | undefined;
|
|
2174
|
-
timezone?: string | undefined;
|
|
2175
|
-
} | undefined;
|
|
2176
|
-
}>;
|
|
2177
|
-
declare const webSearchOutputSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
2178
|
-
action?: {
|
|
2179
|
-
type: "search";
|
|
2180
|
-
query?: string | undefined;
|
|
2181
|
-
queries?: string[] | undefined;
|
|
2182
|
-
} | {
|
|
2183
|
-
type: "openPage";
|
|
2184
|
-
url?: string | null | undefined;
|
|
2185
|
-
} | {
|
|
2186
|
-
type: "findInPage";
|
|
2187
|
-
url?: string | null | undefined;
|
|
2188
|
-
pattern?: string | null | undefined;
|
|
2189
|
-
} | undefined;
|
|
2190
|
-
sources?: ({
|
|
2191
|
-
type: "url";
|
|
2192
|
-
url: string;
|
|
2193
|
-
} | {
|
|
2194
|
-
type: "api";
|
|
2195
|
-
name: string;
|
|
2196
|
-
})[] | undefined;
|
|
2197
|
-
}>;
|
|
2198
|
-
declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {
|
|
2199
|
-
/**
|
|
2200
|
-
* An object describing the specific action taken in this web search call.
|
|
2201
|
-
* Includes details on how the model used the web (search, open_page, find_in_page).
|
|
2202
|
-
*/
|
|
2203
|
-
action?: {
|
|
2204
|
-
/**
|
|
2205
|
-
* Action type "search" - Performs a web search query.
|
|
2206
|
-
*/
|
|
2207
|
-
type: "search";
|
|
2208
|
-
/**
|
|
2209
|
-
* The search query.
|
|
2210
|
-
*
|
|
2211
|
-
* @deprecated Use `queries` instead.
|
|
2212
|
-
*/
|
|
2213
|
-
query?: string;
|
|
2214
|
-
/**
|
|
2215
|
-
* The search queries the model used.
|
|
2216
|
-
*/
|
|
2217
|
-
queries?: string[];
|
|
2218
|
-
} | {
|
|
2219
|
-
/**
|
|
2220
|
-
* Action type "openPage" - Opens a specific URL from search results.
|
|
2221
|
-
*/
|
|
2222
|
-
type: "openPage";
|
|
2223
|
-
/**
|
|
2224
|
-
* The URL opened by the model.
|
|
2225
|
-
*/
|
|
2226
|
-
url?: string | null;
|
|
2227
|
-
} | {
|
|
2228
|
-
/**
|
|
2229
|
-
* Action type "findInPage": Searches for a pattern within a loaded page.
|
|
2230
|
-
*/
|
|
2231
|
-
type: "findInPage";
|
|
2232
|
-
/**
|
|
2233
|
-
* The URL of the page searched for the pattern.
|
|
2234
|
-
*/
|
|
2235
|
-
url?: string | null;
|
|
2236
|
-
/**
|
|
2237
|
-
* The pattern or text to search for within the page.
|
|
2238
|
-
*/
|
|
2239
|
-
pattern?: string | null;
|
|
2240
|
-
};
|
|
2241
|
-
/**
|
|
2242
|
-
* Optional sources cited by the model for the web search call.
|
|
2243
|
-
*/
|
|
2244
|
-
sources?: Array<{
|
|
2245
|
-
type: "url";
|
|
2246
|
-
url: string;
|
|
2247
|
-
} | {
|
|
2248
|
-
type: "api";
|
|
2249
|
-
name: string;
|
|
2250
|
-
}>;
|
|
2251
|
-
}, {
|
|
2252
|
-
/**
|
|
2253
|
-
* Whether to use external web access for fetching live content.
|
|
2254
|
-
* - true: Fetch live web content (default)
|
|
2255
|
-
* - false: Use cached/indexed results
|
|
2256
|
-
*/
|
|
2257
|
-
externalWebAccess?: boolean;
|
|
2258
|
-
/**
|
|
2259
|
-
* Filters for the search.
|
|
2260
|
-
*/
|
|
2261
|
-
filters?: {
|
|
2262
|
-
/**
|
|
2263
|
-
* Allowed domains for the search.
|
|
2264
|
-
* If not provided, all domains are allowed.
|
|
2265
|
-
* Subdomains of the provided domains are allowed as well.
|
|
2266
|
-
* Omit the HTTP or HTTPS prefix. Maximum 100 domains.
|
|
2267
|
-
*/
|
|
2268
|
-
allowedDomains?: string[];
|
|
2269
|
-
/**
|
|
2270
|
-
* Blocked domains for the search.
|
|
2271
|
-
* Subdomains of the provided domains are blocked as well.
|
|
2272
|
-
* Omit the HTTP or HTTPS prefix. Maximum 100 domains.
|
|
2273
|
-
*/
|
|
2274
|
-
blockedDomains?: string[];
|
|
2275
|
-
};
|
|
2276
|
-
/**
|
|
2277
|
-
* Search context size to use for the web search.
|
|
2278
|
-
* - high: Most comprehensive context, highest cost, slower response
|
|
2279
|
-
* - medium: Balanced context, cost, and latency (default)
|
|
2280
|
-
* - low: Least context, lowest cost, fastest response
|
|
2281
|
-
*/
|
|
2282
|
-
searchContextSize?: "low" | "medium" | "high";
|
|
2283
|
-
/**
|
|
2284
|
-
* User location information to provide geographically relevant search results.
|
|
2285
|
-
*/
|
|
2286
|
-
userLocation?: {
|
|
2287
|
-
/**
|
|
2288
|
-
* Type of location (always 'approximate')
|
|
2289
|
-
*/
|
|
2290
|
-
type: "approximate";
|
|
2291
|
-
/**
|
|
2292
|
-
* Two-letter ISO country code (e.g., 'US', 'GB')
|
|
2293
|
-
*/
|
|
2294
|
-
country?: string;
|
|
2295
|
-
/**
|
|
2296
|
-
* City name (free text, e.g., 'Minneapolis')
|
|
2297
|
-
*/
|
|
2298
|
-
city?: string;
|
|
2299
|
-
/**
|
|
2300
|
-
* Region name (free text, e.g., 'Minnesota')
|
|
2301
|
-
*/
|
|
2302
|
-
region?: string;
|
|
2303
|
-
/**
|
|
2304
|
-
* IANA timezone (e.g., 'America/Chicago')
|
|
2305
|
-
*/
|
|
2306
|
-
timezone?: string;
|
|
2307
|
-
};
|
|
2308
|
-
}, {}>;
|
|
2309
|
-
declare const webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{}, {
|
|
2310
|
-
/**
|
|
2311
|
-
* An object describing the specific action taken in this web search call.
|
|
2312
|
-
* Includes details on how the model used the web (search, open_page, find_in_page).
|
|
2313
|
-
*/
|
|
2314
|
-
action?: {
|
|
2315
|
-
/**
|
|
2316
|
-
* Action type "search" - Performs a web search query.
|
|
2317
|
-
*/
|
|
2318
|
-
type: "search";
|
|
2319
|
-
/**
|
|
2320
|
-
* The search query.
|
|
2321
|
-
*
|
|
2322
|
-
* @deprecated Use `queries` instead.
|
|
2323
|
-
*/
|
|
2324
|
-
query?: string;
|
|
2325
|
-
/**
|
|
2326
|
-
* The search queries the model used.
|
|
2327
|
-
*/
|
|
2328
|
-
queries?: string[];
|
|
2329
|
-
} | {
|
|
2330
|
-
/**
|
|
2331
|
-
* Action type "openPage" - Opens a specific URL from search results.
|
|
2332
|
-
*/
|
|
2333
|
-
type: "openPage";
|
|
2334
|
-
/**
|
|
2335
|
-
* The URL opened by the model.
|
|
2336
|
-
*/
|
|
2337
|
-
url?: string | null;
|
|
2338
|
-
} | {
|
|
2339
|
-
/**
|
|
2340
|
-
* Action type "findInPage": Searches for a pattern within a loaded page.
|
|
2341
|
-
*/
|
|
2342
|
-
type: "findInPage";
|
|
2343
|
-
/**
|
|
2344
|
-
* The URL of the page searched for the pattern.
|
|
2345
|
-
*/
|
|
2346
|
-
url?: string | null;
|
|
2347
|
-
/**
|
|
2348
|
-
* The pattern or text to search for within the page.
|
|
2349
|
-
*/
|
|
2350
|
-
pattern?: string | null;
|
|
2351
|
-
};
|
|
2352
|
-
/**
|
|
2353
|
-
* Optional sources cited by the model for the web search call.
|
|
2354
|
-
*/
|
|
2355
|
-
sources?: Array<{
|
|
2356
|
-
type: "url";
|
|
2357
|
-
url: string;
|
|
2358
|
-
} | {
|
|
2359
|
-
type: "api";
|
|
2360
|
-
name: string;
|
|
2361
|
-
}>;
|
|
2362
|
-
}, {}>;
|
|
2363
|
-
|
|
2364
2370
|
declare const webSearchPreviewArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
2365
2371
|
searchContextSize?: "low" | "medium" | "high" | undefined;
|
|
2366
2372
|
userLocation?: {
|
|
@@ -2444,4 +2450,4 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderExecutedToolFacto
|
|
|
2444
2450
|
};
|
|
2445
2451
|
}, {}>;
|
|
2446
2452
|
|
|
2447
|
-
export { type ApplyPatchOperation, OpenAIChatLanguageModel, type OpenAIChatModelId, OpenAICompletionLanguageModel, type OpenAICompletionModelId, OpenAIEmbeddingModel, type OpenAIEmbeddingModelId, type OpenAIEmbeddingModelOptions, OpenAIImageModel, type OpenAIImageModelEditOptions, type OpenAIImageModelGenerationOptions, type OpenAIImageModelId, type OpenAIImageModelOptions, type OpenAILanguageModelChatOptions, type OpenAILanguageModelCompletionOptions, OpenAIResponsesLanguageModel, OpenAISpeechModel, type OpenAISpeechModelId, type OpenAISpeechModelOptions, type OpenAITranscriptionCallOptions, OpenAITranscriptionModel, type OpenAITranscriptionModelId, type OpenAITranscriptionModelOptions, type OpenAITranscriptionStreamOptions, type OpenaiResponsesCompactionProviderMetadata, type OpenaiResponsesProviderMetadata, type OpenaiResponsesReasoningProviderMetadata, type OpenaiResponsesSourceDocumentProviderMetadata, type OpenaiResponsesTextProviderMetadata, type ResponsesCompactionProviderMetadata, type ResponsesProviderMetadata, type ResponsesReasoningProviderMetadata, type ResponsesSourceDocumentProviderMetadata, type ResponsesTextProviderMetadata, applyPatch, applyPatchArgsSchema, applyPatchInputSchema, applyPatchOutputSchema, applyPatchToolFactory, codeInterpreter, codeInterpreterArgsSchema, codeInterpreterInputSchema, codeInterpreterOutputSchema, codeInterpreterToolFactory, fileSearch, fileSearchArgsSchema, fileSearchOutputSchema, getMaxImagesPerCall, hasDefaultResponseFormat, imageGeneration, imageGenerationArgsSchema, imageGenerationOutputSchema, modelMaxImagesPerCall, openAITranscriptionModelOptions, openaiEmbeddingModelOptions, openaiImageModelEditOptions, openaiImageModelGenerationOptions, openaiImageModelOptions, openaiLanguageModelChatOptions, openaiLanguageModelCompletionOptions, openaiSpeechModelOptionsSchema, programmaticToolCalling, programmaticToolCallingInputSchema, programmaticToolCallingOutputSchema, webSearch, webSearchArgsSchema, webSearchOutputSchema, webSearchPreview, webSearchPreviewArgsSchema, webSearchPreviewInputSchema, webSearchToolFactory };
|
|
2453
|
+
export { type ApplyPatchOperation, OpenAIChatLanguageModel, type OpenAIChatModelId, OpenAICompletionLanguageModel, type OpenAICompletionModelId, OpenAIEmbeddingModel, type OpenAIEmbeddingModelId, type OpenAIEmbeddingModelOptions, OpenAIImageModel, type OpenAIImageModelEditOptions, type OpenAIImageModelGenerationOptions, type OpenAIImageModelId, type OpenAIImageModelOptions, type OpenAILanguageModelChatOptions, type OpenAILanguageModelCompletionOptions, OpenAIResponsesLanguageModel, OpenAISpeechModel, type OpenAISpeechModelId, type OpenAISpeechModelOptions, type OpenAITranscriptionCallOptions, OpenAITranscriptionModel, type OpenAITranscriptionModelId, type OpenAITranscriptionModelOptions, type OpenAITranscriptionStreamOptions, type OpenaiResponsesCompactionProviderMetadata, type OpenaiResponsesProviderMetadata, type OpenaiResponsesReasoningProviderMetadata, type OpenaiResponsesSourceDocumentProviderMetadata, type OpenaiResponsesTextProviderMetadata, type ResponsesCompactionProviderMetadata, type ResponsesProviderMetadata, type ResponsesReasoningProviderMetadata, type ResponsesSourceDocumentProviderMetadata, type ResponsesTextProviderMetadata, applyPatch, applyPatchArgsSchema, applyPatchInputSchema, applyPatchOutputSchema, applyPatchToolFactory, codeInterpreter, codeInterpreterArgsSchema, codeInterpreterInputSchema, codeInterpreterOutputSchema, codeInterpreterToolFactory, fileSearch, fileSearchArgsSchema, fileSearchOutputSchema, getMaxImagesPerCall, hasDefaultResponseFormat, imageGeneration, imageGenerationArgsSchema, imageGenerationOutputSchema, mapWebSearchOutput, modelMaxImagesPerCall, openAITranscriptionModelOptions, openaiEmbeddingModelOptions, openaiImageModelEditOptions, openaiImageModelGenerationOptions, openaiImageModelOptions, openaiLanguageModelChatOptions, openaiLanguageModelCompletionOptions, openaiSpeechModelOptionsSchema, programmaticToolCalling, programmaticToolCallingInputSchema, programmaticToolCallingOutputSchema, webSearch, webSearchArgsSchema, webSearchOutputSchema, webSearchPreview, webSearchPreviewArgsSchema, webSearchPreviewInputSchema, webSearchToolFactory };
|
package/dist/internal/index.js
CHANGED
|
@@ -4948,7 +4948,7 @@ var openaiResponsesChunkSchema = lazySchema18(
|
|
|
4948
4948
|
reasoning_tokens: z20.number().nullish(),
|
|
4949
4949
|
orchestration_output_tokens: z20.number().nullish()
|
|
4950
4950
|
}).nullish()
|
|
4951
|
-
}),
|
|
4951
|
+
}).nullish(),
|
|
4952
4952
|
reasoning: z20.object({
|
|
4953
4953
|
context: z20.string().nullish()
|
|
4954
4954
|
}).nullish(),
|
|
@@ -5780,7 +5780,7 @@ var openaiResponsesResponseSchema = lazySchema18(
|
|
|
5780
5780
|
reasoning_tokens: z20.number().nullish(),
|
|
5781
5781
|
orchestration_output_tokens: z20.number().nullish()
|
|
5782
5782
|
}).nullish()
|
|
5783
|
-
}).
|
|
5783
|
+
}).nullish()
|
|
5784
5784
|
})
|
|
5785
5785
|
)
|
|
5786
5786
|
);
|
|
@@ -7960,7 +7960,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7960
7960
|
controller.enqueue({ type: "stream-start", warnings });
|
|
7961
7961
|
},
|
|
7962
7962
|
transform(chunk, controller) {
|
|
7963
|
-
var _a3, _b2, _c2, _d2, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R;
|
|
7963
|
+
var _a3, _b2, _c2, _d2, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S;
|
|
7964
7964
|
if (options.includeRawChunks) {
|
|
7965
7965
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
7966
7966
|
}
|
|
@@ -8895,15 +8895,15 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
8895
8895
|
raw: (_z = (_y = value.response.incomplete_details) == null ? void 0 : _y.reason) != null ? _z : void 0
|
|
8896
8896
|
};
|
|
8897
8897
|
}
|
|
8898
|
-
usage = value.response.usage;
|
|
8898
|
+
usage = (_A = value.response.usage) != null ? _A : void 0;
|
|
8899
8899
|
if (typeof value.response.service_tier === "string") {
|
|
8900
8900
|
serviceTier = value.response.service_tier;
|
|
8901
8901
|
}
|
|
8902
|
-
if (((
|
|
8902
|
+
if (((_B = value.response.reasoning) == null ? void 0 : _B.context) != null) {
|
|
8903
8903
|
reasoningContext = value.response.reasoning.context;
|
|
8904
8904
|
}
|
|
8905
8905
|
} else if (isResponseFailedChunk(value)) {
|
|
8906
|
-
const incompleteReason = (
|
|
8906
|
+
const incompleteReason = (_C = value.response.incomplete_details) == null ? void 0 : _C.reason;
|
|
8907
8907
|
finishReason = {
|
|
8908
8908
|
unified: incompleteReason ? mapOpenAIResponseFinishReason({
|
|
8909
8909
|
finishReason: incompleteReason,
|
|
@@ -8911,8 +8911,8 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
8911
8911
|
}) : "error",
|
|
8912
8912
|
raw: incompleteReason != null ? incompleteReason : "error"
|
|
8913
8913
|
};
|
|
8914
|
-
usage = (
|
|
8915
|
-
if (((
|
|
8914
|
+
usage = (_D = value.response.usage) != null ? _D : void 0;
|
|
8915
|
+
if (((_E = value.response.reasoning) == null ? void 0 : _E.context) != null) {
|
|
8916
8916
|
reasoningContext = value.response.reasoning.context;
|
|
8917
8917
|
}
|
|
8918
8918
|
if (!encounteredStreamError && value.response.error != null) {
|
|
@@ -8928,7 +8928,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
8928
8928
|
};
|
|
8929
8929
|
controller.enqueue({
|
|
8930
8930
|
type: "error",
|
|
8931
|
-
error: (
|
|
8931
|
+
error: (_F = createOpenAIProviderStreamError(error)) != null ? _F : error
|
|
8932
8932
|
});
|
|
8933
8933
|
}
|
|
8934
8934
|
} else if (isResponseAnnotationAddedChunk(value)) {
|
|
@@ -8937,7 +8937,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
8937
8937
|
controller.enqueue({
|
|
8938
8938
|
type: "source",
|
|
8939
8939
|
sourceType: "url",
|
|
8940
|
-
id: (
|
|
8940
|
+
id: (_I = (_H = (_G = self.config).generateId) == null ? void 0 : _H.call(_G)) != null ? _I : generateId2(),
|
|
8941
8941
|
url: value.annotation.url,
|
|
8942
8942
|
title: value.annotation.title
|
|
8943
8943
|
});
|
|
@@ -8945,7 +8945,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
8945
8945
|
controller.enqueue({
|
|
8946
8946
|
type: "source",
|
|
8947
8947
|
sourceType: "document",
|
|
8948
|
-
id: (
|
|
8948
|
+
id: (_L = (_K = (_J = self.config).generateId) == null ? void 0 : _K.call(_J)) != null ? _L : generateId2(),
|
|
8949
8949
|
mediaType: "text/plain",
|
|
8950
8950
|
title: value.annotation.filename,
|
|
8951
8951
|
filename: value.annotation.filename,
|
|
@@ -8961,7 +8961,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
8961
8961
|
controller.enqueue({
|
|
8962
8962
|
type: "source",
|
|
8963
8963
|
sourceType: "document",
|
|
8964
|
-
id: (
|
|
8964
|
+
id: (_O = (_N = (_M = self.config).generateId) == null ? void 0 : _N.call(_M)) != null ? _O : generateId2(),
|
|
8965
8965
|
mediaType: "text/plain",
|
|
8966
8966
|
title: value.annotation.filename,
|
|
8967
8967
|
filename: value.annotation.filename,
|
|
@@ -8977,7 +8977,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
8977
8977
|
controller.enqueue({
|
|
8978
8978
|
type: "source",
|
|
8979
8979
|
sourceType: "document",
|
|
8980
|
-
id: (
|
|
8980
|
+
id: (_R = (_Q = (_P = self.config).generateId) == null ? void 0 : _Q.call(_P)) != null ? _R : generateId2(),
|
|
8981
8981
|
mediaType: "application/octet-stream",
|
|
8982
8982
|
title: value.annotation.file_id,
|
|
8983
8983
|
filename: value.annotation.file_id,
|
|
@@ -8995,7 +8995,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
8995
8995
|
finishReason = { unified: "error", raw: "error" };
|
|
8996
8996
|
controller.enqueue({
|
|
8997
8997
|
type: "error",
|
|
8998
|
-
error: (
|
|
8998
|
+
error: (_S = createOpenAIProviderStreamError(value)) != null ? _S : value
|
|
8999
8999
|
});
|
|
9000
9000
|
}
|
|
9001
9001
|
},
|
|
@@ -9174,6 +9174,7 @@ export {
|
|
|
9174
9174
|
imageGeneration,
|
|
9175
9175
|
imageGenerationArgsSchema,
|
|
9176
9176
|
imageGenerationOutputSchema,
|
|
9177
|
+
mapWebSearchOutput,
|
|
9177
9178
|
modelMaxImagesPerCall,
|
|
9178
9179
|
openAITranscriptionModelOptions,
|
|
9179
9180
|
openaiEmbeddingModelOptions,
|