openai 7.28.0 → 7.30.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 +16 -0
- package/client.d.mts +3 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -0
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/helpers/standard-schema.d.mts +8 -3
- package/helpers/standard-schema.d.mts.map +1 -1
- package/helpers/standard-schema.d.ts +8 -3
- package/helpers/standard-schema.d.ts.map +1 -1
- package/helpers/standard-schema.js +1 -0
- package/helpers/standard-schema.js.map +1 -1
- package/helpers/standard-schema.mjs +1 -0
- package/helpers/standard-schema.mjs.map +1 -1
- package/helpers/zod.d.mts +2 -0
- package/helpers/zod.d.mts.map +1 -1
- package/helpers/zod.d.ts +2 -0
- package/helpers/zod.d.ts.map +1 -1
- package/helpers/zod.js +1 -0
- package/helpers/zod.js.map +1 -1
- package/helpers/zod.mjs +1 -0
- package/helpers/zod.mjs.map +1 -1
- package/lib/ChatCompletionStream.d.mts +2 -1
- package/lib/ChatCompletionStream.d.mts.map +1 -1
- package/lib/ChatCompletionStream.d.ts +2 -1
- package/lib/ChatCompletionStream.d.ts.map +1 -1
- package/lib/ChatCompletionStream.js +9 -2
- package/lib/ChatCompletionStream.js.map +1 -1
- package/lib/ChatCompletionStream.mjs +9 -2
- package/lib/ChatCompletionStream.mjs.map +1 -1
- package/lib/ResponsesParser.d.mts.map +1 -1
- package/lib/ResponsesParser.d.ts.map +1 -1
- package/lib/ResponsesParser.js +5 -0
- package/lib/ResponsesParser.js.map +1 -1
- package/lib/ResponsesParser.mjs +5 -0
- package/lib/ResponsesParser.mjs.map +1 -1
- package/lib/agents/agent-session-stream.d.mts +7 -0
- package/lib/agents/agent-session-stream.d.mts.map +1 -1
- package/lib/agents/agent-session-stream.d.ts +7 -0
- package/lib/agents/agent-session-stream.d.ts.map +1 -1
- package/lib/agents/agent-session-stream.js +8 -110
- package/lib/agents/agent-session-stream.js.map +1 -1
- package/lib/agents/agent-session-stream.mjs +9 -111
- package/lib/agents/agent-session-stream.mjs.map +1 -1
- package/lib/beta/agents/agent-session-create-stream.d.mts +41 -1
- package/lib/beta/agents/agent-session-create-stream.d.mts.map +1 -1
- package/lib/beta/agents/agent-session-create-stream.d.ts +41 -1
- package/lib/beta/agents/agent-session-create-stream.d.ts.map +1 -1
- package/lib/beta/agents/agent-session-create-stream.js +70 -2
- package/lib/beta/agents/agent-session-create-stream.js.map +1 -1
- package/lib/beta/agents/agent-session-create-stream.mjs +69 -2
- package/lib/beta/agents/agent-session-create-stream.mjs.map +1 -1
- package/lib/beta/agents/function-tool.d.mts.map +1 -1
- package/lib/beta/agents/function-tool.d.ts.map +1 -1
- package/lib/beta/agents/function-tool.js +22 -15
- package/lib/beta/agents/function-tool.js.map +1 -1
- package/lib/beta/agents/function-tool.mjs +22 -15
- package/lib/beta/agents/function-tool.mjs.map +1 -1
- package/lib/beta/agents/parse-result.d.mts +2 -0
- package/lib/beta/agents/parse-result.d.mts.map +1 -1
- package/lib/beta/agents/parse-result.d.ts +2 -0
- package/lib/beta/agents/parse-result.d.ts.map +1 -1
- package/lib/beta/agents/tool-dispatcher.d.mts +13 -0
- package/lib/beta/agents/tool-dispatcher.d.mts.map +1 -0
- package/lib/beta/agents/tool-dispatcher.d.ts +13 -0
- package/lib/beta/agents/tool-dispatcher.d.ts.map +1 -0
- package/lib/beta/agents/tool-dispatcher.js +185 -0
- package/lib/beta/agents/tool-dispatcher.js.map +1 -0
- package/lib/beta/agents/tool-dispatcher.mjs +181 -0
- package/lib/beta/agents/tool-dispatcher.mjs.map +1 -0
- package/lib/beta/agents/tool-error.d.mts +13 -0
- package/lib/beta/agents/tool-error.d.mts.map +1 -0
- package/lib/beta/agents/tool-error.d.ts +13 -0
- package/lib/beta/agents/tool-error.d.ts.map +1 -0
- package/lib/beta/agents/tool-error.js +3 -0
- package/lib/beta/agents/tool-error.js.map +1 -0
- package/lib/beta/agents/tool-error.mjs +2 -0
- package/lib/beta/agents/tool-error.mjs.map +1 -0
- package/lib/beta/agents/tool-stages.d.mts +12 -0
- package/lib/beta/agents/tool-stages.d.mts.map +1 -0
- package/lib/beta/agents/tool-stages.d.ts +12 -0
- package/lib/beta/agents/tool-stages.d.ts.map +1 -0
- package/lib/beta/agents/tool-stages.js +6 -0
- package/lib/beta/agents/tool-stages.js.map +1 -0
- package/lib/beta/agents/tool-stages.mjs +3 -0
- package/lib/beta/agents/tool-stages.mjs.map +1 -0
- package/lib/chat-completions/streaming.d.mts +11 -0
- package/lib/chat-completions/streaming.d.mts.map +1 -0
- package/lib/chat-completions/streaming.d.ts +11 -0
- package/lib/chat-completions/streaming.d.ts.map +1 -0
- package/lib/chat-completions/streaming.js +27 -0
- package/lib/chat-completions/streaming.js.map +1 -0
- package/lib/chat-completions/streaming.mjs +23 -0
- package/lib/chat-completions/streaming.mjs.map +1 -0
- package/package.json +1 -1
- package/resources/admin/organization/usage.d.mts +304 -9
- package/resources/admin/organization/usage.d.mts.map +1 -1
- package/resources/admin/organization/usage.d.ts +304 -9
- package/resources/admin/organization/usage.d.ts.map +1 -1
- package/resources/beta/agents/agents.d.mts +12 -6
- package/resources/beta/agents/agents.d.mts.map +1 -1
- package/resources/beta/agents/agents.d.ts +12 -6
- package/resources/beta/agents/agents.d.ts.map +1 -1
- package/resources/beta/agents/agents.js.map +1 -1
- package/resources/beta/agents/agents.mjs.map +1 -1
- package/resources/beta/agents/environments/templates.d.mts +6 -8
- package/resources/beta/agents/environments/templates.d.mts.map +1 -1
- package/resources/beta/agents/environments/templates.d.ts +6 -8
- package/resources/beta/agents/environments/templates.d.ts.map +1 -1
- package/resources/beta/agents/sessions/index.d.mts +1 -1
- package/resources/beta/agents/sessions/index.d.mts.map +1 -1
- package/resources/beta/agents/sessions/index.d.ts +1 -1
- package/resources/beta/agents/sessions/index.d.ts.map +1 -1
- package/resources/beta/agents/sessions/index.js +2 -2
- package/resources/beta/agents/sessions/index.js.map +1 -1
- package/resources/beta/agents/sessions/index.mjs +1 -1
- package/resources/beta/agents/sessions/index.mjs.map +1 -1
- package/resources/beta/agents/sessions/sessions.d.mts +6 -3
- package/resources/beta/agents/sessions/sessions.d.mts.map +1 -1
- package/resources/beta/agents/sessions/sessions.d.ts +6 -3
- package/resources/beta/agents/sessions/sessions.d.ts.map +1 -1
- package/resources/beta/agents/sessions/sessions.js +7 -4
- package/resources/beta/agents/sessions/sessions.js.map +1 -1
- package/resources/beta/agents/sessions/sessions.mjs +8 -5
- package/resources/beta/agents/sessions/sessions.mjs.map +1 -1
- package/resources/beta/agents/sessions/subagents/turns/turns.d.mts +2 -2
- package/resources/beta/agents/sessions/subagents/turns/turns.d.mts.map +1 -1
- package/resources/beta/agents/sessions/subagents/turns/turns.d.ts +2 -2
- package/resources/beta/agents/sessions/subagents/turns/turns.d.ts.map +1 -1
- package/resources/beta/agents/sessions/turns/index.d.mts +3 -0
- package/resources/beta/agents/sessions/turns/index.d.mts.map +1 -0
- package/resources/beta/agents/sessions/turns/index.d.ts +3 -0
- package/resources/beta/agents/sessions/turns/index.d.ts.map +1 -0
- package/resources/beta/agents/sessions/turns/index.js +9 -0
- package/resources/beta/agents/sessions/turns/index.js.map +1 -0
- package/resources/beta/agents/sessions/turns/index.mjs +4 -0
- package/resources/beta/agents/sessions/turns/index.mjs.map +1 -0
- package/resources/beta/agents/sessions/turns/items.d.mts +43 -0
- package/resources/beta/agents/sessions/turns/items.d.mts.map +1 -0
- package/resources/beta/agents/sessions/turns/items.d.ts +43 -0
- package/resources/beta/agents/sessions/turns/items.d.ts.map +1 -0
- package/resources/beta/agents/sessions/turns/items.js +40 -0
- package/resources/beta/agents/sessions/turns/items.js.map +1 -0
- package/resources/beta/agents/sessions/turns/items.mjs +36 -0
- package/resources/beta/agents/sessions/turns/items.mjs.map +1 -0
- package/resources/beta/agents/sessions/turns/turns.d.mts +128 -0
- package/resources/beta/agents/sessions/turns/turns.d.mts.map +1 -0
- package/resources/beta/agents/sessions/turns/turns.d.ts +128 -0
- package/resources/beta/agents/sessions/turns/turns.d.ts.map +1 -0
- package/resources/beta/agents/sessions/turns/turns.js +111 -0
- package/resources/beta/agents/sessions/turns/turns.js.map +1 -0
- package/resources/beta/agents/sessions/turns/turns.mjs +106 -0
- package/resources/beta/agents/sessions/turns/turns.mjs.map +1 -0
- package/resources/beta/agents/sessions/turns.d.mts +1 -123
- package/resources/beta/agents/sessions/turns.d.mts.map +1 -1
- package/resources/beta/agents/sessions/turns.d.ts +1 -123
- package/resources/beta/agents/sessions/turns.d.ts.map +1 -1
- package/resources/beta/agents/sessions/turns.js +2 -99
- package/resources/beta/agents/sessions/turns.js.map +1 -1
- package/resources/beta/agents/sessions/turns.mjs +1 -97
- package/resources/beta/agents/sessions/turns.mjs.map +1 -1
- package/resources/beta/beta.d.mts +2 -2
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +2 -2
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.d.mts +1 -1
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +1 -1
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/responses/index.d.mts +1 -1
- package/resources/beta/responses/index.d.mts.map +1 -1
- package/resources/beta/responses/index.d.ts +1 -1
- package/resources/beta/responses/index.d.ts.map +1 -1
- package/resources/beta/responses/index.js.map +1 -1
- package/resources/beta/responses/index.mjs.map +1 -1
- package/resources/beta/responses/responses.d.mts +378 -6
- package/resources/beta/responses/responses.d.mts.map +1 -1
- package/resources/beta/responses/responses.d.ts +378 -6
- package/resources/beta/responses/responses.d.ts.map +1 -1
- package/resources/beta/responses/responses.js.map +1 -1
- package/resources/beta/responses/responses.mjs.map +1 -1
- package/resources/chat/completions/completions.d.mts +42 -8
- package/resources/chat/completions/completions.d.mts.map +1 -1
- package/resources/chat/completions/completions.d.ts +42 -8
- package/resources/chat/completions/completions.d.ts.map +1 -1
- package/resources/chat/completions/completions.js +5 -2
- package/resources/chat/completions/completions.js.map +1 -1
- package/resources/chat/completions/completions.mjs +5 -2
- package/resources/chat/completions/completions.mjs.map +1 -1
- package/resources/completions.d.mts +1 -1
- package/resources/completions.d.mts.map +1 -1
- package/resources/completions.d.ts +1 -1
- package/resources/completions.d.ts.map +1 -1
- package/resources/decisions.d.mts +196 -0
- package/resources/decisions.d.mts.map +1 -0
- package/resources/decisions.d.ts +196 -0
- package/resources/decisions.d.ts.map +1 -0
- package/resources/decisions.js +32 -0
- package/resources/decisions.js.map +1 -0
- package/resources/decisions.mjs +28 -0
- package/resources/decisions.mjs.map +1 -0
- package/resources/fine-tuning/jobs/jobs.d.mts +7 -2
- package/resources/fine-tuning/jobs/jobs.d.mts.map +1 -1
- package/resources/fine-tuning/jobs/jobs.d.ts +7 -2
- package/resources/fine-tuning/jobs/jobs.d.ts.map +1 -1
- package/resources/fine-tuning/jobs/jobs.js.map +1 -1
- package/resources/fine-tuning/jobs/jobs.mjs.map +1 -1
- package/resources/graders/grader-models.d.mts +1 -1
- package/resources/graders/grader-models.d.ts +1 -1
- package/resources/images.d.mts +4 -3
- package/resources/images.d.mts.map +1 -1
- package/resources/images.d.ts +4 -3
- package/resources/images.d.ts.map +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/realtime/realtime.d.mts +10 -0
- package/resources/realtime/realtime.d.mts.map +1 -1
- package/resources/realtime/realtime.d.ts +10 -0
- 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/responses.d.mts +380 -6
- package/resources/responses/responses.d.mts.map +1 -1
- package/resources/responses/responses.d.ts +380 -6
- package/resources/responses/responses.d.ts.map +1 -1
- package/resources/responses/responses.js.map +1 -1
- package/resources/responses/responses.mjs.map +1 -1
- package/resources/shared.d.mts +5 -0
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +5 -0
- package/resources/shared.d.ts.map +1 -1
- package/resources/videos.d.mts +5 -0
- package/resources/videos.d.mts.map +1 -1
- package/resources/videos.d.ts +5 -0
- package/resources/videos.d.ts.map +1 -1
- package/src/client.ts +21 -0
- package/src/helpers/standard-schema.ts +11 -4
- package/src/helpers/zod.ts +4 -0
- package/src/lib/ChatCompletionStream.ts +10 -3
- package/src/lib/ResponsesParser.ts +8 -0
- package/src/lib/agents/agent-session-stream.ts +20 -124
- package/src/lib/beta/agents/agent-session-create-stream.ts +87 -1
- package/src/lib/beta/agents/function-tool.ts +23 -15
- package/src/lib/beta/agents/tool-dispatcher.ts +226 -0
- package/src/lib/beta/agents/tool-error.ts +12 -0
- package/src/lib/beta/agents/tool-stages.ts +14 -0
- package/src/lib/chat-completions/streaming.ts +35 -0
- package/src/resources/admin/organization/usage.ts +350 -9
- package/src/resources/beta/agents/agents.ts +14 -5
- package/src/resources/beta/agents/environments/templates.ts +6 -8
- package/src/resources/beta/agents/sessions/index.ts +7 -1
- package/src/resources/beta/agents/sessions/sessions.ts +16 -4
- package/src/resources/beta/agents/sessions/subagents/turns/turns.ts +2 -2
- package/src/resources/beta/agents/sessions/turns/index.ts +4 -0
- package/src/resources/beta/agents/sessions/turns/items.ts +79 -0
- package/src/resources/beta/agents/sessions/turns/turns.ts +383 -0
- package/src/resources/beta/agents/sessions/turns.ts +1 -373
- package/src/resources/beta/beta.ts +2 -0
- package/src/resources/beta/index.ts +1 -0
- package/src/resources/beta/responses/index.ts +1 -0
- package/src/resources/beta/responses/responses.ts +470 -5
- package/src/resources/chat/completions/completions.ts +65 -18
- package/src/resources/completions.ts +1 -1
- package/src/resources/decisions.ts +290 -0
- package/src/resources/fine-tuning/jobs/jobs.ts +7 -2
- package/src/resources/graders/grader-models.ts +1 -1
- package/src/resources/images.ts +4 -3
- package/src/resources/index.ts +9 -0
- package/src/resources/realtime/realtime.ts +10 -0
- package/src/resources/responses/api.md +1 -0
- package/src/resources/responses/responses.ts +472 -5
- package/src/resources/shared.ts +6 -0
- package/src/resources/videos.ts +6 -0
- 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
|
@@ -2977,7 +2977,7 @@ export namespace BetaResponseComputerToolCall {
|
|
|
2977
2977
|
|
|
2978
2978
|
export interface BetaResponseComputerToolCallOutputItem {
|
|
2979
2979
|
/**
|
|
2980
|
-
* The
|
|
2980
|
+
* The ID of the computer tool call output.
|
|
2981
2981
|
*/
|
|
2982
2982
|
id: string;
|
|
2983
2983
|
|
|
@@ -3725,6 +3725,12 @@ export namespace BetaResponseError {
|
|
|
3725
3725
|
| 'potentially_unintended_destructive_activity'
|
|
3726
3726
|
| 'other';
|
|
3727
3727
|
|
|
3728
|
+
/**
|
|
3729
|
+
* An opaque target for explicitly continuing this review, or null when
|
|
3730
|
+
* unavailable.
|
|
3731
|
+
*/
|
|
3732
|
+
review_target?: string | null;
|
|
3733
|
+
|
|
3728
3734
|
/**
|
|
3729
3735
|
* An optional public continuation instruction.
|
|
3730
3736
|
*/
|
|
@@ -11658,7 +11664,24 @@ export interface BetaResponseToolSearchOutputItemParam {
|
|
|
11658
11664
|
/**
|
|
11659
11665
|
* The loaded tool definitions returned by the tool search output.
|
|
11660
11666
|
*/
|
|
11661
|
-
tools: Array<
|
|
11667
|
+
tools: Array<
|
|
11668
|
+
| BetaFunctionTool
|
|
11669
|
+
| BetaFileSearchTool
|
|
11670
|
+
| BetaComputerTool
|
|
11671
|
+
| BetaComputerUsePreviewTool
|
|
11672
|
+
| BetaWebSearchTool
|
|
11673
|
+
| BetaResponseToolSearchOutputItemParam.Mcp
|
|
11674
|
+
| BetaResponseToolSearchOutputItemParam.CodeInterpreter
|
|
11675
|
+
| BetaResponseToolSearchOutputItemParam.ProgrammaticToolCalling
|
|
11676
|
+
| BetaResponseToolSearchOutputItemParam.ImageGeneration
|
|
11677
|
+
| BetaResponseToolSearchOutputItemParam.LocalShell
|
|
11678
|
+
| BetaFunctionShellTool
|
|
11679
|
+
| BetaCustomTool
|
|
11680
|
+
| BetaToolSearchOutputNamespaceTool
|
|
11681
|
+
| BetaToolSearchTool
|
|
11682
|
+
| BetaWebSearchPreviewTool
|
|
11683
|
+
| BetaApplyPatchTool
|
|
11684
|
+
>;
|
|
11662
11685
|
|
|
11663
11686
|
/**
|
|
11664
11687
|
* The item type. Always `tool_search_output`.
|
|
@@ -11692,6 +11715,371 @@ export interface BetaResponseToolSearchOutputItemParam {
|
|
|
11692
11715
|
}
|
|
11693
11716
|
|
|
11694
11717
|
export namespace BetaResponseToolSearchOutputItemParam {
|
|
11718
|
+
/**
|
|
11719
|
+
* Give the model access to additional tools via remote Model Context Protocol
|
|
11720
|
+
* (MCP) servers.
|
|
11721
|
+
* [Learn more about MCP](https://developers.openai.com/api/docs/guides/tools-connectors-mcp).
|
|
11722
|
+
*/
|
|
11723
|
+
export interface Mcp {
|
|
11724
|
+
/**
|
|
11725
|
+
* A label for this MCP server, used to identify it in tool calls.
|
|
11726
|
+
*/
|
|
11727
|
+
server_label: string;
|
|
11728
|
+
|
|
11729
|
+
/**
|
|
11730
|
+
* The type of the MCP tool. Always `mcp`.
|
|
11731
|
+
*/
|
|
11732
|
+
type: 'mcp';
|
|
11733
|
+
|
|
11734
|
+
/**
|
|
11735
|
+
* The tool invocation context(s).
|
|
11736
|
+
*/
|
|
11737
|
+
allowed_callers?: Array<'direct' | 'programmatic'> | null;
|
|
11738
|
+
|
|
11739
|
+
/**
|
|
11740
|
+
* List of allowed tool names or a filter object.
|
|
11741
|
+
*/
|
|
11742
|
+
allowed_tools?: Array<string> | Mcp.McpToolFilter | null;
|
|
11743
|
+
|
|
11744
|
+
/**
|
|
11745
|
+
* An OAuth access token that can be used with a remote MCP server, either with a
|
|
11746
|
+
* custom MCP server URL or a service connector. Your application must handle the
|
|
11747
|
+
* OAuth authorization flow and provide the token here.
|
|
11748
|
+
*/
|
|
11749
|
+
authorization?: string;
|
|
11750
|
+
|
|
11751
|
+
/**
|
|
11752
|
+
* @deprecated Identifier for service connectors, like those available in ChatGPT.
|
|
11753
|
+
* One of `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more
|
|
11754
|
+
* about service connectors
|
|
11755
|
+
* [here](https://developers.openai.com/api/docs/guides/tools-connectors-mcp#connectors).
|
|
11756
|
+
*
|
|
11757
|
+
* This field is deprecated for models released after September 1, 2026. Use
|
|
11758
|
+
* `server_url` to connect to a remote MCP server, or `tunnel_id` to connect
|
|
11759
|
+
* through a Secure MCP Tunnel.
|
|
11760
|
+
*
|
|
11761
|
+
* Currently supported `connector_id` values are:
|
|
11762
|
+
*
|
|
11763
|
+
* - Dropbox: `connector_dropbox`
|
|
11764
|
+
* - Gmail: `connector_gmail`
|
|
11765
|
+
* - Google Calendar: `connector_googlecalendar`
|
|
11766
|
+
* - Google Drive: `connector_googledrive`
|
|
11767
|
+
* - Microsoft Teams: `connector_microsoftteams`
|
|
11768
|
+
* - Outlook Calendar: `connector_outlookcalendar`
|
|
11769
|
+
* - Outlook Email: `connector_outlookemail`
|
|
11770
|
+
* - SharePoint: `connector_sharepoint`
|
|
11771
|
+
*/
|
|
11772
|
+
connector_id?:
|
|
11773
|
+
| 'connector_dropbox'
|
|
11774
|
+
| 'connector_gmail'
|
|
11775
|
+
| 'connector_googlecalendar'
|
|
11776
|
+
| 'connector_googledrive'
|
|
11777
|
+
| 'connector_microsoftteams'
|
|
11778
|
+
| 'connector_outlookcalendar'
|
|
11779
|
+
| 'connector_outlookemail'
|
|
11780
|
+
| 'connector_sharepoint';
|
|
11781
|
+
|
|
11782
|
+
/**
|
|
11783
|
+
* Whether this MCP tool is deferred and discovered via tool search.
|
|
11784
|
+
*/
|
|
11785
|
+
defer_loading?: boolean;
|
|
11786
|
+
|
|
11787
|
+
/**
|
|
11788
|
+
* Optional HTTP headers to send to the MCP server. Use for authentication or other
|
|
11789
|
+
* purposes.
|
|
11790
|
+
*/
|
|
11791
|
+
headers?: { [key: string]: string } | null;
|
|
11792
|
+
|
|
11793
|
+
/**
|
|
11794
|
+
* Specify which of the MCP server's tools require approval.
|
|
11795
|
+
*/
|
|
11796
|
+
require_approval?: Mcp.McpToolApprovalFilter | 'always' | 'never' | null;
|
|
11797
|
+
|
|
11798
|
+
/**
|
|
11799
|
+
* Optional description of the MCP server, used to provide more context.
|
|
11800
|
+
*/
|
|
11801
|
+
server_description?: string;
|
|
11802
|
+
|
|
11803
|
+
/**
|
|
11804
|
+
* The URL for the MCP server. One of `server_url`, `connector_id`, or `tunnel_id`
|
|
11805
|
+
* must be provided.
|
|
11806
|
+
*/
|
|
11807
|
+
server_url?: string;
|
|
11808
|
+
|
|
11809
|
+
/**
|
|
11810
|
+
* The Secure MCP Tunnel ID to use instead of a direct server URL. One of
|
|
11811
|
+
* `server_url`, `connector_id`, or `tunnel_id` must be provided.
|
|
11812
|
+
*/
|
|
11813
|
+
tunnel_id?: string;
|
|
11814
|
+
}
|
|
11815
|
+
|
|
11816
|
+
export namespace Mcp {
|
|
11817
|
+
/**
|
|
11818
|
+
* A filter object to specify which tools are allowed.
|
|
11819
|
+
*/
|
|
11820
|
+
export interface McpToolFilter {
|
|
11821
|
+
/**
|
|
11822
|
+
* Indicates whether or not a tool modifies data or is read-only. If an MCP server
|
|
11823
|
+
* is
|
|
11824
|
+
* [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
|
|
11825
|
+
* it will match this filter.
|
|
11826
|
+
*/
|
|
11827
|
+
read_only?: boolean;
|
|
11828
|
+
|
|
11829
|
+
/**
|
|
11830
|
+
* List of allowed tool names.
|
|
11831
|
+
*/
|
|
11832
|
+
tool_names?: Array<string>;
|
|
11833
|
+
}
|
|
11834
|
+
|
|
11835
|
+
/**
|
|
11836
|
+
* Specify which of the MCP server's tools require approval. Can be `always`,
|
|
11837
|
+
* `never`, or a filter object associated with tools that require approval.
|
|
11838
|
+
*/
|
|
11839
|
+
export interface McpToolApprovalFilter {
|
|
11840
|
+
/**
|
|
11841
|
+
* A filter object to specify which tools are allowed.
|
|
11842
|
+
*/
|
|
11843
|
+
always?: McpToolApprovalFilter.Always;
|
|
11844
|
+
|
|
11845
|
+
/**
|
|
11846
|
+
* A filter object to specify which tools are allowed.
|
|
11847
|
+
*/
|
|
11848
|
+
never?: McpToolApprovalFilter.Never;
|
|
11849
|
+
}
|
|
11850
|
+
|
|
11851
|
+
export namespace McpToolApprovalFilter {
|
|
11852
|
+
/**
|
|
11853
|
+
* A filter object to specify which tools are allowed.
|
|
11854
|
+
*/
|
|
11855
|
+
export interface Always {
|
|
11856
|
+
/**
|
|
11857
|
+
* Indicates whether or not a tool modifies data or is read-only. If an MCP server
|
|
11858
|
+
* is
|
|
11859
|
+
* [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
|
|
11860
|
+
* it will match this filter.
|
|
11861
|
+
*/
|
|
11862
|
+
read_only?: boolean;
|
|
11863
|
+
|
|
11864
|
+
/**
|
|
11865
|
+
* List of allowed tool names.
|
|
11866
|
+
*/
|
|
11867
|
+
tool_names?: Array<string>;
|
|
11868
|
+
}
|
|
11869
|
+
|
|
11870
|
+
/**
|
|
11871
|
+
* A filter object to specify which tools are allowed.
|
|
11872
|
+
*/
|
|
11873
|
+
export interface Never {
|
|
11874
|
+
/**
|
|
11875
|
+
* Indicates whether or not a tool modifies data or is read-only. If an MCP server
|
|
11876
|
+
* is
|
|
11877
|
+
* [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
|
|
11878
|
+
* it will match this filter.
|
|
11879
|
+
*/
|
|
11880
|
+
read_only?: boolean;
|
|
11881
|
+
|
|
11882
|
+
/**
|
|
11883
|
+
* List of allowed tool names.
|
|
11884
|
+
*/
|
|
11885
|
+
tool_names?: Array<string>;
|
|
11886
|
+
}
|
|
11887
|
+
}
|
|
11888
|
+
}
|
|
11889
|
+
|
|
11890
|
+
/**
|
|
11891
|
+
* A tool that runs Python code to help generate a response to a prompt.
|
|
11892
|
+
*/
|
|
11893
|
+
export interface CodeInterpreter {
|
|
11894
|
+
/**
|
|
11895
|
+
* The code interpreter container. Can be a container ID or an object that
|
|
11896
|
+
* specifies uploaded file IDs to make available to your code, along with an
|
|
11897
|
+
* optional `memory_limit` setting.
|
|
11898
|
+
*/
|
|
11899
|
+
container: string | CodeInterpreter.CodeInterpreterToolAuto;
|
|
11900
|
+
|
|
11901
|
+
/**
|
|
11902
|
+
* The type of the code interpreter tool. Always `code_interpreter`.
|
|
11903
|
+
*/
|
|
11904
|
+
type: 'code_interpreter';
|
|
11905
|
+
|
|
11906
|
+
/**
|
|
11907
|
+
* The tool invocation context(s).
|
|
11908
|
+
*/
|
|
11909
|
+
allowed_callers?: Array<'direct' | 'programmatic'> | null;
|
|
11910
|
+
}
|
|
11911
|
+
|
|
11912
|
+
export namespace CodeInterpreter {
|
|
11913
|
+
/**
|
|
11914
|
+
* Configuration for a code interpreter container. Optionally specify the IDs of
|
|
11915
|
+
* the files to run the code on.
|
|
11916
|
+
*/
|
|
11917
|
+
export interface CodeInterpreterToolAuto {
|
|
11918
|
+
/**
|
|
11919
|
+
* Always `auto`.
|
|
11920
|
+
*/
|
|
11921
|
+
type: 'auto';
|
|
11922
|
+
|
|
11923
|
+
/**
|
|
11924
|
+
* An optional list of uploaded files to make available to your code.
|
|
11925
|
+
*/
|
|
11926
|
+
file_ids?: Array<string>;
|
|
11927
|
+
|
|
11928
|
+
/**
|
|
11929
|
+
* The memory limit for the code interpreter container.
|
|
11930
|
+
*/
|
|
11931
|
+
memory_limit?: '1g' | '4g' | '16g' | '64g' | null;
|
|
11932
|
+
|
|
11933
|
+
/**
|
|
11934
|
+
* Network access policy for the container.
|
|
11935
|
+
*/
|
|
11936
|
+
network_policy?:
|
|
11937
|
+
| ResponsesAPI.BetaContainerNetworkPolicyDisabled
|
|
11938
|
+
| ResponsesAPI.BetaContainerNetworkPolicyAllowlist;
|
|
11939
|
+
}
|
|
11940
|
+
}
|
|
11941
|
+
|
|
11942
|
+
export interface ProgrammaticToolCalling {
|
|
11943
|
+
/**
|
|
11944
|
+
* The type of the tool. Always `programmatic_tool_calling`.
|
|
11945
|
+
*/
|
|
11946
|
+
type: 'programmatic_tool_calling';
|
|
11947
|
+
}
|
|
11948
|
+
|
|
11949
|
+
/**
|
|
11950
|
+
* A tool that generates images using the GPT image models.
|
|
11951
|
+
*/
|
|
11952
|
+
export interface ImageGeneration {
|
|
11953
|
+
/**
|
|
11954
|
+
* The type of the image generation tool. Always `image_generation`.
|
|
11955
|
+
*/
|
|
11956
|
+
type: 'image_generation';
|
|
11957
|
+
|
|
11958
|
+
/**
|
|
11959
|
+
* Whether to generate a new image or edit an existing image. Default: `auto`.
|
|
11960
|
+
*/
|
|
11961
|
+
action?: 'generate' | 'edit' | 'auto';
|
|
11962
|
+
|
|
11963
|
+
/**
|
|
11964
|
+
* Allows to set transparency for the background of the generated image(s). Must be
|
|
11965
|
+
* one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
|
|
11966
|
+
* the model will automatically determine the best background for the image.
|
|
11967
|
+
*
|
|
11968
|
+
* `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
|
|
11969
|
+
* snapshots, support `opaque` and `transparent` backgrounds. Transparent
|
|
11970
|
+
* backgrounds are available for supported GPT Image models. For `gpt-image-2` and
|
|
11971
|
+
* `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
|
|
11972
|
+
* set the output format to `png` or `webp`.
|
|
11973
|
+
*/
|
|
11974
|
+
background?: 'transparent' | 'opaque' | 'auto';
|
|
11975
|
+
|
|
11976
|
+
/**
|
|
11977
|
+
* Control how much effort the model will exert to match the style and features,
|
|
11978
|
+
* especially facial features, of input images. Supports `high` and `low` on
|
|
11979
|
+
* `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
|
|
11980
|
+
* `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
|
|
11981
|
+
*/
|
|
11982
|
+
input_fidelity?: 'high' | 'low' | null;
|
|
11983
|
+
|
|
11984
|
+
/**
|
|
11985
|
+
* Optional mask for inpainting. Contains `image_url` (string, optional) and
|
|
11986
|
+
* `file_id` (string, optional).
|
|
11987
|
+
*/
|
|
11988
|
+
input_image_mask?: ImageGeneration.InputImageMask;
|
|
11989
|
+
|
|
11990
|
+
/**
|
|
11991
|
+
* The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`,
|
|
11992
|
+
* `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
|
|
11993
|
+
* `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
|
|
11994
|
+
* `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
|
|
11995
|
+
* `chatgpt-image-latest`. Default: `gpt-image-1`.
|
|
11996
|
+
*/
|
|
11997
|
+
model?:
|
|
11998
|
+
| (string & {})
|
|
11999
|
+
| 'gpt-image-1'
|
|
12000
|
+
| 'gpt-image-1-mini'
|
|
12001
|
+
| 'gpt-image-2'
|
|
12002
|
+
| 'gpt-image-2-2026-04-21'
|
|
12003
|
+
| 'gpt-image-2.5-sunburst'
|
|
12004
|
+
| 'gpt-image-2.5-sunburst-2026-09-08'
|
|
12005
|
+
| 'gpt-image-2.5-flare'
|
|
12006
|
+
| 'gpt-image-2.5-flare-2026-09-08'
|
|
12007
|
+
| 'gpt-image-1.5'
|
|
12008
|
+
| 'chatgpt-image-latest';
|
|
12009
|
+
|
|
12010
|
+
/**
|
|
12011
|
+
* Moderation level for the generated image. Default: `auto`.
|
|
12012
|
+
*/
|
|
12013
|
+
moderation?: 'auto' | 'low';
|
|
12014
|
+
|
|
12015
|
+
/**
|
|
12016
|
+
* Compression level for the output image. Default: 100.
|
|
12017
|
+
*/
|
|
12018
|
+
output_compression?: number;
|
|
12019
|
+
|
|
12020
|
+
/**
|
|
12021
|
+
* The output format of the generated image. One of `png`, `webp`, or `jpeg`.
|
|
12022
|
+
* Default: `png`.
|
|
12023
|
+
*/
|
|
12024
|
+
output_format?: 'png' | 'webp' | 'jpeg';
|
|
12025
|
+
|
|
12026
|
+
/**
|
|
12027
|
+
* Number of partial images to generate in streaming mode, from 0 (default value)
|
|
12028
|
+
* to 3.
|
|
12029
|
+
*/
|
|
12030
|
+
partial_images?: number;
|
|
12031
|
+
|
|
12032
|
+
/**
|
|
12033
|
+
* The quality of the generated image. The GPT image models support `low`,
|
|
12034
|
+
* `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`,
|
|
12035
|
+
* including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default:
|
|
12036
|
+
* `auto`.
|
|
12037
|
+
*/
|
|
12038
|
+
quality?: 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto';
|
|
12039
|
+
|
|
12040
|
+
/**
|
|
12041
|
+
* The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
|
|
12042
|
+
* `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
|
|
12043
|
+
* `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
|
|
12044
|
+
* resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
|
|
12045
|
+
* Width and height must both be divisible by 16 and the requested aspect ratio
|
|
12046
|
+
* must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
|
|
12047
|
+
* the maximum supported resolution is `3840x2160`. The requested size must also
|
|
12048
|
+
* satisfy the model's current pixel and edge limits. The standard sizes
|
|
12049
|
+
* `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
|
|
12050
|
+
* `auto` is supported for models that allow automatic sizing.
|
|
12051
|
+
*/
|
|
12052
|
+
size?: (string & {}) | '1024x1024' | '1024x1536' | '1536x1024' | 'auto';
|
|
12053
|
+
}
|
|
12054
|
+
|
|
12055
|
+
export namespace ImageGeneration {
|
|
12056
|
+
/**
|
|
12057
|
+
* Optional mask for inpainting. Contains `image_url` (string, optional) and
|
|
12058
|
+
* `file_id` (string, optional).
|
|
12059
|
+
*/
|
|
12060
|
+
export interface InputImageMask {
|
|
12061
|
+
/**
|
|
12062
|
+
* File ID for the mask image.
|
|
12063
|
+
*/
|
|
12064
|
+
file_id?: string;
|
|
12065
|
+
|
|
12066
|
+
/**
|
|
12067
|
+
* Base64-encoded mask image.
|
|
12068
|
+
*/
|
|
12069
|
+
image_url?: string;
|
|
12070
|
+
}
|
|
12071
|
+
}
|
|
12072
|
+
|
|
12073
|
+
/**
|
|
12074
|
+
* A tool that allows the model to execute shell commands in a local environment.
|
|
12075
|
+
*/
|
|
12076
|
+
export interface LocalShell {
|
|
12077
|
+
/**
|
|
12078
|
+
* The type of the local shell tool. Always `local_shell`.
|
|
12079
|
+
*/
|
|
12080
|
+
type: 'local_shell';
|
|
12081
|
+
}
|
|
12082
|
+
|
|
11695
12083
|
/**
|
|
11696
12084
|
* The agent that produced this item.
|
|
11697
12085
|
*/
|
|
@@ -13403,6 +13791,12 @@ export namespace BetaResponsesServerEvent {
|
|
|
13403
13791
|
| 'potentially_unintended_destructive_activity'
|
|
13404
13792
|
| 'other';
|
|
13405
13793
|
|
|
13794
|
+
/**
|
|
13795
|
+
* An opaque target for explicitly continuing this review, or null when
|
|
13796
|
+
* unavailable.
|
|
13797
|
+
*/
|
|
13798
|
+
review_target?: string | null;
|
|
13799
|
+
|
|
13406
13800
|
/**
|
|
13407
13801
|
* An optional public continuation instruction.
|
|
13408
13802
|
*/
|
|
@@ -13770,9 +14164,10 @@ export namespace BetaTool {
|
|
|
13770
14164
|
background?: 'transparent' | 'opaque' | 'auto';
|
|
13771
14165
|
|
|
13772
14166
|
/**
|
|
13773
|
-
*
|
|
13774
|
-
*
|
|
13775
|
-
* `gpt-image-
|
|
14167
|
+
* Control how much effort the model will exert to match the style and features,
|
|
14168
|
+
* especially facial features, of input images. Supports `high` and `low` on
|
|
14169
|
+
* `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
|
|
14170
|
+
* `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
|
|
13776
14171
|
*/
|
|
13777
14172
|
input_fidelity?: 'high' | 'low' | null;
|
|
13778
14173
|
|
|
@@ -14024,6 +14419,75 @@ export interface BetaToolChoiceTypes {
|
|
|
14024
14419
|
| 'code_interpreter';
|
|
14025
14420
|
}
|
|
14026
14421
|
|
|
14422
|
+
/**
|
|
14423
|
+
* Groups function/custom tools under a shared namespace.
|
|
14424
|
+
*/
|
|
14425
|
+
export interface BetaToolSearchOutputNamespaceTool {
|
|
14426
|
+
/**
|
|
14427
|
+
* A description of the namespace shown to the model.
|
|
14428
|
+
*/
|
|
14429
|
+
description: string;
|
|
14430
|
+
|
|
14431
|
+
/**
|
|
14432
|
+
* The namespace name used in tool calls (for example, `crm`).
|
|
14433
|
+
*/
|
|
14434
|
+
name: string;
|
|
14435
|
+
|
|
14436
|
+
/**
|
|
14437
|
+
* The function/custom tools loaded inside this namespace.
|
|
14438
|
+
*/
|
|
14439
|
+
tools: Array<BetaToolSearchOutputNamespaceTool.Function | BetaCustomTool>;
|
|
14440
|
+
|
|
14441
|
+
/**
|
|
14442
|
+
* The type of the tool. Always `namespace`.
|
|
14443
|
+
*/
|
|
14444
|
+
type: 'namespace';
|
|
14445
|
+
}
|
|
14446
|
+
|
|
14447
|
+
export namespace BetaToolSearchOutputNamespaceTool {
|
|
14448
|
+
export interface Function {
|
|
14449
|
+
/**
|
|
14450
|
+
* The name of the loaded function tool.
|
|
14451
|
+
*/
|
|
14452
|
+
name: string;
|
|
14453
|
+
|
|
14454
|
+
type: 'function';
|
|
14455
|
+
|
|
14456
|
+
/**
|
|
14457
|
+
* The tool invocation context(s).
|
|
14458
|
+
*/
|
|
14459
|
+
allowed_callers?: Array<'direct' | 'programmatic'> | null;
|
|
14460
|
+
|
|
14461
|
+
/**
|
|
14462
|
+
* Whether the tool response can be returned asynchronously versus immediately
|
|
14463
|
+
* returned on next response creation.
|
|
14464
|
+
*/
|
|
14465
|
+
async?: boolean;
|
|
14466
|
+
|
|
14467
|
+
/**
|
|
14468
|
+
* Whether this function should be deferred and discovered via tool search.
|
|
14469
|
+
*/
|
|
14470
|
+
defer_loading?: boolean;
|
|
14471
|
+
|
|
14472
|
+
description?: string | null;
|
|
14473
|
+
|
|
14474
|
+
/**
|
|
14475
|
+
* A JSON Schema describing the JSON value encoded in string outputs for this
|
|
14476
|
+
* function tool. This does not describe content-array outputs.
|
|
14477
|
+
*/
|
|
14478
|
+
output_schema?: { [key: string]: unknown } | null;
|
|
14479
|
+
|
|
14480
|
+
parameters?: unknown | null;
|
|
14481
|
+
|
|
14482
|
+
/**
|
|
14483
|
+
* Whether to enforce strict parameter validation. If omitted, Responses attempts
|
|
14484
|
+
* to use strict validation when the schema is compatible, and falls back to
|
|
14485
|
+
* non-strict validation otherwise.
|
|
14486
|
+
*/
|
|
14487
|
+
strict?: boolean | null;
|
|
14488
|
+
}
|
|
14489
|
+
}
|
|
14490
|
+
|
|
14027
14491
|
/**
|
|
14028
14492
|
* Hosted or BYOT tool search configuration for deferred tools.
|
|
14029
14493
|
*/
|
|
@@ -15385,6 +15849,7 @@ export declare namespace Responses {
|
|
|
15385
15849
|
type BetaToolChoiceOptions as BetaToolChoiceOptions,
|
|
15386
15850
|
type BetaToolChoiceShell as BetaToolChoiceShell,
|
|
15387
15851
|
type BetaToolChoiceTypes as BetaToolChoiceTypes,
|
|
15852
|
+
type BetaToolSearchOutputNamespaceTool as BetaToolSearchOutputNamespaceTool,
|
|
15388
15853
|
type BetaToolSearchTool as BetaToolSearchTool,
|
|
15389
15854
|
type BetaWebSearchPreviewTool as BetaWebSearchPreviewTool,
|
|
15390
15855
|
type BetaWebSearchTool as BetaWebSearchTool,
|
|
@@ -9,6 +9,10 @@ import { MessageListParams, Messages } from './messages';
|
|
|
9
9
|
import { APIPromise } from '../../../core/api-promise';
|
|
10
10
|
import { CursorPage, type CursorPageParams, PagePromise } from '../../../core/pagination';
|
|
11
11
|
import { Stream } from '../../../core/streaming';
|
|
12
|
+
import {
|
|
13
|
+
normalizeChatCompletionStream,
|
|
14
|
+
type ChatCompletionWireChunk,
|
|
15
|
+
} from '../../../lib/chat-completions/streaming';
|
|
12
16
|
import { RequestOptions } from '../../../internal/request-options';
|
|
13
17
|
import { path } from '../../../internal/utils/path';
|
|
14
18
|
|
|
@@ -192,15 +196,19 @@ export class Completions extends APIResource {
|
|
|
192
196
|
body: ChatCompletionCreateParams,
|
|
193
197
|
options?: RequestOptions,
|
|
194
198
|
): APIPromise<ChatCompletion> | APIPromise<Stream<ChatCompletionChunk>> {
|
|
195
|
-
return this._client
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
199
|
+
return this._client
|
|
200
|
+
.post<ChatCompletion | Stream<ChatCompletionWireChunk>>(
|
|
201
|
+
'/chat/completions',
|
|
202
|
+
resolveResourceRequestOptions(options, (options) => ({
|
|
203
|
+
body,
|
|
204
|
+
...options,
|
|
205
|
+
stream: body.stream ?? false,
|
|
206
|
+
__security: { bearerAuth: true },
|
|
207
|
+
})),
|
|
208
|
+
)
|
|
209
|
+
._thenUnwrap((result) =>
|
|
210
|
+
body.stream ? normalizeChatCompletionStream(result as Stream<ChatCompletionWireChunk>) : result,
|
|
211
|
+
) as APIPromise<ChatCompletion> | APIPromise<Stream<ChatCompletionChunk>>;
|
|
204
212
|
}
|
|
205
213
|
|
|
206
214
|
/**
|
|
@@ -1116,25 +1124,28 @@ export interface ChatCompletionChunk {
|
|
|
1116
1124
|
export namespace ChatCompletionChunk {
|
|
1117
1125
|
export interface Choice {
|
|
1118
1126
|
/**
|
|
1119
|
-
* A chat completion delta generated by streamed model responses.
|
|
1127
|
+
* A chat completion delta generated by streamed model responses. Streamed audio
|
|
1128
|
+
* can arrive in partial updates with an ID, base64 data, or transcript text. The
|
|
1129
|
+
* final audio update contains only its expiry timestamp.
|
|
1120
1130
|
*/
|
|
1121
1131
|
delta: Choice.Delta;
|
|
1122
1132
|
|
|
1133
|
+
/**
|
|
1134
|
+
* The index of the choice in the list of choices.
|
|
1135
|
+
*/
|
|
1136
|
+
index: number;
|
|
1137
|
+
|
|
1123
1138
|
/**
|
|
1124
1139
|
* The reason the model stopped generating tokens. This will be `stop` if the model
|
|
1125
1140
|
* hit a natural stop point or a provided stop sequence, `length` if the maximum
|
|
1126
1141
|
* number of tokens specified in the request was reached, `content_filter` if
|
|
1127
1142
|
* content was omitted due to a flag from our content filters, `tool_calls` if the
|
|
1128
1143
|
* model called a tool, or `function_call` (deprecated) if the model called a
|
|
1129
|
-
* function.
|
|
1144
|
+
* function. Omitted from the final audio update containing only
|
|
1145
|
+
* `delta.audio.expires_at`.
|
|
1130
1146
|
*/
|
|
1131
1147
|
finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call' | null;
|
|
1132
1148
|
|
|
1133
|
-
/**
|
|
1134
|
-
* The index of the choice in the list of choices.
|
|
1135
|
-
*/
|
|
1136
|
-
index: number;
|
|
1137
|
-
|
|
1138
1149
|
/**
|
|
1139
1150
|
* Log probability information for the choice.
|
|
1140
1151
|
*/
|
|
@@ -1143,9 +1154,17 @@ export namespace ChatCompletionChunk {
|
|
|
1143
1154
|
|
|
1144
1155
|
export namespace Choice {
|
|
1145
1156
|
/**
|
|
1146
|
-
* A chat completion delta generated by streamed model responses.
|
|
1157
|
+
* A chat completion delta generated by streamed model responses. Streamed audio
|
|
1158
|
+
* can arrive in partial updates with an ID, base64 data, or transcript text. The
|
|
1159
|
+
* final audio update contains only its expiry timestamp.
|
|
1147
1160
|
*/
|
|
1148
1161
|
export interface Delta {
|
|
1162
|
+
/**
|
|
1163
|
+
* A partial audio response. Audio chunks may carry an ID, base64 data, or
|
|
1164
|
+
* transcript text; the final audio update contains only its expiry timestamp.
|
|
1165
|
+
*/
|
|
1166
|
+
audio?: Delta.Audio;
|
|
1167
|
+
|
|
1149
1168
|
/**
|
|
1150
1169
|
* The contents of the chunk message.
|
|
1151
1170
|
*/
|
|
@@ -1171,6 +1190,34 @@ export namespace ChatCompletionChunk {
|
|
|
1171
1190
|
}
|
|
1172
1191
|
|
|
1173
1192
|
export namespace Delta {
|
|
1193
|
+
/**
|
|
1194
|
+
* A partial audio response. Audio chunks may carry an ID, base64 data, or
|
|
1195
|
+
* transcript text; the final audio update contains only its expiry timestamp.
|
|
1196
|
+
*/
|
|
1197
|
+
export interface Audio {
|
|
1198
|
+
/**
|
|
1199
|
+
* Unique identifier for this audio response.
|
|
1200
|
+
*/
|
|
1201
|
+
id?: string;
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* Base64 encoded audio bytes generated by the model, in the format specified in
|
|
1205
|
+
* the request.
|
|
1206
|
+
*/
|
|
1207
|
+
data?: string;
|
|
1208
|
+
|
|
1209
|
+
/**
|
|
1210
|
+
* The Unix timestamp (in seconds) for when this audio response will no longer be
|
|
1211
|
+
* accessible on the server for use in multi-turn conversations.
|
|
1212
|
+
*/
|
|
1213
|
+
expires_at?: number;
|
|
1214
|
+
|
|
1215
|
+
/**
|
|
1216
|
+
* Transcript text from this audio chunk.
|
|
1217
|
+
*/
|
|
1218
|
+
transcript?: string;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1174
1221
|
/**
|
|
1175
1222
|
* @deprecated Deprecated and replaced by `tool_calls`. The name and arguments of a
|
|
1176
1223
|
* function that should be called, as generated by the model.
|
|
@@ -2562,7 +2609,7 @@ export interface ChatCompletionCreateParamsBase {
|
|
|
2562
2609
|
* Up to 4 sequences where the API will stop generating further tokens. The
|
|
2563
2610
|
* returned text will not contain the stop sequence.
|
|
2564
2611
|
*/
|
|
2565
|
-
stop?: string |
|
|
2612
|
+
stop?: string | Array<string> | null;
|
|
2566
2613
|
|
|
2567
2614
|
/**
|
|
2568
2615
|
* Whether or not to store the output of this chat completion request for use in
|
|
@@ -343,7 +343,7 @@ export interface CompletionCreateParamsBase {
|
|
|
343
343
|
* Up to 4 sequences where the API will stop generating further tokens. The
|
|
344
344
|
* returned text will not contain the stop sequence.
|
|
345
345
|
*/
|
|
346
|
-
stop?: string |
|
|
346
|
+
stop?: string | Array<string> | null;
|
|
347
347
|
|
|
348
348
|
/**
|
|
349
349
|
* Whether to stream back partial progress. If set, tokens will be sent as
|