llama-stack-client 0.3.5 → 0.4.0-rc2
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 +153 -0
- package/README.md +48 -39
- package/error.d.ts.map +1 -1
- package/error.js +1 -0
- package/error.js.map +1 -1
- package/error.mjs.map +1 -1
- package/index.d.mts +33 -54
- package/index.d.ts +33 -54
- package/index.d.ts.map +1 -1
- package/index.js +20 -29
- package/index.js.map +1 -1
- package/index.mjs +18 -28
- package/index.mjs.map +1 -1
- package/lib/response-helpers.d.ts +23 -0
- package/lib/response-helpers.d.ts.map +1 -0
- package/lib/response-helpers.js +53 -0
- package/lib/response-helpers.js.map +1 -0
- package/lib/response-helpers.mjs +49 -0
- package/lib/response-helpers.mjs.map +1 -0
- package/package.json +7 -1
- package/pagination.d.ts.map +1 -1
- package/pagination.js +2 -4
- package/pagination.js.map +1 -1
- package/pagination.mjs +1 -4
- package/pagination.mjs.map +1 -1
- package/resource.d.ts.map +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs.map +1 -1
- package/resources/alpha/admin.d.ts +41 -0
- package/resources/alpha/admin.d.ts.map +1 -0
- package/resources/alpha/admin.js +46 -0
- package/resources/alpha/admin.js.map +1 -0
- package/resources/alpha/admin.mjs +42 -0
- package/resources/alpha/admin.mjs.map +1 -0
- package/resources/alpha/alpha.d.ts +26 -0
- package/resources/alpha/alpha.d.ts.map +1 -0
- package/resources/alpha/alpha.js +61 -0
- package/resources/alpha/alpha.js.map +1 -0
- package/resources/alpha/alpha.mjs +34 -0
- package/resources/alpha/alpha.mjs.map +1 -0
- package/resources/{benchmarks.d.ts → alpha/benchmarks.d.ts} +41 -15
- package/resources/alpha/benchmarks.d.ts.map +1 -0
- package/resources/{benchmarks.js → alpha/benchmarks.js} +18 -4
- package/resources/alpha/benchmarks.js.map +1 -0
- package/resources/alpha/benchmarks.mjs +44 -0
- package/resources/alpha/benchmarks.mjs.map +1 -0
- package/resources/alpha/eval/eval.d.ts +160 -0
- package/resources/alpha/eval/eval.d.ts.map +1 -0
- package/resources/{eval → alpha/eval}/eval.js +7 -6
- package/resources/alpha/eval/eval.js.map +1 -0
- package/resources/{eval → alpha/eval}/eval.mjs +7 -5
- package/resources/alpha/eval/eval.mjs.map +1 -0
- package/resources/alpha/eval/index.d.ts +3 -0
- package/resources/alpha/eval/index.d.ts.map +1 -0
- package/resources/{eval → alpha/eval}/index.js +2 -1
- package/resources/alpha/eval/index.js.map +1 -0
- package/resources/{eval → alpha/eval}/index.mjs +2 -0
- package/resources/alpha/eval/index.mjs.map +1 -0
- package/resources/{eval → alpha/eval}/jobs.d.ts +2 -2
- package/resources/alpha/eval/jobs.d.ts.map +1 -0
- package/resources/{eval → alpha/eval}/jobs.js +6 -5
- package/resources/alpha/eval/jobs.js.map +1 -0
- package/resources/{eval → alpha/eval}/jobs.mjs +6 -4
- package/resources/alpha/eval/jobs.mjs.map +1 -0
- package/resources/alpha/eval.d.ts.map +1 -0
- package/resources/{eval.js → alpha/eval.js} +1 -0
- package/resources/alpha/eval.js.map +1 -0
- package/resources/alpha/eval.mjs.map +1 -0
- package/resources/alpha/index.d.ts +7 -0
- package/resources/alpha/index.d.ts.map +1 -0
- package/resources/alpha/index.js +23 -0
- package/resources/alpha/index.js.map +1 -0
- package/resources/alpha/index.mjs +14 -0
- package/resources/alpha/index.mjs.map +1 -0
- package/resources/alpha/inference.d.ts +85 -0
- package/resources/alpha/inference.d.ts.map +1 -0
- package/resources/{agents/steps.js → alpha/inference.js} +9 -8
- package/resources/alpha/inference.js.map +1 -0
- package/resources/alpha/inference.mjs +17 -0
- package/resources/alpha/inference.mjs.map +1 -0
- package/resources/alpha/post-training/index.d.ts.map +1 -0
- package/resources/{post-training → alpha/post-training}/index.js +2 -1
- package/resources/alpha/post-training/index.js.map +1 -0
- package/resources/{post-training → alpha/post-training}/index.mjs +2 -0
- package/resources/alpha/post-training/index.mjs.map +1 -0
- package/resources/alpha/post-training/job.d.ts +113 -0
- package/resources/alpha/post-training/job.d.ts.map +1 -0
- package/resources/{post-training → alpha/post-training}/job.js +7 -6
- package/resources/alpha/post-training/job.js.map +1 -0
- package/resources/{post-training → alpha/post-training}/job.mjs +7 -5
- package/resources/alpha/post-training/job.mjs.map +1 -0
- package/resources/alpha/post-training/post-training.d.ts +245 -0
- package/resources/alpha/post-training/post-training.d.ts.map +1 -0
- package/resources/{post-training → alpha/post-training}/post-training.js +5 -4
- package/resources/alpha/post-training/post-training.js.map +1 -0
- package/resources/{post-training → alpha/post-training}/post-training.mjs +5 -3
- package/resources/alpha/post-training/post-training.mjs.map +1 -0
- package/resources/alpha/post-training.d.ts.map +1 -0
- package/resources/{post-training.js → alpha/post-training.js} +2 -1
- package/resources/alpha/post-training.js.map +1 -0
- package/resources/{post-training.mjs → alpha/post-training.mjs} +2 -0
- package/resources/alpha/post-training.mjs.map +1 -0
- package/resources/alpha.d.ts +2 -0
- package/resources/alpha.d.ts.map +1 -0
- package/resources/alpha.js +25 -0
- package/resources/alpha.js.map +1 -0
- package/resources/alpha.mjs +9 -0
- package/resources/alpha.mjs.map +1 -0
- package/resources/batches.d.ts +322 -0
- package/resources/batches.d.ts.map +1 -0
- package/resources/batches.js +45 -0
- package/resources/batches.js.map +1 -0
- package/resources/batches.mjs +40 -0
- package/resources/batches.mjs.map +1 -0
- package/resources/beta/beta.d.ts +10 -0
- package/resources/beta/beta.d.ts.map +1 -0
- package/resources/{tool-runtime/tool-runtime.js → beta/beta.js} +10 -22
- package/resources/beta/beta.js.map +1 -0
- package/resources/beta/beta.mjs +18 -0
- package/resources/beta/beta.mjs.map +1 -0
- package/resources/{datasets.d.ts → beta/datasets.d.ts} +117 -99
- package/resources/beta/datasets.d.ts.map +1 -0
- package/resources/{datasets.js → beta/datasets.js} +14 -9
- package/resources/beta/datasets.js.map +1 -0
- package/resources/{datasets.mjs → beta/datasets.mjs} +14 -8
- package/resources/beta/datasets.mjs.map +1 -0
- package/resources/beta/index.d.ts +3 -0
- package/resources/beta/index.d.ts.map +1 -0
- package/resources/beta/index.js +15 -0
- package/resources/beta/index.js.map +1 -0
- package/resources/beta/index.mjs +10 -0
- package/resources/beta/index.mjs.map +1 -0
- package/resources/beta.d.ts +2 -0
- package/resources/beta.d.ts.map +1 -0
- package/resources/{agents.js → beta.js} +4 -3
- package/resources/beta.js.map +1 -0
- package/resources/beta.mjs +9 -0
- package/resources/beta.mjs.map +1 -0
- package/resources/chat/chat.d.ts +75 -80
- package/resources/chat/chat.d.ts.map +1 -1
- package/resources/chat/chat.js +2 -2
- package/resources/chat/chat.js.map +1 -1
- package/resources/chat/chat.mjs +3 -2
- package/resources/chat/chat.mjs.map +1 -1
- package/resources/chat/completions.d.ts +760 -1406
- package/resources/chat/completions.d.ts.map +1 -1
- package/resources/chat/completions.js +8 -14
- package/resources/chat/completions.js.map +1 -1
- package/resources/chat/completions.mjs +7 -11
- package/resources/chat/completions.mjs.map +1 -1
- package/resources/chat/index.d.ts +1 -1
- package/resources/chat/index.d.ts.map +1 -1
- package/resources/chat/index.js +3 -3
- package/resources/chat/index.js.map +1 -1
- package/resources/chat/index.mjs +3 -1
- package/resources/chat/index.mjs.map +1 -1
- package/resources/chat.js +2 -1
- package/resources/chat.js.map +1 -1
- package/resources/chat.mjs +2 -0
- package/resources/chat.mjs.map +1 -1
- package/resources/completions.d.ts +54 -97
- package/resources/completions.d.ts.map +1 -1
- package/resources/completions.js +3 -6
- package/resources/completions.js.map +1 -1
- package/resources/completions.mjs +3 -5
- package/resources/completions.mjs.map +1 -1
- package/resources/conversations/conversations.d.ts +320 -0
- package/resources/conversations/conversations.d.ts.map +1 -0
- package/resources/conversations/conversations.js +78 -0
- package/resources/conversations/conversations.js.map +1 -0
- package/resources/conversations/conversations.mjs +51 -0
- package/resources/conversations/conversations.mjs.map +1 -0
- package/resources/conversations/index.d.ts +3 -0
- package/resources/conversations/index.d.ts.map +1 -0
- package/resources/conversations/index.js +16 -0
- package/resources/conversations/index.js.map +1 -0
- package/resources/conversations/index.mjs +10 -0
- package/resources/conversations/index.mjs.map +1 -0
- package/resources/conversations/items.d.ts +874 -0
- package/resources/conversations/items.d.ts.map +1 -0
- package/resources/conversations/items.js +51 -0
- package/resources/conversations/items.js.map +1 -0
- package/resources/conversations/items.mjs +46 -0
- package/resources/conversations/items.mjs.map +1 -0
- package/resources/conversations.d.ts +2 -0
- package/resources/conversations.d.ts.map +1 -0
- package/resources/conversations.js +25 -0
- package/resources/conversations.js.map +1 -0
- package/resources/conversations.mjs +9 -0
- package/resources/conversations.mjs.map +1 -0
- package/resources/embeddings.d.ts +10 -52
- package/resources/embeddings.d.ts.map +1 -1
- package/resources/embeddings.js +5 -2
- package/resources/embeddings.js.map +1 -1
- package/resources/embeddings.mjs +5 -1
- package/resources/embeddings.mjs.map +1 -1
- package/resources/files.d.ts +44 -54
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +18 -9
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +18 -8
- package/resources/files.mjs.map +1 -1
- package/resources/index.d.ts +11 -15
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +15 -21
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +9 -11
- package/resources/index.mjs.map +1 -1
- package/resources/inspect.d.ts +3 -71
- package/resources/inspect.d.ts.map +1 -1
- package/resources/inspect.js +2 -1
- package/resources/inspect.js.map +1 -1
- package/resources/inspect.mjs +2 -0
- package/resources/inspect.mjs.map +1 -1
- package/resources/models/index.d.ts +2 -2
- package/resources/models/index.d.ts.map +1 -1
- package/resources/models/index.js +2 -1
- package/resources/models/index.js.map +1 -1
- package/resources/models/index.mjs +2 -0
- package/resources/models/index.mjs.map +1 -1
- package/resources/models/models.d.ts +71 -31
- package/resources/models/models.d.ts.map +1 -1
- package/resources/models/models.js +13 -2
- package/resources/models/models.js.map +1 -1
- package/resources/models/models.mjs +13 -1
- package/resources/models/models.mjs.map +1 -1
- package/resources/models/openai.d.ts +2 -16
- package/resources/models/openai.d.ts.map +1 -1
- package/resources/models/openai.js +3 -2
- package/resources/models/openai.js.map +1 -1
- package/resources/models/openai.mjs +3 -1
- package/resources/models/openai.mjs.map +1 -1
- package/resources/models.js +2 -1
- package/resources/models.js.map +1 -1
- package/resources/models.mjs +2 -0
- package/resources/models.mjs.map +1 -1
- package/resources/moderations.d.ts +9 -35
- package/resources/moderations.d.ts.map +1 -1
- package/resources/moderations.js +5 -2
- package/resources/moderations.js.map +1 -1
- package/resources/moderations.mjs +5 -1
- package/resources/moderations.mjs.map +1 -1
- package/resources/prompts/index.d.ts +3 -0
- package/resources/prompts/index.d.ts.map +1 -0
- package/resources/prompts/index.js +15 -0
- package/resources/prompts/index.js.map +1 -0
- package/resources/prompts/index.mjs +10 -0
- package/resources/prompts/index.mjs.map +1 -0
- package/resources/prompts/prompts.d.ts +96 -0
- package/resources/prompts/prompts.d.ts.map +1 -0
- package/resources/{agents/agents.js → prompts/prompts.js} +43 -30
- package/resources/prompts/prompts.js.map +1 -0
- package/resources/prompts/prompts.mjs +66 -0
- package/resources/prompts/prompts.mjs.map +1 -0
- package/resources/prompts/versions.d.ts +12 -0
- package/resources/prompts/versions.d.ts.map +1 -0
- package/resources/prompts/versions.js +23 -0
- package/resources/prompts/versions.js.map +1 -0
- package/resources/prompts/versions.mjs +19 -0
- package/resources/prompts/versions.mjs.map +1 -0
- package/resources/prompts.d.ts +2 -0
- package/resources/prompts.d.ts.map +1 -0
- package/resources/prompts.js +25 -0
- package/resources/prompts.js.map +1 -0
- package/resources/prompts.mjs +9 -0
- package/resources/prompts.mjs.map +1 -0
- package/resources/providers.d.ts +4 -13
- package/resources/providers.d.ts.map +1 -1
- package/resources/providers.js +2 -1
- package/resources/providers.js.map +1 -1
- package/resources/providers.mjs +2 -0
- package/resources/providers.mjs.map +1 -1
- package/resources/responses/index.js +2 -1
- package/resources/responses/index.js.map +1 -1
- package/resources/responses/index.mjs +2 -0
- package/resources/responses/index.mjs.map +1 -1
- package/resources/responses/input-items.d.ts +246 -151
- package/resources/responses/input-items.d.ts.map +1 -1
- package/resources/responses/input-items.js +3 -2
- package/resources/responses/input-items.js.map +1 -1
- package/resources/responses/input-items.mjs +3 -1
- package/resources/responses/input-items.mjs.map +1 -1
- package/resources/responses/responses.d.ts +1841 -1455
- package/resources/responses/responses.d.ts.map +1 -1
- package/resources/responses/responses.js +8 -11
- package/resources/responses/responses.js.map +1 -1
- package/resources/responses/responses.mjs +8 -10
- package/resources/responses/responses.mjs.map +1 -1
- package/resources/responses.js +2 -1
- package/resources/responses.js.map +1 -1
- package/resources/responses.mjs +2 -0
- package/resources/responses.mjs.map +1 -1
- package/resources/routes.d.ts +11 -10
- package/resources/routes.d.ts.map +1 -1
- package/resources/routes.js +8 -6
- package/resources/routes.js.map +1 -1
- package/resources/routes.mjs +8 -5
- package/resources/routes.mjs.map +1 -1
- package/resources/safety.d.ts +144 -10
- package/resources/safety.d.ts.map +1 -1
- package/resources/safety.js +4 -1
- package/resources/safety.js.map +1 -1
- package/resources/safety.mjs +4 -0
- package/resources/safety.mjs.map +1 -1
- package/resources/scoring-functions.d.ts +120 -50
- package/resources/scoring-functions.d.ts.map +1 -1
- package/resources/scoring-functions.js +15 -1
- package/resources/scoring-functions.js.map +1 -1
- package/resources/scoring-functions.mjs +15 -0
- package/resources/scoring-functions.mjs.map +1 -1
- package/resources/scoring.d.ts +85 -26
- package/resources/scoring.d.ts.map +1 -1
- package/resources/scoring.js +2 -1
- package/resources/scoring.js.map +1 -1
- package/resources/scoring.mjs +2 -0
- package/resources/scoring.mjs.map +1 -1
- package/resources/shared.d.ts +173 -591
- package/resources/shared.d.ts.map +1 -1
- package/resources/shared.js +2 -0
- package/resources/shared.js.map +1 -1
- package/resources/shared.mjs +2 -0
- package/resources/shared.mjs.map +1 -1
- package/resources/shields.d.ts +19 -24
- package/resources/shields.d.ts.map +1 -1
- package/resources/shields.js +6 -1
- package/resources/shields.js.map +1 -1
- package/resources/shields.mjs +6 -0
- package/resources/shields.mjs.map +1 -1
- package/resources/tool-runtime.d.ts +151 -1
- package/resources/tool-runtime.d.ts.map +1 -1
- package/resources/tool-runtime.js +22 -16
- package/resources/tool-runtime.js.map +1 -1
- package/resources/tool-runtime.mjs +20 -1
- package/resources/tool-runtime.mjs.map +1 -1
- package/resources/toolgroups.d.ts +27 -37
- package/resources/toolgroups.d.ts.map +1 -1
- package/resources/toolgroups.js +10 -1
- package/resources/toolgroups.js.map +1 -1
- package/resources/toolgroups.mjs +10 -0
- package/resources/toolgroups.mjs.map +1 -1
- package/resources/tools.d.ts +9 -76
- package/resources/tools.d.ts.map +1 -1
- package/resources/tools.js +4 -1
- package/resources/tools.js.map +1 -1
- package/resources/tools.mjs +4 -0
- package/resources/tools.mjs.map +1 -1
- package/resources/vector-io.d.ts +272 -148
- package/resources/vector-io.d.ts.map +1 -1
- package/resources/vector-io.js +2 -1
- package/resources/vector-io.js.map +1 -1
- package/resources/vector-io.mjs +2 -0
- package/resources/vector-io.mjs.map +1 -1
- package/resources/vector-stores/file-batches.d.ts +111 -0
- package/resources/vector-stores/file-batches.d.ts.map +1 -0
- package/resources/vector-stores/file-batches.js +45 -0
- package/resources/vector-stores/file-batches.js.map +1 -0
- package/resources/vector-stores/file-batches.mjs +41 -0
- package/resources/vector-stores/file-batches.mjs.map +1 -0
- package/resources/vector-stores/files.d.ts +83 -135
- package/resources/vector-stores/files.d.ts.map +1 -1
- package/resources/vector-stores/files.js +15 -14
- package/resources/vector-stores/files.js.map +1 -1
- package/resources/vector-stores/files.mjs +15 -13
- package/resources/vector-stores/files.mjs.map +1 -1
- package/resources/vector-stores/index.d.ts +2 -1
- package/resources/vector-stores/index.d.ts.map +1 -1
- package/resources/vector-stores/index.js +5 -2
- package/resources/vector-stores/index.js.map +1 -1
- package/resources/vector-stores/index.mjs +3 -0
- package/resources/vector-stores/index.mjs.map +1 -1
- package/resources/vector-stores/vector-stores.d.ts +118 -217
- package/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/resources/vector-stores/vector-stores.js +18 -12
- package/resources/vector-stores/vector-stores.js.map +1 -1
- package/resources/vector-stores/vector-stores.mjs +18 -11
- package/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/resources/vector-stores.js +2 -1
- package/resources/vector-stores.js.map +1 -1
- package/resources/vector-stores.mjs +2 -0
- package/resources/vector-stores.mjs.map +1 -1
- package/src/error.ts +1 -0
- package/src/index.ts +92 -267
- package/src/lib/response-helpers.ts +60 -0
- package/src/pagination.ts +2 -5
- package/src/resource.ts +1 -0
- package/src/resources/alpha/admin.ts +84 -0
- package/src/resources/alpha/alpha.ts +93 -0
- package/src/resources/{benchmarks.ts → alpha/benchmarks.ts} +51 -16
- package/src/resources/{eval → alpha/eval}/eval.ts +83 -65
- package/src/resources/{eval → alpha/eval}/index.ts +1 -2
- package/src/resources/{eval → alpha/eval}/jobs.ts +6 -6
- package/src/resources/{eval.ts → alpha/eval.ts} +1 -0
- package/src/resources/alpha/index.ts +36 -0
- package/src/resources/alpha/inference.ts +132 -0
- package/src/resources/{post-training → alpha/post-training}/index.ts +1 -1
- package/src/resources/alpha/post-training/job.ts +177 -0
- package/src/resources/alpha/post-training/post-training.ts +372 -0
- package/src/resources/{post-training.ts → alpha/post-training.ts} +1 -1
- package/src/resources/alpha.ts +9 -0
- package/src/resources/batches.ts +572 -0
- package/src/resources/beta/beta.ts +41 -0
- package/src/resources/{datasets.ts → beta/datasets.ts} +128 -110
- package/src/resources/beta/index.ts +20 -0
- package/src/resources/{agents.ts → beta.ts} +2 -2
- package/src/resources/chat/chat.ts +84 -83
- package/src/resources/chat/completions.ts +876 -1486
- package/src/resources/chat/index.ts +1 -2
- package/src/resources/chat.ts +1 -1
- package/src/resources/completions.ts +59 -103
- package/src/resources/conversations/conversations.ts +491 -0
- package/src/resources/conversations/index.ts +25 -0
- package/src/resources/conversations/items.ts +1365 -0
- package/src/resources/conversations.ts +9 -0
- package/src/resources/embeddings.ts +14 -55
- package/src/resources/files.ts +54 -61
- package/src/resources/index.ts +35 -111
- package/src/resources/inspect.ts +4 -84
- package/src/resources/models/index.ts +4 -2
- package/src/resources/models/models.ts +79 -30
- package/src/resources/models/openai.ts +4 -24
- package/src/resources/models.ts +1 -1
- package/src/resources/moderations.ts +10 -36
- package/src/resources/prompts/index.ts +19 -0
- package/src/resources/prompts/prompts.ts +171 -0
- package/src/resources/prompts/versions.ts +26 -0
- package/src/resources/prompts.ts +9 -0
- package/src/resources/providers.ts +5 -18
- package/src/resources/responses/index.ts +1 -1
- package/src/resources/responses/input-items.ts +365 -161
- package/src/resources/responses/responses.ts +2959 -1870
- package/src/resources/responses.ts +1 -1
- package/src/resources/routes.ts +25 -14
- package/src/resources/safety.ts +199 -9
- package/src/resources/scoring-functions.ts +168 -52
- package/src/resources/scoring.ts +125 -22
- package/src/resources/shared.ts +187 -665
- package/src/resources/shields.ts +18 -23
- package/src/resources/tool-runtime.ts +210 -2
- package/src/resources/toolgroups.ts +26 -36
- package/src/resources/tools.ts +10 -94
- package/src/resources/vector-io.ts +323 -145
- package/src/resources/vector-stores/file-batches.ts +201 -0
- package/src/resources/vector-stores/files.ts +123 -143
- package/src/resources/vector-stores/index.ts +9 -1
- package/src/resources/vector-stores/vector-stores.ts +150 -216
- package/src/resources/vector-stores.ts +1 -1
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/agents/agents.d.ts +0 -246
- package/resources/agents/agents.d.ts.map +0 -1
- package/resources/agents/agents.js.map +0 -1
- package/resources/agents/agents.mjs +0 -52
- package/resources/agents/agents.mjs.map +0 -1
- package/resources/agents/index.d.ts +0 -5
- package/resources/agents/index.d.ts.map +0 -1
- package/resources/agents/index.js +0 -18
- package/resources/agents/index.js.map +0 -1
- package/resources/agents/index.mjs +0 -10
- package/resources/agents/index.mjs.map +0 -1
- package/resources/agents/session.d.ts +0 -98
- package/resources/agents/session.d.ts.map +0 -1
- package/resources/agents/session.js +0 -42
- package/resources/agents/session.js.map +0 -1
- package/resources/agents/session.mjs +0 -37
- package/resources/agents/session.mjs.map +0 -1
- package/resources/agents/steps.d.ts +0 -22
- package/resources/agents/steps.d.ts.map +0 -1
- package/resources/agents/steps.js.map +0 -1
- package/resources/agents/steps.mjs +0 -15
- package/resources/agents/steps.mjs.map +0 -1
- package/resources/agents/turn.d.ts +0 -461
- package/resources/agents/turn.d.ts.map +0 -1
- package/resources/agents/turn.js +0 -34
- package/resources/agents/turn.js.map +0 -1
- package/resources/agents/turn.mjs +0 -29
- package/resources/agents/turn.mjs.map +0 -1
- package/resources/agents.d.ts +0 -2
- package/resources/agents.d.ts.map +0 -1
- package/resources/agents.js.map +0 -1
- package/resources/agents.mjs +0 -7
- package/resources/agents.mjs.map +0 -1
- package/resources/benchmarks.d.ts.map +0 -1
- package/resources/benchmarks.js.map +0 -1
- package/resources/benchmarks.mjs +0 -31
- package/resources/benchmarks.mjs.map +0 -1
- package/resources/datasets.d.ts.map +0 -1
- package/resources/datasets.js.map +0 -1
- package/resources/datasets.mjs.map +0 -1
- package/resources/eval/eval.d.ts +0 -159
- package/resources/eval/eval.d.ts.map +0 -1
- package/resources/eval/eval.js.map +0 -1
- package/resources/eval/eval.mjs.map +0 -1
- package/resources/eval/index.d.ts +0 -3
- package/resources/eval/index.d.ts.map +0 -1
- package/resources/eval/index.js.map +0 -1
- package/resources/eval/index.mjs.map +0 -1
- package/resources/eval/jobs.d.ts.map +0 -1
- package/resources/eval/jobs.js.map +0 -1
- package/resources/eval/jobs.mjs.map +0 -1
- package/resources/eval.d.ts.map +0 -1
- package/resources/eval.js.map +0 -1
- package/resources/eval.mjs.map +0 -1
- package/resources/inference.d.ts +0 -580
- package/resources/inference.d.ts.map +0 -1
- package/resources/inference.js +0 -54
- package/resources/inference.js.map +0 -1
- package/resources/inference.mjs +0 -49
- package/resources/inference.mjs.map +0 -1
- package/resources/post-training/index.d.ts.map +0 -1
- package/resources/post-training/index.js.map +0 -1
- package/resources/post-training/index.mjs.map +0 -1
- package/resources/post-training/job.d.ts +0 -205
- package/resources/post-training/job.d.ts.map +0 -1
- package/resources/post-training/job.js.map +0 -1
- package/resources/post-training/job.mjs.map +0 -1
- package/resources/post-training/post-training.d.ts +0 -402
- package/resources/post-training/post-training.d.ts.map +0 -1
- package/resources/post-training/post-training.js.map +0 -1
- package/resources/post-training/post-training.mjs.map +0 -1
- package/resources/post-training.d.ts.map +0 -1
- package/resources/post-training.js.map +0 -1
- package/resources/post-training.mjs.map +0 -1
- package/resources/synthetic-data-generation.d.ts +0 -47
- package/resources/synthetic-data-generation.d.ts.map +0 -1
- package/resources/synthetic-data-generation.js +0 -20
- package/resources/synthetic-data-generation.js.map +0 -1
- package/resources/synthetic-data-generation.mjs +0 -15
- package/resources/synthetic-data-generation.mjs.map +0 -1
- package/resources/telemetry.d.ts +0 -519
- package/resources/telemetry.d.ts.map +0 -1
- package/resources/telemetry.js +0 -70
- package/resources/telemetry.js.map +0 -1
- package/resources/telemetry.mjs +0 -65
- package/resources/telemetry.mjs.map +0 -1
- package/resources/tool-runtime/index.d.ts +0 -3
- package/resources/tool-runtime/index.d.ts.map +0 -1
- package/resources/tool-runtime/index.js +0 -14
- package/resources/tool-runtime/index.js.map +0 -1
- package/resources/tool-runtime/index.mjs +0 -8
- package/resources/tool-runtime/index.mjs.map +0 -1
- package/resources/tool-runtime/rag-tool.d.ts +0 -45
- package/resources/tool-runtime/rag-tool.d.ts.map +0 -1
- package/resources/tool-runtime/rag-tool.js +0 -30
- package/resources/tool-runtime/rag-tool.js.map +0 -1
- package/resources/tool-runtime/rag-tool.mjs +0 -25
- package/resources/tool-runtime/rag-tool.mjs.map +0 -1
- package/resources/tool-runtime/tool-runtime.d.ts +0 -132
- package/resources/tool-runtime/tool-runtime.d.ts.map +0 -1
- package/resources/tool-runtime/tool-runtime.js.map +0 -1
- package/resources/tool-runtime/tool-runtime.mjs +0 -29
- package/resources/tool-runtime/tool-runtime.mjs.map +0 -1
- package/resources/vector-dbs.d.ts +0 -128
- package/resources/vector-dbs.d.ts.map +0 -1
- package/resources/vector-dbs.js +0 -41
- package/resources/vector-dbs.js.map +0 -1
- package/resources/vector-dbs.mjs +0 -36
- package/resources/vector-dbs.mjs.map +0 -1
- package/src/resources/agents/agents.ts +0 -372
- package/src/resources/agents/index.ts +0 -44
- package/src/resources/agents/session.ts +0 -169
- package/src/resources/agents/steps.ts +0 -47
- package/src/resources/agents/turn.ts +0 -638
- package/src/resources/inference.ts +0 -768
- package/src/resources/post-training/job.ts +0 -274
- package/src/resources/post-training/post-training.ts +0 -516
- package/src/resources/synthetic-data-generation.ts +0 -65
- package/src/resources/telemetry.ts +0 -692
- package/src/resources/tool-runtime/index.ts +0 -17
- package/src/resources/tool-runtime/rag-tool.ts +0 -69
- package/src/resources/tool-runtime/tool-runtime.ts +0 -191
- package/src/resources/vector-dbs.ts +0 -191
- /package/resources/{eval.d.ts → alpha/eval.d.ts} +0 -0
- /package/resources/{eval.mjs → alpha/eval.mjs} +0 -0
- /package/resources/{post-training → alpha/post-training}/index.d.ts +0 -0
- /package/resources/{post-training.d.ts → alpha/post-training.d.ts} +0 -0
|
@@ -9,22 +9,22 @@ import { Stream } from "../../streaming.js";
|
|
|
9
9
|
export declare class Responses extends APIResource {
|
|
10
10
|
inputItems: InputItemsAPI.InputItems;
|
|
11
11
|
/**
|
|
12
|
-
* Create a
|
|
12
|
+
* Create a model response.
|
|
13
13
|
*/
|
|
14
14
|
create(body: ResponseCreateParamsNonStreaming, options?: Core.RequestOptions): APIPromise<ResponseObject>;
|
|
15
15
|
create(body: ResponseCreateParamsStreaming, options?: Core.RequestOptions): APIPromise<Stream<ResponseObjectStream>>;
|
|
16
16
|
create(body: ResponseCreateParamsBase, options?: Core.RequestOptions): APIPromise<Stream<ResponseObjectStream> | ResponseObject>;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Get a model response.
|
|
19
19
|
*/
|
|
20
20
|
retrieve(responseId: string, options?: Core.RequestOptions): Core.APIPromise<ResponseObject>;
|
|
21
21
|
/**
|
|
22
|
-
* List all
|
|
22
|
+
* List all responses.
|
|
23
23
|
*/
|
|
24
24
|
list(query?: ResponseListParams, options?: Core.RequestOptions): Core.PagePromise<ResponseListResponsesOpenAICursorPage, ResponseListResponse>;
|
|
25
25
|
list(options?: Core.RequestOptions): Core.PagePromise<ResponseListResponsesOpenAICursorPage, ResponseListResponse>;
|
|
26
26
|
/**
|
|
27
|
-
* Delete
|
|
27
|
+
* Delete a response.
|
|
28
28
|
*/
|
|
29
29
|
delete(responseId: string, options?: Core.RequestOptions): Core.APIPromise<ResponseDeleteResponse>;
|
|
30
30
|
}
|
|
@@ -34,62 +34,43 @@ export declare class ResponseListResponsesOpenAICursorPage extends OpenAICursorP
|
|
|
34
34
|
* Complete OpenAI response object containing generation results and metadata.
|
|
35
35
|
*/
|
|
36
36
|
export interface ResponseObject {
|
|
37
|
-
/**
|
|
38
|
-
* Unique identifier for this response
|
|
39
|
-
*/
|
|
40
37
|
id: string;
|
|
41
|
-
/**
|
|
42
|
-
* Unix timestamp when the response was created
|
|
43
|
-
*/
|
|
44
38
|
created_at: number;
|
|
45
|
-
/**
|
|
46
|
-
* Model identifier used for generation
|
|
47
|
-
*/
|
|
48
39
|
model: string;
|
|
49
|
-
|
|
50
|
-
* Object type identifier, always "response"
|
|
51
|
-
*/
|
|
52
|
-
object: 'response';
|
|
53
|
-
/**
|
|
54
|
-
* List of generated output items (messages, tool calls, etc.)
|
|
55
|
-
*/
|
|
56
|
-
output: Array<ResponseObject.OpenAIResponseMessage | ResponseObject.OpenAIResponseOutputMessageWebSearchToolCall | ResponseObject.OpenAIResponseOutputMessageFileSearchToolCall | ResponseObject.OpenAIResponseOutputMessageFunctionToolCall | ResponseObject.OpenAIResponseOutputMessageMcpCall | ResponseObject.OpenAIResponseOutputMessageMcpListTools>;
|
|
57
|
-
/**
|
|
58
|
-
* Whether tool calls can be executed in parallel
|
|
59
|
-
*/
|
|
60
|
-
parallel_tool_calls: boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Current status of the response generation
|
|
63
|
-
*/
|
|
40
|
+
output: Array<ResponseObject.OpenAIResponseMessageOutput | ResponseObject.OpenAIResponseOutputMessageWebSearchToolCall | ResponseObject.OpenAIResponseOutputMessageFileSearchToolCall | ResponseObject.OpenAIResponseOutputMessageFunctionToolCall | ResponseObject.OpenAIResponseOutputMessageMcpCall | ResponseObject.OpenAIResponseOutputMessageMcpListTools | ResponseObject.OpenAIResponseMcpApprovalRequest>;
|
|
64
41
|
status: string;
|
|
65
42
|
/**
|
|
66
|
-
*
|
|
67
|
-
*/
|
|
68
|
-
text: ResponseObject.Text;
|
|
69
|
-
/**
|
|
70
|
-
* (Optional) Error details if the response generation failed
|
|
43
|
+
* Error details for failed OpenAI response requests.
|
|
71
44
|
*/
|
|
72
|
-
error?: ResponseObject.Error;
|
|
45
|
+
error?: ResponseObject.Error | null;
|
|
46
|
+
instructions?: string | null;
|
|
47
|
+
max_tool_calls?: number | null;
|
|
48
|
+
metadata?: {
|
|
49
|
+
[key: string]: string;
|
|
50
|
+
} | null;
|
|
51
|
+
object?: 'response';
|
|
52
|
+
parallel_tool_calls?: boolean | null;
|
|
53
|
+
previous_response_id?: string | null;
|
|
73
54
|
/**
|
|
74
|
-
*
|
|
55
|
+
* OpenAI compatible Prompt object that is used in OpenAI responses.
|
|
75
56
|
*/
|
|
76
|
-
|
|
57
|
+
prompt?: ResponseObject.Prompt | null;
|
|
58
|
+
temperature?: number | null;
|
|
77
59
|
/**
|
|
78
|
-
*
|
|
79
|
-
*/
|
|
80
|
-
temperature?: number;
|
|
81
|
-
/**
|
|
82
|
-
* (Optional) Nucleus sampling parameter used for generation
|
|
60
|
+
* Text response configuration for OpenAI responses.
|
|
83
61
|
*/
|
|
84
|
-
|
|
62
|
+
text?: ResponseObject.Text;
|
|
85
63
|
/**
|
|
86
|
-
*
|
|
64
|
+
* Constrains the tools available to the model to a pre-defined set.
|
|
87
65
|
*/
|
|
88
|
-
|
|
66
|
+
tool_choice?: 'auto' | 'required' | 'none' | ResponseObject.OpenAIResponseInputToolChoiceAllowedTools | ResponseObject.OpenAIResponseInputToolChoiceFileSearch | ResponseObject.OpenAIResponseInputToolChoiceWebSearch | ResponseObject.OpenAIResponseInputToolChoiceFunctionTool | ResponseObject.OpenAIResponseInputToolChoiceMcpTool | ResponseObject.OpenAIResponseInputToolChoiceCustomTool | null;
|
|
67
|
+
tools?: Array<ResponseObject.OpenAIResponseInputToolWebSearch | ResponseObject.OpenAIResponseInputToolFileSearch | ResponseObject.OpenAIResponseInputToolFunction | ResponseObject.OpenAIResponseToolMcp> | null;
|
|
68
|
+
top_p?: number | null;
|
|
69
|
+
truncation?: string | null;
|
|
89
70
|
/**
|
|
90
|
-
*
|
|
71
|
+
* Usage information for OpenAI response.
|
|
91
72
|
*/
|
|
92
|
-
|
|
73
|
+
usage?: ResponseObject.Usage | null;
|
|
93
74
|
}
|
|
94
75
|
export declare namespace ResponseObject {
|
|
95
76
|
/**
|
|
@@ -97,95 +78,65 @@ export declare namespace ResponseObject {
|
|
|
97
78
|
* under one type because the Responses API gives them all the same "type" value,
|
|
98
79
|
* and there is no way to tell them apart in certain scenarios.
|
|
99
80
|
*/
|
|
100
|
-
interface
|
|
101
|
-
content: string | Array<
|
|
81
|
+
interface OpenAIResponseMessageOutput {
|
|
82
|
+
content: string | Array<OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentText | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentImage | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessageOutput.OpenAIResponseOutputMessageContentOutputTextOutput | OpenAIResponseMessageOutput.OpenAIResponseContentPartRefusal>;
|
|
102
83
|
role: 'system' | 'developer' | 'user' | 'assistant';
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
84
|
+
id?: string | null;
|
|
85
|
+
status?: string | null;
|
|
86
|
+
type?: 'message';
|
|
106
87
|
}
|
|
107
|
-
namespace
|
|
88
|
+
namespace OpenAIResponseMessageOutput {
|
|
108
89
|
/**
|
|
109
90
|
* Text content for input messages in OpenAI response format.
|
|
110
91
|
*/
|
|
111
92
|
interface OpenAIResponseInputMessageContentText {
|
|
112
|
-
/**
|
|
113
|
-
* The text content of the input message
|
|
114
|
-
*/
|
|
115
93
|
text: string;
|
|
116
|
-
|
|
117
|
-
* Content type identifier, always "input_text"
|
|
118
|
-
*/
|
|
119
|
-
type: 'input_text';
|
|
94
|
+
type?: 'input_text';
|
|
120
95
|
}
|
|
121
96
|
/**
|
|
122
97
|
* Image content for input messages in OpenAI response format.
|
|
123
98
|
*/
|
|
124
99
|
interface OpenAIResponseInputMessageContentImage {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
100
|
+
detail?: 'low' | 'high' | 'auto';
|
|
101
|
+
file_id?: string | null;
|
|
102
|
+
image_url?: string | null;
|
|
103
|
+
type?: 'input_image';
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* File content for input messages in OpenAI response format.
|
|
107
|
+
*/
|
|
108
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
109
|
+
file_data?: string | null;
|
|
110
|
+
file_id?: string | null;
|
|
111
|
+
file_url?: string | null;
|
|
112
|
+
filename?: string | null;
|
|
113
|
+
type?: 'input_file';
|
|
137
114
|
}
|
|
138
|
-
interface
|
|
139
|
-
annotations: Array<UnionMember2.OpenAIResponseAnnotationFileCitation | UnionMember2.OpenAIResponseAnnotationCitation | UnionMember2.OpenAIResponseAnnotationContainerFileCitation | UnionMember2.OpenAIResponseAnnotationFilePath>;
|
|
115
|
+
interface OpenAIResponseOutputMessageContentOutputTextOutput {
|
|
140
116
|
text: string;
|
|
141
|
-
|
|
117
|
+
annotations?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFilePath>;
|
|
118
|
+
logprobs?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.Logprob> | null;
|
|
119
|
+
type?: 'output_text';
|
|
142
120
|
}
|
|
143
|
-
namespace
|
|
121
|
+
namespace OpenAIResponseOutputMessageContentOutputTextOutput {
|
|
144
122
|
/**
|
|
145
123
|
* File citation annotation for referencing specific files in response content.
|
|
146
124
|
*/
|
|
147
125
|
interface OpenAIResponseAnnotationFileCitation {
|
|
148
|
-
/**
|
|
149
|
-
* Unique identifier of the referenced file
|
|
150
|
-
*/
|
|
151
126
|
file_id: string;
|
|
152
|
-
/**
|
|
153
|
-
* Name of the referenced file
|
|
154
|
-
*/
|
|
155
127
|
filename: string;
|
|
156
|
-
/**
|
|
157
|
-
* Position index of the citation within the content
|
|
158
|
-
*/
|
|
159
128
|
index: number;
|
|
160
|
-
|
|
161
|
-
* Annotation type identifier, always "file_citation"
|
|
162
|
-
*/
|
|
163
|
-
type: 'file_citation';
|
|
129
|
+
type?: 'file_citation';
|
|
164
130
|
}
|
|
165
131
|
/**
|
|
166
132
|
* URL citation annotation for referencing external web resources.
|
|
167
133
|
*/
|
|
168
134
|
interface OpenAIResponseAnnotationCitation {
|
|
169
|
-
/**
|
|
170
|
-
* End position of the citation span in the content
|
|
171
|
-
*/
|
|
172
135
|
end_index: number;
|
|
173
|
-
/**
|
|
174
|
-
* Start position of the citation span in the content
|
|
175
|
-
*/
|
|
176
136
|
start_index: number;
|
|
177
|
-
/**
|
|
178
|
-
* Title of the referenced web resource
|
|
179
|
-
*/
|
|
180
137
|
title: string;
|
|
181
|
-
/**
|
|
182
|
-
* Annotation type identifier, always "url_citation"
|
|
183
|
-
*/
|
|
184
|
-
type: 'url_citation';
|
|
185
|
-
/**
|
|
186
|
-
* URL of the referenced web resource
|
|
187
|
-
*/
|
|
188
138
|
url: string;
|
|
139
|
+
type?: 'url_citation';
|
|
189
140
|
}
|
|
190
141
|
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
191
142
|
container_id: string;
|
|
@@ -193,83 +144,78 @@ export declare namespace ResponseObject {
|
|
|
193
144
|
file_id: string;
|
|
194
145
|
filename: string;
|
|
195
146
|
start_index: number;
|
|
196
|
-
type
|
|
147
|
+
type?: 'container_file_citation';
|
|
197
148
|
}
|
|
198
149
|
interface OpenAIResponseAnnotationFilePath {
|
|
199
150
|
file_id: string;
|
|
200
151
|
index: number;
|
|
201
|
-
type
|
|
152
|
+
type?: 'file_path';
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
156
|
+
* response.
|
|
157
|
+
*
|
|
158
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
159
|
+
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
160
|
+
*/
|
|
161
|
+
interface Logprob {
|
|
162
|
+
token: string;
|
|
163
|
+
logprob: number;
|
|
164
|
+
bytes?: Array<number> | null;
|
|
165
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
202
166
|
}
|
|
167
|
+
namespace Logprob {
|
|
168
|
+
/**
|
|
169
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
170
|
+
* response.
|
|
171
|
+
*
|
|
172
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
173
|
+
* probability of the token
|
|
174
|
+
*/
|
|
175
|
+
interface TopLogprob {
|
|
176
|
+
token: string;
|
|
177
|
+
logprob: number;
|
|
178
|
+
bytes?: Array<number> | null;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Refusal content within a streamed response part.
|
|
184
|
+
*/
|
|
185
|
+
interface OpenAIResponseContentPartRefusal {
|
|
186
|
+
refusal: string;
|
|
187
|
+
type?: 'refusal';
|
|
203
188
|
}
|
|
204
189
|
}
|
|
205
190
|
/**
|
|
206
191
|
* Web search tool call output message for OpenAI responses.
|
|
207
192
|
*/
|
|
208
193
|
interface OpenAIResponseOutputMessageWebSearchToolCall {
|
|
209
|
-
/**
|
|
210
|
-
* Unique identifier for this tool call
|
|
211
|
-
*/
|
|
212
194
|
id: string;
|
|
213
|
-
/**
|
|
214
|
-
* Current status of the web search operation
|
|
215
|
-
*/
|
|
216
195
|
status: string;
|
|
217
|
-
|
|
218
|
-
* Tool call type identifier, always "web_search_call"
|
|
219
|
-
*/
|
|
220
|
-
type: 'web_search_call';
|
|
196
|
+
type?: 'web_search_call';
|
|
221
197
|
}
|
|
222
198
|
/**
|
|
223
199
|
* File search tool call output message for OpenAI responses.
|
|
224
200
|
*/
|
|
225
201
|
interface OpenAIResponseOutputMessageFileSearchToolCall {
|
|
226
|
-
/**
|
|
227
|
-
* Unique identifier for this tool call
|
|
228
|
-
*/
|
|
229
202
|
id: string;
|
|
230
|
-
/**
|
|
231
|
-
* List of search queries executed
|
|
232
|
-
*/
|
|
233
203
|
queries: Array<string>;
|
|
234
|
-
/**
|
|
235
|
-
* Current status of the file search operation
|
|
236
|
-
*/
|
|
237
204
|
status: string;
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
*/
|
|
241
|
-
type: 'file_search_call';
|
|
242
|
-
/**
|
|
243
|
-
* (Optional) Search results returned by the file search operation
|
|
244
|
-
*/
|
|
245
|
-
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result>;
|
|
205
|
+
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
|
|
206
|
+
type?: 'file_search_call';
|
|
246
207
|
}
|
|
247
208
|
namespace OpenAIResponseOutputMessageFileSearchToolCall {
|
|
248
209
|
/**
|
|
249
210
|
* Search results returned by the file search operation.
|
|
250
211
|
*/
|
|
251
212
|
interface Result {
|
|
252
|
-
/**
|
|
253
|
-
* (Optional) Key-value attributes associated with the file
|
|
254
|
-
*/
|
|
255
213
|
attributes: {
|
|
256
|
-
[key: string]:
|
|
214
|
+
[key: string]: unknown;
|
|
257
215
|
};
|
|
258
|
-
/**
|
|
259
|
-
* Unique identifier of the file containing the result
|
|
260
|
-
*/
|
|
261
216
|
file_id: string;
|
|
262
|
-
/**
|
|
263
|
-
* Name of the file containing the result
|
|
264
|
-
*/
|
|
265
217
|
filename: string;
|
|
266
|
-
/**
|
|
267
|
-
* Relevance score for this search result (between 0 and 1)
|
|
268
|
-
*/
|
|
269
218
|
score: number;
|
|
270
|
-
/**
|
|
271
|
-
* Text content of the search result
|
|
272
|
-
*/
|
|
273
219
|
text: string;
|
|
274
220
|
}
|
|
275
221
|
}
|
|
@@ -277,202 +223,301 @@ export declare namespace ResponseObject {
|
|
|
277
223
|
* Function tool call output message for OpenAI responses.
|
|
278
224
|
*/
|
|
279
225
|
interface OpenAIResponseOutputMessageFunctionToolCall {
|
|
280
|
-
/**
|
|
281
|
-
* JSON string containing the function arguments
|
|
282
|
-
*/
|
|
283
226
|
arguments: string;
|
|
284
|
-
/**
|
|
285
|
-
* Unique identifier for the function call
|
|
286
|
-
*/
|
|
287
227
|
call_id: string;
|
|
288
|
-
/**
|
|
289
|
-
* Name of the function being called
|
|
290
|
-
*/
|
|
291
228
|
name: string;
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
type: 'function_call';
|
|
296
|
-
/**
|
|
297
|
-
* (Optional) Additional identifier for the tool call
|
|
298
|
-
*/
|
|
299
|
-
id?: string;
|
|
300
|
-
/**
|
|
301
|
-
* (Optional) Current status of the function call execution
|
|
302
|
-
*/
|
|
303
|
-
status?: string;
|
|
229
|
+
id?: string | null;
|
|
230
|
+
status?: string | null;
|
|
231
|
+
type?: 'function_call';
|
|
304
232
|
}
|
|
305
233
|
/**
|
|
306
234
|
* Model Context Protocol (MCP) call output message for OpenAI responses.
|
|
307
235
|
*/
|
|
308
236
|
interface OpenAIResponseOutputMessageMcpCall {
|
|
309
|
-
/**
|
|
310
|
-
* Unique identifier for this MCP call
|
|
311
|
-
*/
|
|
312
237
|
id: string;
|
|
313
|
-
/**
|
|
314
|
-
* JSON string containing the MCP call arguments
|
|
315
|
-
*/
|
|
316
238
|
arguments: string;
|
|
317
|
-
/**
|
|
318
|
-
* Name of the MCP method being called
|
|
319
|
-
*/
|
|
320
239
|
name: string;
|
|
321
|
-
/**
|
|
322
|
-
* Label identifying the MCP server handling the call
|
|
323
|
-
*/
|
|
324
240
|
server_label: string;
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
type: 'mcp_call';
|
|
329
|
-
/**
|
|
330
|
-
* (Optional) Error message if the MCP call failed
|
|
331
|
-
*/
|
|
332
|
-
error?: string;
|
|
333
|
-
/**
|
|
334
|
-
* (Optional) Output result from the successful MCP call
|
|
335
|
-
*/
|
|
336
|
-
output?: string;
|
|
241
|
+
error?: string | null;
|
|
242
|
+
output?: string | null;
|
|
243
|
+
type?: 'mcp_call';
|
|
337
244
|
}
|
|
338
245
|
/**
|
|
339
246
|
* MCP list tools output message containing available tools from an MCP server.
|
|
340
247
|
*/
|
|
341
248
|
interface OpenAIResponseOutputMessageMcpListTools {
|
|
342
|
-
/**
|
|
343
|
-
* Unique identifier for this MCP list tools operation
|
|
344
|
-
*/
|
|
345
249
|
id: string;
|
|
346
|
-
/**
|
|
347
|
-
* Label identifying the MCP server providing the tools
|
|
348
|
-
*/
|
|
349
250
|
server_label: string;
|
|
350
|
-
/**
|
|
351
|
-
* List of available tools provided by the MCP server
|
|
352
|
-
*/
|
|
353
251
|
tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
|
|
354
|
-
|
|
355
|
-
* Tool call type identifier, always "mcp_list_tools"
|
|
356
|
-
*/
|
|
357
|
-
type: 'mcp_list_tools';
|
|
252
|
+
type?: 'mcp_list_tools';
|
|
358
253
|
}
|
|
359
254
|
namespace OpenAIResponseOutputMessageMcpListTools {
|
|
360
255
|
/**
|
|
361
256
|
* Tool definition returned by MCP list tools operation.
|
|
362
257
|
*/
|
|
363
258
|
interface Tool {
|
|
364
|
-
/**
|
|
365
|
-
* JSON schema defining the tool's input parameters
|
|
366
|
-
*/
|
|
367
259
|
input_schema: {
|
|
368
|
-
[key: string]:
|
|
260
|
+
[key: string]: unknown;
|
|
369
261
|
};
|
|
370
|
-
/**
|
|
371
|
-
* Name of the tool
|
|
372
|
-
*/
|
|
373
262
|
name: string;
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
263
|
+
description?: string | null;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* A request for human approval of a tool invocation.
|
|
268
|
+
*/
|
|
269
|
+
interface OpenAIResponseMcpApprovalRequest {
|
|
270
|
+
id: string;
|
|
271
|
+
arguments: string;
|
|
272
|
+
name: string;
|
|
273
|
+
server_label: string;
|
|
274
|
+
type?: 'mcp_approval_request';
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Error details for failed OpenAI response requests.
|
|
278
|
+
*/
|
|
279
|
+
interface Error {
|
|
280
|
+
code: string;
|
|
281
|
+
message: string;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* OpenAI compatible Prompt object that is used in OpenAI responses.
|
|
285
|
+
*/
|
|
286
|
+
interface Prompt {
|
|
287
|
+
id: string;
|
|
288
|
+
variables?: {
|
|
289
|
+
[key: string]: Prompt.OpenAIResponseInputMessageContentText | Prompt.OpenAIResponseInputMessageContentImage | Prompt.OpenAIResponseInputMessageContentFile;
|
|
290
|
+
} | null;
|
|
291
|
+
version?: string | null;
|
|
292
|
+
}
|
|
293
|
+
namespace Prompt {
|
|
294
|
+
/**
|
|
295
|
+
* Text content for input messages in OpenAI response format.
|
|
296
|
+
*/
|
|
297
|
+
interface OpenAIResponseInputMessageContentText {
|
|
298
|
+
text: string;
|
|
299
|
+
type?: 'input_text';
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Image content for input messages in OpenAI response format.
|
|
303
|
+
*/
|
|
304
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
305
|
+
detail?: 'low' | 'high' | 'auto';
|
|
306
|
+
file_id?: string | null;
|
|
307
|
+
image_url?: string | null;
|
|
308
|
+
type?: 'input_image';
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* File content for input messages in OpenAI response format.
|
|
312
|
+
*/
|
|
313
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
314
|
+
file_data?: string | null;
|
|
315
|
+
file_id?: string | null;
|
|
316
|
+
file_url?: string | null;
|
|
317
|
+
filename?: string | null;
|
|
318
|
+
type?: 'input_file';
|
|
378
319
|
}
|
|
379
320
|
}
|
|
380
321
|
/**
|
|
381
|
-
* Text
|
|
322
|
+
* Text response configuration for OpenAI responses.
|
|
382
323
|
*/
|
|
383
324
|
interface Text {
|
|
384
325
|
/**
|
|
385
|
-
*
|
|
326
|
+
* Configuration for Responses API text format.
|
|
386
327
|
*/
|
|
387
|
-
format?: Text.Format;
|
|
328
|
+
format?: Text.Format | null;
|
|
388
329
|
}
|
|
389
330
|
namespace Text {
|
|
390
331
|
/**
|
|
391
|
-
*
|
|
332
|
+
* Configuration for Responses API text format.
|
|
392
333
|
*/
|
|
393
334
|
interface Format {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
*/
|
|
397
|
-
type: 'text' | 'json_schema' | 'json_object';
|
|
398
|
-
/**
|
|
399
|
-
* (Optional) A description of the response format. Only used for json_schema.
|
|
400
|
-
*/
|
|
401
|
-
description?: string;
|
|
402
|
-
/**
|
|
403
|
-
* The name of the response format. Only used for json_schema.
|
|
404
|
-
*/
|
|
405
|
-
name?: string;
|
|
406
|
-
/**
|
|
407
|
-
* The JSON schema the response should conform to. In a Python SDK, this is often a
|
|
408
|
-
* `pydantic` model. Only used for json_schema.
|
|
409
|
-
*/
|
|
335
|
+
description?: string | null;
|
|
336
|
+
name?: string | null;
|
|
410
337
|
schema?: {
|
|
411
|
-
[key: string]:
|
|
412
|
-
};
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
* must match the schema exactly. Only used for json_schema.
|
|
416
|
-
*/
|
|
417
|
-
strict?: boolean;
|
|
338
|
+
[key: string]: unknown;
|
|
339
|
+
} | null;
|
|
340
|
+
strict?: boolean | null;
|
|
341
|
+
type?: 'text' | 'json_schema' | 'json_object';
|
|
418
342
|
}
|
|
419
343
|
}
|
|
420
344
|
/**
|
|
421
|
-
*
|
|
345
|
+
* Constrains the tools available to the model to a pre-defined set.
|
|
422
346
|
*/
|
|
423
|
-
interface
|
|
347
|
+
interface OpenAIResponseInputToolChoiceAllowedTools {
|
|
348
|
+
tools: Array<{
|
|
349
|
+
[key: string]: string;
|
|
350
|
+
}>;
|
|
351
|
+
mode?: 'auto' | 'required';
|
|
352
|
+
type?: 'allowed_tools';
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Indicates that the model should use file search to generate a response.
|
|
356
|
+
*/
|
|
357
|
+
interface OpenAIResponseInputToolChoiceFileSearch {
|
|
358
|
+
type?: 'file_search';
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Indicates that the model should use web search to generate a response
|
|
362
|
+
*/
|
|
363
|
+
interface OpenAIResponseInputToolChoiceWebSearch {
|
|
364
|
+
type?: 'web_search' | 'web_search_preview' | 'web_search_preview_2025_03_11' | 'web_search_2025_08_26';
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Forces the model to call a specific function.
|
|
368
|
+
*/
|
|
369
|
+
interface OpenAIResponseInputToolChoiceFunctionTool {
|
|
370
|
+
name: string;
|
|
371
|
+
type?: 'function';
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Forces the model to call a specific tool on a remote MCP server
|
|
375
|
+
*/
|
|
376
|
+
interface OpenAIResponseInputToolChoiceMcpTool {
|
|
377
|
+
server_label: string;
|
|
378
|
+
name?: string | null;
|
|
379
|
+
type?: 'mcp';
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Forces the model to call a custom tool.
|
|
383
|
+
*/
|
|
384
|
+
interface OpenAIResponseInputToolChoiceCustomTool {
|
|
385
|
+
name: string;
|
|
386
|
+
type?: 'custom';
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Web search tool configuration for OpenAI response inputs.
|
|
390
|
+
*/
|
|
391
|
+
interface OpenAIResponseInputToolWebSearch {
|
|
392
|
+
search_context_size?: string | null;
|
|
393
|
+
type?: 'web_search' | 'web_search_preview' | 'web_search_preview_2025_03_11' | 'web_search_2025_08_26';
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* File search tool configuration for OpenAI response inputs.
|
|
397
|
+
*/
|
|
398
|
+
interface OpenAIResponseInputToolFileSearch {
|
|
399
|
+
vector_store_ids: Array<string>;
|
|
400
|
+
filters?: {
|
|
401
|
+
[key: string]: unknown;
|
|
402
|
+
} | null;
|
|
403
|
+
max_num_results?: number | null;
|
|
424
404
|
/**
|
|
425
|
-
*
|
|
405
|
+
* Options for ranking and filtering search results.
|
|
426
406
|
*/
|
|
427
|
-
|
|
407
|
+
ranking_options?: OpenAIResponseInputToolFileSearch.RankingOptions | null;
|
|
408
|
+
type?: 'file_search';
|
|
409
|
+
}
|
|
410
|
+
namespace OpenAIResponseInputToolFileSearch {
|
|
428
411
|
/**
|
|
429
|
-
*
|
|
412
|
+
* Options for ranking and filtering search results.
|
|
430
413
|
*/
|
|
431
|
-
|
|
414
|
+
interface RankingOptions {
|
|
415
|
+
ranker?: string | null;
|
|
416
|
+
score_threshold?: number | null;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Function tool configuration for OpenAI response inputs.
|
|
421
|
+
*/
|
|
422
|
+
interface OpenAIResponseInputToolFunction {
|
|
423
|
+
name: string;
|
|
424
|
+
parameters: {
|
|
425
|
+
[key: string]: unknown;
|
|
426
|
+
} | null;
|
|
427
|
+
description?: string | null;
|
|
428
|
+
strict?: boolean | null;
|
|
429
|
+
type?: 'function';
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Model Context Protocol (MCP) tool configuration for OpenAI response object.
|
|
433
|
+
*/
|
|
434
|
+
interface OpenAIResponseToolMcp {
|
|
435
|
+
server_label: string;
|
|
436
|
+
/**
|
|
437
|
+
* Filter configuration for restricting which MCP tools can be used.
|
|
438
|
+
*/
|
|
439
|
+
allowed_tools?: Array<string> | OpenAIResponseToolMcp.AllowedToolsFilter | null;
|
|
440
|
+
type?: 'mcp';
|
|
441
|
+
}
|
|
442
|
+
namespace OpenAIResponseToolMcp {
|
|
443
|
+
/**
|
|
444
|
+
* Filter configuration for restricting which MCP tools can be used.
|
|
445
|
+
*/
|
|
446
|
+
interface AllowedToolsFilter {
|
|
447
|
+
tool_names?: Array<string> | null;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Usage information for OpenAI response.
|
|
452
|
+
*/
|
|
453
|
+
interface Usage {
|
|
454
|
+
input_tokens: number;
|
|
455
|
+
output_tokens: number;
|
|
456
|
+
total_tokens: number;
|
|
457
|
+
/**
|
|
458
|
+
* Token details for input tokens in OpenAI response usage.
|
|
459
|
+
*/
|
|
460
|
+
input_tokens_details?: Usage.InputTokensDetails | null;
|
|
461
|
+
/**
|
|
462
|
+
* Token details for output tokens in OpenAI response usage.
|
|
463
|
+
*/
|
|
464
|
+
output_tokens_details?: Usage.OutputTokensDetails | null;
|
|
465
|
+
}
|
|
466
|
+
namespace Usage {
|
|
467
|
+
/**
|
|
468
|
+
* Token details for input tokens in OpenAI response usage.
|
|
469
|
+
*/
|
|
470
|
+
interface InputTokensDetails {
|
|
471
|
+
cached_tokens?: number | null;
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Token details for output tokens in OpenAI response usage.
|
|
475
|
+
*/
|
|
476
|
+
interface OutputTokensDetails {
|
|
477
|
+
reasoning_tokens?: number | null;
|
|
478
|
+
}
|
|
432
479
|
}
|
|
433
480
|
}
|
|
434
481
|
/**
|
|
435
482
|
* Streaming event indicating a new response has been created.
|
|
436
483
|
*/
|
|
437
|
-
export type ResponseObjectStream = ResponseObjectStream.OpenAIResponseObjectStreamResponseCreated | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputItemAdded | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputItemDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputTextDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputTextDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseWebSearchCallInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseWebSearchCallSearching | ResponseObjectStream.OpenAIResponseObjectStreamResponseWebSearchCallCompleted | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpListToolsInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpListToolsFailed | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpListToolsCompleted | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallArgumentsDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallFailed | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallCompleted | ResponseObjectStream.OpenAIResponseObjectStreamResponseContentPartAdded | ResponseObjectStream.OpenAIResponseObjectStreamResponseContentPartDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseCompleted;
|
|
484
|
+
export type ResponseObjectStream = ResponseObjectStream.OpenAIResponseObjectStreamResponseCreated | ResponseObjectStream.OpenAIResponseObjectStreamResponseInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputItemAdded | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputItemDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputTextDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputTextDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseWebSearchCallInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseWebSearchCallSearching | ResponseObjectStream.OpenAIResponseObjectStreamResponseWebSearchCallCompleted | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpListToolsInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpListToolsFailed | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpListToolsCompleted | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallArgumentsDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallFailed | ResponseObjectStream.OpenAIResponseObjectStreamResponseMcpCallCompleted | ResponseObjectStream.OpenAIResponseObjectStreamResponseContentPartAdded | ResponseObjectStream.OpenAIResponseObjectStreamResponseContentPartDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseReasoningTextDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseReasoningTextDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded | ResponseObjectStream.OpenAIResponseObjectStreamResponseReasoningSummaryPartDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseReasoningSummaryTextDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseRefusalDelta | ResponseObjectStream.OpenAIResponseObjectStreamResponseRefusalDone | ResponseObjectStream.OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded | ResponseObjectStream.OpenAIResponseObjectStreamResponseFileSearchCallInProgress | ResponseObjectStream.OpenAIResponseObjectStreamResponseFileSearchCallSearching | ResponseObjectStream.OpenAIResponseObjectStreamResponseFileSearchCallCompleted | ResponseObjectStream.OpenAIResponseObjectStreamResponseIncomplete | ResponseObjectStream.OpenAIResponseObjectStreamResponseFailed | ResponseObjectStream.OpenAIResponseObjectStreamResponseCompleted;
|
|
438
485
|
export declare namespace ResponseObjectStream {
|
|
439
486
|
/**
|
|
440
487
|
* Streaming event indicating a new response has been created.
|
|
441
488
|
*/
|
|
442
489
|
interface OpenAIResponseObjectStreamResponseCreated {
|
|
443
490
|
/**
|
|
444
|
-
*
|
|
491
|
+
* Complete OpenAI response object containing generation results and metadata.
|
|
445
492
|
*/
|
|
446
493
|
response: ResponsesAPI.ResponseObject;
|
|
494
|
+
type?: 'response.created';
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Streaming event indicating the response remains in progress.
|
|
498
|
+
*/
|
|
499
|
+
interface OpenAIResponseObjectStreamResponseInProgress {
|
|
447
500
|
/**
|
|
448
|
-
*
|
|
501
|
+
* Complete OpenAI response object containing generation results and metadata.
|
|
449
502
|
*/
|
|
450
|
-
|
|
503
|
+
response: ResponsesAPI.ResponseObject;
|
|
504
|
+
sequence_number: number;
|
|
505
|
+
type?: 'response.in_progress';
|
|
451
506
|
}
|
|
452
507
|
/**
|
|
453
508
|
* Streaming event for when a new output item is added to the response.
|
|
454
509
|
*/
|
|
455
510
|
interface OpenAIResponseObjectStreamResponseOutputItemAdded {
|
|
456
511
|
/**
|
|
457
|
-
*
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
/**
|
|
461
|
-
* Index position of this item in the output list
|
|
512
|
+
* Corresponds to the various Message types in the Responses API. They are all
|
|
513
|
+
* under one type because the Responses API gives them all the same "type" value,
|
|
514
|
+
* and there is no way to tell them apart in certain scenarios.
|
|
462
515
|
*/
|
|
516
|
+
item: OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseMessage | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageWebSearchToolCall | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageFileSearchToolCall | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageFunctionToolCall | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageMcpCall | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseOutputMessageMcpListTools | OpenAIResponseObjectStreamResponseOutputItemAdded.OpenAIResponseMcpApprovalRequest;
|
|
463
517
|
output_index: number;
|
|
464
|
-
/**
|
|
465
|
-
* Unique identifier of the response containing this output
|
|
466
|
-
*/
|
|
467
518
|
response_id: string;
|
|
468
|
-
/**
|
|
469
|
-
* Sequential number for ordering streaming events
|
|
470
|
-
*/
|
|
471
519
|
sequence_number: number;
|
|
472
|
-
|
|
473
|
-
* Event type identifier, always "response.output_item.added"
|
|
474
|
-
*/
|
|
475
|
-
type: 'response.output_item.added';
|
|
520
|
+
type?: 'response.output_item.added';
|
|
476
521
|
}
|
|
477
522
|
namespace OpenAIResponseObjectStreamResponseOutputItemAdded {
|
|
478
523
|
/**
|
|
@@ -481,94 +526,64 @@ export declare namespace ResponseObjectStream {
|
|
|
481
526
|
* and there is no way to tell them apart in certain scenarios.
|
|
482
527
|
*/
|
|
483
528
|
interface OpenAIResponseMessage {
|
|
484
|
-
content: string | Array<OpenAIResponseMessage.OpenAIResponseInputMessageContentText | OpenAIResponseMessage.OpenAIResponseInputMessageContentImage> | Array<OpenAIResponseMessage.
|
|
529
|
+
content: string | Array<OpenAIResponseMessage.OpenAIResponseInputMessageContentText | OpenAIResponseMessage.OpenAIResponseInputMessageContentImage | OpenAIResponseMessage.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessage.OpenAIResponseOutputMessageContentOutputText | OpenAIResponseMessage.OpenAIResponseContentPartRefusal>;
|
|
485
530
|
role: 'system' | 'developer' | 'user' | 'assistant';
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
531
|
+
id?: string | null;
|
|
532
|
+
status?: string | null;
|
|
533
|
+
type?: 'message';
|
|
489
534
|
}
|
|
490
535
|
namespace OpenAIResponseMessage {
|
|
491
536
|
/**
|
|
492
537
|
* Text content for input messages in OpenAI response format.
|
|
493
538
|
*/
|
|
494
539
|
interface OpenAIResponseInputMessageContentText {
|
|
495
|
-
/**
|
|
496
|
-
* The text content of the input message
|
|
497
|
-
*/
|
|
498
540
|
text: string;
|
|
499
|
-
|
|
500
|
-
* Content type identifier, always "input_text"
|
|
501
|
-
*/
|
|
502
|
-
type: 'input_text';
|
|
541
|
+
type?: 'input_text';
|
|
503
542
|
}
|
|
504
543
|
/**
|
|
505
544
|
* Image content for input messages in OpenAI response format.
|
|
506
545
|
*/
|
|
507
546
|
interface OpenAIResponseInputMessageContentImage {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
547
|
+
detail?: 'low' | 'high' | 'auto';
|
|
548
|
+
file_id?: string | null;
|
|
549
|
+
image_url?: string | null;
|
|
550
|
+
type?: 'input_image';
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* File content for input messages in OpenAI response format.
|
|
554
|
+
*/
|
|
555
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
556
|
+
file_data?: string | null;
|
|
557
|
+
file_id?: string | null;
|
|
558
|
+
file_url?: string | null;
|
|
559
|
+
filename?: string | null;
|
|
560
|
+
type?: 'input_file';
|
|
520
561
|
}
|
|
521
|
-
interface
|
|
522
|
-
annotations: Array<UnionMember2.OpenAIResponseAnnotationFileCitation | UnionMember2.OpenAIResponseAnnotationCitation | UnionMember2.OpenAIResponseAnnotationContainerFileCitation | UnionMember2.OpenAIResponseAnnotationFilePath>;
|
|
562
|
+
interface OpenAIResponseOutputMessageContentOutputText {
|
|
523
563
|
text: string;
|
|
524
|
-
|
|
564
|
+
annotations?: Array<OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFilePath>;
|
|
565
|
+
logprobs?: Array<OpenAIResponseOutputMessageContentOutputText.Logprob> | null;
|
|
566
|
+
type?: 'output_text';
|
|
525
567
|
}
|
|
526
|
-
namespace
|
|
568
|
+
namespace OpenAIResponseOutputMessageContentOutputText {
|
|
527
569
|
/**
|
|
528
570
|
* File citation annotation for referencing specific files in response content.
|
|
529
571
|
*/
|
|
530
572
|
interface OpenAIResponseAnnotationFileCitation {
|
|
531
|
-
/**
|
|
532
|
-
* Unique identifier of the referenced file
|
|
533
|
-
*/
|
|
534
573
|
file_id: string;
|
|
535
|
-
/**
|
|
536
|
-
* Name of the referenced file
|
|
537
|
-
*/
|
|
538
574
|
filename: string;
|
|
539
|
-
/**
|
|
540
|
-
* Position index of the citation within the content
|
|
541
|
-
*/
|
|
542
575
|
index: number;
|
|
543
|
-
|
|
544
|
-
* Annotation type identifier, always "file_citation"
|
|
545
|
-
*/
|
|
546
|
-
type: 'file_citation';
|
|
576
|
+
type?: 'file_citation';
|
|
547
577
|
}
|
|
548
578
|
/**
|
|
549
579
|
* URL citation annotation for referencing external web resources.
|
|
550
580
|
*/
|
|
551
581
|
interface OpenAIResponseAnnotationCitation {
|
|
552
|
-
/**
|
|
553
|
-
* End position of the citation span in the content
|
|
554
|
-
*/
|
|
555
582
|
end_index: number;
|
|
556
|
-
/**
|
|
557
|
-
* Start position of the citation span in the content
|
|
558
|
-
*/
|
|
559
583
|
start_index: number;
|
|
560
|
-
/**
|
|
561
|
-
* Title of the referenced web resource
|
|
562
|
-
*/
|
|
563
584
|
title: string;
|
|
564
|
-
/**
|
|
565
|
-
* Annotation type identifier, always "url_citation"
|
|
566
|
-
*/
|
|
567
|
-
type: 'url_citation';
|
|
568
|
-
/**
|
|
569
|
-
* URL of the referenced web resource
|
|
570
|
-
*/
|
|
571
585
|
url: string;
|
|
586
|
+
type?: 'url_citation';
|
|
572
587
|
}
|
|
573
588
|
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
574
589
|
container_id: string;
|
|
@@ -576,83 +591,78 @@ export declare namespace ResponseObjectStream {
|
|
|
576
591
|
file_id: string;
|
|
577
592
|
filename: string;
|
|
578
593
|
start_index: number;
|
|
579
|
-
type
|
|
594
|
+
type?: 'container_file_citation';
|
|
580
595
|
}
|
|
581
596
|
interface OpenAIResponseAnnotationFilePath {
|
|
582
597
|
file_id: string;
|
|
583
598
|
index: number;
|
|
584
|
-
type
|
|
599
|
+
type?: 'file_path';
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
603
|
+
* response.
|
|
604
|
+
*
|
|
605
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
606
|
+
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
607
|
+
*/
|
|
608
|
+
interface Logprob {
|
|
609
|
+
token: string;
|
|
610
|
+
logprob: number;
|
|
611
|
+
bytes?: Array<number> | null;
|
|
612
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
585
613
|
}
|
|
614
|
+
namespace Logprob {
|
|
615
|
+
/**
|
|
616
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
617
|
+
* response.
|
|
618
|
+
*
|
|
619
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
620
|
+
* probability of the token
|
|
621
|
+
*/
|
|
622
|
+
interface TopLogprob {
|
|
623
|
+
token: string;
|
|
624
|
+
logprob: number;
|
|
625
|
+
bytes?: Array<number> | null;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Refusal content within a streamed response part.
|
|
631
|
+
*/
|
|
632
|
+
interface OpenAIResponseContentPartRefusal {
|
|
633
|
+
refusal: string;
|
|
634
|
+
type?: 'refusal';
|
|
586
635
|
}
|
|
587
636
|
}
|
|
588
637
|
/**
|
|
589
638
|
* Web search tool call output message for OpenAI responses.
|
|
590
639
|
*/
|
|
591
640
|
interface OpenAIResponseOutputMessageWebSearchToolCall {
|
|
592
|
-
/**
|
|
593
|
-
* Unique identifier for this tool call
|
|
594
|
-
*/
|
|
595
641
|
id: string;
|
|
596
|
-
/**
|
|
597
|
-
* Current status of the web search operation
|
|
598
|
-
*/
|
|
599
642
|
status: string;
|
|
600
|
-
|
|
601
|
-
* Tool call type identifier, always "web_search_call"
|
|
602
|
-
*/
|
|
603
|
-
type: 'web_search_call';
|
|
643
|
+
type?: 'web_search_call';
|
|
604
644
|
}
|
|
605
645
|
/**
|
|
606
646
|
* File search tool call output message for OpenAI responses.
|
|
607
647
|
*/
|
|
608
648
|
interface OpenAIResponseOutputMessageFileSearchToolCall {
|
|
609
|
-
/**
|
|
610
|
-
* Unique identifier for this tool call
|
|
611
|
-
*/
|
|
612
649
|
id: string;
|
|
613
|
-
/**
|
|
614
|
-
* List of search queries executed
|
|
615
|
-
*/
|
|
616
650
|
queries: Array<string>;
|
|
617
|
-
/**
|
|
618
|
-
* Current status of the file search operation
|
|
619
|
-
*/
|
|
620
651
|
status: string;
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
*/
|
|
624
|
-
type: 'file_search_call';
|
|
625
|
-
/**
|
|
626
|
-
* (Optional) Search results returned by the file search operation
|
|
627
|
-
*/
|
|
628
|
-
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result>;
|
|
652
|
+
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
|
|
653
|
+
type?: 'file_search_call';
|
|
629
654
|
}
|
|
630
655
|
namespace OpenAIResponseOutputMessageFileSearchToolCall {
|
|
631
656
|
/**
|
|
632
657
|
* Search results returned by the file search operation.
|
|
633
658
|
*/
|
|
634
659
|
interface Result {
|
|
635
|
-
/**
|
|
636
|
-
* (Optional) Key-value attributes associated with the file
|
|
637
|
-
*/
|
|
638
660
|
attributes: {
|
|
639
|
-
[key: string]:
|
|
661
|
+
[key: string]: unknown;
|
|
640
662
|
};
|
|
641
|
-
/**
|
|
642
|
-
* Unique identifier of the file containing the result
|
|
643
|
-
*/
|
|
644
663
|
file_id: string;
|
|
645
|
-
/**
|
|
646
|
-
* Name of the file containing the result
|
|
647
|
-
*/
|
|
648
664
|
filename: string;
|
|
649
|
-
/**
|
|
650
|
-
* Relevance score for this search result (between 0 and 1)
|
|
651
|
-
*/
|
|
652
665
|
score: number;
|
|
653
|
-
/**
|
|
654
|
-
* Text content of the search result
|
|
655
|
-
*/
|
|
656
666
|
text: string;
|
|
657
667
|
}
|
|
658
668
|
}
|
|
@@ -660,131 +670,71 @@ export declare namespace ResponseObjectStream {
|
|
|
660
670
|
* Function tool call output message for OpenAI responses.
|
|
661
671
|
*/
|
|
662
672
|
interface OpenAIResponseOutputMessageFunctionToolCall {
|
|
663
|
-
/**
|
|
664
|
-
* JSON string containing the function arguments
|
|
665
|
-
*/
|
|
666
673
|
arguments: string;
|
|
667
|
-
/**
|
|
668
|
-
* Unique identifier for the function call
|
|
669
|
-
*/
|
|
670
674
|
call_id: string;
|
|
671
|
-
/**
|
|
672
|
-
* Name of the function being called
|
|
673
|
-
*/
|
|
674
675
|
name: string;
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
type: 'function_call';
|
|
679
|
-
/**
|
|
680
|
-
* (Optional) Additional identifier for the tool call
|
|
681
|
-
*/
|
|
682
|
-
id?: string;
|
|
683
|
-
/**
|
|
684
|
-
* (Optional) Current status of the function call execution
|
|
685
|
-
*/
|
|
686
|
-
status?: string;
|
|
676
|
+
id?: string | null;
|
|
677
|
+
status?: string | null;
|
|
678
|
+
type?: 'function_call';
|
|
687
679
|
}
|
|
688
680
|
/**
|
|
689
681
|
* Model Context Protocol (MCP) call output message for OpenAI responses.
|
|
690
682
|
*/
|
|
691
683
|
interface OpenAIResponseOutputMessageMcpCall {
|
|
692
|
-
/**
|
|
693
|
-
* Unique identifier for this MCP call
|
|
694
|
-
*/
|
|
695
684
|
id: string;
|
|
696
|
-
/**
|
|
697
|
-
* JSON string containing the MCP call arguments
|
|
698
|
-
*/
|
|
699
685
|
arguments: string;
|
|
700
|
-
/**
|
|
701
|
-
* Name of the MCP method being called
|
|
702
|
-
*/
|
|
703
686
|
name: string;
|
|
704
|
-
/**
|
|
705
|
-
* Label identifying the MCP server handling the call
|
|
706
|
-
*/
|
|
707
687
|
server_label: string;
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
type: 'mcp_call';
|
|
712
|
-
/**
|
|
713
|
-
* (Optional) Error message if the MCP call failed
|
|
714
|
-
*/
|
|
715
|
-
error?: string;
|
|
716
|
-
/**
|
|
717
|
-
* (Optional) Output result from the successful MCP call
|
|
718
|
-
*/
|
|
719
|
-
output?: string;
|
|
688
|
+
error?: string | null;
|
|
689
|
+
output?: string | null;
|
|
690
|
+
type?: 'mcp_call';
|
|
720
691
|
}
|
|
721
692
|
/**
|
|
722
693
|
* MCP list tools output message containing available tools from an MCP server.
|
|
723
694
|
*/
|
|
724
695
|
interface OpenAIResponseOutputMessageMcpListTools {
|
|
725
|
-
/**
|
|
726
|
-
* Unique identifier for this MCP list tools operation
|
|
727
|
-
*/
|
|
728
696
|
id: string;
|
|
729
|
-
/**
|
|
730
|
-
* Label identifying the MCP server providing the tools
|
|
731
|
-
*/
|
|
732
697
|
server_label: string;
|
|
733
|
-
/**
|
|
734
|
-
* List of available tools provided by the MCP server
|
|
735
|
-
*/
|
|
736
698
|
tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
|
|
737
|
-
|
|
738
|
-
* Tool call type identifier, always "mcp_list_tools"
|
|
739
|
-
*/
|
|
740
|
-
type: 'mcp_list_tools';
|
|
699
|
+
type?: 'mcp_list_tools';
|
|
741
700
|
}
|
|
742
701
|
namespace OpenAIResponseOutputMessageMcpListTools {
|
|
743
702
|
/**
|
|
744
703
|
* Tool definition returned by MCP list tools operation.
|
|
745
704
|
*/
|
|
746
705
|
interface Tool {
|
|
747
|
-
/**
|
|
748
|
-
* JSON schema defining the tool's input parameters
|
|
749
|
-
*/
|
|
750
706
|
input_schema: {
|
|
751
|
-
[key: string]:
|
|
707
|
+
[key: string]: unknown;
|
|
752
708
|
};
|
|
753
|
-
/**
|
|
754
|
-
* Name of the tool
|
|
755
|
-
*/
|
|
756
709
|
name: string;
|
|
757
|
-
|
|
758
|
-
* (Optional) Description of what the tool does
|
|
759
|
-
*/
|
|
760
|
-
description?: string;
|
|
710
|
+
description?: string | null;
|
|
761
711
|
}
|
|
762
712
|
}
|
|
713
|
+
/**
|
|
714
|
+
* A request for human approval of a tool invocation.
|
|
715
|
+
*/
|
|
716
|
+
interface OpenAIResponseMcpApprovalRequest {
|
|
717
|
+
id: string;
|
|
718
|
+
arguments: string;
|
|
719
|
+
name: string;
|
|
720
|
+
server_label: string;
|
|
721
|
+
type?: 'mcp_approval_request';
|
|
722
|
+
}
|
|
763
723
|
}
|
|
764
724
|
/**
|
|
765
725
|
* Streaming event for when an output item is completed.
|
|
766
726
|
*/
|
|
767
727
|
interface OpenAIResponseObjectStreamResponseOutputItemDone {
|
|
768
728
|
/**
|
|
769
|
-
*
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
/**
|
|
773
|
-
* Index position of this item in the output list
|
|
729
|
+
* Corresponds to the various Message types in the Responses API. They are all
|
|
730
|
+
* under one type because the Responses API gives them all the same "type" value,
|
|
731
|
+
* and there is no way to tell them apart in certain scenarios.
|
|
774
732
|
*/
|
|
733
|
+
item: OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseMessage | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageWebSearchToolCall | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageFileSearchToolCall | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageFunctionToolCall | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageMcpCall | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseOutputMessageMcpListTools | OpenAIResponseObjectStreamResponseOutputItemDone.OpenAIResponseMcpApprovalRequest;
|
|
775
734
|
output_index: number;
|
|
776
|
-
/**
|
|
777
|
-
* Unique identifier of the response containing this output
|
|
778
|
-
*/
|
|
779
735
|
response_id: string;
|
|
780
|
-
/**
|
|
781
|
-
* Sequential number for ordering streaming events
|
|
782
|
-
*/
|
|
783
736
|
sequence_number: number;
|
|
784
|
-
|
|
785
|
-
* Event type identifier, always "response.output_item.done"
|
|
786
|
-
*/
|
|
787
|
-
type: 'response.output_item.done';
|
|
737
|
+
type?: 'response.output_item.done';
|
|
788
738
|
}
|
|
789
739
|
namespace OpenAIResponseObjectStreamResponseOutputItemDone {
|
|
790
740
|
/**
|
|
@@ -793,94 +743,64 @@ export declare namespace ResponseObjectStream {
|
|
|
793
743
|
* and there is no way to tell them apart in certain scenarios.
|
|
794
744
|
*/
|
|
795
745
|
interface OpenAIResponseMessage {
|
|
796
|
-
content: string | Array<OpenAIResponseMessage.OpenAIResponseInputMessageContentText | OpenAIResponseMessage.OpenAIResponseInputMessageContentImage> | Array<OpenAIResponseMessage.
|
|
746
|
+
content: string | Array<OpenAIResponseMessage.OpenAIResponseInputMessageContentText | OpenAIResponseMessage.OpenAIResponseInputMessageContentImage | OpenAIResponseMessage.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessage.OpenAIResponseOutputMessageContentOutputText | OpenAIResponseMessage.OpenAIResponseContentPartRefusal>;
|
|
797
747
|
role: 'system' | 'developer' | 'user' | 'assistant';
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
748
|
+
id?: string | null;
|
|
749
|
+
status?: string | null;
|
|
750
|
+
type?: 'message';
|
|
801
751
|
}
|
|
802
752
|
namespace OpenAIResponseMessage {
|
|
803
753
|
/**
|
|
804
754
|
* Text content for input messages in OpenAI response format.
|
|
805
755
|
*/
|
|
806
756
|
interface OpenAIResponseInputMessageContentText {
|
|
807
|
-
/**
|
|
808
|
-
* The text content of the input message
|
|
809
|
-
*/
|
|
810
757
|
text: string;
|
|
811
|
-
|
|
812
|
-
* Content type identifier, always "input_text"
|
|
813
|
-
*/
|
|
814
|
-
type: 'input_text';
|
|
758
|
+
type?: 'input_text';
|
|
815
759
|
}
|
|
816
760
|
/**
|
|
817
761
|
* Image content for input messages in OpenAI response format.
|
|
818
762
|
*/
|
|
819
763
|
interface OpenAIResponseInputMessageContentImage {
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
/**
|
|
825
|
-
* Content type identifier, always "input_image"
|
|
826
|
-
*/
|
|
827
|
-
type: 'input_image';
|
|
828
|
-
/**
|
|
829
|
-
* (Optional) URL of the image content
|
|
830
|
-
*/
|
|
831
|
-
image_url?: string;
|
|
764
|
+
detail?: 'low' | 'high' | 'auto';
|
|
765
|
+
file_id?: string | null;
|
|
766
|
+
image_url?: string | null;
|
|
767
|
+
type?: 'input_image';
|
|
832
768
|
}
|
|
833
|
-
|
|
834
|
-
|
|
769
|
+
/**
|
|
770
|
+
* File content for input messages in OpenAI response format.
|
|
771
|
+
*/
|
|
772
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
773
|
+
file_data?: string | null;
|
|
774
|
+
file_id?: string | null;
|
|
775
|
+
file_url?: string | null;
|
|
776
|
+
filename?: string | null;
|
|
777
|
+
type?: 'input_file';
|
|
778
|
+
}
|
|
779
|
+
interface OpenAIResponseOutputMessageContentOutputText {
|
|
835
780
|
text: string;
|
|
836
|
-
|
|
781
|
+
annotations?: Array<OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputText.OpenAIResponseAnnotationFilePath>;
|
|
782
|
+
logprobs?: Array<OpenAIResponseOutputMessageContentOutputText.Logprob> | null;
|
|
783
|
+
type?: 'output_text';
|
|
837
784
|
}
|
|
838
|
-
namespace
|
|
785
|
+
namespace OpenAIResponseOutputMessageContentOutputText {
|
|
839
786
|
/**
|
|
840
787
|
* File citation annotation for referencing specific files in response content.
|
|
841
788
|
*/
|
|
842
789
|
interface OpenAIResponseAnnotationFileCitation {
|
|
843
|
-
/**
|
|
844
|
-
* Unique identifier of the referenced file
|
|
845
|
-
*/
|
|
846
790
|
file_id: string;
|
|
847
|
-
/**
|
|
848
|
-
* Name of the referenced file
|
|
849
|
-
*/
|
|
850
791
|
filename: string;
|
|
851
|
-
/**
|
|
852
|
-
* Position index of the citation within the content
|
|
853
|
-
*/
|
|
854
792
|
index: number;
|
|
855
|
-
|
|
856
|
-
* Annotation type identifier, always "file_citation"
|
|
857
|
-
*/
|
|
858
|
-
type: 'file_citation';
|
|
793
|
+
type?: 'file_citation';
|
|
859
794
|
}
|
|
860
795
|
/**
|
|
861
796
|
* URL citation annotation for referencing external web resources.
|
|
862
797
|
*/
|
|
863
798
|
interface OpenAIResponseAnnotationCitation {
|
|
864
|
-
/**
|
|
865
|
-
* End position of the citation span in the content
|
|
866
|
-
*/
|
|
867
799
|
end_index: number;
|
|
868
|
-
/**
|
|
869
|
-
* Start position of the citation span in the content
|
|
870
|
-
*/
|
|
871
800
|
start_index: number;
|
|
872
|
-
/**
|
|
873
|
-
* Title of the referenced web resource
|
|
874
|
-
*/
|
|
875
801
|
title: string;
|
|
876
|
-
/**
|
|
877
|
-
* Annotation type identifier, always "url_citation"
|
|
878
|
-
*/
|
|
879
|
-
type: 'url_citation';
|
|
880
|
-
/**
|
|
881
|
-
* URL of the referenced web resource
|
|
882
|
-
*/
|
|
883
802
|
url: string;
|
|
803
|
+
type?: 'url_citation';
|
|
884
804
|
}
|
|
885
805
|
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
886
806
|
container_id: string;
|
|
@@ -888,83 +808,78 @@ export declare namespace ResponseObjectStream {
|
|
|
888
808
|
file_id: string;
|
|
889
809
|
filename: string;
|
|
890
810
|
start_index: number;
|
|
891
|
-
type
|
|
811
|
+
type?: 'container_file_citation';
|
|
892
812
|
}
|
|
893
813
|
interface OpenAIResponseAnnotationFilePath {
|
|
894
814
|
file_id: string;
|
|
895
815
|
index: number;
|
|
896
|
-
type
|
|
816
|
+
type?: 'file_path';
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
820
|
+
* response.
|
|
821
|
+
*
|
|
822
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
823
|
+
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
824
|
+
*/
|
|
825
|
+
interface Logprob {
|
|
826
|
+
token: string;
|
|
827
|
+
logprob: number;
|
|
828
|
+
bytes?: Array<number> | null;
|
|
829
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
830
|
+
}
|
|
831
|
+
namespace Logprob {
|
|
832
|
+
/**
|
|
833
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
834
|
+
* response.
|
|
835
|
+
*
|
|
836
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
837
|
+
* probability of the token
|
|
838
|
+
*/
|
|
839
|
+
interface TopLogprob {
|
|
840
|
+
token: string;
|
|
841
|
+
logprob: number;
|
|
842
|
+
bytes?: Array<number> | null;
|
|
843
|
+
}
|
|
897
844
|
}
|
|
898
845
|
}
|
|
846
|
+
/**
|
|
847
|
+
* Refusal content within a streamed response part.
|
|
848
|
+
*/
|
|
849
|
+
interface OpenAIResponseContentPartRefusal {
|
|
850
|
+
refusal: string;
|
|
851
|
+
type?: 'refusal';
|
|
852
|
+
}
|
|
899
853
|
}
|
|
900
854
|
/**
|
|
901
855
|
* Web search tool call output message for OpenAI responses.
|
|
902
856
|
*/
|
|
903
857
|
interface OpenAIResponseOutputMessageWebSearchToolCall {
|
|
904
|
-
/**
|
|
905
|
-
* Unique identifier for this tool call
|
|
906
|
-
*/
|
|
907
858
|
id: string;
|
|
908
|
-
/**
|
|
909
|
-
* Current status of the web search operation
|
|
910
|
-
*/
|
|
911
859
|
status: string;
|
|
912
|
-
|
|
913
|
-
* Tool call type identifier, always "web_search_call"
|
|
914
|
-
*/
|
|
915
|
-
type: 'web_search_call';
|
|
860
|
+
type?: 'web_search_call';
|
|
916
861
|
}
|
|
917
862
|
/**
|
|
918
863
|
* File search tool call output message for OpenAI responses.
|
|
919
864
|
*/
|
|
920
865
|
interface OpenAIResponseOutputMessageFileSearchToolCall {
|
|
921
|
-
/**
|
|
922
|
-
* Unique identifier for this tool call
|
|
923
|
-
*/
|
|
924
866
|
id: string;
|
|
925
|
-
/**
|
|
926
|
-
* List of search queries executed
|
|
927
|
-
*/
|
|
928
867
|
queries: Array<string>;
|
|
929
|
-
/**
|
|
930
|
-
* Current status of the file search operation
|
|
931
|
-
*/
|
|
932
868
|
status: string;
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
*/
|
|
936
|
-
type: 'file_search_call';
|
|
937
|
-
/**
|
|
938
|
-
* (Optional) Search results returned by the file search operation
|
|
939
|
-
*/
|
|
940
|
-
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result>;
|
|
869
|
+
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
|
|
870
|
+
type?: 'file_search_call';
|
|
941
871
|
}
|
|
942
872
|
namespace OpenAIResponseOutputMessageFileSearchToolCall {
|
|
943
873
|
/**
|
|
944
874
|
* Search results returned by the file search operation.
|
|
945
875
|
*/
|
|
946
876
|
interface Result {
|
|
947
|
-
/**
|
|
948
|
-
* (Optional) Key-value attributes associated with the file
|
|
949
|
-
*/
|
|
950
877
|
attributes: {
|
|
951
|
-
[key: string]:
|
|
878
|
+
[key: string]: unknown;
|
|
952
879
|
};
|
|
953
|
-
/**
|
|
954
|
-
* Unique identifier of the file containing the result
|
|
955
|
-
*/
|
|
956
880
|
file_id: string;
|
|
957
|
-
/**
|
|
958
|
-
* Name of the file containing the result
|
|
959
|
-
*/
|
|
960
881
|
filename: string;
|
|
961
|
-
/**
|
|
962
|
-
* Relevance score for this search result (between 0 and 1)
|
|
963
|
-
*/
|
|
964
882
|
score: number;
|
|
965
|
-
/**
|
|
966
|
-
* Text content of the search result
|
|
967
|
-
*/
|
|
968
883
|
text: string;
|
|
969
884
|
}
|
|
970
885
|
}
|
|
@@ -972,554 +887,812 @@ export declare namespace ResponseObjectStream {
|
|
|
972
887
|
* Function tool call output message for OpenAI responses.
|
|
973
888
|
*/
|
|
974
889
|
interface OpenAIResponseOutputMessageFunctionToolCall {
|
|
975
|
-
/**
|
|
976
|
-
* JSON string containing the function arguments
|
|
977
|
-
*/
|
|
978
890
|
arguments: string;
|
|
979
|
-
/**
|
|
980
|
-
* Unique identifier for the function call
|
|
981
|
-
*/
|
|
982
891
|
call_id: string;
|
|
983
|
-
/**
|
|
984
|
-
* Name of the function being called
|
|
985
|
-
*/
|
|
986
892
|
name: string;
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
type: 'function_call';
|
|
991
|
-
/**
|
|
992
|
-
* (Optional) Additional identifier for the tool call
|
|
993
|
-
*/
|
|
994
|
-
id?: string;
|
|
995
|
-
/**
|
|
996
|
-
* (Optional) Current status of the function call execution
|
|
997
|
-
*/
|
|
998
|
-
status?: string;
|
|
893
|
+
id?: string | null;
|
|
894
|
+
status?: string | null;
|
|
895
|
+
type?: 'function_call';
|
|
999
896
|
}
|
|
1000
897
|
/**
|
|
1001
898
|
* Model Context Protocol (MCP) call output message for OpenAI responses.
|
|
1002
899
|
*/
|
|
1003
900
|
interface OpenAIResponseOutputMessageMcpCall {
|
|
1004
|
-
/**
|
|
1005
|
-
* Unique identifier for this MCP call
|
|
1006
|
-
*/
|
|
1007
901
|
id: string;
|
|
1008
|
-
/**
|
|
1009
|
-
* JSON string containing the MCP call arguments
|
|
1010
|
-
*/
|
|
1011
902
|
arguments: string;
|
|
1012
|
-
/**
|
|
1013
|
-
* Name of the MCP method being called
|
|
1014
|
-
*/
|
|
1015
903
|
name: string;
|
|
1016
|
-
/**
|
|
1017
|
-
* Label identifying the MCP server handling the call
|
|
1018
|
-
*/
|
|
1019
904
|
server_label: string;
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
type: 'mcp_call';
|
|
1024
|
-
/**
|
|
1025
|
-
* (Optional) Error message if the MCP call failed
|
|
1026
|
-
*/
|
|
1027
|
-
error?: string;
|
|
1028
|
-
/**
|
|
1029
|
-
* (Optional) Output result from the successful MCP call
|
|
1030
|
-
*/
|
|
1031
|
-
output?: string;
|
|
905
|
+
error?: string | null;
|
|
906
|
+
output?: string | null;
|
|
907
|
+
type?: 'mcp_call';
|
|
1032
908
|
}
|
|
1033
909
|
/**
|
|
1034
910
|
* MCP list tools output message containing available tools from an MCP server.
|
|
1035
911
|
*/
|
|
1036
912
|
interface OpenAIResponseOutputMessageMcpListTools {
|
|
1037
|
-
/**
|
|
1038
|
-
* Unique identifier for this MCP list tools operation
|
|
1039
|
-
*/
|
|
1040
913
|
id: string;
|
|
1041
|
-
/**
|
|
1042
|
-
* Label identifying the MCP server providing the tools
|
|
1043
|
-
*/
|
|
1044
914
|
server_label: string;
|
|
1045
|
-
/**
|
|
1046
|
-
* List of available tools provided by the MCP server
|
|
1047
|
-
*/
|
|
1048
915
|
tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
|
|
1049
|
-
|
|
1050
|
-
* Tool call type identifier, always "mcp_list_tools"
|
|
1051
|
-
*/
|
|
1052
|
-
type: 'mcp_list_tools';
|
|
916
|
+
type?: 'mcp_list_tools';
|
|
1053
917
|
}
|
|
1054
918
|
namespace OpenAIResponseOutputMessageMcpListTools {
|
|
1055
919
|
/**
|
|
1056
920
|
* Tool definition returned by MCP list tools operation.
|
|
1057
921
|
*/
|
|
1058
922
|
interface Tool {
|
|
1059
|
-
/**
|
|
1060
|
-
* JSON schema defining the tool's input parameters
|
|
1061
|
-
*/
|
|
1062
923
|
input_schema: {
|
|
1063
|
-
[key: string]:
|
|
924
|
+
[key: string]: unknown;
|
|
1064
925
|
};
|
|
1065
|
-
/**
|
|
1066
|
-
* Name of the tool
|
|
1067
|
-
*/
|
|
1068
926
|
name: string;
|
|
1069
|
-
|
|
1070
|
-
* (Optional) Description of what the tool does
|
|
1071
|
-
*/
|
|
1072
|
-
description?: string;
|
|
927
|
+
description?: string | null;
|
|
1073
928
|
}
|
|
1074
929
|
}
|
|
930
|
+
/**
|
|
931
|
+
* A request for human approval of a tool invocation.
|
|
932
|
+
*/
|
|
933
|
+
interface OpenAIResponseMcpApprovalRequest {
|
|
934
|
+
id: string;
|
|
935
|
+
arguments: string;
|
|
936
|
+
name: string;
|
|
937
|
+
server_label: string;
|
|
938
|
+
type?: 'mcp_approval_request';
|
|
939
|
+
}
|
|
1075
940
|
}
|
|
1076
941
|
/**
|
|
1077
942
|
* Streaming event for incremental text content updates.
|
|
1078
943
|
*/
|
|
1079
944
|
interface OpenAIResponseObjectStreamResponseOutputTextDelta {
|
|
1080
|
-
/**
|
|
1081
|
-
* Index position within the text content
|
|
1082
|
-
*/
|
|
1083
945
|
content_index: number;
|
|
1084
|
-
/**
|
|
1085
|
-
* Incremental text content being added
|
|
1086
|
-
*/
|
|
1087
946
|
delta: string;
|
|
1088
|
-
/**
|
|
1089
|
-
* Unique identifier of the output item being updated
|
|
1090
|
-
*/
|
|
1091
947
|
item_id: string;
|
|
1092
|
-
/**
|
|
1093
|
-
* Index position of the item in the output list
|
|
1094
|
-
*/
|
|
1095
948
|
output_index: number;
|
|
1096
|
-
/**
|
|
1097
|
-
* Sequential number for ordering streaming events
|
|
1098
|
-
*/
|
|
1099
949
|
sequence_number: number;
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
950
|
+
logprobs?: Array<OpenAIResponseObjectStreamResponseOutputTextDelta.Logprob> | null;
|
|
951
|
+
type?: 'response.output_text.delta';
|
|
952
|
+
}
|
|
953
|
+
namespace OpenAIResponseObjectStreamResponseOutputTextDelta {
|
|
954
|
+
/**
|
|
955
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
956
|
+
* response.
|
|
957
|
+
*
|
|
958
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
959
|
+
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
960
|
+
*/
|
|
961
|
+
interface Logprob {
|
|
962
|
+
token: string;
|
|
963
|
+
logprob: number;
|
|
964
|
+
bytes?: Array<number> | null;
|
|
965
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
966
|
+
}
|
|
967
|
+
namespace Logprob {
|
|
968
|
+
/**
|
|
969
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
970
|
+
* response.
|
|
971
|
+
*
|
|
972
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
973
|
+
* probability of the token
|
|
974
|
+
*/
|
|
975
|
+
interface TopLogprob {
|
|
976
|
+
token: string;
|
|
977
|
+
logprob: number;
|
|
978
|
+
bytes?: Array<number> | null;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
1104
981
|
}
|
|
1105
982
|
/**
|
|
1106
983
|
* Streaming event for when text output is completed.
|
|
1107
984
|
*/
|
|
1108
985
|
interface OpenAIResponseObjectStreamResponseOutputTextDone {
|
|
1109
|
-
/**
|
|
1110
|
-
* Index position within the text content
|
|
1111
|
-
*/
|
|
1112
986
|
content_index: number;
|
|
1113
|
-
/**
|
|
1114
|
-
* Unique identifier of the completed output item
|
|
1115
|
-
*/
|
|
1116
987
|
item_id: string;
|
|
1117
|
-
/**
|
|
1118
|
-
* Index position of the item in the output list
|
|
1119
|
-
*/
|
|
1120
988
|
output_index: number;
|
|
1121
|
-
/**
|
|
1122
|
-
* Sequential number for ordering streaming events
|
|
1123
|
-
*/
|
|
1124
989
|
sequence_number: number;
|
|
1125
|
-
/**
|
|
1126
|
-
* Final complete text content of the output item
|
|
1127
|
-
*/
|
|
1128
990
|
text: string;
|
|
1129
|
-
|
|
1130
|
-
* Event type identifier, always "response.output_text.done"
|
|
1131
|
-
*/
|
|
1132
|
-
type: 'response.output_text.done';
|
|
991
|
+
type?: 'response.output_text.done';
|
|
1133
992
|
}
|
|
1134
993
|
/**
|
|
1135
994
|
* Streaming event for incremental function call argument updates.
|
|
1136
995
|
*/
|
|
1137
996
|
interface OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta {
|
|
1138
|
-
/**
|
|
1139
|
-
* Incremental function call arguments being added
|
|
1140
|
-
*/
|
|
1141
997
|
delta: string;
|
|
1142
|
-
/**
|
|
1143
|
-
* Unique identifier of the function call being updated
|
|
1144
|
-
*/
|
|
1145
998
|
item_id: string;
|
|
1146
|
-
/**
|
|
1147
|
-
* Index position of the item in the output list
|
|
1148
|
-
*/
|
|
1149
999
|
output_index: number;
|
|
1150
|
-
/**
|
|
1151
|
-
* Sequential number for ordering streaming events
|
|
1152
|
-
*/
|
|
1153
1000
|
sequence_number: number;
|
|
1154
|
-
|
|
1155
|
-
* Event type identifier, always "response.function_call_arguments.delta"
|
|
1156
|
-
*/
|
|
1157
|
-
type: 'response.function_call_arguments.delta';
|
|
1001
|
+
type?: 'response.function_call_arguments.delta';
|
|
1158
1002
|
}
|
|
1159
1003
|
/**
|
|
1160
1004
|
* Streaming event for when function call arguments are completed.
|
|
1161
1005
|
*/
|
|
1162
1006
|
interface OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone {
|
|
1163
|
-
/**
|
|
1164
|
-
* Final complete arguments JSON string for the function call
|
|
1165
|
-
*/
|
|
1166
1007
|
arguments: string;
|
|
1167
|
-
/**
|
|
1168
|
-
* Unique identifier of the completed function call
|
|
1169
|
-
*/
|
|
1170
1008
|
item_id: string;
|
|
1171
|
-
/**
|
|
1172
|
-
* Index position of the item in the output list
|
|
1173
|
-
*/
|
|
1174
1009
|
output_index: number;
|
|
1175
|
-
/**
|
|
1176
|
-
* Sequential number for ordering streaming events
|
|
1177
|
-
*/
|
|
1178
1010
|
sequence_number: number;
|
|
1179
|
-
|
|
1180
|
-
* Event type identifier, always "response.function_call_arguments.done"
|
|
1181
|
-
*/
|
|
1182
|
-
type: 'response.function_call_arguments.done';
|
|
1011
|
+
type?: 'response.function_call_arguments.done';
|
|
1183
1012
|
}
|
|
1184
1013
|
/**
|
|
1185
1014
|
* Streaming event for web search calls in progress.
|
|
1186
1015
|
*/
|
|
1187
1016
|
interface OpenAIResponseObjectStreamResponseWebSearchCallInProgress {
|
|
1188
|
-
/**
|
|
1189
|
-
* Unique identifier of the web search call
|
|
1190
|
-
*/
|
|
1191
1017
|
item_id: string;
|
|
1192
|
-
/**
|
|
1193
|
-
* Index position of the item in the output list
|
|
1194
|
-
*/
|
|
1195
1018
|
output_index: number;
|
|
1196
|
-
/**
|
|
1197
|
-
* Sequential number for ordering streaming events
|
|
1198
|
-
*/
|
|
1199
1019
|
sequence_number: number;
|
|
1200
|
-
|
|
1201
|
-
* Event type identifier, always "response.web_search_call.in_progress"
|
|
1202
|
-
*/
|
|
1203
|
-
type: 'response.web_search_call.in_progress';
|
|
1020
|
+
type?: 'response.web_search_call.in_progress';
|
|
1204
1021
|
}
|
|
1205
1022
|
interface OpenAIResponseObjectStreamResponseWebSearchCallSearching {
|
|
1206
1023
|
item_id: string;
|
|
1207
1024
|
output_index: number;
|
|
1208
1025
|
sequence_number: number;
|
|
1209
|
-
type
|
|
1026
|
+
type?: 'response.web_search_call.searching';
|
|
1210
1027
|
}
|
|
1211
1028
|
/**
|
|
1212
1029
|
* Streaming event for completed web search calls.
|
|
1213
1030
|
*/
|
|
1214
1031
|
interface OpenAIResponseObjectStreamResponseWebSearchCallCompleted {
|
|
1215
|
-
/**
|
|
1216
|
-
* Unique identifier of the completed web search call
|
|
1217
|
-
*/
|
|
1218
1032
|
item_id: string;
|
|
1219
|
-
/**
|
|
1220
|
-
* Index position of the item in the output list
|
|
1221
|
-
*/
|
|
1222
1033
|
output_index: number;
|
|
1223
|
-
/**
|
|
1224
|
-
* Sequential number for ordering streaming events
|
|
1225
|
-
*/
|
|
1226
1034
|
sequence_number: number;
|
|
1227
|
-
|
|
1228
|
-
* Event type identifier, always "response.web_search_call.completed"
|
|
1229
|
-
*/
|
|
1230
|
-
type: 'response.web_search_call.completed';
|
|
1035
|
+
type?: 'response.web_search_call.completed';
|
|
1231
1036
|
}
|
|
1232
1037
|
interface OpenAIResponseObjectStreamResponseMcpListToolsInProgress {
|
|
1233
1038
|
sequence_number: number;
|
|
1234
|
-
type
|
|
1039
|
+
type?: 'response.mcp_list_tools.in_progress';
|
|
1235
1040
|
}
|
|
1236
1041
|
interface OpenAIResponseObjectStreamResponseMcpListToolsFailed {
|
|
1237
1042
|
sequence_number: number;
|
|
1238
|
-
type
|
|
1043
|
+
type?: 'response.mcp_list_tools.failed';
|
|
1239
1044
|
}
|
|
1240
1045
|
interface OpenAIResponseObjectStreamResponseMcpListToolsCompleted {
|
|
1241
1046
|
sequence_number: number;
|
|
1242
|
-
type
|
|
1047
|
+
type?: 'response.mcp_list_tools.completed';
|
|
1243
1048
|
}
|
|
1244
1049
|
interface OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta {
|
|
1245
1050
|
delta: string;
|
|
1246
1051
|
item_id: string;
|
|
1247
1052
|
output_index: number;
|
|
1248
1053
|
sequence_number: number;
|
|
1249
|
-
type
|
|
1054
|
+
type?: 'response.mcp_call.arguments.delta';
|
|
1250
1055
|
}
|
|
1251
1056
|
interface OpenAIResponseObjectStreamResponseMcpCallArgumentsDone {
|
|
1252
1057
|
arguments: string;
|
|
1253
1058
|
item_id: string;
|
|
1254
1059
|
output_index: number;
|
|
1255
1060
|
sequence_number: number;
|
|
1256
|
-
type
|
|
1061
|
+
type?: 'response.mcp_call.arguments.done';
|
|
1257
1062
|
}
|
|
1258
1063
|
/**
|
|
1259
1064
|
* Streaming event for MCP calls in progress.
|
|
1260
1065
|
*/
|
|
1261
1066
|
interface OpenAIResponseObjectStreamResponseMcpCallInProgress {
|
|
1262
|
-
/**
|
|
1263
|
-
* Unique identifier of the MCP call
|
|
1264
|
-
*/
|
|
1265
1067
|
item_id: string;
|
|
1266
|
-
/**
|
|
1267
|
-
* Index position of the item in the output list
|
|
1268
|
-
*/
|
|
1269
1068
|
output_index: number;
|
|
1270
|
-
/**
|
|
1271
|
-
* Sequential number for ordering streaming events
|
|
1272
|
-
*/
|
|
1273
1069
|
sequence_number: number;
|
|
1274
|
-
|
|
1275
|
-
* Event type identifier, always "response.mcp_call.in_progress"
|
|
1276
|
-
*/
|
|
1277
|
-
type: 'response.mcp_call.in_progress';
|
|
1070
|
+
type?: 'response.mcp_call.in_progress';
|
|
1278
1071
|
}
|
|
1279
1072
|
/**
|
|
1280
1073
|
* Streaming event for failed MCP calls.
|
|
1281
1074
|
*/
|
|
1282
1075
|
interface OpenAIResponseObjectStreamResponseMcpCallFailed {
|
|
1283
|
-
/**
|
|
1284
|
-
* Sequential number for ordering streaming events
|
|
1285
|
-
*/
|
|
1286
1076
|
sequence_number: number;
|
|
1287
|
-
|
|
1288
|
-
* Event type identifier, always "response.mcp_call.failed"
|
|
1289
|
-
*/
|
|
1290
|
-
type: 'response.mcp_call.failed';
|
|
1077
|
+
type?: 'response.mcp_call.failed';
|
|
1291
1078
|
}
|
|
1292
1079
|
/**
|
|
1293
1080
|
* Streaming event for completed MCP calls.
|
|
1294
1081
|
*/
|
|
1295
1082
|
interface OpenAIResponseObjectStreamResponseMcpCallCompleted {
|
|
1296
|
-
/**
|
|
1297
|
-
* Sequential number for ordering streaming events
|
|
1298
|
-
*/
|
|
1299
1083
|
sequence_number: number;
|
|
1300
|
-
|
|
1301
|
-
* Event type identifier, always "response.mcp_call.completed"
|
|
1302
|
-
*/
|
|
1303
|
-
type: 'response.mcp_call.completed';
|
|
1084
|
+
type?: 'response.mcp_call.completed';
|
|
1304
1085
|
}
|
|
1305
1086
|
/**
|
|
1306
1087
|
* Streaming event for when a new content part is added to a response item.
|
|
1307
1088
|
*/
|
|
1308
1089
|
interface OpenAIResponseObjectStreamResponseContentPartAdded {
|
|
1309
|
-
|
|
1310
|
-
* Unique identifier of the output item containing this content part
|
|
1311
|
-
*/
|
|
1090
|
+
content_index: number;
|
|
1312
1091
|
item_id: string;
|
|
1092
|
+
output_index: number;
|
|
1313
1093
|
/**
|
|
1314
|
-
*
|
|
1315
|
-
*/
|
|
1316
|
-
part: OpenAIResponseObjectStreamResponseContentPartAdded.OpenAIResponseContentPartOutputText | OpenAIResponseObjectStreamResponseContentPartAdded.OpenAIResponseContentPartRefusal;
|
|
1317
|
-
/**
|
|
1318
|
-
* Unique identifier of the response containing this content
|
|
1094
|
+
* Text content within a streamed response part.
|
|
1319
1095
|
*/
|
|
1096
|
+
part: OpenAIResponseObjectStreamResponseContentPartAdded.OpenAIResponseContentPartOutputText | OpenAIResponseObjectStreamResponseContentPartAdded.OpenAIResponseContentPartRefusal | OpenAIResponseObjectStreamResponseContentPartAdded.OpenAIResponseContentPartReasoningText;
|
|
1320
1097
|
response_id: string;
|
|
1321
|
-
/**
|
|
1322
|
-
* Sequential number for ordering streaming events
|
|
1323
|
-
*/
|
|
1324
1098
|
sequence_number: number;
|
|
1325
|
-
|
|
1326
|
-
* Event type identifier, always "response.content_part.added"
|
|
1327
|
-
*/
|
|
1328
|
-
type: 'response.content_part.added';
|
|
1099
|
+
type?: 'response.content_part.added';
|
|
1329
1100
|
}
|
|
1330
1101
|
namespace OpenAIResponseObjectStreamResponseContentPartAdded {
|
|
1102
|
+
/**
|
|
1103
|
+
* Text content within a streamed response part.
|
|
1104
|
+
*/
|
|
1331
1105
|
interface OpenAIResponseContentPartOutputText {
|
|
1332
1106
|
text: string;
|
|
1333
|
-
|
|
1107
|
+
annotations?: Array<OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationFileCitation | OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationCitation | OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationFilePath>;
|
|
1108
|
+
logprobs?: Array<OpenAIResponseContentPartOutputText.Logprob> | null;
|
|
1109
|
+
type?: 'output_text';
|
|
1110
|
+
}
|
|
1111
|
+
namespace OpenAIResponseContentPartOutputText {
|
|
1112
|
+
/**
|
|
1113
|
+
* File citation annotation for referencing specific files in response content.
|
|
1114
|
+
*/
|
|
1115
|
+
interface OpenAIResponseAnnotationFileCitation {
|
|
1116
|
+
file_id: string;
|
|
1117
|
+
filename: string;
|
|
1118
|
+
index: number;
|
|
1119
|
+
type?: 'file_citation';
|
|
1120
|
+
}
|
|
1121
|
+
/**
|
|
1122
|
+
* URL citation annotation for referencing external web resources.
|
|
1123
|
+
*/
|
|
1124
|
+
interface OpenAIResponseAnnotationCitation {
|
|
1125
|
+
end_index: number;
|
|
1126
|
+
start_index: number;
|
|
1127
|
+
title: string;
|
|
1128
|
+
url: string;
|
|
1129
|
+
type?: 'url_citation';
|
|
1130
|
+
}
|
|
1131
|
+
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
1132
|
+
container_id: string;
|
|
1133
|
+
end_index: number;
|
|
1134
|
+
file_id: string;
|
|
1135
|
+
filename: string;
|
|
1136
|
+
start_index: number;
|
|
1137
|
+
type?: 'container_file_citation';
|
|
1138
|
+
}
|
|
1139
|
+
interface OpenAIResponseAnnotationFilePath {
|
|
1140
|
+
file_id: string;
|
|
1141
|
+
index: number;
|
|
1142
|
+
type?: 'file_path';
|
|
1143
|
+
}
|
|
1144
|
+
/**
|
|
1145
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
1146
|
+
* response.
|
|
1147
|
+
*
|
|
1148
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
1149
|
+
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
1150
|
+
*/
|
|
1151
|
+
interface Logprob {
|
|
1152
|
+
token: string;
|
|
1153
|
+
logprob: number;
|
|
1154
|
+
bytes?: Array<number> | null;
|
|
1155
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
1156
|
+
}
|
|
1157
|
+
namespace Logprob {
|
|
1158
|
+
/**
|
|
1159
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
1160
|
+
* response.
|
|
1161
|
+
*
|
|
1162
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
1163
|
+
* probability of the token
|
|
1164
|
+
*/
|
|
1165
|
+
interface TopLogprob {
|
|
1166
|
+
token: string;
|
|
1167
|
+
logprob: number;
|
|
1168
|
+
bytes?: Array<number> | null;
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1334
1171
|
}
|
|
1172
|
+
/**
|
|
1173
|
+
* Refusal content within a streamed response part.
|
|
1174
|
+
*/
|
|
1335
1175
|
interface OpenAIResponseContentPartRefusal {
|
|
1336
1176
|
refusal: string;
|
|
1337
|
-
type
|
|
1177
|
+
type?: 'refusal';
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* Reasoning text emitted as part of a streamed response.
|
|
1181
|
+
*/
|
|
1182
|
+
interface OpenAIResponseContentPartReasoningText {
|
|
1183
|
+
text: string;
|
|
1184
|
+
type?: 'reasoning_text';
|
|
1338
1185
|
}
|
|
1339
1186
|
}
|
|
1340
1187
|
/**
|
|
1341
1188
|
* Streaming event for when a content part is completed.
|
|
1342
1189
|
*/
|
|
1343
1190
|
interface OpenAIResponseObjectStreamResponseContentPartDone {
|
|
1344
|
-
|
|
1345
|
-
* Unique identifier of the output item containing this content part
|
|
1346
|
-
*/
|
|
1191
|
+
content_index: number;
|
|
1347
1192
|
item_id: string;
|
|
1193
|
+
output_index: number;
|
|
1348
1194
|
/**
|
|
1349
|
-
*
|
|
1350
|
-
*/
|
|
1351
|
-
part: OpenAIResponseObjectStreamResponseContentPartDone.OpenAIResponseContentPartOutputText | OpenAIResponseObjectStreamResponseContentPartDone.OpenAIResponseContentPartRefusal;
|
|
1352
|
-
/**
|
|
1353
|
-
* Unique identifier of the response containing this content
|
|
1195
|
+
* Text content within a streamed response part.
|
|
1354
1196
|
*/
|
|
1197
|
+
part: OpenAIResponseObjectStreamResponseContentPartDone.OpenAIResponseContentPartOutputText | OpenAIResponseObjectStreamResponseContentPartDone.OpenAIResponseContentPartRefusal | OpenAIResponseObjectStreamResponseContentPartDone.OpenAIResponseContentPartReasoningText;
|
|
1355
1198
|
response_id: string;
|
|
1356
|
-
/**
|
|
1357
|
-
* Sequential number for ordering streaming events
|
|
1358
|
-
*/
|
|
1359
1199
|
sequence_number: number;
|
|
1360
|
-
|
|
1361
|
-
* Event type identifier, always "response.content_part.done"
|
|
1362
|
-
*/
|
|
1363
|
-
type: 'response.content_part.done';
|
|
1200
|
+
type?: 'response.content_part.done';
|
|
1364
1201
|
}
|
|
1365
1202
|
namespace OpenAIResponseObjectStreamResponseContentPartDone {
|
|
1203
|
+
/**
|
|
1204
|
+
* Text content within a streamed response part.
|
|
1205
|
+
*/
|
|
1366
1206
|
interface OpenAIResponseContentPartOutputText {
|
|
1367
1207
|
text: string;
|
|
1368
|
-
|
|
1208
|
+
annotations?: Array<OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationFileCitation | OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationCitation | OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseContentPartOutputText.OpenAIResponseAnnotationFilePath>;
|
|
1209
|
+
logprobs?: Array<OpenAIResponseContentPartOutputText.Logprob> | null;
|
|
1210
|
+
type?: 'output_text';
|
|
1211
|
+
}
|
|
1212
|
+
namespace OpenAIResponseContentPartOutputText {
|
|
1213
|
+
/**
|
|
1214
|
+
* File citation annotation for referencing specific files in response content.
|
|
1215
|
+
*/
|
|
1216
|
+
interface OpenAIResponseAnnotationFileCitation {
|
|
1217
|
+
file_id: string;
|
|
1218
|
+
filename: string;
|
|
1219
|
+
index: number;
|
|
1220
|
+
type?: 'file_citation';
|
|
1221
|
+
}
|
|
1222
|
+
/**
|
|
1223
|
+
* URL citation annotation for referencing external web resources.
|
|
1224
|
+
*/
|
|
1225
|
+
interface OpenAIResponseAnnotationCitation {
|
|
1226
|
+
end_index: number;
|
|
1227
|
+
start_index: number;
|
|
1228
|
+
title: string;
|
|
1229
|
+
url: string;
|
|
1230
|
+
type?: 'url_citation';
|
|
1231
|
+
}
|
|
1232
|
+
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
1233
|
+
container_id: string;
|
|
1234
|
+
end_index: number;
|
|
1235
|
+
file_id: string;
|
|
1236
|
+
filename: string;
|
|
1237
|
+
start_index: number;
|
|
1238
|
+
type?: 'container_file_citation';
|
|
1239
|
+
}
|
|
1240
|
+
interface OpenAIResponseAnnotationFilePath {
|
|
1241
|
+
file_id: string;
|
|
1242
|
+
index: number;
|
|
1243
|
+
type?: 'file_path';
|
|
1244
|
+
}
|
|
1245
|
+
/**
|
|
1246
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
1247
|
+
* response.
|
|
1248
|
+
*
|
|
1249
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
1250
|
+
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
1251
|
+
*/
|
|
1252
|
+
interface Logprob {
|
|
1253
|
+
token: string;
|
|
1254
|
+
logprob: number;
|
|
1255
|
+
bytes?: Array<number> | null;
|
|
1256
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
1257
|
+
}
|
|
1258
|
+
namespace Logprob {
|
|
1259
|
+
/**
|
|
1260
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
1261
|
+
* response.
|
|
1262
|
+
*
|
|
1263
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
1264
|
+
* probability of the token
|
|
1265
|
+
*/
|
|
1266
|
+
interface TopLogprob {
|
|
1267
|
+
token: string;
|
|
1268
|
+
logprob: number;
|
|
1269
|
+
bytes?: Array<number> | null;
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1369
1272
|
}
|
|
1273
|
+
/**
|
|
1274
|
+
* Refusal content within a streamed response part.
|
|
1275
|
+
*/
|
|
1370
1276
|
interface OpenAIResponseContentPartRefusal {
|
|
1371
1277
|
refusal: string;
|
|
1372
|
-
type
|
|
1278
|
+
type?: 'refusal';
|
|
1279
|
+
}
|
|
1280
|
+
/**
|
|
1281
|
+
* Reasoning text emitted as part of a streamed response.
|
|
1282
|
+
*/
|
|
1283
|
+
interface OpenAIResponseContentPartReasoningText {
|
|
1284
|
+
text: string;
|
|
1285
|
+
type?: 'reasoning_text';
|
|
1373
1286
|
}
|
|
1374
1287
|
}
|
|
1375
1288
|
/**
|
|
1376
|
-
* Streaming event
|
|
1289
|
+
* Streaming event for incremental reasoning text updates.
|
|
1377
1290
|
*/
|
|
1378
|
-
interface
|
|
1291
|
+
interface OpenAIResponseObjectStreamResponseReasoningTextDelta {
|
|
1292
|
+
content_index: number;
|
|
1293
|
+
delta: string;
|
|
1294
|
+
item_id: string;
|
|
1295
|
+
output_index: number;
|
|
1296
|
+
sequence_number: number;
|
|
1297
|
+
type?: 'response.reasoning_text.delta';
|
|
1298
|
+
}
|
|
1299
|
+
/**
|
|
1300
|
+
* Streaming event for when reasoning text is completed.
|
|
1301
|
+
*/
|
|
1302
|
+
interface OpenAIResponseObjectStreamResponseReasoningTextDone {
|
|
1303
|
+
content_index: number;
|
|
1304
|
+
item_id: string;
|
|
1305
|
+
output_index: number;
|
|
1306
|
+
sequence_number: number;
|
|
1307
|
+
text: string;
|
|
1308
|
+
type?: 'response.reasoning_text.done';
|
|
1309
|
+
}
|
|
1310
|
+
/**
|
|
1311
|
+
* Streaming event for when a new reasoning summary part is added.
|
|
1312
|
+
*/
|
|
1313
|
+
interface OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded {
|
|
1314
|
+
item_id: string;
|
|
1315
|
+
output_index: number;
|
|
1379
1316
|
/**
|
|
1380
|
-
*
|
|
1317
|
+
* Reasoning summary part in a streamed response.
|
|
1381
1318
|
*/
|
|
1382
|
-
|
|
1319
|
+
part: OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded.Part;
|
|
1320
|
+
sequence_number: number;
|
|
1321
|
+
summary_index: number;
|
|
1322
|
+
type?: 'response.reasoning_summary_part.added';
|
|
1323
|
+
}
|
|
1324
|
+
namespace OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded {
|
|
1383
1325
|
/**
|
|
1384
|
-
*
|
|
1326
|
+
* Reasoning summary part in a streamed response.
|
|
1385
1327
|
*/
|
|
1386
|
-
|
|
1328
|
+
interface Part {
|
|
1329
|
+
text: string;
|
|
1330
|
+
type?: 'summary_text';
|
|
1331
|
+
}
|
|
1387
1332
|
}
|
|
1388
|
-
}
|
|
1389
|
-
/**
|
|
1390
|
-
* OpenAI response object extended with input context information.
|
|
1391
|
-
*/
|
|
1392
|
-
export interface ResponseListResponse {
|
|
1393
|
-
/**
|
|
1394
|
-
* Unique identifier for this response
|
|
1395
|
-
*/
|
|
1396
|
-
id: string;
|
|
1397
1333
|
/**
|
|
1398
|
-
*
|
|
1334
|
+
* Streaming event for when a reasoning summary part is completed.
|
|
1399
1335
|
*/
|
|
1400
|
-
|
|
1336
|
+
interface OpenAIResponseObjectStreamResponseReasoningSummaryPartDone {
|
|
1337
|
+
item_id: string;
|
|
1338
|
+
output_index: number;
|
|
1339
|
+
/**
|
|
1340
|
+
* Reasoning summary part in a streamed response.
|
|
1341
|
+
*/
|
|
1342
|
+
part: OpenAIResponseObjectStreamResponseReasoningSummaryPartDone.Part;
|
|
1343
|
+
sequence_number: number;
|
|
1344
|
+
summary_index: number;
|
|
1345
|
+
type?: 'response.reasoning_summary_part.done';
|
|
1346
|
+
}
|
|
1347
|
+
namespace OpenAIResponseObjectStreamResponseReasoningSummaryPartDone {
|
|
1348
|
+
/**
|
|
1349
|
+
* Reasoning summary part in a streamed response.
|
|
1350
|
+
*/
|
|
1351
|
+
interface Part {
|
|
1352
|
+
text: string;
|
|
1353
|
+
type?: 'summary_text';
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1401
1356
|
/**
|
|
1402
|
-
*
|
|
1357
|
+
* Streaming event for incremental reasoning summary text updates.
|
|
1403
1358
|
*/
|
|
1404
|
-
|
|
1359
|
+
interface OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta {
|
|
1360
|
+
delta: string;
|
|
1361
|
+
item_id: string;
|
|
1362
|
+
output_index: number;
|
|
1363
|
+
sequence_number: number;
|
|
1364
|
+
summary_index: number;
|
|
1365
|
+
type?: 'response.reasoning_summary_text.delta';
|
|
1366
|
+
}
|
|
1405
1367
|
/**
|
|
1406
|
-
*
|
|
1368
|
+
* Streaming event for when reasoning summary text is completed.
|
|
1407
1369
|
*/
|
|
1408
|
-
|
|
1370
|
+
interface OpenAIResponseObjectStreamResponseReasoningSummaryTextDone {
|
|
1371
|
+
item_id: string;
|
|
1372
|
+
output_index: number;
|
|
1373
|
+
sequence_number: number;
|
|
1374
|
+
summary_index: number;
|
|
1375
|
+
text: string;
|
|
1376
|
+
type?: 'response.reasoning_summary_text.done';
|
|
1377
|
+
}
|
|
1409
1378
|
/**
|
|
1410
|
-
*
|
|
1379
|
+
* Streaming event for incremental refusal text updates.
|
|
1411
1380
|
*/
|
|
1412
|
-
|
|
1381
|
+
interface OpenAIResponseObjectStreamResponseRefusalDelta {
|
|
1382
|
+
content_index: number;
|
|
1383
|
+
delta: string;
|
|
1384
|
+
item_id: string;
|
|
1385
|
+
output_index: number;
|
|
1386
|
+
sequence_number: number;
|
|
1387
|
+
type?: 'response.refusal.delta';
|
|
1388
|
+
}
|
|
1413
1389
|
/**
|
|
1414
|
-
*
|
|
1390
|
+
* Streaming event for when refusal text is completed.
|
|
1415
1391
|
*/
|
|
1416
|
-
|
|
1392
|
+
interface OpenAIResponseObjectStreamResponseRefusalDone {
|
|
1393
|
+
content_index: number;
|
|
1394
|
+
item_id: string;
|
|
1395
|
+
output_index: number;
|
|
1396
|
+
refusal: string;
|
|
1397
|
+
sequence_number: number;
|
|
1398
|
+
type?: 'response.refusal.done';
|
|
1399
|
+
}
|
|
1417
1400
|
/**
|
|
1418
|
-
*
|
|
1401
|
+
* Streaming event for when an annotation is added to output text.
|
|
1419
1402
|
*/
|
|
1420
|
-
|
|
1403
|
+
interface OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded {
|
|
1404
|
+
/**
|
|
1405
|
+
* File citation annotation for referencing specific files in response content.
|
|
1406
|
+
*/
|
|
1407
|
+
annotation: OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded.OpenAIResponseAnnotationFileCitation | OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded.OpenAIResponseAnnotationCitation | OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded.OpenAIResponseAnnotationFilePath;
|
|
1408
|
+
annotation_index: number;
|
|
1409
|
+
content_index: number;
|
|
1410
|
+
item_id: string;
|
|
1411
|
+
output_index: number;
|
|
1412
|
+
sequence_number: number;
|
|
1413
|
+
type?: 'response.output_text.annotation.added';
|
|
1414
|
+
}
|
|
1415
|
+
namespace OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded {
|
|
1416
|
+
/**
|
|
1417
|
+
* File citation annotation for referencing specific files in response content.
|
|
1418
|
+
*/
|
|
1419
|
+
interface OpenAIResponseAnnotationFileCitation {
|
|
1420
|
+
file_id: string;
|
|
1421
|
+
filename: string;
|
|
1422
|
+
index: number;
|
|
1423
|
+
type?: 'file_citation';
|
|
1424
|
+
}
|
|
1425
|
+
/**
|
|
1426
|
+
* URL citation annotation for referencing external web resources.
|
|
1427
|
+
*/
|
|
1428
|
+
interface OpenAIResponseAnnotationCitation {
|
|
1429
|
+
end_index: number;
|
|
1430
|
+
start_index: number;
|
|
1431
|
+
title: string;
|
|
1432
|
+
url: string;
|
|
1433
|
+
type?: 'url_citation';
|
|
1434
|
+
}
|
|
1435
|
+
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
1436
|
+
container_id: string;
|
|
1437
|
+
end_index: number;
|
|
1438
|
+
file_id: string;
|
|
1439
|
+
filename: string;
|
|
1440
|
+
start_index: number;
|
|
1441
|
+
type?: 'container_file_citation';
|
|
1442
|
+
}
|
|
1443
|
+
interface OpenAIResponseAnnotationFilePath {
|
|
1444
|
+
file_id: string;
|
|
1445
|
+
index: number;
|
|
1446
|
+
type?: 'file_path';
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1421
1449
|
/**
|
|
1422
|
-
*
|
|
1450
|
+
* Streaming event for file search calls in progress.
|
|
1423
1451
|
*/
|
|
1424
|
-
|
|
1452
|
+
interface OpenAIResponseObjectStreamResponseFileSearchCallInProgress {
|
|
1453
|
+
item_id: string;
|
|
1454
|
+
output_index: number;
|
|
1455
|
+
sequence_number: number;
|
|
1456
|
+
type?: 'response.file_search_call.in_progress';
|
|
1457
|
+
}
|
|
1425
1458
|
/**
|
|
1426
|
-
*
|
|
1459
|
+
* Streaming event for file search currently searching.
|
|
1427
1460
|
*/
|
|
1428
|
-
|
|
1461
|
+
interface OpenAIResponseObjectStreamResponseFileSearchCallSearching {
|
|
1462
|
+
item_id: string;
|
|
1463
|
+
output_index: number;
|
|
1464
|
+
sequence_number: number;
|
|
1465
|
+
type?: 'response.file_search_call.searching';
|
|
1466
|
+
}
|
|
1429
1467
|
/**
|
|
1430
|
-
*
|
|
1468
|
+
* Streaming event for completed file search calls.
|
|
1431
1469
|
*/
|
|
1432
|
-
|
|
1470
|
+
interface OpenAIResponseObjectStreamResponseFileSearchCallCompleted {
|
|
1471
|
+
item_id: string;
|
|
1472
|
+
output_index: number;
|
|
1473
|
+
sequence_number: number;
|
|
1474
|
+
type?: 'response.file_search_call.completed';
|
|
1475
|
+
}
|
|
1433
1476
|
/**
|
|
1434
|
-
*
|
|
1477
|
+
* Streaming event emitted when a response ends in an incomplete state.
|
|
1435
1478
|
*/
|
|
1436
|
-
|
|
1479
|
+
interface OpenAIResponseObjectStreamResponseIncomplete {
|
|
1480
|
+
/**
|
|
1481
|
+
* Complete OpenAI response object containing generation results and metadata.
|
|
1482
|
+
*/
|
|
1483
|
+
response: ResponsesAPI.ResponseObject;
|
|
1484
|
+
sequence_number: number;
|
|
1485
|
+
type?: 'response.incomplete';
|
|
1486
|
+
}
|
|
1437
1487
|
/**
|
|
1438
|
-
*
|
|
1488
|
+
* Streaming event emitted when a response fails.
|
|
1439
1489
|
*/
|
|
1440
|
-
|
|
1490
|
+
interface OpenAIResponseObjectStreamResponseFailed {
|
|
1491
|
+
/**
|
|
1492
|
+
* Complete OpenAI response object containing generation results and metadata.
|
|
1493
|
+
*/
|
|
1494
|
+
response: ResponsesAPI.ResponseObject;
|
|
1495
|
+
sequence_number: number;
|
|
1496
|
+
type?: 'response.failed';
|
|
1497
|
+
}
|
|
1441
1498
|
/**
|
|
1442
|
-
*
|
|
1499
|
+
* Streaming event indicating a response has been completed.
|
|
1443
1500
|
*/
|
|
1444
|
-
|
|
1501
|
+
interface OpenAIResponseObjectStreamResponseCompleted {
|
|
1502
|
+
/**
|
|
1503
|
+
* Complete OpenAI response object containing generation results and metadata.
|
|
1504
|
+
*/
|
|
1505
|
+
response: ResponsesAPI.ResponseObject;
|
|
1506
|
+
type?: 'response.completed';
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
/**
|
|
1510
|
+
* OpenAI response object extended with input context information.
|
|
1511
|
+
*/
|
|
1512
|
+
export interface ResponseListResponse {
|
|
1513
|
+
id: string;
|
|
1514
|
+
created_at: number;
|
|
1515
|
+
input: Array<ResponseListResponse.OpenAIResponseMessageOutput | ResponseListResponse.OpenAIResponseOutputMessageWebSearchToolCall | ResponseListResponse.OpenAIResponseOutputMessageFileSearchToolCall | ResponseListResponse.OpenAIResponseOutputMessageFunctionToolCall | ResponseListResponse.OpenAIResponseOutputMessageMcpCall | ResponseListResponse.OpenAIResponseOutputMessageMcpListTools | ResponseListResponse.OpenAIResponseMcpApprovalRequest | ResponseListResponse.OpenAIResponseInputFunctionToolCallOutput | ResponseListResponse.OpenAIResponseMcpApprovalResponse | ResponseListResponse.OpenAIResponseMessageOutput>;
|
|
1516
|
+
model: string;
|
|
1517
|
+
output: Array<ResponseListResponse.OpenAIResponseMessageOutput | ResponseListResponse.OpenAIResponseOutputMessageWebSearchToolCall | ResponseListResponse.OpenAIResponseOutputMessageFileSearchToolCall | ResponseListResponse.OpenAIResponseOutputMessageFunctionToolCall | ResponseListResponse.OpenAIResponseOutputMessageMcpCall | ResponseListResponse.OpenAIResponseOutputMessageMcpListTools | ResponseListResponse.OpenAIResponseMcpApprovalRequest>;
|
|
1518
|
+
status: string;
|
|
1445
1519
|
/**
|
|
1446
|
-
*
|
|
1520
|
+
* Error details for failed OpenAI response requests.
|
|
1447
1521
|
*/
|
|
1448
|
-
|
|
1522
|
+
error?: ResponseListResponse.Error | null;
|
|
1523
|
+
instructions?: string | null;
|
|
1524
|
+
max_tool_calls?: number | null;
|
|
1525
|
+
metadata?: {
|
|
1526
|
+
[key: string]: string;
|
|
1527
|
+
} | null;
|
|
1528
|
+
object?: 'response';
|
|
1529
|
+
parallel_tool_calls?: boolean | null;
|
|
1530
|
+
previous_response_id?: string | null;
|
|
1449
1531
|
/**
|
|
1450
|
-
*
|
|
1532
|
+
* OpenAI compatible Prompt object that is used in OpenAI responses.
|
|
1451
1533
|
*/
|
|
1452
|
-
|
|
1534
|
+
prompt?: ResponseListResponse.Prompt | null;
|
|
1535
|
+
temperature?: number | null;
|
|
1536
|
+
/**
|
|
1537
|
+
* Text response configuration for OpenAI responses.
|
|
1538
|
+
*/
|
|
1539
|
+
text?: ResponseListResponse.Text;
|
|
1540
|
+
/**
|
|
1541
|
+
* Constrains the tools available to the model to a pre-defined set.
|
|
1542
|
+
*/
|
|
1543
|
+
tool_choice?: 'auto' | 'required' | 'none' | ResponseListResponse.OpenAIResponseInputToolChoiceAllowedTools | ResponseListResponse.OpenAIResponseInputToolChoiceFileSearch | ResponseListResponse.OpenAIResponseInputToolChoiceWebSearch | ResponseListResponse.OpenAIResponseInputToolChoiceFunctionTool | ResponseListResponse.OpenAIResponseInputToolChoiceMcpTool | ResponseListResponse.OpenAIResponseInputToolChoiceCustomTool | null;
|
|
1544
|
+
tools?: Array<ResponseListResponse.OpenAIResponseInputToolWebSearch | ResponseListResponse.OpenAIResponseInputToolFileSearch | ResponseListResponse.OpenAIResponseInputToolFunction | ResponseListResponse.OpenAIResponseToolMcp> | null;
|
|
1545
|
+
top_p?: number | null;
|
|
1546
|
+
truncation?: string | null;
|
|
1547
|
+
/**
|
|
1548
|
+
* Usage information for OpenAI response.
|
|
1549
|
+
*/
|
|
1550
|
+
usage?: ResponseListResponse.Usage | null;
|
|
1453
1551
|
}
|
|
1454
1552
|
export declare namespace ResponseListResponse {
|
|
1455
1553
|
/**
|
|
1456
|
-
*
|
|
1554
|
+
* Corresponds to the various Message types in the Responses API. They are all
|
|
1555
|
+
* under one type because the Responses API gives them all the same "type" value,
|
|
1556
|
+
* and there is no way to tell them apart in certain scenarios.
|
|
1457
1557
|
*/
|
|
1458
|
-
interface
|
|
1558
|
+
interface OpenAIResponseMessageOutput {
|
|
1559
|
+
content: string | Array<OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentText | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentImage | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessageOutput.OpenAIResponseOutputMessageContentOutputTextOutput | OpenAIResponseMessageOutput.OpenAIResponseContentPartRefusal>;
|
|
1560
|
+
role: 'system' | 'developer' | 'user' | 'assistant';
|
|
1561
|
+
id?: string | null;
|
|
1562
|
+
status?: string | null;
|
|
1563
|
+
type?: 'message';
|
|
1564
|
+
}
|
|
1565
|
+
namespace OpenAIResponseMessageOutput {
|
|
1459
1566
|
/**
|
|
1460
|
-
*
|
|
1567
|
+
* Text content for input messages in OpenAI response format.
|
|
1461
1568
|
*/
|
|
1462
|
-
|
|
1569
|
+
interface OpenAIResponseInputMessageContentText {
|
|
1570
|
+
text: string;
|
|
1571
|
+
type?: 'input_text';
|
|
1572
|
+
}
|
|
1463
1573
|
/**
|
|
1464
|
-
*
|
|
1574
|
+
* Image content for input messages in OpenAI response format.
|
|
1465
1575
|
*/
|
|
1466
|
-
|
|
1576
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
1577
|
+
detail?: 'low' | 'high' | 'auto';
|
|
1578
|
+
file_id?: string | null;
|
|
1579
|
+
image_url?: string | null;
|
|
1580
|
+
type?: 'input_image';
|
|
1581
|
+
}
|
|
1582
|
+
/**
|
|
1583
|
+
* File content for input messages in OpenAI response format.
|
|
1584
|
+
*/
|
|
1585
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
1586
|
+
file_data?: string | null;
|
|
1587
|
+
file_id?: string | null;
|
|
1588
|
+
file_url?: string | null;
|
|
1589
|
+
filename?: string | null;
|
|
1590
|
+
type?: 'input_file';
|
|
1591
|
+
}
|
|
1592
|
+
interface OpenAIResponseOutputMessageContentOutputTextOutput {
|
|
1593
|
+
text: string;
|
|
1594
|
+
annotations?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFilePath>;
|
|
1595
|
+
logprobs?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.Logprob> | null;
|
|
1596
|
+
type?: 'output_text';
|
|
1597
|
+
}
|
|
1598
|
+
namespace OpenAIResponseOutputMessageContentOutputTextOutput {
|
|
1599
|
+
/**
|
|
1600
|
+
* File citation annotation for referencing specific files in response content.
|
|
1601
|
+
*/
|
|
1602
|
+
interface OpenAIResponseAnnotationFileCitation {
|
|
1603
|
+
file_id: string;
|
|
1604
|
+
filename: string;
|
|
1605
|
+
index: number;
|
|
1606
|
+
type?: 'file_citation';
|
|
1607
|
+
}
|
|
1608
|
+
/**
|
|
1609
|
+
* URL citation annotation for referencing external web resources.
|
|
1610
|
+
*/
|
|
1611
|
+
interface OpenAIResponseAnnotationCitation {
|
|
1612
|
+
end_index: number;
|
|
1613
|
+
start_index: number;
|
|
1614
|
+
title: string;
|
|
1615
|
+
url: string;
|
|
1616
|
+
type?: 'url_citation';
|
|
1617
|
+
}
|
|
1618
|
+
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
1619
|
+
container_id: string;
|
|
1620
|
+
end_index: number;
|
|
1621
|
+
file_id: string;
|
|
1622
|
+
filename: string;
|
|
1623
|
+
start_index: number;
|
|
1624
|
+
type?: 'container_file_citation';
|
|
1625
|
+
}
|
|
1626
|
+
interface OpenAIResponseAnnotationFilePath {
|
|
1627
|
+
file_id: string;
|
|
1628
|
+
index: number;
|
|
1629
|
+
type?: 'file_path';
|
|
1630
|
+
}
|
|
1631
|
+
/**
|
|
1632
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
1633
|
+
* response.
|
|
1634
|
+
*
|
|
1635
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
1636
|
+
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
1637
|
+
*/
|
|
1638
|
+
interface Logprob {
|
|
1639
|
+
token: string;
|
|
1640
|
+
logprob: number;
|
|
1641
|
+
bytes?: Array<number> | null;
|
|
1642
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
1643
|
+
}
|
|
1644
|
+
namespace Logprob {
|
|
1645
|
+
/**
|
|
1646
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
1647
|
+
* response.
|
|
1648
|
+
*
|
|
1649
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
1650
|
+
* probability of the token
|
|
1651
|
+
*/
|
|
1652
|
+
interface TopLogprob {
|
|
1653
|
+
token: string;
|
|
1654
|
+
logprob: number;
|
|
1655
|
+
bytes?: Array<number> | null;
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1467
1659
|
/**
|
|
1468
|
-
*
|
|
1660
|
+
* Refusal content within a streamed response part.
|
|
1469
1661
|
*/
|
|
1470
|
-
|
|
1662
|
+
interface OpenAIResponseContentPartRefusal {
|
|
1663
|
+
refusal: string;
|
|
1664
|
+
type?: 'refusal';
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
/**
|
|
1668
|
+
* Web search tool call output message for OpenAI responses.
|
|
1669
|
+
*/
|
|
1670
|
+
interface OpenAIResponseOutputMessageWebSearchToolCall {
|
|
1671
|
+
id: string;
|
|
1672
|
+
status: string;
|
|
1673
|
+
type?: 'web_search_call';
|
|
1471
1674
|
}
|
|
1472
1675
|
/**
|
|
1473
1676
|
* File search tool call output message for OpenAI responses.
|
|
1474
1677
|
*/
|
|
1475
1678
|
interface OpenAIResponseOutputMessageFileSearchToolCall {
|
|
1476
|
-
/**
|
|
1477
|
-
* Unique identifier for this tool call
|
|
1478
|
-
*/
|
|
1479
1679
|
id: string;
|
|
1480
|
-
/**
|
|
1481
|
-
* List of search queries executed
|
|
1482
|
-
*/
|
|
1483
1680
|
queries: Array<string>;
|
|
1484
|
-
/**
|
|
1485
|
-
* Current status of the file search operation
|
|
1486
|
-
*/
|
|
1487
1681
|
status: string;
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
*/
|
|
1491
|
-
type: 'file_search_call';
|
|
1492
|
-
/**
|
|
1493
|
-
* (Optional) Search results returned by the file search operation
|
|
1494
|
-
*/
|
|
1495
|
-
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result>;
|
|
1682
|
+
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
|
|
1683
|
+
type?: 'file_search_call';
|
|
1496
1684
|
}
|
|
1497
1685
|
namespace OpenAIResponseOutputMessageFileSearchToolCall {
|
|
1498
1686
|
/**
|
|
1499
1687
|
* Search results returned by the file search operation.
|
|
1500
1688
|
*/
|
|
1501
1689
|
interface Result {
|
|
1502
|
-
/**
|
|
1503
|
-
* (Optional) Key-value attributes associated with the file
|
|
1504
|
-
*/
|
|
1505
1690
|
attributes: {
|
|
1506
|
-
[key: string]:
|
|
1691
|
+
[key: string]: unknown;
|
|
1507
1692
|
};
|
|
1508
|
-
/**
|
|
1509
|
-
* Unique identifier of the file containing the result
|
|
1510
|
-
*/
|
|
1511
1693
|
file_id: string;
|
|
1512
|
-
/**
|
|
1513
|
-
* Name of the file containing the result
|
|
1514
|
-
*/
|
|
1515
1694
|
filename: string;
|
|
1516
|
-
/**
|
|
1517
|
-
* Relevance score for this search result (between 0 and 1)
|
|
1518
|
-
*/
|
|
1519
1695
|
score: number;
|
|
1520
|
-
/**
|
|
1521
|
-
* Text content of the search result
|
|
1522
|
-
*/
|
|
1523
1696
|
text: string;
|
|
1524
1697
|
}
|
|
1525
1698
|
}
|
|
@@ -1527,30 +1700,55 @@ export declare namespace ResponseListResponse {
|
|
|
1527
1700
|
* Function tool call output message for OpenAI responses.
|
|
1528
1701
|
*/
|
|
1529
1702
|
interface OpenAIResponseOutputMessageFunctionToolCall {
|
|
1530
|
-
/**
|
|
1531
|
-
* JSON string containing the function arguments
|
|
1532
|
-
*/
|
|
1533
1703
|
arguments: string;
|
|
1534
|
-
/**
|
|
1535
|
-
* Unique identifier for the function call
|
|
1536
|
-
*/
|
|
1537
1704
|
call_id: string;
|
|
1538
|
-
/**
|
|
1539
|
-
* Name of the function being called
|
|
1540
|
-
*/
|
|
1541
1705
|
name: string;
|
|
1706
|
+
id?: string | null;
|
|
1707
|
+
status?: string | null;
|
|
1708
|
+
type?: 'function_call';
|
|
1709
|
+
}
|
|
1710
|
+
/**
|
|
1711
|
+
* Model Context Protocol (MCP) call output message for OpenAI responses.
|
|
1712
|
+
*/
|
|
1713
|
+
interface OpenAIResponseOutputMessageMcpCall {
|
|
1714
|
+
id: string;
|
|
1715
|
+
arguments: string;
|
|
1716
|
+
name: string;
|
|
1717
|
+
server_label: string;
|
|
1718
|
+
error?: string | null;
|
|
1719
|
+
output?: string | null;
|
|
1720
|
+
type?: 'mcp_call';
|
|
1721
|
+
}
|
|
1722
|
+
/**
|
|
1723
|
+
* MCP list tools output message containing available tools from an MCP server.
|
|
1724
|
+
*/
|
|
1725
|
+
interface OpenAIResponseOutputMessageMcpListTools {
|
|
1726
|
+
id: string;
|
|
1727
|
+
server_label: string;
|
|
1728
|
+
tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
|
|
1729
|
+
type?: 'mcp_list_tools';
|
|
1730
|
+
}
|
|
1731
|
+
namespace OpenAIResponseOutputMessageMcpListTools {
|
|
1542
1732
|
/**
|
|
1543
|
-
* Tool
|
|
1544
|
-
*/
|
|
1545
|
-
type: 'function_call';
|
|
1546
|
-
/**
|
|
1547
|
-
* (Optional) Additional identifier for the tool call
|
|
1548
|
-
*/
|
|
1549
|
-
id?: string;
|
|
1550
|
-
/**
|
|
1551
|
-
* (Optional) Current status of the function call execution
|
|
1733
|
+
* Tool definition returned by MCP list tools operation.
|
|
1552
1734
|
*/
|
|
1553
|
-
|
|
1735
|
+
interface Tool {
|
|
1736
|
+
input_schema: {
|
|
1737
|
+
[key: string]: unknown;
|
|
1738
|
+
};
|
|
1739
|
+
name: string;
|
|
1740
|
+
description?: string | null;
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
/**
|
|
1744
|
+
* A request for human approval of a tool invocation.
|
|
1745
|
+
*/
|
|
1746
|
+
interface OpenAIResponseMcpApprovalRequest {
|
|
1747
|
+
id: string;
|
|
1748
|
+
arguments: string;
|
|
1749
|
+
name: string;
|
|
1750
|
+
server_label: string;
|
|
1751
|
+
type?: 'mcp_approval_request';
|
|
1554
1752
|
}
|
|
1555
1753
|
/**
|
|
1556
1754
|
* This represents the output of a function call that gets passed back to the
|
|
@@ -1559,104 +1757,84 @@ export declare namespace ResponseListResponse {
|
|
|
1559
1757
|
interface OpenAIResponseInputFunctionToolCallOutput {
|
|
1560
1758
|
call_id: string;
|
|
1561
1759
|
output: string;
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1760
|
+
id?: string | null;
|
|
1761
|
+
status?: string | null;
|
|
1762
|
+
type?: 'function_call_output';
|
|
1763
|
+
}
|
|
1764
|
+
/**
|
|
1765
|
+
* A response to an MCP approval request.
|
|
1766
|
+
*/
|
|
1767
|
+
interface OpenAIResponseMcpApprovalResponse {
|
|
1768
|
+
approval_request_id: string;
|
|
1769
|
+
approve: boolean;
|
|
1770
|
+
id?: string | null;
|
|
1771
|
+
reason?: string | null;
|
|
1772
|
+
type?: 'mcp_approval_response';
|
|
1565
1773
|
}
|
|
1566
1774
|
/**
|
|
1567
1775
|
* Corresponds to the various Message types in the Responses API. They are all
|
|
1568
1776
|
* under one type because the Responses API gives them all the same "type" value,
|
|
1569
1777
|
* and there is no way to tell them apart in certain scenarios.
|
|
1570
1778
|
*/
|
|
1571
|
-
interface
|
|
1572
|
-
content: string | Array<
|
|
1779
|
+
interface OpenAIResponseMessageOutput {
|
|
1780
|
+
content: string | Array<OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentText | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentImage | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessageOutput.OpenAIResponseOutputMessageContentOutputTextOutput | OpenAIResponseMessageOutput.OpenAIResponseContentPartRefusal>;
|
|
1573
1781
|
role: 'system' | 'developer' | 'user' | 'assistant';
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1782
|
+
id?: string | null;
|
|
1783
|
+
status?: string | null;
|
|
1784
|
+
type?: 'message';
|
|
1577
1785
|
}
|
|
1578
|
-
namespace
|
|
1786
|
+
namespace OpenAIResponseMessageOutput {
|
|
1579
1787
|
/**
|
|
1580
1788
|
* Text content for input messages in OpenAI response format.
|
|
1581
1789
|
*/
|
|
1582
1790
|
interface OpenAIResponseInputMessageContentText {
|
|
1583
|
-
/**
|
|
1584
|
-
* The text content of the input message
|
|
1585
|
-
*/
|
|
1586
1791
|
text: string;
|
|
1587
|
-
|
|
1588
|
-
* Content type identifier, always "input_text"
|
|
1589
|
-
*/
|
|
1590
|
-
type: 'input_text';
|
|
1792
|
+
type?: 'input_text';
|
|
1591
1793
|
}
|
|
1592
1794
|
/**
|
|
1593
1795
|
* Image content for input messages in OpenAI response format.
|
|
1594
1796
|
*/
|
|
1595
1797
|
interface OpenAIResponseInputMessageContentImage {
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
/**
|
|
1601
|
-
* Content type identifier, always "input_image"
|
|
1602
|
-
*/
|
|
1603
|
-
type: 'input_image';
|
|
1604
|
-
/**
|
|
1605
|
-
* (Optional) URL of the image content
|
|
1606
|
-
*/
|
|
1607
|
-
image_url?: string;
|
|
1798
|
+
detail?: 'low' | 'high' | 'auto';
|
|
1799
|
+
file_id?: string | null;
|
|
1800
|
+
image_url?: string | null;
|
|
1801
|
+
type?: 'input_image';
|
|
1608
1802
|
}
|
|
1609
|
-
|
|
1610
|
-
|
|
1803
|
+
/**
|
|
1804
|
+
* File content for input messages in OpenAI response format.
|
|
1805
|
+
*/
|
|
1806
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
1807
|
+
file_data?: string | null;
|
|
1808
|
+
file_id?: string | null;
|
|
1809
|
+
file_url?: string | null;
|
|
1810
|
+
filename?: string | null;
|
|
1811
|
+
type?: 'input_file';
|
|
1812
|
+
}
|
|
1813
|
+
interface OpenAIResponseOutputMessageContentOutputTextOutput {
|
|
1611
1814
|
text: string;
|
|
1612
|
-
|
|
1815
|
+
annotations?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFilePath>;
|
|
1816
|
+
logprobs?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.Logprob> | null;
|
|
1817
|
+
type?: 'output_text';
|
|
1613
1818
|
}
|
|
1614
|
-
namespace
|
|
1819
|
+
namespace OpenAIResponseOutputMessageContentOutputTextOutput {
|
|
1615
1820
|
/**
|
|
1616
1821
|
* File citation annotation for referencing specific files in response content.
|
|
1617
1822
|
*/
|
|
1618
1823
|
interface OpenAIResponseAnnotationFileCitation {
|
|
1619
|
-
/**
|
|
1620
|
-
* Unique identifier of the referenced file
|
|
1621
|
-
*/
|
|
1622
1824
|
file_id: string;
|
|
1623
|
-
/**
|
|
1624
|
-
* Name of the referenced file
|
|
1625
|
-
*/
|
|
1626
1825
|
filename: string;
|
|
1627
|
-
/**
|
|
1628
|
-
* Position index of the citation within the content
|
|
1629
|
-
*/
|
|
1630
1826
|
index: number;
|
|
1631
|
-
|
|
1632
|
-
* Annotation type identifier, always "file_citation"
|
|
1633
|
-
*/
|
|
1634
|
-
type: 'file_citation';
|
|
1827
|
+
type?: 'file_citation';
|
|
1635
1828
|
}
|
|
1636
1829
|
/**
|
|
1637
1830
|
* URL citation annotation for referencing external web resources.
|
|
1638
1831
|
*/
|
|
1639
1832
|
interface OpenAIResponseAnnotationCitation {
|
|
1640
|
-
/**
|
|
1641
|
-
* End position of the citation span in the content
|
|
1642
|
-
*/
|
|
1643
1833
|
end_index: number;
|
|
1644
|
-
/**
|
|
1645
|
-
* Start position of the citation span in the content
|
|
1646
|
-
*/
|
|
1647
1834
|
start_index: number;
|
|
1648
|
-
/**
|
|
1649
|
-
* Title of the referenced web resource
|
|
1650
|
-
*/
|
|
1651
1835
|
title: string;
|
|
1652
|
-
/**
|
|
1653
|
-
* Annotation type identifier, always "url_citation"
|
|
1654
|
-
*/
|
|
1655
|
-
type: 'url_citation';
|
|
1656
|
-
/**
|
|
1657
|
-
* URL of the referenced web resource
|
|
1658
|
-
*/
|
|
1659
1836
|
url: string;
|
|
1837
|
+
type?: 'url_citation';
|
|
1660
1838
|
}
|
|
1661
1839
|
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
1662
1840
|
container_id: string;
|
|
@@ -1664,13 +1842,47 @@ export declare namespace ResponseListResponse {
|
|
|
1664
1842
|
file_id: string;
|
|
1665
1843
|
filename: string;
|
|
1666
1844
|
start_index: number;
|
|
1667
|
-
type
|
|
1845
|
+
type?: 'container_file_citation';
|
|
1668
1846
|
}
|
|
1669
1847
|
interface OpenAIResponseAnnotationFilePath {
|
|
1670
1848
|
file_id: string;
|
|
1671
1849
|
index: number;
|
|
1672
|
-
type
|
|
1850
|
+
type?: 'file_path';
|
|
1851
|
+
}
|
|
1852
|
+
/**
|
|
1853
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
1854
|
+
* response.
|
|
1855
|
+
*
|
|
1856
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
1857
|
+
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
1858
|
+
*/
|
|
1859
|
+
interface Logprob {
|
|
1860
|
+
token: string;
|
|
1861
|
+
logprob: number;
|
|
1862
|
+
bytes?: Array<number> | null;
|
|
1863
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
1673
1864
|
}
|
|
1865
|
+
namespace Logprob {
|
|
1866
|
+
/**
|
|
1867
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
1868
|
+
* response.
|
|
1869
|
+
*
|
|
1870
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
1871
|
+
* probability of the token
|
|
1872
|
+
*/
|
|
1873
|
+
interface TopLogprob {
|
|
1874
|
+
token: string;
|
|
1875
|
+
logprob: number;
|
|
1876
|
+
bytes?: Array<number> | null;
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
/**
|
|
1881
|
+
* Refusal content within a streamed response part.
|
|
1882
|
+
*/
|
|
1883
|
+
interface OpenAIResponseContentPartRefusal {
|
|
1884
|
+
refusal: string;
|
|
1885
|
+
type?: 'refusal';
|
|
1674
1886
|
}
|
|
1675
1887
|
}
|
|
1676
1888
|
/**
|
|
@@ -1678,95 +1890,65 @@ export declare namespace ResponseListResponse {
|
|
|
1678
1890
|
* under one type because the Responses API gives them all the same "type" value,
|
|
1679
1891
|
* and there is no way to tell them apart in certain scenarios.
|
|
1680
1892
|
*/
|
|
1681
|
-
interface
|
|
1682
|
-
content: string | Array<
|
|
1893
|
+
interface OpenAIResponseMessageOutput {
|
|
1894
|
+
content: string | Array<OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentText | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentImage | OpenAIResponseMessageOutput.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessageOutput.OpenAIResponseOutputMessageContentOutputTextOutput | OpenAIResponseMessageOutput.OpenAIResponseContentPartRefusal>;
|
|
1683
1895
|
role: 'system' | 'developer' | 'user' | 'assistant';
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1896
|
+
id?: string | null;
|
|
1897
|
+
status?: string | null;
|
|
1898
|
+
type?: 'message';
|
|
1687
1899
|
}
|
|
1688
|
-
namespace
|
|
1900
|
+
namespace OpenAIResponseMessageOutput {
|
|
1689
1901
|
/**
|
|
1690
1902
|
* Text content for input messages in OpenAI response format.
|
|
1691
1903
|
*/
|
|
1692
1904
|
interface OpenAIResponseInputMessageContentText {
|
|
1693
|
-
/**
|
|
1694
|
-
* The text content of the input message
|
|
1695
|
-
*/
|
|
1696
1905
|
text: string;
|
|
1697
|
-
|
|
1698
|
-
* Content type identifier, always "input_text"
|
|
1699
|
-
*/
|
|
1700
|
-
type: 'input_text';
|
|
1906
|
+
type?: 'input_text';
|
|
1701
1907
|
}
|
|
1702
1908
|
/**
|
|
1703
1909
|
* Image content for input messages in OpenAI response format.
|
|
1704
1910
|
*/
|
|
1705
1911
|
interface OpenAIResponseInputMessageContentImage {
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1912
|
+
detail?: 'low' | 'high' | 'auto';
|
|
1913
|
+
file_id?: string | null;
|
|
1914
|
+
image_url?: string | null;
|
|
1915
|
+
type?: 'input_image';
|
|
1916
|
+
}
|
|
1917
|
+
/**
|
|
1918
|
+
* File content for input messages in OpenAI response format.
|
|
1919
|
+
*/
|
|
1920
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
1921
|
+
file_data?: string | null;
|
|
1922
|
+
file_id?: string | null;
|
|
1923
|
+
file_url?: string | null;
|
|
1924
|
+
filename?: string | null;
|
|
1925
|
+
type?: 'input_file';
|
|
1718
1926
|
}
|
|
1719
|
-
interface
|
|
1720
|
-
annotations: Array<UnionMember2.OpenAIResponseAnnotationFileCitation | UnionMember2.OpenAIResponseAnnotationCitation | UnionMember2.OpenAIResponseAnnotationContainerFileCitation | UnionMember2.OpenAIResponseAnnotationFilePath>;
|
|
1927
|
+
interface OpenAIResponseOutputMessageContentOutputTextOutput {
|
|
1721
1928
|
text: string;
|
|
1722
|
-
|
|
1929
|
+
annotations?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputTextOutput.OpenAIResponseAnnotationFilePath>;
|
|
1930
|
+
logprobs?: Array<OpenAIResponseOutputMessageContentOutputTextOutput.Logprob> | null;
|
|
1931
|
+
type?: 'output_text';
|
|
1723
1932
|
}
|
|
1724
|
-
namespace
|
|
1933
|
+
namespace OpenAIResponseOutputMessageContentOutputTextOutput {
|
|
1725
1934
|
/**
|
|
1726
1935
|
* File citation annotation for referencing specific files in response content.
|
|
1727
1936
|
*/
|
|
1728
1937
|
interface OpenAIResponseAnnotationFileCitation {
|
|
1729
|
-
/**
|
|
1730
|
-
* Unique identifier of the referenced file
|
|
1731
|
-
*/
|
|
1732
1938
|
file_id: string;
|
|
1733
|
-
/**
|
|
1734
|
-
* Name of the referenced file
|
|
1735
|
-
*/
|
|
1736
1939
|
filename: string;
|
|
1737
|
-
/**
|
|
1738
|
-
* Position index of the citation within the content
|
|
1739
|
-
*/
|
|
1740
1940
|
index: number;
|
|
1741
|
-
|
|
1742
|
-
* Annotation type identifier, always "file_citation"
|
|
1743
|
-
*/
|
|
1744
|
-
type: 'file_citation';
|
|
1941
|
+
type?: 'file_citation';
|
|
1745
1942
|
}
|
|
1746
1943
|
/**
|
|
1747
1944
|
* URL citation annotation for referencing external web resources.
|
|
1748
1945
|
*/
|
|
1749
1946
|
interface OpenAIResponseAnnotationCitation {
|
|
1750
|
-
/**
|
|
1751
|
-
* End position of the citation span in the content
|
|
1752
|
-
*/
|
|
1753
1947
|
end_index: number;
|
|
1754
|
-
/**
|
|
1755
|
-
* Start position of the citation span in the content
|
|
1756
|
-
*/
|
|
1757
1948
|
start_index: number;
|
|
1758
|
-
/**
|
|
1759
|
-
* Title of the referenced web resource
|
|
1760
|
-
*/
|
|
1761
1949
|
title: string;
|
|
1762
|
-
/**
|
|
1763
|
-
* Annotation type identifier, always "url_citation"
|
|
1764
|
-
*/
|
|
1765
|
-
type: 'url_citation';
|
|
1766
|
-
/**
|
|
1767
|
-
* URL of the referenced web resource
|
|
1768
|
-
*/
|
|
1769
1950
|
url: string;
|
|
1951
|
+
type?: 'url_citation';
|
|
1770
1952
|
}
|
|
1771
1953
|
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
1772
1954
|
container_id: string;
|
|
@@ -1774,83 +1956,78 @@ export declare namespace ResponseListResponse {
|
|
|
1774
1956
|
file_id: string;
|
|
1775
1957
|
filename: string;
|
|
1776
1958
|
start_index: number;
|
|
1777
|
-
type
|
|
1959
|
+
type?: 'container_file_citation';
|
|
1778
1960
|
}
|
|
1779
1961
|
interface OpenAIResponseAnnotationFilePath {
|
|
1780
1962
|
file_id: string;
|
|
1781
1963
|
index: number;
|
|
1782
|
-
type
|
|
1964
|
+
type?: 'file_path';
|
|
1965
|
+
}
|
|
1966
|
+
/**
|
|
1967
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
1968
|
+
* response.
|
|
1969
|
+
*
|
|
1970
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
1971
|
+
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
1972
|
+
*/
|
|
1973
|
+
interface Logprob {
|
|
1974
|
+
token: string;
|
|
1975
|
+
logprob: number;
|
|
1976
|
+
bytes?: Array<number> | null;
|
|
1977
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
1978
|
+
}
|
|
1979
|
+
namespace Logprob {
|
|
1980
|
+
/**
|
|
1981
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
1982
|
+
* response.
|
|
1983
|
+
*
|
|
1984
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
1985
|
+
* probability of the token
|
|
1986
|
+
*/
|
|
1987
|
+
interface TopLogprob {
|
|
1988
|
+
token: string;
|
|
1989
|
+
logprob: number;
|
|
1990
|
+
bytes?: Array<number> | null;
|
|
1991
|
+
}
|
|
1783
1992
|
}
|
|
1784
1993
|
}
|
|
1994
|
+
/**
|
|
1995
|
+
* Refusal content within a streamed response part.
|
|
1996
|
+
*/
|
|
1997
|
+
interface OpenAIResponseContentPartRefusal {
|
|
1998
|
+
refusal: string;
|
|
1999
|
+
type?: 'refusal';
|
|
2000
|
+
}
|
|
1785
2001
|
}
|
|
1786
2002
|
/**
|
|
1787
2003
|
* Web search tool call output message for OpenAI responses.
|
|
1788
2004
|
*/
|
|
1789
2005
|
interface OpenAIResponseOutputMessageWebSearchToolCall {
|
|
1790
|
-
/**
|
|
1791
|
-
* Unique identifier for this tool call
|
|
1792
|
-
*/
|
|
1793
2006
|
id: string;
|
|
1794
|
-
/**
|
|
1795
|
-
* Current status of the web search operation
|
|
1796
|
-
*/
|
|
1797
2007
|
status: string;
|
|
1798
|
-
|
|
1799
|
-
* Tool call type identifier, always "web_search_call"
|
|
1800
|
-
*/
|
|
1801
|
-
type: 'web_search_call';
|
|
2008
|
+
type?: 'web_search_call';
|
|
1802
2009
|
}
|
|
1803
2010
|
/**
|
|
1804
2011
|
* File search tool call output message for OpenAI responses.
|
|
1805
2012
|
*/
|
|
1806
2013
|
interface OpenAIResponseOutputMessageFileSearchToolCall {
|
|
1807
|
-
/**
|
|
1808
|
-
* Unique identifier for this tool call
|
|
1809
|
-
*/
|
|
1810
2014
|
id: string;
|
|
1811
|
-
/**
|
|
1812
|
-
* List of search queries executed
|
|
1813
|
-
*/
|
|
1814
2015
|
queries: Array<string>;
|
|
1815
|
-
/**
|
|
1816
|
-
* Current status of the file search operation
|
|
1817
|
-
*/
|
|
1818
2016
|
status: string;
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
*/
|
|
1822
|
-
type: 'file_search_call';
|
|
1823
|
-
/**
|
|
1824
|
-
* (Optional) Search results returned by the file search operation
|
|
1825
|
-
*/
|
|
1826
|
-
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result>;
|
|
2017
|
+
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
|
|
2018
|
+
type?: 'file_search_call';
|
|
1827
2019
|
}
|
|
1828
2020
|
namespace OpenAIResponseOutputMessageFileSearchToolCall {
|
|
1829
2021
|
/**
|
|
1830
2022
|
* Search results returned by the file search operation.
|
|
1831
2023
|
*/
|
|
1832
2024
|
interface Result {
|
|
1833
|
-
/**
|
|
1834
|
-
* (Optional) Key-value attributes associated with the file
|
|
1835
|
-
*/
|
|
1836
2025
|
attributes: {
|
|
1837
|
-
[key: string]:
|
|
2026
|
+
[key: string]: unknown;
|
|
1838
2027
|
};
|
|
1839
|
-
/**
|
|
1840
|
-
* Unique identifier of the file containing the result
|
|
1841
|
-
*/
|
|
1842
2028
|
file_id: string;
|
|
1843
|
-
/**
|
|
1844
|
-
* Name of the file containing the result
|
|
1845
|
-
*/
|
|
1846
2029
|
filename: string;
|
|
1847
|
-
/**
|
|
1848
|
-
* Relevance score for this search result (between 0 and 1)
|
|
1849
|
-
*/
|
|
1850
2030
|
score: number;
|
|
1851
|
-
/**
|
|
1852
|
-
* Text content of the search result
|
|
1853
|
-
*/
|
|
1854
2031
|
text: string;
|
|
1855
2032
|
}
|
|
1856
2033
|
}
|
|
@@ -1858,277 +2035,444 @@ export declare namespace ResponseListResponse {
|
|
|
1858
2035
|
* Function tool call output message for OpenAI responses.
|
|
1859
2036
|
*/
|
|
1860
2037
|
interface OpenAIResponseOutputMessageFunctionToolCall {
|
|
1861
|
-
/**
|
|
1862
|
-
* JSON string containing the function arguments
|
|
1863
|
-
*/
|
|
1864
2038
|
arguments: string;
|
|
1865
|
-
/**
|
|
1866
|
-
* Unique identifier for the function call
|
|
1867
|
-
*/
|
|
1868
2039
|
call_id: string;
|
|
2040
|
+
name: string;
|
|
2041
|
+
id?: string | null;
|
|
2042
|
+
status?: string | null;
|
|
2043
|
+
type?: 'function_call';
|
|
2044
|
+
}
|
|
2045
|
+
/**
|
|
2046
|
+
* Model Context Protocol (MCP) call output message for OpenAI responses.
|
|
2047
|
+
*/
|
|
2048
|
+
interface OpenAIResponseOutputMessageMcpCall {
|
|
2049
|
+
id: string;
|
|
2050
|
+
arguments: string;
|
|
2051
|
+
name: string;
|
|
2052
|
+
server_label: string;
|
|
2053
|
+
error?: string | null;
|
|
2054
|
+
output?: string | null;
|
|
2055
|
+
type?: 'mcp_call';
|
|
2056
|
+
}
|
|
2057
|
+
/**
|
|
2058
|
+
* MCP list tools output message containing available tools from an MCP server.
|
|
2059
|
+
*/
|
|
2060
|
+
interface OpenAIResponseOutputMessageMcpListTools {
|
|
2061
|
+
id: string;
|
|
2062
|
+
server_label: string;
|
|
2063
|
+
tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
|
|
2064
|
+
type?: 'mcp_list_tools';
|
|
2065
|
+
}
|
|
2066
|
+
namespace OpenAIResponseOutputMessageMcpListTools {
|
|
1869
2067
|
/**
|
|
1870
|
-
*
|
|
2068
|
+
* Tool definition returned by MCP list tools operation.
|
|
1871
2069
|
*/
|
|
2070
|
+
interface Tool {
|
|
2071
|
+
input_schema: {
|
|
2072
|
+
[key: string]: unknown;
|
|
2073
|
+
};
|
|
2074
|
+
name: string;
|
|
2075
|
+
description?: string | null;
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
2078
|
+
/**
|
|
2079
|
+
* A request for human approval of a tool invocation.
|
|
2080
|
+
*/
|
|
2081
|
+
interface OpenAIResponseMcpApprovalRequest {
|
|
2082
|
+
id: string;
|
|
2083
|
+
arguments: string;
|
|
1872
2084
|
name: string;
|
|
2085
|
+
server_label: string;
|
|
2086
|
+
type?: 'mcp_approval_request';
|
|
2087
|
+
}
|
|
2088
|
+
/**
|
|
2089
|
+
* Error details for failed OpenAI response requests.
|
|
2090
|
+
*/
|
|
2091
|
+
interface Error {
|
|
2092
|
+
code: string;
|
|
2093
|
+
message: string;
|
|
2094
|
+
}
|
|
2095
|
+
/**
|
|
2096
|
+
* OpenAI compatible Prompt object that is used in OpenAI responses.
|
|
2097
|
+
*/
|
|
2098
|
+
interface Prompt {
|
|
2099
|
+
id: string;
|
|
2100
|
+
variables?: {
|
|
2101
|
+
[key: string]: Prompt.OpenAIResponseInputMessageContentText | Prompt.OpenAIResponseInputMessageContentImage | Prompt.OpenAIResponseInputMessageContentFile;
|
|
2102
|
+
} | null;
|
|
2103
|
+
version?: string | null;
|
|
2104
|
+
}
|
|
2105
|
+
namespace Prompt {
|
|
1873
2106
|
/**
|
|
1874
|
-
*
|
|
2107
|
+
* Text content for input messages in OpenAI response format.
|
|
1875
2108
|
*/
|
|
1876
|
-
|
|
2109
|
+
interface OpenAIResponseInputMessageContentText {
|
|
2110
|
+
text: string;
|
|
2111
|
+
type?: 'input_text';
|
|
2112
|
+
}
|
|
1877
2113
|
/**
|
|
1878
|
-
*
|
|
2114
|
+
* Image content for input messages in OpenAI response format.
|
|
1879
2115
|
*/
|
|
1880
|
-
|
|
2116
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
2117
|
+
detail?: 'low' | 'high' | 'auto';
|
|
2118
|
+
file_id?: string | null;
|
|
2119
|
+
image_url?: string | null;
|
|
2120
|
+
type?: 'input_image';
|
|
2121
|
+
}
|
|
1881
2122
|
/**
|
|
1882
|
-
*
|
|
2123
|
+
* File content for input messages in OpenAI response format.
|
|
1883
2124
|
*/
|
|
1884
|
-
|
|
2125
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
2126
|
+
file_data?: string | null;
|
|
2127
|
+
file_id?: string | null;
|
|
2128
|
+
file_url?: string | null;
|
|
2129
|
+
filename?: string | null;
|
|
2130
|
+
type?: 'input_file';
|
|
2131
|
+
}
|
|
1885
2132
|
}
|
|
1886
2133
|
/**
|
|
1887
|
-
*
|
|
2134
|
+
* Text response configuration for OpenAI responses.
|
|
1888
2135
|
*/
|
|
1889
|
-
interface
|
|
1890
|
-
/**
|
|
1891
|
-
* Unique identifier for this MCP call
|
|
1892
|
-
*/
|
|
1893
|
-
id: string;
|
|
2136
|
+
interface Text {
|
|
1894
2137
|
/**
|
|
1895
|
-
*
|
|
2138
|
+
* Configuration for Responses API text format.
|
|
1896
2139
|
*/
|
|
1897
|
-
|
|
2140
|
+
format?: Text.Format | null;
|
|
2141
|
+
}
|
|
2142
|
+
namespace Text {
|
|
1898
2143
|
/**
|
|
1899
|
-
*
|
|
2144
|
+
* Configuration for Responses API text format.
|
|
1900
2145
|
*/
|
|
2146
|
+
interface Format {
|
|
2147
|
+
description?: string | null;
|
|
2148
|
+
name?: string | null;
|
|
2149
|
+
schema?: {
|
|
2150
|
+
[key: string]: unknown;
|
|
2151
|
+
} | null;
|
|
2152
|
+
strict?: boolean | null;
|
|
2153
|
+
type?: 'text' | 'json_schema' | 'json_object';
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
/**
|
|
2157
|
+
* Constrains the tools available to the model to a pre-defined set.
|
|
2158
|
+
*/
|
|
2159
|
+
interface OpenAIResponseInputToolChoiceAllowedTools {
|
|
2160
|
+
tools: Array<{
|
|
2161
|
+
[key: string]: string;
|
|
2162
|
+
}>;
|
|
2163
|
+
mode?: 'auto' | 'required';
|
|
2164
|
+
type?: 'allowed_tools';
|
|
2165
|
+
}
|
|
2166
|
+
/**
|
|
2167
|
+
* Indicates that the model should use file search to generate a response.
|
|
2168
|
+
*/
|
|
2169
|
+
interface OpenAIResponseInputToolChoiceFileSearch {
|
|
2170
|
+
type?: 'file_search';
|
|
2171
|
+
}
|
|
2172
|
+
/**
|
|
2173
|
+
* Indicates that the model should use web search to generate a response
|
|
2174
|
+
*/
|
|
2175
|
+
interface OpenAIResponseInputToolChoiceWebSearch {
|
|
2176
|
+
type?: 'web_search' | 'web_search_preview' | 'web_search_preview_2025_03_11' | 'web_search_2025_08_26';
|
|
2177
|
+
}
|
|
2178
|
+
/**
|
|
2179
|
+
* Forces the model to call a specific function.
|
|
2180
|
+
*/
|
|
2181
|
+
interface OpenAIResponseInputToolChoiceFunctionTool {
|
|
1901
2182
|
name: string;
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
2183
|
+
type?: 'function';
|
|
2184
|
+
}
|
|
2185
|
+
/**
|
|
2186
|
+
* Forces the model to call a specific tool on a remote MCP server
|
|
2187
|
+
*/
|
|
2188
|
+
interface OpenAIResponseInputToolChoiceMcpTool {
|
|
1905
2189
|
server_label: string;
|
|
2190
|
+
name?: string | null;
|
|
2191
|
+
type?: 'mcp';
|
|
2192
|
+
}
|
|
2193
|
+
/**
|
|
2194
|
+
* Forces the model to call a custom tool.
|
|
2195
|
+
*/
|
|
2196
|
+
interface OpenAIResponseInputToolChoiceCustomTool {
|
|
2197
|
+
name: string;
|
|
2198
|
+
type?: 'custom';
|
|
2199
|
+
}
|
|
2200
|
+
/**
|
|
2201
|
+
* Web search tool configuration for OpenAI response inputs.
|
|
2202
|
+
*/
|
|
2203
|
+
interface OpenAIResponseInputToolWebSearch {
|
|
2204
|
+
search_context_size?: string | null;
|
|
2205
|
+
type?: 'web_search' | 'web_search_preview' | 'web_search_preview_2025_03_11' | 'web_search_2025_08_26';
|
|
2206
|
+
}
|
|
2207
|
+
/**
|
|
2208
|
+
* File search tool configuration for OpenAI response inputs.
|
|
2209
|
+
*/
|
|
2210
|
+
interface OpenAIResponseInputToolFileSearch {
|
|
2211
|
+
vector_store_ids: Array<string>;
|
|
2212
|
+
filters?: {
|
|
2213
|
+
[key: string]: unknown;
|
|
2214
|
+
} | null;
|
|
2215
|
+
max_num_results?: number | null;
|
|
1906
2216
|
/**
|
|
1907
|
-
*
|
|
1908
|
-
*/
|
|
1909
|
-
type: 'mcp_call';
|
|
1910
|
-
/**
|
|
1911
|
-
* (Optional) Error message if the MCP call failed
|
|
2217
|
+
* Options for ranking and filtering search results.
|
|
1912
2218
|
*/
|
|
1913
|
-
|
|
2219
|
+
ranking_options?: OpenAIResponseInputToolFileSearch.RankingOptions | null;
|
|
2220
|
+
type?: 'file_search';
|
|
2221
|
+
}
|
|
2222
|
+
namespace OpenAIResponseInputToolFileSearch {
|
|
1914
2223
|
/**
|
|
1915
|
-
*
|
|
2224
|
+
* Options for ranking and filtering search results.
|
|
1916
2225
|
*/
|
|
1917
|
-
|
|
2226
|
+
interface RankingOptions {
|
|
2227
|
+
ranker?: string | null;
|
|
2228
|
+
score_threshold?: number | null;
|
|
2229
|
+
}
|
|
1918
2230
|
}
|
|
1919
2231
|
/**
|
|
1920
|
-
*
|
|
2232
|
+
* Function tool configuration for OpenAI response inputs.
|
|
1921
2233
|
*/
|
|
1922
|
-
interface
|
|
2234
|
+
interface OpenAIResponseInputToolFunction {
|
|
2235
|
+
name: string;
|
|
2236
|
+
parameters: {
|
|
2237
|
+
[key: string]: unknown;
|
|
2238
|
+
} | null;
|
|
2239
|
+
description?: string | null;
|
|
2240
|
+
strict?: boolean | null;
|
|
2241
|
+
type?: 'function';
|
|
2242
|
+
}
|
|
2243
|
+
/**
|
|
2244
|
+
* Model Context Protocol (MCP) tool configuration for OpenAI response object.
|
|
2245
|
+
*/
|
|
2246
|
+
interface OpenAIResponseToolMcp {
|
|
2247
|
+
server_label: string;
|
|
1923
2248
|
/**
|
|
1924
|
-
*
|
|
2249
|
+
* Filter configuration for restricting which MCP tools can be used.
|
|
1925
2250
|
*/
|
|
1926
|
-
|
|
2251
|
+
allowed_tools?: Array<string> | OpenAIResponseToolMcp.AllowedToolsFilter | null;
|
|
2252
|
+
type?: 'mcp';
|
|
2253
|
+
}
|
|
2254
|
+
namespace OpenAIResponseToolMcp {
|
|
1927
2255
|
/**
|
|
1928
|
-
*
|
|
2256
|
+
* Filter configuration for restricting which MCP tools can be used.
|
|
1929
2257
|
*/
|
|
1930
|
-
|
|
2258
|
+
interface AllowedToolsFilter {
|
|
2259
|
+
tool_names?: Array<string> | null;
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
/**
|
|
2263
|
+
* Usage information for OpenAI response.
|
|
2264
|
+
*/
|
|
2265
|
+
interface Usage {
|
|
2266
|
+
input_tokens: number;
|
|
2267
|
+
output_tokens: number;
|
|
2268
|
+
total_tokens: number;
|
|
1931
2269
|
/**
|
|
1932
|
-
*
|
|
2270
|
+
* Token details for input tokens in OpenAI response usage.
|
|
1933
2271
|
*/
|
|
1934
|
-
|
|
2272
|
+
input_tokens_details?: Usage.InputTokensDetails | null;
|
|
1935
2273
|
/**
|
|
1936
|
-
*
|
|
2274
|
+
* Token details for output tokens in OpenAI response usage.
|
|
1937
2275
|
*/
|
|
1938
|
-
|
|
2276
|
+
output_tokens_details?: Usage.OutputTokensDetails | null;
|
|
1939
2277
|
}
|
|
1940
|
-
namespace
|
|
2278
|
+
namespace Usage {
|
|
1941
2279
|
/**
|
|
1942
|
-
*
|
|
2280
|
+
* Token details for input tokens in OpenAI response usage.
|
|
1943
2281
|
*/
|
|
1944
|
-
interface
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
* Name of the tool
|
|
1953
|
-
*/
|
|
1954
|
-
name: string;
|
|
1955
|
-
/**
|
|
1956
|
-
* (Optional) Description of what the tool does
|
|
1957
|
-
*/
|
|
1958
|
-
description?: string;
|
|
2282
|
+
interface InputTokensDetails {
|
|
2283
|
+
cached_tokens?: number | null;
|
|
2284
|
+
}
|
|
2285
|
+
/**
|
|
2286
|
+
* Token details for output tokens in OpenAI response usage.
|
|
2287
|
+
*/
|
|
2288
|
+
interface OutputTokensDetails {
|
|
2289
|
+
reasoning_tokens?: number | null;
|
|
1959
2290
|
}
|
|
1960
2291
|
}
|
|
2292
|
+
}
|
|
2293
|
+
/**
|
|
2294
|
+
* Response object confirming deletion of an OpenAI response.
|
|
2295
|
+
*/
|
|
2296
|
+
export interface ResponseDeleteResponse {
|
|
2297
|
+
id: string;
|
|
2298
|
+
deleted?: boolean;
|
|
2299
|
+
object?: 'response';
|
|
2300
|
+
}
|
|
2301
|
+
export type ResponseCreateParams = ResponseCreateParamsNonStreaming | ResponseCreateParamsStreaming;
|
|
2302
|
+
export interface ResponseCreateParamsBase {
|
|
2303
|
+
input: string | Array<ResponseCreateParams.OpenAIResponseMessageInput | ResponseCreateParams.OpenAIResponseOutputMessageWebSearchToolCall | ResponseCreateParams.OpenAIResponseOutputMessageFileSearchToolCall | ResponseCreateParams.OpenAIResponseOutputMessageFunctionToolCall | ResponseCreateParams.OpenAIResponseOutputMessageMcpCall | ResponseCreateParams.OpenAIResponseOutputMessageMcpListTools | ResponseCreateParams.OpenAIResponseMcpApprovalRequest | ResponseCreateParams.OpenAIResponseInputFunctionToolCallOutput | ResponseCreateParams.OpenAIResponseMcpApprovalResponse | ResponseCreateParams.OpenAIResponseMessageInput>;
|
|
2304
|
+
model: string;
|
|
2305
|
+
conversation?: string | null;
|
|
2306
|
+
include?: Array<'web_search_call.action.sources' | 'code_interpreter_call.outputs' | 'computer_call_output.output.image_url' | 'file_search_call.results' | 'message.input_image.image_url' | 'message.output_text.logprobs' | 'reasoning.encrypted_content'> | null;
|
|
2307
|
+
instructions?: string | null;
|
|
2308
|
+
max_infer_iters?: number | null;
|
|
2309
|
+
max_tool_calls?: number | null;
|
|
2310
|
+
metadata?: {
|
|
2311
|
+
[key: string]: string;
|
|
2312
|
+
} | null;
|
|
2313
|
+
parallel_tool_calls?: boolean | null;
|
|
2314
|
+
previous_response_id?: string | null;
|
|
2315
|
+
/**
|
|
2316
|
+
* OpenAI compatible Prompt object that is used in OpenAI responses.
|
|
2317
|
+
*/
|
|
2318
|
+
prompt?: ResponseCreateParams.Prompt | null;
|
|
2319
|
+
store?: boolean | null;
|
|
2320
|
+
stream?: boolean | null;
|
|
2321
|
+
temperature?: number | null;
|
|
1961
2322
|
/**
|
|
1962
|
-
* Text
|
|
2323
|
+
* Text response configuration for OpenAI responses.
|
|
1963
2324
|
*/
|
|
1964
|
-
|
|
2325
|
+
text?: ResponseCreateParams.Text | null;
|
|
2326
|
+
/**
|
|
2327
|
+
* Constrains the tools available to the model to a pre-defined set.
|
|
2328
|
+
*/
|
|
2329
|
+
tool_choice?: 'auto' | 'required' | 'none' | ResponseCreateParams.OpenAIResponseInputToolChoiceAllowedTools | ResponseCreateParams.OpenAIResponseInputToolChoiceFileSearch | ResponseCreateParams.OpenAIResponseInputToolChoiceWebSearch | ResponseCreateParams.OpenAIResponseInputToolChoiceFunctionTool | ResponseCreateParams.OpenAIResponseInputToolChoiceMcpTool | ResponseCreateParams.OpenAIResponseInputToolChoiceCustomTool | null;
|
|
2330
|
+
tools?: Array<ResponseCreateParams.OpenAIResponseInputToolWebSearch | ResponseCreateParams.OpenAIResponseInputToolFileSearch | ResponseCreateParams.OpenAIResponseInputToolFunction | ResponseCreateParams.OpenAIResponseInputToolMcp> | null;
|
|
2331
|
+
}
|
|
2332
|
+
export declare namespace ResponseCreateParams {
|
|
2333
|
+
/**
|
|
2334
|
+
* Corresponds to the various Message types in the Responses API. They are all
|
|
2335
|
+
* under one type because the Responses API gives them all the same "type" value,
|
|
2336
|
+
* and there is no way to tell them apart in certain scenarios.
|
|
2337
|
+
*/
|
|
2338
|
+
interface OpenAIResponseMessageInput {
|
|
2339
|
+
content: string | Array<OpenAIResponseMessageInput.OpenAIResponseInputMessageContentText | OpenAIResponseMessageInput.OpenAIResponseInputMessageContentImage | OpenAIResponseMessageInput.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessageInput.OpenAIResponseOutputMessageContentOutputTextInput | OpenAIResponseMessageInput.OpenAIResponseContentPartRefusal>;
|
|
2340
|
+
role: 'system' | 'developer' | 'user' | 'assistant';
|
|
2341
|
+
id?: string | null;
|
|
2342
|
+
status?: string | null;
|
|
2343
|
+
type?: 'message';
|
|
2344
|
+
}
|
|
2345
|
+
namespace OpenAIResponseMessageInput {
|
|
1965
2346
|
/**
|
|
1966
|
-
*
|
|
2347
|
+
* Text content for input messages in OpenAI response format.
|
|
1967
2348
|
*/
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
2349
|
+
interface OpenAIResponseInputMessageContentText {
|
|
2350
|
+
text: string;
|
|
2351
|
+
type?: 'input_text';
|
|
2352
|
+
}
|
|
1971
2353
|
/**
|
|
1972
|
-
*
|
|
2354
|
+
* Image content for input messages in OpenAI response format.
|
|
1973
2355
|
*/
|
|
1974
|
-
interface
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
type
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
2356
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
2357
|
+
detail?: 'low' | 'high' | 'auto';
|
|
2358
|
+
file_id?: string | null;
|
|
2359
|
+
image_url?: string | null;
|
|
2360
|
+
type?: 'input_image';
|
|
2361
|
+
}
|
|
2362
|
+
/**
|
|
2363
|
+
* File content for input messages in OpenAI response format.
|
|
2364
|
+
*/
|
|
2365
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
2366
|
+
file_data?: string | null;
|
|
2367
|
+
file_id?: string | null;
|
|
2368
|
+
file_url?: string | null;
|
|
2369
|
+
filename?: string | null;
|
|
2370
|
+
type?: 'input_file';
|
|
2371
|
+
}
|
|
2372
|
+
interface OpenAIResponseOutputMessageContentOutputTextInput {
|
|
2373
|
+
text: string;
|
|
2374
|
+
annotations?: Array<OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationFilePath>;
|
|
2375
|
+
logprobs?: Array<OpenAIResponseOutputMessageContentOutputTextInput.Logprob> | null;
|
|
2376
|
+
type?: 'output_text';
|
|
2377
|
+
}
|
|
2378
|
+
namespace OpenAIResponseOutputMessageContentOutputTextInput {
|
|
1983
2379
|
/**
|
|
1984
|
-
*
|
|
2380
|
+
* File citation annotation for referencing specific files in response content.
|
|
1985
2381
|
*/
|
|
1986
|
-
|
|
2382
|
+
interface OpenAIResponseAnnotationFileCitation {
|
|
2383
|
+
file_id: string;
|
|
2384
|
+
filename: string;
|
|
2385
|
+
index: number;
|
|
2386
|
+
type?: 'file_citation';
|
|
2387
|
+
}
|
|
1987
2388
|
/**
|
|
1988
|
-
*
|
|
1989
|
-
* `pydantic` model. Only used for json_schema.
|
|
2389
|
+
* URL citation annotation for referencing external web resources.
|
|
1990
2390
|
*/
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
2391
|
+
interface OpenAIResponseAnnotationCitation {
|
|
2392
|
+
end_index: number;
|
|
2393
|
+
start_index: number;
|
|
2394
|
+
title: string;
|
|
2395
|
+
url: string;
|
|
2396
|
+
type?: 'url_citation';
|
|
2397
|
+
}
|
|
2398
|
+
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
2399
|
+
container_id: string;
|
|
2400
|
+
end_index: number;
|
|
2401
|
+
file_id: string;
|
|
2402
|
+
filename: string;
|
|
2403
|
+
start_index: number;
|
|
2404
|
+
type?: 'container_file_citation';
|
|
2405
|
+
}
|
|
2406
|
+
interface OpenAIResponseAnnotationFilePath {
|
|
2407
|
+
file_id: string;
|
|
2408
|
+
index: number;
|
|
2409
|
+
type?: 'file_path';
|
|
2410
|
+
}
|
|
1994
2411
|
/**
|
|
1995
|
-
*
|
|
1996
|
-
*
|
|
1997
|
-
|
|
1998
|
-
|
|
2412
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
2413
|
+
* response.
|
|
2414
|
+
*
|
|
2415
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
2416
|
+
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
2417
|
+
*/
|
|
2418
|
+
interface Logprob {
|
|
2419
|
+
token: string;
|
|
2420
|
+
logprob: number;
|
|
2421
|
+
bytes?: Array<number> | null;
|
|
2422
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
2423
|
+
}
|
|
2424
|
+
namespace Logprob {
|
|
2425
|
+
/**
|
|
2426
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
2427
|
+
* response.
|
|
2428
|
+
*
|
|
2429
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
2430
|
+
* probability of the token
|
|
2431
|
+
*/
|
|
2432
|
+
interface TopLogprob {
|
|
2433
|
+
token: string;
|
|
2434
|
+
logprob: number;
|
|
2435
|
+
bytes?: Array<number> | null;
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
1999
2438
|
}
|
|
2000
|
-
}
|
|
2001
|
-
/**
|
|
2002
|
-
* (Optional) Error details if the response generation failed
|
|
2003
|
-
*/
|
|
2004
|
-
interface Error {
|
|
2005
2439
|
/**
|
|
2006
|
-
*
|
|
2440
|
+
* Refusal content within a streamed response part.
|
|
2007
2441
|
*/
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
message: string;
|
|
2442
|
+
interface OpenAIResponseContentPartRefusal {
|
|
2443
|
+
refusal: string;
|
|
2444
|
+
type?: 'refusal';
|
|
2445
|
+
}
|
|
2013
2446
|
}
|
|
2014
|
-
}
|
|
2015
|
-
/**
|
|
2016
|
-
* Response object confirming deletion of an OpenAI response.
|
|
2017
|
-
*/
|
|
2018
|
-
export interface ResponseDeleteResponse {
|
|
2019
|
-
/**
|
|
2020
|
-
* Unique identifier of the deleted response
|
|
2021
|
-
*/
|
|
2022
|
-
id: string;
|
|
2023
|
-
/**
|
|
2024
|
-
* Deletion confirmation flag, always True
|
|
2025
|
-
*/
|
|
2026
|
-
deleted: boolean;
|
|
2027
|
-
/**
|
|
2028
|
-
* Object type identifier, always "response"
|
|
2029
|
-
*/
|
|
2030
|
-
object: 'response';
|
|
2031
|
-
}
|
|
2032
|
-
export type ResponseCreateParams = ResponseCreateParamsNonStreaming | ResponseCreateParamsStreaming;
|
|
2033
|
-
export interface ResponseCreateParamsBase {
|
|
2034
|
-
/**
|
|
2035
|
-
* Input message(s) to create the response.
|
|
2036
|
-
*/
|
|
2037
|
-
input: string | Array<ResponseCreateParams.OpenAIResponseOutputMessageWebSearchToolCall | ResponseCreateParams.OpenAIResponseOutputMessageFileSearchToolCall | ResponseCreateParams.OpenAIResponseOutputMessageFunctionToolCall | ResponseCreateParams.OpenAIResponseInputFunctionToolCallOutput | ResponseCreateParams.OpenAIResponseMessage>;
|
|
2038
|
-
/**
|
|
2039
|
-
* The underlying LLM used for completions.
|
|
2040
|
-
*/
|
|
2041
|
-
model: string;
|
|
2042
|
-
/**
|
|
2043
|
-
* (Optional) Additional fields to include in the response.
|
|
2044
|
-
*/
|
|
2045
|
-
include?: Array<string>;
|
|
2046
|
-
instructions?: string;
|
|
2047
|
-
max_infer_iters?: number;
|
|
2048
|
-
/**
|
|
2049
|
-
* (Optional) if specified, the new response will be a continuation of the previous
|
|
2050
|
-
* response. This can be used to easily fork-off new responses from existing
|
|
2051
|
-
* responses.
|
|
2052
|
-
*/
|
|
2053
|
-
previous_response_id?: string;
|
|
2054
|
-
store?: boolean;
|
|
2055
|
-
stream?: boolean;
|
|
2056
|
-
temperature?: number;
|
|
2057
|
-
/**
|
|
2058
|
-
* Text response configuration for OpenAI responses.
|
|
2059
|
-
*/
|
|
2060
|
-
text?: ResponseCreateParams.Text;
|
|
2061
|
-
tools?: Array<ResponseCreateParams.OpenAIResponseInputToolWebSearch | ResponseCreateParams.OpenAIResponseInputToolFileSearch | ResponseCreateParams.OpenAIResponseInputToolFunction | ResponseCreateParams.OpenAIResponseInputToolMcp>;
|
|
2062
|
-
}
|
|
2063
|
-
export declare namespace ResponseCreateParams {
|
|
2064
2447
|
/**
|
|
2065
2448
|
* Web search tool call output message for OpenAI responses.
|
|
2066
2449
|
*/
|
|
2067
2450
|
interface OpenAIResponseOutputMessageWebSearchToolCall {
|
|
2068
|
-
/**
|
|
2069
|
-
* Unique identifier for this tool call
|
|
2070
|
-
*/
|
|
2071
2451
|
id: string;
|
|
2072
|
-
/**
|
|
2073
|
-
* Current status of the web search operation
|
|
2074
|
-
*/
|
|
2075
2452
|
status: string;
|
|
2076
|
-
|
|
2077
|
-
* Tool call type identifier, always "web_search_call"
|
|
2078
|
-
*/
|
|
2079
|
-
type: 'web_search_call';
|
|
2453
|
+
type?: 'web_search_call';
|
|
2080
2454
|
}
|
|
2081
2455
|
/**
|
|
2082
2456
|
* File search tool call output message for OpenAI responses.
|
|
2083
2457
|
*/
|
|
2084
2458
|
interface OpenAIResponseOutputMessageFileSearchToolCall {
|
|
2085
|
-
/**
|
|
2086
|
-
* Unique identifier for this tool call
|
|
2087
|
-
*/
|
|
2088
2459
|
id: string;
|
|
2089
|
-
/**
|
|
2090
|
-
* List of search queries executed
|
|
2091
|
-
*/
|
|
2092
2460
|
queries: Array<string>;
|
|
2093
|
-
/**
|
|
2094
|
-
* Current status of the file search operation
|
|
2095
|
-
*/
|
|
2096
2461
|
status: string;
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
*/
|
|
2100
|
-
type: 'file_search_call';
|
|
2101
|
-
/**
|
|
2102
|
-
* (Optional) Search results returned by the file search operation
|
|
2103
|
-
*/
|
|
2104
|
-
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result>;
|
|
2462
|
+
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result> | null;
|
|
2463
|
+
type?: 'file_search_call';
|
|
2105
2464
|
}
|
|
2106
2465
|
namespace OpenAIResponseOutputMessageFileSearchToolCall {
|
|
2107
2466
|
/**
|
|
2108
2467
|
* Search results returned by the file search operation.
|
|
2109
2468
|
*/
|
|
2110
2469
|
interface Result {
|
|
2111
|
-
/**
|
|
2112
|
-
* (Optional) Key-value attributes associated with the file
|
|
2113
|
-
*/
|
|
2114
2470
|
attributes: {
|
|
2115
|
-
[key: string]:
|
|
2471
|
+
[key: string]: unknown;
|
|
2116
2472
|
};
|
|
2117
|
-
/**
|
|
2118
|
-
* Unique identifier of the file containing the result
|
|
2119
|
-
*/
|
|
2120
2473
|
file_id: string;
|
|
2121
|
-
/**
|
|
2122
|
-
* Name of the file containing the result
|
|
2123
|
-
*/
|
|
2124
2474
|
filename: string;
|
|
2125
|
-
/**
|
|
2126
|
-
* Relevance score for this search result (between 0 and 1)
|
|
2127
|
-
*/
|
|
2128
2475
|
score: number;
|
|
2129
|
-
/**
|
|
2130
|
-
* Text content of the search result
|
|
2131
|
-
*/
|
|
2132
2476
|
text: string;
|
|
2133
2477
|
}
|
|
2134
2478
|
}
|
|
@@ -2136,30 +2480,55 @@ export declare namespace ResponseCreateParams {
|
|
|
2136
2480
|
* Function tool call output message for OpenAI responses.
|
|
2137
2481
|
*/
|
|
2138
2482
|
interface OpenAIResponseOutputMessageFunctionToolCall {
|
|
2139
|
-
/**
|
|
2140
|
-
* JSON string containing the function arguments
|
|
2141
|
-
*/
|
|
2142
2483
|
arguments: string;
|
|
2143
|
-
/**
|
|
2144
|
-
* Unique identifier for the function call
|
|
2145
|
-
*/
|
|
2146
2484
|
call_id: string;
|
|
2147
|
-
/**
|
|
2148
|
-
* Name of the function being called
|
|
2149
|
-
*/
|
|
2150
2485
|
name: string;
|
|
2486
|
+
id?: string | null;
|
|
2487
|
+
status?: string | null;
|
|
2488
|
+
type?: 'function_call';
|
|
2489
|
+
}
|
|
2490
|
+
/**
|
|
2491
|
+
* Model Context Protocol (MCP) call output message for OpenAI responses.
|
|
2492
|
+
*/
|
|
2493
|
+
interface OpenAIResponseOutputMessageMcpCall {
|
|
2494
|
+
id: string;
|
|
2495
|
+
arguments: string;
|
|
2496
|
+
name: string;
|
|
2497
|
+
server_label: string;
|
|
2498
|
+
error?: string | null;
|
|
2499
|
+
output?: string | null;
|
|
2500
|
+
type?: 'mcp_call';
|
|
2501
|
+
}
|
|
2502
|
+
/**
|
|
2503
|
+
* MCP list tools output message containing available tools from an MCP server.
|
|
2504
|
+
*/
|
|
2505
|
+
interface OpenAIResponseOutputMessageMcpListTools {
|
|
2506
|
+
id: string;
|
|
2507
|
+
server_label: string;
|
|
2508
|
+
tools: Array<OpenAIResponseOutputMessageMcpListTools.Tool>;
|
|
2509
|
+
type?: 'mcp_list_tools';
|
|
2510
|
+
}
|
|
2511
|
+
namespace OpenAIResponseOutputMessageMcpListTools {
|
|
2151
2512
|
/**
|
|
2152
|
-
* Tool
|
|
2153
|
-
*/
|
|
2154
|
-
type: 'function_call';
|
|
2155
|
-
/**
|
|
2156
|
-
* (Optional) Additional identifier for the tool call
|
|
2157
|
-
*/
|
|
2158
|
-
id?: string;
|
|
2159
|
-
/**
|
|
2160
|
-
* (Optional) Current status of the function call execution
|
|
2513
|
+
* Tool definition returned by MCP list tools operation.
|
|
2161
2514
|
*/
|
|
2162
|
-
|
|
2515
|
+
interface Tool {
|
|
2516
|
+
input_schema: {
|
|
2517
|
+
[key: string]: unknown;
|
|
2518
|
+
};
|
|
2519
|
+
name: string;
|
|
2520
|
+
description?: string | null;
|
|
2521
|
+
}
|
|
2522
|
+
}
|
|
2523
|
+
/**
|
|
2524
|
+
* A request for human approval of a tool invocation.
|
|
2525
|
+
*/
|
|
2526
|
+
interface OpenAIResponseMcpApprovalRequest {
|
|
2527
|
+
id: string;
|
|
2528
|
+
arguments: string;
|
|
2529
|
+
name: string;
|
|
2530
|
+
server_label: string;
|
|
2531
|
+
type?: 'mcp_approval_request';
|
|
2163
2532
|
}
|
|
2164
2533
|
/**
|
|
2165
2534
|
* This represents the output of a function call that gets passed back to the
|
|
@@ -2168,104 +2537,84 @@ export declare namespace ResponseCreateParams {
|
|
|
2168
2537
|
interface OpenAIResponseInputFunctionToolCallOutput {
|
|
2169
2538
|
call_id: string;
|
|
2170
2539
|
output: string;
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2540
|
+
id?: string | null;
|
|
2541
|
+
status?: string | null;
|
|
2542
|
+
type?: 'function_call_output';
|
|
2543
|
+
}
|
|
2544
|
+
/**
|
|
2545
|
+
* A response to an MCP approval request.
|
|
2546
|
+
*/
|
|
2547
|
+
interface OpenAIResponseMcpApprovalResponse {
|
|
2548
|
+
approval_request_id: string;
|
|
2549
|
+
approve: boolean;
|
|
2550
|
+
id?: string | null;
|
|
2551
|
+
reason?: string | null;
|
|
2552
|
+
type?: 'mcp_approval_response';
|
|
2174
2553
|
}
|
|
2175
2554
|
/**
|
|
2176
2555
|
* Corresponds to the various Message types in the Responses API. They are all
|
|
2177
2556
|
* under one type because the Responses API gives them all the same "type" value,
|
|
2178
2557
|
* and there is no way to tell them apart in certain scenarios.
|
|
2179
2558
|
*/
|
|
2180
|
-
interface
|
|
2181
|
-
content: string | Array<
|
|
2559
|
+
interface OpenAIResponseMessageInput {
|
|
2560
|
+
content: string | Array<OpenAIResponseMessageInput.OpenAIResponseInputMessageContentText | OpenAIResponseMessageInput.OpenAIResponseInputMessageContentImage | OpenAIResponseMessageInput.OpenAIResponseInputMessageContentFile> | Array<OpenAIResponseMessageInput.OpenAIResponseOutputMessageContentOutputTextInput | OpenAIResponseMessageInput.OpenAIResponseContentPartRefusal>;
|
|
2182
2561
|
role: 'system' | 'developer' | 'user' | 'assistant';
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2562
|
+
id?: string | null;
|
|
2563
|
+
status?: string | null;
|
|
2564
|
+
type?: 'message';
|
|
2186
2565
|
}
|
|
2187
|
-
namespace
|
|
2566
|
+
namespace OpenAIResponseMessageInput {
|
|
2188
2567
|
/**
|
|
2189
2568
|
* Text content for input messages in OpenAI response format.
|
|
2190
2569
|
*/
|
|
2191
2570
|
interface OpenAIResponseInputMessageContentText {
|
|
2192
|
-
/**
|
|
2193
|
-
* The text content of the input message
|
|
2194
|
-
*/
|
|
2195
2571
|
text: string;
|
|
2196
|
-
|
|
2197
|
-
* Content type identifier, always "input_text"
|
|
2198
|
-
*/
|
|
2199
|
-
type: 'input_text';
|
|
2572
|
+
type?: 'input_text';
|
|
2200
2573
|
}
|
|
2201
2574
|
/**
|
|
2202
2575
|
* Image content for input messages in OpenAI response format.
|
|
2203
2576
|
*/
|
|
2204
2577
|
interface OpenAIResponseInputMessageContentImage {
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2578
|
+
detail?: 'low' | 'high' | 'auto';
|
|
2579
|
+
file_id?: string | null;
|
|
2580
|
+
image_url?: string | null;
|
|
2581
|
+
type?: 'input_image';
|
|
2582
|
+
}
|
|
2583
|
+
/**
|
|
2584
|
+
* File content for input messages in OpenAI response format.
|
|
2585
|
+
*/
|
|
2586
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
2587
|
+
file_data?: string | null;
|
|
2588
|
+
file_id?: string | null;
|
|
2589
|
+
file_url?: string | null;
|
|
2590
|
+
filename?: string | null;
|
|
2591
|
+
type?: 'input_file';
|
|
2217
2592
|
}
|
|
2218
|
-
interface
|
|
2219
|
-
annotations: Array<UnionMember2.OpenAIResponseAnnotationFileCitation | UnionMember2.OpenAIResponseAnnotationCitation | UnionMember2.OpenAIResponseAnnotationContainerFileCitation | UnionMember2.OpenAIResponseAnnotationFilePath>;
|
|
2593
|
+
interface OpenAIResponseOutputMessageContentOutputTextInput {
|
|
2220
2594
|
text: string;
|
|
2221
|
-
|
|
2595
|
+
annotations?: Array<OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationFileCitation | OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationCitation | OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationContainerFileCitation | OpenAIResponseOutputMessageContentOutputTextInput.OpenAIResponseAnnotationFilePath>;
|
|
2596
|
+
logprobs?: Array<OpenAIResponseOutputMessageContentOutputTextInput.Logprob> | null;
|
|
2597
|
+
type?: 'output_text';
|
|
2222
2598
|
}
|
|
2223
|
-
namespace
|
|
2599
|
+
namespace OpenAIResponseOutputMessageContentOutputTextInput {
|
|
2224
2600
|
/**
|
|
2225
2601
|
* File citation annotation for referencing specific files in response content.
|
|
2226
2602
|
*/
|
|
2227
2603
|
interface OpenAIResponseAnnotationFileCitation {
|
|
2228
|
-
/**
|
|
2229
|
-
* Unique identifier of the referenced file
|
|
2230
|
-
*/
|
|
2231
2604
|
file_id: string;
|
|
2232
|
-
/**
|
|
2233
|
-
* Name of the referenced file
|
|
2234
|
-
*/
|
|
2235
2605
|
filename: string;
|
|
2236
|
-
/**
|
|
2237
|
-
* Position index of the citation within the content
|
|
2238
|
-
*/
|
|
2239
2606
|
index: number;
|
|
2240
|
-
|
|
2241
|
-
* Annotation type identifier, always "file_citation"
|
|
2242
|
-
*/
|
|
2243
|
-
type: 'file_citation';
|
|
2607
|
+
type?: 'file_citation';
|
|
2244
2608
|
}
|
|
2245
2609
|
/**
|
|
2246
2610
|
* URL citation annotation for referencing external web resources.
|
|
2247
2611
|
*/
|
|
2248
2612
|
interface OpenAIResponseAnnotationCitation {
|
|
2249
|
-
/**
|
|
2250
|
-
* End position of the citation span in the content
|
|
2251
|
-
*/
|
|
2252
2613
|
end_index: number;
|
|
2253
|
-
/**
|
|
2254
|
-
* Start position of the citation span in the content
|
|
2255
|
-
*/
|
|
2256
2614
|
start_index: number;
|
|
2257
|
-
/**
|
|
2258
|
-
* Title of the referenced web resource
|
|
2259
|
-
*/
|
|
2260
2615
|
title: string;
|
|
2261
|
-
/**
|
|
2262
|
-
* Annotation type identifier, always "url_citation"
|
|
2263
|
-
*/
|
|
2264
|
-
type: 'url_citation';
|
|
2265
|
-
/**
|
|
2266
|
-
* URL of the referenced web resource
|
|
2267
|
-
*/
|
|
2268
2616
|
url: string;
|
|
2617
|
+
type?: 'url_citation';
|
|
2269
2618
|
}
|
|
2270
2619
|
interface OpenAIResponseAnnotationContainerFileCitation {
|
|
2271
2620
|
container_id: string;
|
|
@@ -2273,13 +2622,85 @@ export declare namespace ResponseCreateParams {
|
|
|
2273
2622
|
file_id: string;
|
|
2274
2623
|
filename: string;
|
|
2275
2624
|
start_index: number;
|
|
2276
|
-
type
|
|
2625
|
+
type?: 'container_file_citation';
|
|
2277
2626
|
}
|
|
2278
2627
|
interface OpenAIResponseAnnotationFilePath {
|
|
2279
2628
|
file_id: string;
|
|
2280
2629
|
index: number;
|
|
2281
|
-
type
|
|
2630
|
+
type?: 'file_path';
|
|
2631
|
+
}
|
|
2632
|
+
/**
|
|
2633
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
2634
|
+
* response.
|
|
2635
|
+
*
|
|
2636
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
2637
|
+
* probability of the token :top_logprobs: The top log probabilities for the token
|
|
2638
|
+
*/
|
|
2639
|
+
interface Logprob {
|
|
2640
|
+
token: string;
|
|
2641
|
+
logprob: number;
|
|
2642
|
+
bytes?: Array<number> | null;
|
|
2643
|
+
top_logprobs?: Array<Logprob.TopLogprob> | null;
|
|
2282
2644
|
}
|
|
2645
|
+
namespace Logprob {
|
|
2646
|
+
/**
|
|
2647
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
2648
|
+
* response.
|
|
2649
|
+
*
|
|
2650
|
+
* :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
|
|
2651
|
+
* probability of the token
|
|
2652
|
+
*/
|
|
2653
|
+
interface TopLogprob {
|
|
2654
|
+
token: string;
|
|
2655
|
+
logprob: number;
|
|
2656
|
+
bytes?: Array<number> | null;
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
/**
|
|
2661
|
+
* Refusal content within a streamed response part.
|
|
2662
|
+
*/
|
|
2663
|
+
interface OpenAIResponseContentPartRefusal {
|
|
2664
|
+
refusal: string;
|
|
2665
|
+
type?: 'refusal';
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
/**
|
|
2669
|
+
* OpenAI compatible Prompt object that is used in OpenAI responses.
|
|
2670
|
+
*/
|
|
2671
|
+
interface Prompt {
|
|
2672
|
+
id: string;
|
|
2673
|
+
variables?: {
|
|
2674
|
+
[key: string]: Prompt.OpenAIResponseInputMessageContentText | Prompt.OpenAIResponseInputMessageContentImage | Prompt.OpenAIResponseInputMessageContentFile;
|
|
2675
|
+
} | null;
|
|
2676
|
+
version?: string | null;
|
|
2677
|
+
}
|
|
2678
|
+
namespace Prompt {
|
|
2679
|
+
/**
|
|
2680
|
+
* Text content for input messages in OpenAI response format.
|
|
2681
|
+
*/
|
|
2682
|
+
interface OpenAIResponseInputMessageContentText {
|
|
2683
|
+
text: string;
|
|
2684
|
+
type?: 'input_text';
|
|
2685
|
+
}
|
|
2686
|
+
/**
|
|
2687
|
+
* Image content for input messages in OpenAI response format.
|
|
2688
|
+
*/
|
|
2689
|
+
interface OpenAIResponseInputMessageContentImage {
|
|
2690
|
+
detail?: 'low' | 'high' | 'auto';
|
|
2691
|
+
file_id?: string | null;
|
|
2692
|
+
image_url?: string | null;
|
|
2693
|
+
type?: 'input_image';
|
|
2694
|
+
}
|
|
2695
|
+
/**
|
|
2696
|
+
* File content for input messages in OpenAI response format.
|
|
2697
|
+
*/
|
|
2698
|
+
interface OpenAIResponseInputMessageContentFile {
|
|
2699
|
+
file_data?: string | null;
|
|
2700
|
+
file_id?: string | null;
|
|
2701
|
+
file_url?: string | null;
|
|
2702
|
+
filename?: string | null;
|
|
2703
|
+
type?: 'input_file';
|
|
2283
2704
|
}
|
|
2284
2705
|
}
|
|
2285
2706
|
/**
|
|
@@ -2287,196 +2708,161 @@ export declare namespace ResponseCreateParams {
|
|
|
2287
2708
|
*/
|
|
2288
2709
|
interface Text {
|
|
2289
2710
|
/**
|
|
2290
|
-
*
|
|
2711
|
+
* Configuration for Responses API text format.
|
|
2291
2712
|
*/
|
|
2292
|
-
format?: Text.Format;
|
|
2713
|
+
format?: Text.Format | null;
|
|
2293
2714
|
}
|
|
2294
2715
|
namespace Text {
|
|
2295
2716
|
/**
|
|
2296
|
-
*
|
|
2717
|
+
* Configuration for Responses API text format.
|
|
2297
2718
|
*/
|
|
2298
2719
|
interface Format {
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
*/
|
|
2302
|
-
type: 'text' | 'json_schema' | 'json_object';
|
|
2303
|
-
/**
|
|
2304
|
-
* (Optional) A description of the response format. Only used for json_schema.
|
|
2305
|
-
*/
|
|
2306
|
-
description?: string;
|
|
2307
|
-
/**
|
|
2308
|
-
* The name of the response format. Only used for json_schema.
|
|
2309
|
-
*/
|
|
2310
|
-
name?: string;
|
|
2311
|
-
/**
|
|
2312
|
-
* The JSON schema the response should conform to. In a Python SDK, this is often a
|
|
2313
|
-
* `pydantic` model. Only used for json_schema.
|
|
2314
|
-
*/
|
|
2720
|
+
description?: string | null;
|
|
2721
|
+
name?: string | null;
|
|
2315
2722
|
schema?: {
|
|
2316
|
-
[key: string]:
|
|
2317
|
-
};
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
* must match the schema exactly. Only used for json_schema.
|
|
2321
|
-
*/
|
|
2322
|
-
strict?: boolean;
|
|
2723
|
+
[key: string]: unknown;
|
|
2724
|
+
} | null;
|
|
2725
|
+
strict?: boolean | null;
|
|
2726
|
+
type?: 'text' | 'json_schema' | 'json_object';
|
|
2323
2727
|
}
|
|
2324
2728
|
}
|
|
2729
|
+
/**
|
|
2730
|
+
* Constrains the tools available to the model to a pre-defined set.
|
|
2731
|
+
*/
|
|
2732
|
+
interface OpenAIResponseInputToolChoiceAllowedTools {
|
|
2733
|
+
tools: Array<{
|
|
2734
|
+
[key: string]: string;
|
|
2735
|
+
}>;
|
|
2736
|
+
mode?: 'auto' | 'required';
|
|
2737
|
+
type?: 'allowed_tools';
|
|
2738
|
+
}
|
|
2739
|
+
/**
|
|
2740
|
+
* Indicates that the model should use file search to generate a response.
|
|
2741
|
+
*/
|
|
2742
|
+
interface OpenAIResponseInputToolChoiceFileSearch {
|
|
2743
|
+
type?: 'file_search';
|
|
2744
|
+
}
|
|
2745
|
+
/**
|
|
2746
|
+
* Indicates that the model should use web search to generate a response
|
|
2747
|
+
*/
|
|
2748
|
+
interface OpenAIResponseInputToolChoiceWebSearch {
|
|
2749
|
+
type?: 'web_search' | 'web_search_preview' | 'web_search_preview_2025_03_11' | 'web_search_2025_08_26';
|
|
2750
|
+
}
|
|
2751
|
+
/**
|
|
2752
|
+
* Forces the model to call a specific function.
|
|
2753
|
+
*/
|
|
2754
|
+
interface OpenAIResponseInputToolChoiceFunctionTool {
|
|
2755
|
+
name: string;
|
|
2756
|
+
type?: 'function';
|
|
2757
|
+
}
|
|
2758
|
+
/**
|
|
2759
|
+
* Forces the model to call a specific tool on a remote MCP server
|
|
2760
|
+
*/
|
|
2761
|
+
interface OpenAIResponseInputToolChoiceMcpTool {
|
|
2762
|
+
server_label: string;
|
|
2763
|
+
name?: string | null;
|
|
2764
|
+
type?: 'mcp';
|
|
2765
|
+
}
|
|
2766
|
+
/**
|
|
2767
|
+
* Forces the model to call a custom tool.
|
|
2768
|
+
*/
|
|
2769
|
+
interface OpenAIResponseInputToolChoiceCustomTool {
|
|
2770
|
+
name: string;
|
|
2771
|
+
type?: 'custom';
|
|
2772
|
+
}
|
|
2325
2773
|
/**
|
|
2326
2774
|
* Web search tool configuration for OpenAI response inputs.
|
|
2327
2775
|
*/
|
|
2328
2776
|
interface OpenAIResponseInputToolWebSearch {
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
*/
|
|
2332
|
-
type: 'web_search' | 'web_search_preview' | 'web_search_preview_2025_03_11';
|
|
2333
|
-
/**
|
|
2334
|
-
* (Optional) Size of search context, must be "low", "medium", or "high"
|
|
2335
|
-
*/
|
|
2336
|
-
search_context_size?: string;
|
|
2777
|
+
search_context_size?: string | null;
|
|
2778
|
+
type?: 'web_search' | 'web_search_preview' | 'web_search_preview_2025_03_11' | 'web_search_2025_08_26';
|
|
2337
2779
|
}
|
|
2338
2780
|
/**
|
|
2339
2781
|
* File search tool configuration for OpenAI response inputs.
|
|
2340
2782
|
*/
|
|
2341
2783
|
interface OpenAIResponseInputToolFileSearch {
|
|
2342
|
-
/**
|
|
2343
|
-
* Tool type identifier, always "file_search"
|
|
2344
|
-
*/
|
|
2345
|
-
type: 'file_search';
|
|
2346
|
-
/**
|
|
2347
|
-
* List of vector store identifiers to search within
|
|
2348
|
-
*/
|
|
2349
2784
|
vector_store_ids: Array<string>;
|
|
2350
|
-
/**
|
|
2351
|
-
* (Optional) Additional filters to apply to the search
|
|
2352
|
-
*/
|
|
2353
2785
|
filters?: {
|
|
2354
|
-
[key: string]:
|
|
2355
|
-
};
|
|
2786
|
+
[key: string]: unknown;
|
|
2787
|
+
} | null;
|
|
2788
|
+
max_num_results?: number | null;
|
|
2356
2789
|
/**
|
|
2357
|
-
*
|
|
2790
|
+
* Options for ranking and filtering search results.
|
|
2358
2791
|
*/
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
* (Optional) Options for ranking and scoring search results
|
|
2362
|
-
*/
|
|
2363
|
-
ranking_options?: OpenAIResponseInputToolFileSearch.RankingOptions;
|
|
2792
|
+
ranking_options?: OpenAIResponseInputToolFileSearch.RankingOptions | null;
|
|
2793
|
+
type?: 'file_search';
|
|
2364
2794
|
}
|
|
2365
2795
|
namespace OpenAIResponseInputToolFileSearch {
|
|
2366
2796
|
/**
|
|
2367
|
-
*
|
|
2797
|
+
* Options for ranking and filtering search results.
|
|
2368
2798
|
*/
|
|
2369
2799
|
interface RankingOptions {
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
*/
|
|
2373
|
-
ranker?: string;
|
|
2374
|
-
/**
|
|
2375
|
-
* (Optional) Minimum relevance score threshold for results
|
|
2376
|
-
*/
|
|
2377
|
-
score_threshold?: number;
|
|
2800
|
+
ranker?: string | null;
|
|
2801
|
+
score_threshold?: number | null;
|
|
2378
2802
|
}
|
|
2379
2803
|
}
|
|
2380
2804
|
/**
|
|
2381
2805
|
* Function tool configuration for OpenAI response inputs.
|
|
2382
2806
|
*/
|
|
2383
2807
|
interface OpenAIResponseInputToolFunction {
|
|
2384
|
-
/**
|
|
2385
|
-
* Name of the function that can be called
|
|
2386
|
-
*/
|
|
2387
2808
|
name: string;
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
*/
|
|
2395
|
-
description?: string;
|
|
2396
|
-
/**
|
|
2397
|
-
* (Optional) JSON schema defining the function's parameters
|
|
2398
|
-
*/
|
|
2399
|
-
parameters?: {
|
|
2400
|
-
[key: string]: boolean | number | string | Array<unknown> | unknown | null;
|
|
2401
|
-
};
|
|
2402
|
-
/**
|
|
2403
|
-
* (Optional) Whether to enforce strict parameter validation
|
|
2404
|
-
*/
|
|
2405
|
-
strict?: boolean;
|
|
2809
|
+
parameters: {
|
|
2810
|
+
[key: string]: unknown;
|
|
2811
|
+
} | null;
|
|
2812
|
+
description?: string | null;
|
|
2813
|
+
strict?: boolean | null;
|
|
2814
|
+
type?: 'function';
|
|
2406
2815
|
}
|
|
2407
2816
|
/**
|
|
2408
2817
|
* Model Context Protocol (MCP) tool configuration for OpenAI response inputs.
|
|
2409
2818
|
*/
|
|
2410
2819
|
interface OpenAIResponseInputToolMcp {
|
|
2411
|
-
/**
|
|
2412
|
-
* Approval requirement for tool calls ("always", "never", or filter)
|
|
2413
|
-
*/
|
|
2414
|
-
require_approval: 'always' | 'never' | OpenAIResponseInputToolMcp.ApprovalFilter;
|
|
2415
|
-
/**
|
|
2416
|
-
* Label to identify this MCP server
|
|
2417
|
-
*/
|
|
2418
2820
|
server_label: string;
|
|
2419
|
-
/**
|
|
2420
|
-
* URL endpoint of the MCP server
|
|
2421
|
-
*/
|
|
2422
2821
|
server_url: string;
|
|
2423
2822
|
/**
|
|
2424
|
-
*
|
|
2425
|
-
*/
|
|
2426
|
-
type: 'mcp';
|
|
2427
|
-
/**
|
|
2428
|
-
* (Optional) Restriction on which tools can be used from this server
|
|
2823
|
+
* Filter configuration for restricting which MCP tools can be used.
|
|
2429
2824
|
*/
|
|
2430
|
-
allowed_tools?: Array<string> | OpenAIResponseInputToolMcp.AllowedToolsFilter;
|
|
2825
|
+
allowed_tools?: Array<string> | OpenAIResponseInputToolMcp.AllowedToolsFilter | null;
|
|
2826
|
+
authorization?: string | null;
|
|
2827
|
+
headers?: {
|
|
2828
|
+
[key: string]: unknown;
|
|
2829
|
+
} | null;
|
|
2431
2830
|
/**
|
|
2432
|
-
*
|
|
2831
|
+
* Filter configuration for MCP tool approval requirements.
|
|
2433
2832
|
*/
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
};
|
|
2833
|
+
require_approval?: 'always' | 'never' | OpenAIResponseInputToolMcp.ApprovalFilter;
|
|
2834
|
+
type?: 'mcp';
|
|
2437
2835
|
}
|
|
2438
2836
|
namespace OpenAIResponseInputToolMcp {
|
|
2439
2837
|
/**
|
|
2440
|
-
* Filter configuration for MCP
|
|
2838
|
+
* Filter configuration for restricting which MCP tools can be used.
|
|
2441
2839
|
*/
|
|
2442
|
-
interface
|
|
2443
|
-
|
|
2444
|
-
* (Optional) List of tool names that always require approval
|
|
2445
|
-
*/
|
|
2446
|
-
always?: Array<string>;
|
|
2447
|
-
/**
|
|
2448
|
-
* (Optional) List of tool names that never require approval
|
|
2449
|
-
*/
|
|
2450
|
-
never?: Array<string>;
|
|
2840
|
+
interface AllowedToolsFilter {
|
|
2841
|
+
tool_names?: Array<string> | null;
|
|
2451
2842
|
}
|
|
2452
2843
|
/**
|
|
2453
|
-
* Filter configuration for
|
|
2844
|
+
* Filter configuration for MCP tool approval requirements.
|
|
2454
2845
|
*/
|
|
2455
|
-
interface
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
*/
|
|
2459
|
-
tool_names?: Array<string>;
|
|
2846
|
+
interface ApprovalFilter {
|
|
2847
|
+
always?: Array<string> | null;
|
|
2848
|
+
never?: Array<string> | null;
|
|
2460
2849
|
}
|
|
2461
2850
|
}
|
|
2462
2851
|
type ResponseCreateParamsNonStreaming = ResponsesAPI.ResponseCreateParamsNonStreaming;
|
|
2463
2852
|
type ResponseCreateParamsStreaming = ResponsesAPI.ResponseCreateParamsStreaming;
|
|
2464
2853
|
}
|
|
2465
2854
|
export interface ResponseCreateParamsNonStreaming extends ResponseCreateParamsBase {
|
|
2466
|
-
stream?: false;
|
|
2855
|
+
stream?: false | null;
|
|
2467
2856
|
}
|
|
2468
2857
|
export interface ResponseCreateParamsStreaming extends ResponseCreateParamsBase {
|
|
2469
2858
|
stream: true;
|
|
2470
2859
|
}
|
|
2471
2860
|
export interface ResponseListParams extends OpenAICursorPageParams {
|
|
2861
|
+
model?: string | null;
|
|
2472
2862
|
/**
|
|
2473
|
-
*
|
|
2474
|
-
*/
|
|
2475
|
-
model?: string;
|
|
2476
|
-
/**
|
|
2477
|
-
* The order to sort responses by when sorted by created_at ('asc' or 'desc').
|
|
2863
|
+
* Sort order for paginated responses.
|
|
2478
2864
|
*/
|
|
2479
|
-
order?: 'asc' | 'desc';
|
|
2865
|
+
order?: 'asc' | 'desc' | null;
|
|
2480
2866
|
}
|
|
2481
2867
|
export declare namespace Responses {
|
|
2482
2868
|
export { type ResponseObject as ResponseObject, type ResponseObjectStream as ResponseObjectStream, type ResponseListResponse as ResponseListResponse, type ResponseDeleteResponse as ResponseDeleteResponse, ResponseListResponsesOpenAICursorPage as ResponseListResponsesOpenAICursorPage, type ResponseCreateParams as ResponseCreateParams, type ResponseCreateParamsNonStreaming as ResponseCreateParamsNonStreaming, type ResponseCreateParamsStreaming as ResponseCreateParamsStreaming, type ResponseListParams as ResponseListParams, };
|