@ai-sdk/openai 2.0.24 → 2.0.26
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 +13 -0
- package/dist/index.d.mts +47 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.js +378 -321
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +347 -290
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +317 -264
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +305 -252
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 2.0.26
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5819aec: fix (provider/openai): only send tool calls finish reason for tools that are not provider-executed
|
|
8
|
+
- af8c6bb: feat (provider/openai): add web_search tool
|
|
9
|
+
|
|
10
|
+
## 2.0.25
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- fb45ade: fix timestamp granularities support for openai transcription
|
|
15
|
+
|
|
3
16
|
## 2.0.24
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -11,6 +11,52 @@ type OpenAIEmbeddingModelId = 'text-embedding-3-small' | 'text-embedding-3-large
|
|
|
11
11
|
|
|
12
12
|
type OpenAIImageModelId = 'gpt-image-1' | 'dall-e-3' | 'dall-e-2' | (string & {});
|
|
13
13
|
|
|
14
|
+
declare const factory: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{}, {
|
|
15
|
+
/**
|
|
16
|
+
* Filters for the search.
|
|
17
|
+
*/
|
|
18
|
+
filters?: {
|
|
19
|
+
/**
|
|
20
|
+
* Allowed domains for the search.
|
|
21
|
+
* If not provided, all domains are allowed.
|
|
22
|
+
* Subdomains of the provided domains are allowed as well.
|
|
23
|
+
*/
|
|
24
|
+
allowedDomains?: string[];
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Search context size to use for the web search.
|
|
28
|
+
* - high: Most comprehensive context, highest cost, slower response
|
|
29
|
+
* - medium: Balanced context, cost, and latency (default)
|
|
30
|
+
* - low: Least context, lowest cost, fastest response
|
|
31
|
+
*/
|
|
32
|
+
searchContextSize?: "low" | "medium" | "high";
|
|
33
|
+
/**
|
|
34
|
+
* User location information to provide geographically relevant search results.
|
|
35
|
+
*/
|
|
36
|
+
userLocation?: {
|
|
37
|
+
/**
|
|
38
|
+
* Type of location (always 'approximate')
|
|
39
|
+
*/
|
|
40
|
+
type: "approximate";
|
|
41
|
+
/**
|
|
42
|
+
* Two-letter ISO country code (e.g., 'US', 'GB')
|
|
43
|
+
*/
|
|
44
|
+
country?: string;
|
|
45
|
+
/**
|
|
46
|
+
* City name (free text, e.g., 'Minneapolis')
|
|
47
|
+
*/
|
|
48
|
+
city?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Region name (free text, e.g., 'Minnesota')
|
|
51
|
+
*/
|
|
52
|
+
region?: string;
|
|
53
|
+
/**
|
|
54
|
+
* IANA timezone (e.g., 'America/Chicago')
|
|
55
|
+
*/
|
|
56
|
+
timezone?: string;
|
|
57
|
+
};
|
|
58
|
+
}>;
|
|
59
|
+
|
|
14
60
|
declare const openaiTools: {
|
|
15
61
|
codeInterpreter: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{}, {
|
|
16
62
|
container?: string | {
|
|
@@ -44,6 +90,7 @@ declare const openaiTools: {
|
|
|
44
90
|
timezone?: string;
|
|
45
91
|
};
|
|
46
92
|
}>;
|
|
93
|
+
webSearch: (args?: Parameters<typeof factory>[0]) => _ai_sdk_provider_utils.Tool<{}, unknown>;
|
|
47
94
|
};
|
|
48
95
|
|
|
49
96
|
type OpenAIResponsesModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4' | 'gpt-4-0613' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'chatgpt-4o-latest' | (string & {});
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,52 @@ type OpenAIEmbeddingModelId = 'text-embedding-3-small' | 'text-embedding-3-large
|
|
|
11
11
|
|
|
12
12
|
type OpenAIImageModelId = 'gpt-image-1' | 'dall-e-3' | 'dall-e-2' | (string & {});
|
|
13
13
|
|
|
14
|
+
declare const factory: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{}, {
|
|
15
|
+
/**
|
|
16
|
+
* Filters for the search.
|
|
17
|
+
*/
|
|
18
|
+
filters?: {
|
|
19
|
+
/**
|
|
20
|
+
* Allowed domains for the search.
|
|
21
|
+
* If not provided, all domains are allowed.
|
|
22
|
+
* Subdomains of the provided domains are allowed as well.
|
|
23
|
+
*/
|
|
24
|
+
allowedDomains?: string[];
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Search context size to use for the web search.
|
|
28
|
+
* - high: Most comprehensive context, highest cost, slower response
|
|
29
|
+
* - medium: Balanced context, cost, and latency (default)
|
|
30
|
+
* - low: Least context, lowest cost, fastest response
|
|
31
|
+
*/
|
|
32
|
+
searchContextSize?: "low" | "medium" | "high";
|
|
33
|
+
/**
|
|
34
|
+
* User location information to provide geographically relevant search results.
|
|
35
|
+
*/
|
|
36
|
+
userLocation?: {
|
|
37
|
+
/**
|
|
38
|
+
* Type of location (always 'approximate')
|
|
39
|
+
*/
|
|
40
|
+
type: "approximate";
|
|
41
|
+
/**
|
|
42
|
+
* Two-letter ISO country code (e.g., 'US', 'GB')
|
|
43
|
+
*/
|
|
44
|
+
country?: string;
|
|
45
|
+
/**
|
|
46
|
+
* City name (free text, e.g., 'Minneapolis')
|
|
47
|
+
*/
|
|
48
|
+
city?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Region name (free text, e.g., 'Minnesota')
|
|
51
|
+
*/
|
|
52
|
+
region?: string;
|
|
53
|
+
/**
|
|
54
|
+
* IANA timezone (e.g., 'America/Chicago')
|
|
55
|
+
*/
|
|
56
|
+
timezone?: string;
|
|
57
|
+
};
|
|
58
|
+
}>;
|
|
59
|
+
|
|
14
60
|
declare const openaiTools: {
|
|
15
61
|
codeInterpreter: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{}, {
|
|
16
62
|
container?: string | {
|
|
@@ -44,6 +90,7 @@ declare const openaiTools: {
|
|
|
44
90
|
timezone?: string;
|
|
45
91
|
};
|
|
46
92
|
}>;
|
|
93
|
+
webSearch: (args?: Parameters<typeof factory>[0]) => _ai_sdk_provider_utils.Tool<{}, unknown>;
|
|
47
94
|
};
|
|
48
95
|
|
|
49
96
|
type OpenAIResponsesModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4' | 'gpt-4-0613' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'chatgpt-4o-latest' | (string & {});
|