openai 6.45.0 → 6.47.0
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 +49 -0
- package/README.md +9 -2
- package/client.d.mts +1 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +1 -0
- package/client.d.ts.map +1 -1
- package/client.js +11 -5
- package/client.js.map +1 -1
- package/client.mjs +11 -5
- package/client.mjs.map +1 -1
- package/core/streaming.d.mts.map +1 -1
- package/core/streaming.d.ts.map +1 -1
- package/core/streaming.js +38 -6
- package/core/streaming.js.map +1 -1
- package/core/streaming.mjs +38 -6
- package/core/streaming.mjs.map +1 -1
- package/core/uploads.d.mts +1 -1
- package/core/uploads.d.mts.map +1 -1
- package/core/uploads.d.ts +1 -1
- package/core/uploads.d.ts.map +1 -1
- package/core/uploads.js +3 -1
- package/core/uploads.js.map +1 -1
- package/core/uploads.mjs +1 -0
- package/core/uploads.mjs.map +1 -1
- package/helpers/audio.d.mts.map +1 -1
- package/helpers/audio.d.ts.map +1 -1
- package/helpers/audio.js +16 -3
- package/helpers/audio.js.map +1 -1
- package/helpers/audio.mjs +17 -4
- package/helpers/audio.mjs.map +1 -1
- package/helpers/zod.d.mts +20 -7
- package/helpers/zod.d.mts.map +1 -1
- package/helpers/zod.d.ts +20 -7
- package/helpers/zod.d.ts.map +1 -1
- package/helpers/zod.js +24 -12
- package/helpers/zod.js.map +1 -1
- package/helpers/zod.mjs +24 -12
- package/helpers/zod.mjs.map +1 -1
- package/index.d.mts +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +2 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -1
- package/index.mjs.map +1 -1
- package/internal/uploads.d.mts +26 -1
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts +26 -1
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.js +169 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs +169 -2
- package/internal/uploads.mjs.map +1 -1
- package/lib/AbstractChatCompletionRunner.d.mts +3 -3
- package/lib/AbstractChatCompletionRunner.d.mts.map +1 -1
- package/lib/AbstractChatCompletionRunner.d.ts +3 -3
- package/lib/AbstractChatCompletionRunner.d.ts.map +1 -1
- package/lib/AbstractChatCompletionRunner.js +18 -3
- package/lib/AbstractChatCompletionRunner.js.map +1 -1
- package/lib/AbstractChatCompletionRunner.mjs +18 -3
- package/lib/AbstractChatCompletionRunner.mjs.map +1 -1
- package/lib/AssistantStream.d.mts.map +1 -1
- package/lib/AssistantStream.d.ts.map +1 -1
- package/lib/AssistantStream.js +4 -3
- package/lib/AssistantStream.js.map +1 -1
- package/lib/AssistantStream.mjs +4 -3
- package/lib/AssistantStream.mjs.map +1 -1
- package/lib/ChatCompletionRunner.d.mts +26 -2
- package/lib/ChatCompletionRunner.d.mts.map +1 -1
- package/lib/ChatCompletionRunner.d.ts +26 -2
- package/lib/ChatCompletionRunner.d.ts.map +1 -1
- package/lib/ChatCompletionRunner.js.map +1 -1
- package/lib/ChatCompletionRunner.mjs.map +1 -1
- package/lib/ChatCompletionStream.d.mts +14 -1
- package/lib/ChatCompletionStream.d.mts.map +1 -1
- package/lib/ChatCompletionStream.d.ts +14 -1
- package/lib/ChatCompletionStream.d.ts.map +1 -1
- package/lib/ChatCompletionStream.js +75 -16
- package/lib/ChatCompletionStream.js.map +1 -1
- package/lib/ChatCompletionStream.mjs +74 -16
- package/lib/ChatCompletionStream.mjs.map +1 -1
- package/lib/ChatCompletionStreamingRunner.d.mts +25 -2
- package/lib/ChatCompletionStreamingRunner.d.mts.map +1 -1
- package/lib/ChatCompletionStreamingRunner.d.ts +25 -2
- package/lib/ChatCompletionStreamingRunner.d.ts.map +1 -1
- package/lib/ChatCompletionStreamingRunner.js +77 -0
- package/lib/ChatCompletionStreamingRunner.js.map +1 -1
- package/lib/ChatCompletionStreamingRunner.mjs +78 -1
- package/lib/ChatCompletionStreamingRunner.mjs.map +1 -1
- package/lib/EventStream.d.mts +13 -0
- package/lib/EventStream.d.mts.map +1 -1
- package/lib/EventStream.d.ts +13 -0
- package/lib/EventStream.d.ts.map +1 -1
- package/lib/EventStream.js +107 -2
- package/lib/EventStream.js.map +1 -1
- package/lib/EventStream.mjs +107 -2
- package/lib/EventStream.mjs.map +1 -1
- package/lib/RunnableFunction.d.mts +38 -21
- package/lib/RunnableFunction.d.mts.map +1 -1
- package/lib/RunnableFunction.d.ts +38 -21
- package/lib/RunnableFunction.d.ts.map +1 -1
- package/lib/RunnableFunction.js.map +1 -1
- package/lib/RunnableFunction.mjs.map +1 -1
- package/lib/parser.d.mts +2 -2
- package/lib/parser.d.mts.map +1 -1
- package/lib/parser.d.ts +2 -2
- package/lib/parser.d.ts.map +1 -1
- package/lib/parser.js.map +1 -1
- package/lib/parser.mjs.map +1 -1
- package/lib/responses/ResponseAccumulator.d.mts +6 -1
- package/lib/responses/ResponseAccumulator.d.mts.map +1 -1
- package/lib/responses/ResponseAccumulator.d.ts +6 -1
- package/lib/responses/ResponseAccumulator.d.ts.map +1 -1
- package/lib/responses/ResponseAccumulator.js +1 -0
- package/lib/responses/ResponseAccumulator.js.map +1 -1
- package/lib/responses/ResponseAccumulator.mjs +1 -0
- package/lib/responses/ResponseAccumulator.mjs.map +1 -1
- package/lib/responses/ResponseInputItems.d.mts.map +1 -1
- package/lib/responses/ResponseInputItems.d.ts.map +1 -1
- package/lib/responses/ResponseInputItems.js +2 -0
- package/lib/responses/ResponseInputItems.js.map +1 -1
- package/lib/responses/ResponseInputItems.mjs +2 -0
- package/lib/responses/ResponseInputItems.mjs.map +1 -1
- package/lib/responses/ResponseStream.d.mts +6 -1
- package/lib/responses/ResponseStream.d.mts.map +1 -1
- package/lib/responses/ResponseStream.d.ts +6 -1
- package/lib/responses/ResponseStream.d.ts.map +1 -1
- package/lib/responses/ResponseStream.js +21 -0
- package/lib/responses/ResponseStream.js.map +1 -1
- package/lib/responses/ResponseStream.mjs +21 -0
- package/lib/responses/ResponseStream.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/admin/organization/projects/api-keys.d.mts +12 -0
- package/resources/admin/organization/projects/api-keys.d.mts.map +1 -1
- package/resources/admin/organization/projects/api-keys.d.ts +12 -0
- package/resources/admin/organization/projects/api-keys.d.ts.map +1 -1
- package/resources/beta/assistants.d.mts +12 -26
- package/resources/beta/assistants.d.mts.map +1 -1
- package/resources/beta/assistants.d.ts +12 -26
- package/resources/beta/assistants.d.ts.map +1 -1
- package/resources/beta/beta.d.mts +6 -1
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +6 -1
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +4 -0
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +4 -0
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.d.mts +1 -0
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +1 -0
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js +5 -3
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs +1 -0
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/responses/index.d.mts +6 -0
- package/resources/beta/responses/index.d.mts.map +1 -0
- package/resources/beta/responses/index.d.ts +6 -0
- package/resources/beta/responses/index.d.ts.map +1 -0
- package/resources/beta/responses/index.js +11 -0
- package/resources/beta/responses/index.js.map +1 -0
- package/resources/beta/responses/index.mjs +5 -0
- package/resources/beta/responses/index.mjs.map +1 -0
- package/resources/beta/responses/input-items.d.mts +69 -0
- package/resources/beta/responses/input-items.d.mts.map +1 -0
- package/resources/beta/responses/input-items.d.ts +69 -0
- package/resources/beta/responses/input-items.d.ts.map +1 -0
- package/resources/beta/responses/input-items.js +37 -0
- package/resources/beta/responses/input-items.js.map +1 -0
- package/resources/beta/responses/input-items.mjs +33 -0
- package/resources/beta/responses/input-items.mjs.map +1 -0
- package/resources/beta/responses/input-tokens.d.mts +191 -0
- package/resources/beta/responses/input-tokens.d.mts.map +1 -0
- package/resources/beta/responses/input-tokens.d.ts +191 -0
- package/resources/beta/responses/input-tokens.d.ts.map +1 -0
- package/resources/beta/responses/input-tokens.js +34 -0
- package/resources/beta/responses/input-tokens.js.map +1 -0
- package/resources/beta/responses/input-tokens.mjs +30 -0
- package/resources/beta/responses/input-tokens.mjs.map +1 -0
- package/resources/beta/responses/internal-base.d.mts +71 -0
- package/resources/beta/responses/internal-base.d.mts.map +1 -0
- package/resources/beta/responses/internal-base.d.ts +71 -0
- package/resources/beta/responses/internal-base.d.ts.map +1 -0
- package/resources/beta/responses/internal-base.js +48 -0
- package/resources/beta/responses/internal-base.js.map +1 -0
- package/resources/beta/responses/internal-base.mjs +42 -0
- package/resources/beta/responses/internal-base.mjs.map +1 -0
- package/resources/beta/responses/responses.d.mts +9986 -0
- package/resources/beta/responses/responses.d.mts.map +1 -0
- package/resources/beta/responses/responses.d.ts +9986 -0
- package/resources/beta/responses/responses.d.ts.map +1 -0
- package/resources/beta/responses/responses.js +121 -0
- package/resources/beta/responses/responses.js.map +1 -0
- package/resources/beta/responses/responses.mjs +116 -0
- package/resources/beta/responses/responses.mjs.map +1 -0
- package/resources/beta/responses/ws-base.d.mts +106 -0
- package/resources/beta/responses/ws-base.d.mts.map +1 -0
- package/resources/beta/responses/ws-base.d.ts +106 -0
- package/resources/beta/responses/ws-base.d.ts.map +1 -0
- package/resources/beta/responses/ws-base.js +476 -0
- package/resources/beta/responses/ws-base.js.map +1 -0
- package/resources/beta/responses/ws-base.mjs +472 -0
- package/resources/beta/responses/ws-base.mjs.map +1 -0
- package/resources/beta/responses/ws.d.mts +13 -0
- package/resources/beta/responses/ws.d.mts.map +1 -0
- package/resources/beta/responses/ws.d.ts +13 -0
- package/resources/beta/responses/ws.d.ts.map +1 -0
- package/resources/beta/responses/ws.js +31 -0
- package/resources/beta/responses/ws.js.map +1 -0
- package/resources/beta/responses/ws.mjs +26 -0
- package/resources/beta/responses/ws.mjs.map +1 -0
- package/resources/beta/responses.d.mts +2 -0
- package/resources/beta/responses.d.mts.map +1 -0
- package/resources/beta/responses.d.ts +2 -0
- package/resources/beta/responses.d.ts.map +1 -0
- package/resources/beta/responses.js +6 -0
- package/resources/beta/responses.js.map +1 -0
- package/resources/beta/responses.mjs +3 -0
- package/resources/beta/responses.mjs.map +1 -0
- package/resources/beta/threads/runs/runs.d.mts +6 -13
- package/resources/beta/threads/runs/runs.d.mts.map +1 -1
- package/resources/beta/threads/runs/runs.d.ts +6 -13
- package/resources/beta/threads/runs/runs.d.ts.map +1 -1
- package/resources/beta/threads/runs/runs.js.map +1 -1
- package/resources/beta/threads/runs/runs.mjs.map +1 -1
- package/resources/chat/completions/completions.d.mts +170 -20
- package/resources/chat/completions/completions.d.mts.map +1 -1
- package/resources/chat/completions/completions.d.ts +170 -20
- package/resources/chat/completions/completions.d.ts.map +1 -1
- package/resources/chat/completions/completions.js.map +1 -1
- package/resources/chat/completions/completions.mjs.map +1 -1
- package/resources/completions.d.mts +4 -0
- package/resources/completions.d.mts.map +1 -1
- package/resources/completions.d.ts +4 -0
- package/resources/completions.d.ts.map +1 -1
- package/resources/conversations/conversations.d.mts +19 -0
- package/resources/conversations/conversations.d.mts.map +1 -1
- package/resources/conversations/conversations.d.ts +19 -0
- package/resources/conversations/conversations.d.ts.map +1 -1
- package/resources/conversations/conversations.js.map +1 -1
- package/resources/conversations/conversations.mjs.map +1 -1
- package/resources/conversations/items.d.mts +45 -1
- package/resources/conversations/items.d.mts.map +1 -1
- package/resources/conversations/items.d.ts +45 -1
- package/resources/conversations/items.d.ts.map +1 -1
- package/resources/evals/runs/runs.d.mts +66 -143
- package/resources/evals/runs/runs.d.mts.map +1 -1
- package/resources/evals/runs/runs.d.ts +66 -143
- package/resources/evals/runs/runs.d.ts.map +1 -1
- package/resources/evals/runs/runs.js.map +1 -1
- package/resources/evals/runs/runs.mjs.map +1 -1
- package/resources/graders/grader-models.d.mts +6 -13
- package/resources/graders/grader-models.d.mts.map +1 -1
- package/resources/graders/grader-models.d.ts +6 -13
- package/resources/graders/grader-models.d.ts.map +1 -1
- package/resources/realtime/calls.d.mts +1 -1
- package/resources/realtime/calls.d.mts.map +1 -1
- package/resources/realtime/calls.d.ts +1 -1
- package/resources/realtime/calls.d.ts.map +1 -1
- package/resources/realtime/client-secrets.d.mts +5 -1
- package/resources/realtime/client-secrets.d.mts.map +1 -1
- package/resources/realtime/client-secrets.d.ts +5 -1
- package/resources/realtime/client-secrets.d.ts.map +1 -1
- package/resources/realtime/realtime.d.mts +9 -1
- package/resources/realtime/realtime.d.mts.map +1 -1
- package/resources/realtime/realtime.d.ts +9 -1
- package/resources/realtime/realtime.d.ts.map +1 -1
- package/resources/realtime/realtime.js.map +1 -1
- package/resources/realtime/realtime.mjs.map +1 -1
- package/resources/responses/input-tokens.d.mts +7 -1
- package/resources/responses/input-tokens.d.mts.map +1 -1
- package/resources/responses/input-tokens.d.ts +7 -1
- package/resources/responses/input-tokens.d.ts.map +1 -1
- package/resources/responses/responses.d.mts +819 -26
- package/resources/responses/responses.d.mts.map +1 -1
- package/resources/responses/responses.d.ts +819 -26
- package/resources/responses/responses.d.ts.map +1 -1
- package/resources/responses/responses.js +1 -1
- package/resources/responses/responses.js.map +1 -1
- package/resources/responses/responses.mjs +1 -1
- package/resources/responses/responses.mjs.map +1 -1
- package/resources/shared.d.mts +20 -28
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +20 -28
- package/resources/shared.d.ts.map +1 -1
- package/src/client.ts +13 -5
- package/src/core/streaming.ts +36 -8
- package/src/core/uploads.ts +6 -1
- package/src/helpers/audio.ts +18 -4
- package/src/helpers/zod.ts +62 -23
- package/src/index.ts +1 -1
- package/src/internal/uploads.ts +214 -4
- package/src/lib/AbstractChatCompletionRunner.ts +32 -9
- package/src/lib/AssistantStream.ts +4 -3
- package/src/lib/ChatCompletionRunner.ts +46 -6
- package/src/lib/ChatCompletionStream.ts +115 -17
- package/src/lib/ChatCompletionStreamingRunner.ts +144 -7
- package/src/lib/EventStream.ts +114 -4
- package/src/lib/RunnableFunction.ts +60 -31
- package/src/lib/parser.ts +4 -0
- package/src/lib/responses/ResponseAccumulator.ts +10 -1
- package/src/lib/responses/ResponseInputItems.ts +2 -0
- package/src/lib/responses/ResponseStream.ts +29 -1
- package/src/resources/admin/organization/projects/api-keys.ts +15 -1
- package/src/resources/beta/assistants.ts +12 -26
- package/src/resources/beta/beta.ts +330 -2
- package/src/resources/beta/index.ts +163 -0
- package/src/resources/beta/responses/index.ts +169 -0
- package/src/resources/beta/responses/input-items.ts +105 -0
- package/src/resources/beta/responses/input-tokens.ts +245 -0
- package/src/resources/beta/responses/internal-base.ts +117 -0
- package/src/resources/beta/responses/responses.ts +12633 -0
- package/src/resources/beta/responses/ws-base.ts +615 -0
- package/src/resources/beta/responses/ws.ts +38 -0
- package/src/resources/beta/responses.ts +3 -0
- package/src/resources/beta/threads/runs/runs.ts +6 -13
- package/src/resources/chat/completions/completions.ts +237 -23
- package/src/resources/completions.ts +5 -0
- package/src/resources/conversations/conversations.ts +21 -0
- package/src/resources/conversations/items.ts +56 -0
- package/src/resources/evals/runs/runs.ts +66 -143
- package/src/resources/graders/grader-models.ts +6 -13
- package/src/resources/realtime/calls.ts +2 -0
- package/src/resources/realtime/client-secrets.ts +7 -0
- package/src/resources/realtime/realtime.ts +12 -0
- package/src/resources/responses/input-tokens.ts +8 -0
- package/src/resources/responses/responses.ts +953 -17
- package/src/resources/shared.ts +23 -27
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -15,8 +15,15 @@ import { path } from '../../../internal/utils/path';
|
|
|
15
15
|
import { ChatCompletionRunner } from '../../../lib/ChatCompletionRunner';
|
|
16
16
|
import { ChatCompletionStreamingRunner } from '../../../lib/ChatCompletionStreamingRunner';
|
|
17
17
|
import { RunnerOptions } from '../../../lib/AbstractChatCompletionRunner';
|
|
18
|
-
import {
|
|
19
|
-
|
|
18
|
+
import {
|
|
19
|
+
ChatCompletionToolRunnerParamsWithContext,
|
|
20
|
+
ChatCompletionToolRunnerParamsWithoutContext,
|
|
21
|
+
} from '../../../lib/ChatCompletionRunner';
|
|
22
|
+
import {
|
|
23
|
+
ChatCompletionStreamingToolRunnerParamsWithContext,
|
|
24
|
+
ChatCompletionStreamingToolRunnerParamsWithoutContext,
|
|
25
|
+
} from '../../../lib/ChatCompletionStreamingRunner';
|
|
26
|
+
import { type RunnableToolFunctionWithContext } from '../../../lib/RunnableFunction';
|
|
20
27
|
import { ChatCompletionStream, type ChatCompletionStreamParams } from '../../../lib/ChatCompletionStream';
|
|
21
28
|
import { ExtractParsedContentFromParams, parseChatCompletion, validateInputTools } from '../../../lib/parser';
|
|
22
29
|
|
|
@@ -188,17 +195,55 @@ export class Completions extends APIResource {
|
|
|
188
195
|
* [the docs](https://github.com/openai/openai-node#automated-function-calls)
|
|
189
196
|
*/
|
|
190
197
|
runTools<
|
|
191
|
-
|
|
198
|
+
ToolContext,
|
|
199
|
+
Params extends Omit<
|
|
200
|
+
ChatCompletionToolRunnerParamsWithContext<any, ToolContext>,
|
|
201
|
+
'toolContext' | 'tools'
|
|
202
|
+
> = Omit<ChatCompletionToolRunnerParamsWithContext<any, ToolContext>, 'toolContext' | 'tools'>,
|
|
203
|
+
ParsedT = ExtractParsedContentFromParams<
|
|
204
|
+
Params & ChatCompletionToolRunnerParamsWithContext<any, ToolContext>
|
|
205
|
+
>,
|
|
206
|
+
>(
|
|
207
|
+
body: Params & {
|
|
208
|
+
toolContext: ToolContext;
|
|
209
|
+
tools: readonly RunnableToolFunctionWithContext<ToolContext>[];
|
|
210
|
+
},
|
|
211
|
+
options?: RunnerOptions,
|
|
212
|
+
): ChatCompletionRunner<ParsedT>;
|
|
213
|
+
|
|
214
|
+
runTools<
|
|
215
|
+
ToolContext,
|
|
216
|
+
Params extends Omit<
|
|
217
|
+
ChatCompletionStreamingToolRunnerParamsWithContext<any, ToolContext>,
|
|
218
|
+
'toolContext' | 'tools'
|
|
219
|
+
> = Omit<ChatCompletionStreamingToolRunnerParamsWithContext<any, ToolContext>, 'toolContext' | 'tools'>,
|
|
220
|
+
ParsedT = ExtractParsedContentFromParams<
|
|
221
|
+
Params & ChatCompletionStreamingToolRunnerParamsWithContext<any, ToolContext>
|
|
222
|
+
>,
|
|
223
|
+
>(
|
|
224
|
+
body: Params & {
|
|
225
|
+
toolContext: ToolContext;
|
|
226
|
+
tools: readonly RunnableToolFunctionWithContext<ToolContext>[];
|
|
227
|
+
},
|
|
228
|
+
options?: RunnerOptions,
|
|
229
|
+
): ChatCompletionStreamingRunner<ParsedT>;
|
|
230
|
+
|
|
231
|
+
runTools<
|
|
232
|
+
Params extends ChatCompletionToolRunnerParamsWithoutContext<any>,
|
|
192
233
|
ParsedT = ExtractParsedContentFromParams<Params>,
|
|
193
234
|
>(body: Params, options?: RunnerOptions): ChatCompletionRunner<ParsedT>;
|
|
194
235
|
|
|
195
236
|
runTools<
|
|
196
|
-
Params extends
|
|
237
|
+
Params extends ChatCompletionStreamingToolRunnerParamsWithoutContext<any>,
|
|
197
238
|
ParsedT = ExtractParsedContentFromParams<Params>,
|
|
198
239
|
>(body: Params, options?: RunnerOptions): ChatCompletionStreamingRunner<ParsedT>;
|
|
199
240
|
|
|
200
241
|
runTools<
|
|
201
|
-
Params extends
|
|
242
|
+
Params extends
|
|
243
|
+
| ChatCompletionToolRunnerParamsWithoutContext<any>
|
|
244
|
+
| ChatCompletionToolRunnerParamsWithContext<any, any>
|
|
245
|
+
| ChatCompletionStreamingToolRunnerParamsWithoutContext<any>
|
|
246
|
+
| ChatCompletionStreamingToolRunnerParamsWithContext<any, any>,
|
|
202
247
|
ParsedT = ExtractParsedContentFromParams<Params>,
|
|
203
248
|
>(
|
|
204
249
|
body: Params,
|
|
@@ -207,12 +252,16 @@ export class Completions extends APIResource {
|
|
|
207
252
|
if (body.stream) {
|
|
208
253
|
return ChatCompletionStreamingRunner.runTools(
|
|
209
254
|
this._client,
|
|
210
|
-
body as
|
|
255
|
+
body as ChatCompletionStreamingToolRunnerParamsWithContext<any, any>,
|
|
211
256
|
options,
|
|
212
257
|
);
|
|
213
258
|
}
|
|
214
259
|
|
|
215
|
-
return ChatCompletionRunner.runTools(
|
|
260
|
+
return ChatCompletionRunner.runTools(
|
|
261
|
+
this._client,
|
|
262
|
+
body as ChatCompletionToolRunnerParamsWithContext<any, any>,
|
|
263
|
+
options,
|
|
264
|
+
);
|
|
216
265
|
}
|
|
217
266
|
|
|
218
267
|
/**
|
|
@@ -255,8 +304,16 @@ export {
|
|
|
255
304
|
type RunnableFunctionWithoutParse,
|
|
256
305
|
ParsingToolFunction,
|
|
257
306
|
} from '../../../lib/RunnableFunction';
|
|
258
|
-
export {
|
|
259
|
-
|
|
307
|
+
export {
|
|
308
|
+
type ChatCompletionToolRunnerParams,
|
|
309
|
+
type ChatCompletionToolRunnerParamsWithContext,
|
|
310
|
+
type ChatCompletionToolRunnerParamsWithoutContext,
|
|
311
|
+
} from '../../../lib/ChatCompletionRunner';
|
|
312
|
+
export {
|
|
313
|
+
type ChatCompletionStreamingToolRunnerParams,
|
|
314
|
+
type ChatCompletionStreamingToolRunnerParamsWithContext,
|
|
315
|
+
type ChatCompletionStreamingToolRunnerParamsWithoutContext,
|
|
316
|
+
} from '../../../lib/ChatCompletionStreamingRunner';
|
|
260
317
|
export { ChatCompletionStream, type ChatCompletionStreamParams } from '../../../lib/ChatCompletionStream';
|
|
261
318
|
export { ChatCompletionRunner } from '../../../lib/ChatCompletionRunner';
|
|
262
319
|
|
|
@@ -1129,6 +1186,13 @@ export namespace ChatCompletionContentPart {
|
|
|
1129
1186
|
* The type of the content part. Always `file`.
|
|
1130
1187
|
*/
|
|
1131
1188
|
type: 'file';
|
|
1189
|
+
|
|
1190
|
+
/**
|
|
1191
|
+
* Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
|
|
1192
|
+
* from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
|
|
1193
|
+
* token block.
|
|
1194
|
+
*/
|
|
1195
|
+
prompt_cache_breakpoint?: File.PromptCacheBreakpoint;
|
|
1132
1196
|
}
|
|
1133
1197
|
|
|
1134
1198
|
export namespace File {
|
|
@@ -1149,6 +1213,18 @@ export namespace ChatCompletionContentPart {
|
|
|
1149
1213
|
*/
|
|
1150
1214
|
filename?: string;
|
|
1151
1215
|
}
|
|
1216
|
+
|
|
1217
|
+
/**
|
|
1218
|
+
* Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
|
|
1219
|
+
* from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
|
|
1220
|
+
* token block.
|
|
1221
|
+
*/
|
|
1222
|
+
export interface PromptCacheBreakpoint {
|
|
1223
|
+
/**
|
|
1224
|
+
* The breakpoint mode. Always `explicit`.
|
|
1225
|
+
*/
|
|
1226
|
+
mode: 'explicit';
|
|
1227
|
+
}
|
|
1152
1228
|
}
|
|
1153
1229
|
}
|
|
1154
1230
|
|
|
@@ -1162,6 +1238,13 @@ export interface ChatCompletionContentPartImage {
|
|
|
1162
1238
|
* The type of the content part.
|
|
1163
1239
|
*/
|
|
1164
1240
|
type: 'image_url';
|
|
1241
|
+
|
|
1242
|
+
/**
|
|
1243
|
+
* Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
|
|
1244
|
+
* from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
|
|
1245
|
+
* token block.
|
|
1246
|
+
*/
|
|
1247
|
+
prompt_cache_breakpoint?: ChatCompletionContentPartImage.PromptCacheBreakpoint;
|
|
1165
1248
|
}
|
|
1166
1249
|
|
|
1167
1250
|
export namespace ChatCompletionContentPartImage {
|
|
@@ -1177,6 +1260,18 @@ export namespace ChatCompletionContentPartImage {
|
|
|
1177
1260
|
*/
|
|
1178
1261
|
detail?: 'auto' | 'low' | 'high';
|
|
1179
1262
|
}
|
|
1263
|
+
|
|
1264
|
+
/**
|
|
1265
|
+
* Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
|
|
1266
|
+
* from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
|
|
1267
|
+
* token block.
|
|
1268
|
+
*/
|
|
1269
|
+
export interface PromptCacheBreakpoint {
|
|
1270
|
+
/**
|
|
1271
|
+
* The breakpoint mode. Always `explicit`.
|
|
1272
|
+
*/
|
|
1273
|
+
mode: 'explicit';
|
|
1274
|
+
}
|
|
1180
1275
|
}
|
|
1181
1276
|
|
|
1182
1277
|
/**
|
|
@@ -1189,6 +1284,13 @@ export interface ChatCompletionContentPartInputAudio {
|
|
|
1189
1284
|
* The type of the content part. Always `input_audio`.
|
|
1190
1285
|
*/
|
|
1191
1286
|
type: 'input_audio';
|
|
1287
|
+
|
|
1288
|
+
/**
|
|
1289
|
+
* Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
|
|
1290
|
+
* from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
|
|
1291
|
+
* token block.
|
|
1292
|
+
*/
|
|
1293
|
+
prompt_cache_breakpoint?: ChatCompletionContentPartInputAudio.PromptCacheBreakpoint;
|
|
1192
1294
|
}
|
|
1193
1295
|
|
|
1194
1296
|
export namespace ChatCompletionContentPartInputAudio {
|
|
@@ -1203,6 +1305,18 @@ export namespace ChatCompletionContentPartInputAudio {
|
|
|
1203
1305
|
*/
|
|
1204
1306
|
format: 'wav' | 'mp3';
|
|
1205
1307
|
}
|
|
1308
|
+
|
|
1309
|
+
/**
|
|
1310
|
+
* Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
|
|
1311
|
+
* from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
|
|
1312
|
+
* token block.
|
|
1313
|
+
*/
|
|
1314
|
+
export interface PromptCacheBreakpoint {
|
|
1315
|
+
/**
|
|
1316
|
+
* The breakpoint mode. Always `explicit`.
|
|
1317
|
+
*/
|
|
1318
|
+
mode: 'explicit';
|
|
1319
|
+
}
|
|
1206
1320
|
}
|
|
1207
1321
|
|
|
1208
1322
|
export interface ChatCompletionContentPartRefusal {
|
|
@@ -1231,6 +1345,27 @@ export interface ChatCompletionContentPartText {
|
|
|
1231
1345
|
* The type of the content part.
|
|
1232
1346
|
*/
|
|
1233
1347
|
type: 'text';
|
|
1348
|
+
|
|
1349
|
+
/**
|
|
1350
|
+
* Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
|
|
1351
|
+
* from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
|
|
1352
|
+
* token block.
|
|
1353
|
+
*/
|
|
1354
|
+
prompt_cache_breakpoint?: ChatCompletionContentPartText.PromptCacheBreakpoint;
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
export namespace ChatCompletionContentPartText {
|
|
1358
|
+
/**
|
|
1359
|
+
* Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
|
|
1360
|
+
* from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
|
|
1361
|
+
* token block.
|
|
1362
|
+
*/
|
|
1363
|
+
export interface PromptCacheBreakpoint {
|
|
1364
|
+
/**
|
|
1365
|
+
* The breakpoint mode. Always `explicit`.
|
|
1366
|
+
*/
|
|
1367
|
+
mode: 'explicit';
|
|
1368
|
+
}
|
|
1234
1369
|
}
|
|
1235
1370
|
|
|
1236
1371
|
/**
|
|
@@ -2046,11 +2181,29 @@ export interface ChatCompletionCreateParamsBase {
|
|
|
2046
2181
|
prompt_cache_key?: string;
|
|
2047
2182
|
|
|
2048
2183
|
/**
|
|
2184
|
+
* Options for prompt caching. Supported for `gpt-5.6` and later models. By
|
|
2185
|
+
* default, OpenAI automatically chooses one implicit cache breakpoint. You can add
|
|
2186
|
+
* explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each
|
|
2187
|
+
* request can write up to four breakpoints. For cache matching, OpenAI considers
|
|
2188
|
+
* up to the latest 80 breakpoints in the conversation, without a content-block
|
|
2189
|
+
* lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
|
|
2190
|
+
* `ttl` defaults to `30m`, which is currently the only supported value. See the
|
|
2191
|
+
* [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching)
|
|
2192
|
+
* for current details.
|
|
2193
|
+
*/
|
|
2194
|
+
prompt_cache_options?: ChatCompletionCreateParams.PromptCacheOptions;
|
|
2195
|
+
|
|
2196
|
+
/**
|
|
2197
|
+
* @deprecated Deprecated. Use `prompt_cache_options.ttl` instead.
|
|
2198
|
+
*
|
|
2049
2199
|
* The retention policy for the prompt cache. Set to `24h` to enable extended
|
|
2050
2200
|
* prompt caching, which keeps cached prefixes active for longer, up to a maximum
|
|
2051
2201
|
* of 24 hours.
|
|
2052
2202
|
* [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
|
|
2053
|
-
*
|
|
2203
|
+
* This field expresses a maximum retention policy, while
|
|
2204
|
+
* `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two fields
|
|
2205
|
+
* are independent and do not interact. For `gpt-5.5`, `gpt-5.5-pro`, and future
|
|
2206
|
+
* models, only `24h` is supported.
|
|
2054
2207
|
*
|
|
2055
2208
|
* For older models that support both `in_memory` and `24h`, the default depends on
|
|
2056
2209
|
* your organization's data retention policy:
|
|
@@ -2062,19 +2215,12 @@ export interface ChatCompletionCreateParamsBase {
|
|
|
2062
2215
|
prompt_cache_retention?: 'in_memory' | '24h' | null;
|
|
2063
2216
|
|
|
2064
2217
|
/**
|
|
2065
|
-
* Constrains effort on reasoning for
|
|
2066
|
-
*
|
|
2067
|
-
*
|
|
2068
|
-
*
|
|
2069
|
-
*
|
|
2070
|
-
*
|
|
2071
|
-
* - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
|
|
2072
|
-
* reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
|
|
2073
|
-
* calls are supported for all reasoning values in gpt-5.1.
|
|
2074
|
-
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
|
|
2075
|
-
* support `none`.
|
|
2076
|
-
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
|
|
2077
|
-
* - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
|
|
2218
|
+
* Constrains effort on reasoning for reasoning models. Currently supported values
|
|
2219
|
+
* are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing
|
|
2220
|
+
* reasoning effort can result in faster responses and fewer tokens used on
|
|
2221
|
+
* reasoning in a response. Not all reasoning models support every value. See the
|
|
2222
|
+
* [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for
|
|
2223
|
+
* model-specific support.
|
|
2078
2224
|
*/
|
|
2079
2225
|
reasoning_effort?: Shared.ReasoningEffort | null;
|
|
2080
2226
|
|
|
@@ -2276,6 +2422,74 @@ export namespace ChatCompletionCreateParams {
|
|
|
2276
2422
|
* 'omni-moderation-latest'.
|
|
2277
2423
|
*/
|
|
2278
2424
|
model: string;
|
|
2425
|
+
|
|
2426
|
+
/**
|
|
2427
|
+
* The policy to apply to moderated response input and output.
|
|
2428
|
+
*/
|
|
2429
|
+
policy?: Moderation.Policy | null;
|
|
2430
|
+
}
|
|
2431
|
+
|
|
2432
|
+
export namespace Moderation {
|
|
2433
|
+
/**
|
|
2434
|
+
* The policy to apply to moderated response input and output.
|
|
2435
|
+
*/
|
|
2436
|
+
export interface Policy {
|
|
2437
|
+
/**
|
|
2438
|
+
* The moderation policy for the response input.
|
|
2439
|
+
*/
|
|
2440
|
+
input?: Policy.Input | null;
|
|
2441
|
+
|
|
2442
|
+
/**
|
|
2443
|
+
* The moderation policy for the response output.
|
|
2444
|
+
*/
|
|
2445
|
+
output?: Policy.Output | null;
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
export namespace Policy {
|
|
2449
|
+
/**
|
|
2450
|
+
* The moderation policy for the response input.
|
|
2451
|
+
*/
|
|
2452
|
+
export interface Input {
|
|
2453
|
+
mode: 'score' | 'block';
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
/**
|
|
2457
|
+
* The moderation policy for the response output.
|
|
2458
|
+
*/
|
|
2459
|
+
export interface Output {
|
|
2460
|
+
mode: 'score' | 'block';
|
|
2461
|
+
}
|
|
2462
|
+
}
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
/**
|
|
2466
|
+
* Options for prompt caching. Supported for `gpt-5.6` and later models. By
|
|
2467
|
+
* default, OpenAI automatically chooses one implicit cache breakpoint. You can add
|
|
2468
|
+
* explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each
|
|
2469
|
+
* request can write up to four breakpoints. For cache matching, OpenAI considers
|
|
2470
|
+
* up to the latest 80 breakpoints in the conversation, without a content-block
|
|
2471
|
+
* lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
|
|
2472
|
+
* `ttl` defaults to `30m`, which is currently the only supported value. See the
|
|
2473
|
+
* [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching)
|
|
2474
|
+
* for current details.
|
|
2475
|
+
*/
|
|
2476
|
+
export interface PromptCacheOptions {
|
|
2477
|
+
/**
|
|
2478
|
+
* Controls whether OpenAI automatically creates an implicit cache breakpoint.
|
|
2479
|
+
* Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint
|
|
2480
|
+
* and writes up to the latest three explicit breakpoints in the request. With
|
|
2481
|
+
* `explicit`, OpenAI does not create an implicit breakpoint and writes up to the
|
|
2482
|
+
* latest four explicit breakpoints. If there are no explicit breakpoints, the
|
|
2483
|
+
* request does not use prompt caching.
|
|
2484
|
+
*/
|
|
2485
|
+
mode?: 'implicit' | 'explicit';
|
|
2486
|
+
|
|
2487
|
+
/**
|
|
2488
|
+
* The minimum lifetime applied to every implicit and explicit cache breakpoint
|
|
2489
|
+
* written by the request. Defaults to `30m`, which is currently the only supported
|
|
2490
|
+
* value. The backend may retain cache entries for longer.
|
|
2491
|
+
*/
|
|
2492
|
+
ttl?: '30m';
|
|
2279
2493
|
}
|
|
2280
2494
|
|
|
2281
2495
|
/**
|
|
@@ -185,6 +185,11 @@ export namespace CompletionUsage {
|
|
|
185
185
|
*/
|
|
186
186
|
audio_tokens?: number;
|
|
187
187
|
|
|
188
|
+
/**
|
|
189
|
+
* The unadjusted number of prompt tokens written to cache.
|
|
190
|
+
*/
|
|
191
|
+
cache_write_tokens?: number;
|
|
192
|
+
|
|
188
193
|
/**
|
|
189
194
|
* Cached tokens present in the prompt.
|
|
190
195
|
*/
|
|
@@ -95,6 +95,27 @@ export interface ComputerScreenshotContent {
|
|
|
95
95
|
* to `computer_screenshot`.
|
|
96
96
|
*/
|
|
97
97
|
type: 'computer_screenshot';
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
|
|
101
|
+
* from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
|
|
102
|
+
* token block.
|
|
103
|
+
*/
|
|
104
|
+
prompt_cache_breakpoint?: ComputerScreenshotContent.PromptCacheBreakpoint;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export namespace ComputerScreenshotContent {
|
|
108
|
+
/**
|
|
109
|
+
* Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
|
|
110
|
+
* from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
|
|
111
|
+
* token block.
|
|
112
|
+
*/
|
|
113
|
+
export interface PromptCacheBreakpoint {
|
|
114
|
+
/**
|
|
115
|
+
* The breakpoint mode. Always `explicit`.
|
|
116
|
+
*/
|
|
117
|
+
mode: 'explicit';
|
|
118
|
+
}
|
|
98
119
|
}
|
|
99
120
|
|
|
100
121
|
export interface Conversation {
|
|
@@ -100,6 +100,8 @@ export type ConversationItem =
|
|
|
100
100
|
| ResponsesAPI.ResponseToolSearchOutputItem
|
|
101
101
|
| ConversationItem.AdditionalTools
|
|
102
102
|
| ResponsesAPI.ResponseReasoningItem
|
|
103
|
+
| ConversationItem.Program
|
|
104
|
+
| ConversationItem.ProgramOutput
|
|
103
105
|
| ResponsesAPI.ResponseCompactionItem
|
|
104
106
|
| ResponsesAPI.ResponseCodeInterpreterToolCall
|
|
105
107
|
| ConversationItem.LocalShellCall
|
|
@@ -163,6 +165,60 @@ export namespace ConversationItem {
|
|
|
163
165
|
type: 'additional_tools';
|
|
164
166
|
}
|
|
165
167
|
|
|
168
|
+
export interface Program {
|
|
169
|
+
/**
|
|
170
|
+
* The unique ID of the program item.
|
|
171
|
+
*/
|
|
172
|
+
id: string;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* The stable call ID of the program item.
|
|
176
|
+
*/
|
|
177
|
+
call_id: string;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* The JavaScript source executed by programmatic tool calling.
|
|
181
|
+
*/
|
|
182
|
+
code: string;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Opaque program replay fingerprint that must be round-tripped.
|
|
186
|
+
*/
|
|
187
|
+
fingerprint: string;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The type of the item. Always `program`.
|
|
191
|
+
*/
|
|
192
|
+
type: 'program';
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface ProgramOutput {
|
|
196
|
+
/**
|
|
197
|
+
* The unique ID of the program output item.
|
|
198
|
+
*/
|
|
199
|
+
id: string;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* The call ID of the program item.
|
|
203
|
+
*/
|
|
204
|
+
call_id: string;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* The result produced by the program item.
|
|
208
|
+
*/
|
|
209
|
+
result: string;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* The terminal status of the program output item.
|
|
213
|
+
*/
|
|
214
|
+
status: 'completed' | 'incomplete';
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* The type of the item. Always `program_output`.
|
|
218
|
+
*/
|
|
219
|
+
type: 'program_output';
|
|
220
|
+
}
|
|
221
|
+
|
|
166
222
|
/**
|
|
167
223
|
* A tool call to run a command on the local shell.
|
|
168
224
|
*/
|