@ai-sdk/openai 2.0.31 → 2.0.33
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 +44 -12
- package/dist/index.d.ts +44 -12
- package/dist/index.js +389 -426
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +355 -392
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +421 -458
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +373 -410
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 2.0.33
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a617948: fix the "incomplete_details" key from nullable to nullish for openai compatibility
|
|
8
|
+
|
|
9
|
+
## 2.0.32
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 1cf857d: fix(provider/openai): remove provider-executed tools from chat completions model
|
|
14
|
+
- 01de47f: feat(provider/openai): rework file search tool
|
|
15
|
+
|
|
3
16
|
## 2.0.31
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -57,6 +57,37 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFa
|
|
|
57
57
|
};
|
|
58
58
|
}>;
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* A filter used to compare a specified attribute key to a given value using a defined comparison operation.
|
|
62
|
+
*/
|
|
63
|
+
type OpenAIResponsesFileSearchToolComparisonFilter = {
|
|
64
|
+
/**
|
|
65
|
+
* The key to compare against the value.
|
|
66
|
+
*/
|
|
67
|
+
key: string;
|
|
68
|
+
/**
|
|
69
|
+
* Specifies the comparison operator: eq, ne, gt, gte, lt, lte.
|
|
70
|
+
*/
|
|
71
|
+
type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte';
|
|
72
|
+
/**
|
|
73
|
+
* The value to compare against the attribute key; supports string, number, or boolean types.
|
|
74
|
+
*/
|
|
75
|
+
value: string | number | boolean;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Combine multiple filters using and or or.
|
|
79
|
+
*/
|
|
80
|
+
type OpenAIResponsesFileSearchToolCompoundFilter = {
|
|
81
|
+
/**
|
|
82
|
+
* Type of operation: and or or.
|
|
83
|
+
*/
|
|
84
|
+
type: 'and' | 'or';
|
|
85
|
+
/**
|
|
86
|
+
* Array of filters to combine. Items can be ComparisonFilter or CompoundFilter.
|
|
87
|
+
*/
|
|
88
|
+
filters: Array<OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter>;
|
|
89
|
+
};
|
|
90
|
+
|
|
60
91
|
declare const openaiTools: {
|
|
61
92
|
/**
|
|
62
93
|
* The Code Interpreter tool allows models to write and run Python code in a
|
|
@@ -95,22 +126,23 @@ declare const openaiTools: {
|
|
|
95
126
|
* @param ranking - The ranking options to use for the file search.
|
|
96
127
|
* @param filters - The filters to use for the file search.
|
|
97
128
|
*/
|
|
98
|
-
fileSearch: _ai_sdk_provider_utils.
|
|
99
|
-
|
|
129
|
+
fileSearch: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
|
|
130
|
+
queries: string[];
|
|
131
|
+
results: null | {
|
|
132
|
+
attributes: Record<string, unknown>;
|
|
133
|
+
fileId: string;
|
|
134
|
+
filename: string;
|
|
135
|
+
score: number;
|
|
136
|
+
text: string;
|
|
137
|
+
}[];
|
|
100
138
|
}, {
|
|
101
|
-
vectorStoreIds
|
|
139
|
+
vectorStoreIds: string[];
|
|
102
140
|
maxNumResults?: number;
|
|
103
141
|
ranking?: {
|
|
104
|
-
ranker?:
|
|
105
|
-
|
|
106
|
-
filters?: {
|
|
107
|
-
key: string;
|
|
108
|
-
type: "eq" | "ne" | "gt" | "gte" | "lt" | "lte";
|
|
109
|
-
value: string | number | boolean;
|
|
110
|
-
} | {
|
|
111
|
-
type: "and" | "or";
|
|
112
|
-
filters: any[];
|
|
142
|
+
ranker?: string;
|
|
143
|
+
scoreThreshold?: number;
|
|
113
144
|
};
|
|
145
|
+
filters?: OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter;
|
|
114
146
|
}>;
|
|
115
147
|
/**
|
|
116
148
|
* The image generation tool allows you to generate images using a text prompt,
|
package/dist/index.d.ts
CHANGED
|
@@ -57,6 +57,37 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFa
|
|
|
57
57
|
};
|
|
58
58
|
}>;
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* A filter used to compare a specified attribute key to a given value using a defined comparison operation.
|
|
62
|
+
*/
|
|
63
|
+
type OpenAIResponsesFileSearchToolComparisonFilter = {
|
|
64
|
+
/**
|
|
65
|
+
* The key to compare against the value.
|
|
66
|
+
*/
|
|
67
|
+
key: string;
|
|
68
|
+
/**
|
|
69
|
+
* Specifies the comparison operator: eq, ne, gt, gte, lt, lte.
|
|
70
|
+
*/
|
|
71
|
+
type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte';
|
|
72
|
+
/**
|
|
73
|
+
* The value to compare against the attribute key; supports string, number, or boolean types.
|
|
74
|
+
*/
|
|
75
|
+
value: string | number | boolean;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Combine multiple filters using and or or.
|
|
79
|
+
*/
|
|
80
|
+
type OpenAIResponsesFileSearchToolCompoundFilter = {
|
|
81
|
+
/**
|
|
82
|
+
* Type of operation: and or or.
|
|
83
|
+
*/
|
|
84
|
+
type: 'and' | 'or';
|
|
85
|
+
/**
|
|
86
|
+
* Array of filters to combine. Items can be ComparisonFilter or CompoundFilter.
|
|
87
|
+
*/
|
|
88
|
+
filters: Array<OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter>;
|
|
89
|
+
};
|
|
90
|
+
|
|
60
91
|
declare const openaiTools: {
|
|
61
92
|
/**
|
|
62
93
|
* The Code Interpreter tool allows models to write and run Python code in a
|
|
@@ -95,22 +126,23 @@ declare const openaiTools: {
|
|
|
95
126
|
* @param ranking - The ranking options to use for the file search.
|
|
96
127
|
* @param filters - The filters to use for the file search.
|
|
97
128
|
*/
|
|
98
|
-
fileSearch: _ai_sdk_provider_utils.
|
|
99
|
-
|
|
129
|
+
fileSearch: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
|
|
130
|
+
queries: string[];
|
|
131
|
+
results: null | {
|
|
132
|
+
attributes: Record<string, unknown>;
|
|
133
|
+
fileId: string;
|
|
134
|
+
filename: string;
|
|
135
|
+
score: number;
|
|
136
|
+
text: string;
|
|
137
|
+
}[];
|
|
100
138
|
}, {
|
|
101
|
-
vectorStoreIds
|
|
139
|
+
vectorStoreIds: string[];
|
|
102
140
|
maxNumResults?: number;
|
|
103
141
|
ranking?: {
|
|
104
|
-
ranker?:
|
|
105
|
-
|
|
106
|
-
filters?: {
|
|
107
|
-
key: string;
|
|
108
|
-
type: "eq" | "ne" | "gt" | "gte" | "lt" | "lte";
|
|
109
|
-
value: string | number | boolean;
|
|
110
|
-
} | {
|
|
111
|
-
type: "and" | "or";
|
|
112
|
-
filters: any[];
|
|
142
|
+
ranker?: string;
|
|
143
|
+
scoreThreshold?: number;
|
|
113
144
|
};
|
|
145
|
+
filters?: OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter;
|
|
114
146
|
}>;
|
|
115
147
|
/**
|
|
116
148
|
* The image generation tool allows you to generate images using a text prompt,
|