@superinterface/react 5.1.3 → 5.2.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (413) hide show
  1. package/dist/index.d.cts +5 -5
  2. package/dist/index.d.ts +5 -5
  3. package/dist/server.d.cts +1 -1
  4. package/dist/server.d.ts +1 -1
  5. package/package.json +8 -6
  6. package/types/index.d.ts +4 -0
  7. package/types/node_modules/openai/LICENSE +201 -0
  8. package/types/node_modules/openai/_vendor/partial-json-parser/parser.d.mts +7 -0
  9. package/types/node_modules/openai/_vendor/partial-json-parser/parser.d.ts +7 -0
  10. package/types/node_modules/openai/_vendor/zod-to-json-schema/Options.d.mts +32 -0
  11. package/types/node_modules/openai/_vendor/zod-to-json-schema/Options.d.ts +32 -0
  12. package/types/node_modules/openai/_vendor/zod-to-json-schema/Refs.d.mts +21 -0
  13. package/types/node_modules/openai/_vendor/zod-to-json-schema/Refs.d.ts +21 -0
  14. package/types/node_modules/openai/_vendor/zod-to-json-schema/errorMessages.d.mts +12 -0
  15. package/types/node_modules/openai/_vendor/zod-to-json-schema/errorMessages.d.ts +12 -0
  16. package/types/node_modules/openai/_vendor/zod-to-json-schema/index.d.mts +38 -0
  17. package/types/node_modules/openai/_vendor/zod-to-json-schema/index.d.ts +38 -0
  18. package/types/node_modules/openai/_vendor/zod-to-json-schema/parseDef.d.mts +38 -0
  19. package/types/node_modules/openai/_vendor/zod-to-json-schema/parseDef.d.ts +38 -0
  20. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/any.d.mts +3 -0
  21. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/any.d.ts +3 -0
  22. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/array.d.mts +13 -0
  23. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/array.d.ts +13 -0
  24. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/bigint.d.mts +15 -0
  25. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/bigint.d.ts +15 -0
  26. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/boolean.d.mts +5 -0
  27. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/boolean.d.ts +5 -0
  28. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/branded.d.mts +4 -0
  29. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/branded.d.ts +4 -0
  30. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/catch.d.mts +4 -0
  31. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/catch.d.ts +4 -0
  32. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/date.d.mts +16 -0
  33. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/date.d.ts +16 -0
  34. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/default.d.mts +7 -0
  35. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/default.d.ts +7 -0
  36. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/effects.d.mts +5 -0
  37. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/effects.d.ts +5 -0
  38. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/enum.d.mts +7 -0
  39. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/enum.d.ts +7 -0
  40. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/intersection.d.mts +9 -0
  41. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/intersection.d.ts +9 -0
  42. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/literal.d.mts +10 -0
  43. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/literal.d.ts +10 -0
  44. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/map.d.mts +16 -0
  45. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/map.d.ts +16 -0
  46. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/nativeEnum.d.mts +7 -0
  47. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/nativeEnum.d.ts +7 -0
  48. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/never.d.mts +5 -0
  49. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/never.d.ts +5 -0
  50. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/null.d.mts +6 -0
  51. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/null.d.ts +6 -0
  52. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/nullable.d.mts +11 -0
  53. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/nullable.d.ts +11 -0
  54. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/number.d.mts +14 -0
  55. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/number.d.ts +14 -0
  56. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/object.d.mts +11 -0
  57. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/object.d.ts +11 -0
  58. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/optional.d.mts +5 -0
  59. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/optional.d.ts +5 -0
  60. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/pipeline.d.mts +6 -0
  61. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/pipeline.d.ts +6 -0
  62. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/promise.d.mts +5 -0
  63. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/promise.d.ts +5 -0
  64. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/readonly.d.mts +4 -0
  65. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/readonly.d.ts +4 -0
  66. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/record.d.mts +14 -0
  67. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/record.d.ts +14 -0
  68. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/set.d.mts +14 -0
  69. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/set.d.ts +14 -0
  70. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/string.d.mts +70 -0
  71. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/string.d.ts +70 -0
  72. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/tuple.d.mts +14 -0
  73. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/tuple.d.ts +14 -0
  74. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/undefined.d.mts +5 -0
  75. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/undefined.d.ts +5 -0
  76. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/union.d.mts +24 -0
  77. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/union.d.ts +24 -0
  78. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/unknown.d.mts +3 -0
  79. package/types/node_modules/openai/_vendor/zod-to-json-schema/parsers/unknown.d.ts +3 -0
  80. package/types/node_modules/openai/_vendor/zod-to-json-schema/util.d.mts +4 -0
  81. package/types/node_modules/openai/_vendor/zod-to-json-schema/util.d.ts +4 -0
  82. package/types/node_modules/openai/_vendor/zod-to-json-schema/zodToJsonSchema.d.mts +11 -0
  83. package/types/node_modules/openai/_vendor/zod-to-json-schema/zodToJsonSchema.d.ts +11 -0
  84. package/types/node_modules/openai/api-promise.d.mts +2 -0
  85. package/types/node_modules/openai/api-promise.d.ts +2 -0
  86. package/types/node_modules/openai/azure.d.mts +63 -0
  87. package/types/node_modules/openai/azure.d.ts +63 -0
  88. package/types/node_modules/openai/beta/realtime/index.d.mts +2 -0
  89. package/types/node_modules/openai/beta/realtime/index.d.ts +2 -0
  90. package/types/node_modules/openai/beta/realtime/internal-base.d.mts +45 -0
  91. package/types/node_modules/openai/beta/realtime/internal-base.d.ts +45 -0
  92. package/types/node_modules/openai/beta/realtime/websocket.d.mts +36 -0
  93. package/types/node_modules/openai/beta/realtime/websocket.d.ts +36 -0
  94. package/types/node_modules/openai/beta/realtime/ws.d.mts +27 -0
  95. package/types/node_modules/openai/beta/realtime/ws.d.ts +27 -0
  96. package/types/node_modules/openai/client.d.mts +297 -0
  97. package/types/node_modules/openai/client.d.ts +297 -0
  98. package/types/node_modules/openai/core/api-promise.d.mts +49 -0
  99. package/types/node_modules/openai/core/api-promise.d.ts +49 -0
  100. package/types/node_modules/openai/core/error.d.mts +59 -0
  101. package/types/node_modules/openai/core/error.d.ts +59 -0
  102. package/types/node_modules/openai/core/pagination.d.mts +89 -0
  103. package/types/node_modules/openai/core/pagination.d.ts +89 -0
  104. package/types/node_modules/openai/core/resource.d.mts +6 -0
  105. package/types/node_modules/openai/core/resource.d.ts +6 -0
  106. package/types/node_modules/openai/core/streaming.d.mts +33 -0
  107. package/types/node_modules/openai/core/streaming.d.ts +33 -0
  108. package/types/node_modules/openai/core/uploads.d.mts +3 -0
  109. package/types/node_modules/openai/core/uploads.d.ts +3 -0
  110. package/types/node_modules/openai/error.d.mts +2 -0
  111. package/types/node_modules/openai/error.d.ts +2 -0
  112. package/types/node_modules/openai/helpers/audio.d.mts +9 -0
  113. package/types/node_modules/openai/helpers/audio.d.ts +9 -0
  114. package/types/node_modules/openai/helpers/zod.d.mts +70 -0
  115. package/types/node_modules/openai/helpers/zod.d.ts +70 -0
  116. package/types/node_modules/openai/index.d.mts +8 -0
  117. package/types/node_modules/openai/index.d.ts +8 -0
  118. package/types/node_modules/openai/internal/builtin-types.d.mts +73 -0
  119. package/types/node_modules/openai/internal/builtin-types.d.ts +73 -0
  120. package/types/node_modules/openai/internal/decoders/line.d.mts +17 -0
  121. package/types/node_modules/openai/internal/decoders/line.d.ts +17 -0
  122. package/types/node_modules/openai/internal/detect-platform.d.mts +15 -0
  123. package/types/node_modules/openai/internal/detect-platform.d.ts +15 -0
  124. package/types/node_modules/openai/internal/errors.d.mts +3 -0
  125. package/types/node_modules/openai/internal/errors.d.ts +3 -0
  126. package/types/node_modules/openai/internal/headers.d.mts +20 -0
  127. package/types/node_modules/openai/internal/headers.d.ts +20 -0
  128. package/types/node_modules/openai/internal/parse.d.mts +17 -0
  129. package/types/node_modules/openai/internal/parse.d.ts +17 -0
  130. package/types/node_modules/openai/internal/qs/formats.d.mts +7 -0
  131. package/types/node_modules/openai/internal/qs/formats.d.ts +7 -0
  132. package/types/node_modules/openai/internal/qs/index.d.mts +10 -0
  133. package/types/node_modules/openai/internal/qs/index.d.ts +10 -0
  134. package/types/node_modules/openai/internal/qs/stringify.d.mts +3 -0
  135. package/types/node_modules/openai/internal/qs/stringify.d.ts +3 -0
  136. package/types/node_modules/openai/internal/qs/types.d.mts +57 -0
  137. package/types/node_modules/openai/internal/qs/types.d.ts +57 -0
  138. package/types/node_modules/openai/internal/qs/utils.d.mts +15 -0
  139. package/types/node_modules/openai/internal/qs/utils.d.ts +15 -0
  140. package/types/node_modules/openai/internal/request-options.d.mts +78 -0
  141. package/types/node_modules/openai/internal/request-options.d.ts +78 -0
  142. package/types/node_modules/openai/internal/shim-types.d.mts +17 -0
  143. package/types/node_modules/openai/internal/shim-types.d.ts +17 -0
  144. package/types/node_modules/openai/internal/shims.d.mts +20 -0
  145. package/types/node_modules/openai/internal/shims.d.ts +20 -0
  146. package/types/node_modules/openai/internal/stream-utils.d.mts +8 -0
  147. package/types/node_modules/openai/internal/stream-utils.d.ts +8 -0
  148. package/types/node_modules/openai/internal/to-file.d.mts +45 -0
  149. package/types/node_modules/openai/internal/to-file.d.ts +45 -0
  150. package/types/node_modules/openai/internal/types.d.mts +69 -0
  151. package/types/node_modules/openai/internal/types.d.ts +69 -0
  152. package/types/node_modules/openai/internal/uploads.d.mts +42 -0
  153. package/types/node_modules/openai/internal/uploads.d.ts +42 -0
  154. package/types/node_modules/openai/internal/utils/base64.d.mts +9 -0
  155. package/types/node_modules/openai/internal/utils/base64.d.ts +9 -0
  156. package/types/node_modules/openai/internal/utils/bytes.d.mts +4 -0
  157. package/types/node_modules/openai/internal/utils/bytes.d.ts +4 -0
  158. package/types/node_modules/openai/internal/utils/env.d.mts +9 -0
  159. package/types/node_modules/openai/internal/utils/env.d.ts +9 -0
  160. package/types/node_modules/openai/internal/utils/log.d.mts +37 -0
  161. package/types/node_modules/openai/internal/utils/log.d.ts +37 -0
  162. package/types/node_modules/openai/internal/utils/path.d.mts +15 -0
  163. package/types/node_modules/openai/internal/utils/path.d.ts +15 -0
  164. package/types/node_modules/openai/internal/utils/sleep.d.mts +2 -0
  165. package/types/node_modules/openai/internal/utils/sleep.d.ts +2 -0
  166. package/types/node_modules/openai/internal/utils/uuid.d.mts +5 -0
  167. package/types/node_modules/openai/internal/utils/uuid.d.ts +5 -0
  168. package/types/node_modules/openai/internal/utils/values.d.mts +18 -0
  169. package/types/node_modules/openai/internal/utils/values.d.ts +18 -0
  170. package/types/node_modules/openai/internal/utils.d.mts +7 -0
  171. package/types/node_modules/openai/internal/utils.d.ts +7 -0
  172. package/types/node_modules/openai/lib/AbstractChatCompletionRunner.d.mts +59 -0
  173. package/types/node_modules/openai/lib/AbstractChatCompletionRunner.d.ts +59 -0
  174. package/types/node_modules/openai/lib/AssistantStream.d.mts +60 -0
  175. package/types/node_modules/openai/lib/AssistantStream.d.ts +60 -0
  176. package/types/node_modules/openai/lib/ChatCompletionRunner.d.mts +16 -0
  177. package/types/node_modules/openai/lib/ChatCompletionRunner.d.ts +16 -0
  178. package/types/node_modules/openai/lib/ChatCompletionStream.d.mts +208 -0
  179. package/types/node_modules/openai/lib/ChatCompletionStream.d.ts +208 -0
  180. package/types/node_modules/openai/lib/ChatCompletionStreamingRunner.d.mts +19 -0
  181. package/types/node_modules/openai/lib/ChatCompletionStreamingRunner.d.ts +19 -0
  182. package/types/node_modules/openai/lib/EventEmitter.d.mts +45 -0
  183. package/types/node_modules/openai/lib/EventEmitter.d.ts +45 -0
  184. package/types/node_modules/openai/lib/EventStream.d.mts +62 -0
  185. package/types/node_modules/openai/lib/EventStream.d.ts +62 -0
  186. package/types/node_modules/openai/lib/ResponsesParser.d.mts +36 -0
  187. package/types/node_modules/openai/lib/ResponsesParser.d.ts +36 -0
  188. package/types/node_modules/openai/lib/RunnableFunction.d.mts +83 -0
  189. package/types/node_modules/openai/lib/RunnableFunction.d.ts +83 -0
  190. package/types/node_modules/openai/lib/Util.d.mts +5 -0
  191. package/types/node_modules/openai/lib/Util.d.ts +5 -0
  192. package/types/node_modules/openai/lib/chatCompletionUtils.d.mts +5 -0
  193. package/types/node_modules/openai/lib/chatCompletionUtils.d.ts +5 -0
  194. package/types/node_modules/openai/lib/jsonschema.d.mts +106 -0
  195. package/types/node_modules/openai/lib/jsonschema.d.ts +106 -0
  196. package/types/node_modules/openai/lib/parser.d.mts +47 -0
  197. package/types/node_modules/openai/lib/parser.d.ts +47 -0
  198. package/types/node_modules/openai/lib/responses/EventTypes.d.mts +9 -0
  199. package/types/node_modules/openai/lib/responses/EventTypes.d.ts +9 -0
  200. package/types/node_modules/openai/lib/responses/ResponseStream.d.mts +59 -0
  201. package/types/node_modules/openai/lib/responses/ResponseStream.d.ts +59 -0
  202. package/types/node_modules/openai/package.json +233 -0
  203. package/types/node_modules/openai/pagination.d.mts +2 -0
  204. package/types/node_modules/openai/pagination.d.ts +2 -0
  205. package/types/node_modules/openai/realtime/index.d.mts +2 -0
  206. package/types/node_modules/openai/realtime/index.d.ts +2 -0
  207. package/types/node_modules/openai/realtime/internal-base.d.mts +45 -0
  208. package/types/node_modules/openai/realtime/internal-base.d.ts +45 -0
  209. package/types/node_modules/openai/realtime/websocket.d.mts +36 -0
  210. package/types/node_modules/openai/realtime/websocket.d.ts +36 -0
  211. package/types/node_modules/openai/realtime/ws.d.mts +27 -0
  212. package/types/node_modules/openai/realtime/ws.d.ts +27 -0
  213. package/types/node_modules/openai/resource.d.mts +2 -0
  214. package/types/node_modules/openai/resource.d.ts +2 -0
  215. package/types/node_modules/openai/resources/audio/audio.d.mts +26 -0
  216. package/types/node_modules/openai/resources/audio/audio.d.ts +26 -0
  217. package/types/node_modules/openai/resources/audio/index.d.mts +5 -0
  218. package/types/node_modules/openai/resources/audio/index.d.ts +5 -0
  219. package/types/node_modules/openai/resources/audio/speech.d.mts +64 -0
  220. package/types/node_modules/openai/resources/audio/speech.d.ts +64 -0
  221. package/types/node_modules/openai/resources/audio/transcriptions.d.mts +485 -0
  222. package/types/node_modules/openai/resources/audio/transcriptions.d.ts +485 -0
  223. package/types/node_modules/openai/resources/audio/translations.d.mts +81 -0
  224. package/types/node_modules/openai/resources/audio/translations.d.ts +81 -0
  225. package/types/node_modules/openai/resources/audio.d.mts +2 -0
  226. package/types/node_modules/openai/resources/audio.d.ts +2 -0
  227. package/types/node_modules/openai/resources/batches.d.mts +279 -0
  228. package/types/node_modules/openai/resources/batches.d.ts +279 -0
  229. package/types/node_modules/openai/resources/beta/assistants.d.mts +1232 -0
  230. package/types/node_modules/openai/resources/beta/assistants.d.ts +1232 -0
  231. package/types/node_modules/openai/resources/beta/beta.d.mts +18 -0
  232. package/types/node_modules/openai/resources/beta/beta.d.ts +18 -0
  233. package/types/node_modules/openai/resources/beta/index.d.mts +5 -0
  234. package/types/node_modules/openai/resources/beta/index.d.ts +5 -0
  235. package/types/node_modules/openai/resources/beta/realtime/index.d.mts +4 -0
  236. package/types/node_modules/openai/resources/beta/realtime/index.d.ts +4 -0
  237. package/types/node_modules/openai/resources/beta/realtime/realtime.d.mts +2332 -0
  238. package/types/node_modules/openai/resources/beta/realtime/realtime.d.ts +2332 -0
  239. package/types/node_modules/openai/resources/beta/realtime/sessions.d.mts +744 -0
  240. package/types/node_modules/openai/resources/beta/realtime/sessions.d.ts +744 -0
  241. package/types/node_modules/openai/resources/beta/realtime/transcription-sessions.d.mts +299 -0
  242. package/types/node_modules/openai/resources/beta/realtime/transcription-sessions.d.ts +299 -0
  243. package/types/node_modules/openai/resources/beta/realtime.d.mts +2 -0
  244. package/types/node_modules/openai/resources/beta/realtime.d.ts +2 -0
  245. package/types/node_modules/openai/resources/beta/threads/index.d.mts +4 -0
  246. package/types/node_modules/openai/resources/beta/threads/index.d.ts +4 -0
  247. package/types/node_modules/openai/resources/beta/threads/messages.d.mts +594 -0
  248. package/types/node_modules/openai/resources/beta/threads/messages.d.ts +594 -0
  249. package/types/node_modules/openai/resources/beta/threads/runs/index.d.mts +3 -0
  250. package/types/node_modules/openai/resources/beta/threads/runs/index.d.ts +3 -0
  251. package/types/node_modules/openai/resources/beta/threads/runs/runs.d.mts +733 -0
  252. package/types/node_modules/openai/resources/beta/threads/runs/runs.d.ts +733 -0
  253. package/types/node_modules/openai/resources/beta/threads/runs/steps.d.mts +615 -0
  254. package/types/node_modules/openai/resources/beta/threads/runs/steps.d.ts +615 -0
  255. package/types/node_modules/openai/resources/beta/threads/runs.d.mts +2 -0
  256. package/types/node_modules/openai/resources/beta/threads/runs.d.ts +2 -0
  257. package/types/node_modules/openai/resources/beta/threads/threads.d.mts +1044 -0
  258. package/types/node_modules/openai/resources/beta/threads/threads.d.ts +1044 -0
  259. package/types/node_modules/openai/resources/beta/threads.d.mts +2 -0
  260. package/types/node_modules/openai/resources/beta/threads.d.ts +2 -0
  261. package/types/node_modules/openai/resources/beta.d.mts +2 -0
  262. package/types/node_modules/openai/resources/beta.d.ts +2 -0
  263. package/types/node_modules/openai/resources/chat/chat.d.mts +13 -0
  264. package/types/node_modules/openai/resources/chat/chat.d.ts +13 -0
  265. package/types/node_modules/openai/resources/chat/completions/completions.d.mts +1627 -0
  266. package/types/node_modules/openai/resources/chat/completions/completions.d.ts +1627 -0
  267. package/types/node_modules/openai/resources/chat/completions/index.d.mts +4 -0
  268. package/types/node_modules/openai/resources/chat/completions/index.d.ts +4 -0
  269. package/types/node_modules/openai/resources/chat/completions/messages.d.mts +34 -0
  270. package/types/node_modules/openai/resources/chat/completions/messages.d.ts +34 -0
  271. package/types/node_modules/openai/resources/chat/completions.d.mts +2 -0
  272. package/types/node_modules/openai/resources/chat/completions.d.ts +2 -0
  273. package/types/node_modules/openai/resources/chat/index.d.mts +3 -0
  274. package/types/node_modules/openai/resources/chat/index.d.ts +3 -0
  275. package/types/node_modules/openai/resources/chat.d.mts +2 -0
  276. package/types/node_modules/openai/resources/chat.d.ts +2 -0
  277. package/types/node_modules/openai/resources/completions.d.mts +329 -0
  278. package/types/node_modules/openai/resources/completions.d.ts +329 -0
  279. package/types/node_modules/openai/resources/containers/containers.d.mts +200 -0
  280. package/types/node_modules/openai/resources/containers/containers.d.ts +200 -0
  281. package/types/node_modules/openai/resources/containers/files/content.d.mts +16 -0
  282. package/types/node_modules/openai/resources/containers/files/content.d.ts +16 -0
  283. package/types/node_modules/openai/resources/containers/files/files.d.mts +148 -0
  284. package/types/node_modules/openai/resources/containers/files/files.d.ts +148 -0
  285. package/types/node_modules/openai/resources/containers/files/index.d.mts +3 -0
  286. package/types/node_modules/openai/resources/containers/files/index.d.ts +3 -0
  287. package/types/node_modules/openai/resources/containers/files.d.mts +2 -0
  288. package/types/node_modules/openai/resources/containers/files.d.ts +2 -0
  289. package/types/node_modules/openai/resources/containers/index.d.mts +3 -0
  290. package/types/node_modules/openai/resources/containers/index.d.ts +3 -0
  291. package/types/node_modules/openai/resources/containers.d.mts +2 -0
  292. package/types/node_modules/openai/resources/containers.d.ts +2 -0
  293. package/types/node_modules/openai/resources/conversations/conversations.d.mts +176 -0
  294. package/types/node_modules/openai/resources/conversations/conversations.d.ts +176 -0
  295. package/types/node_modules/openai/resources/conversations/index.d.mts +3 -0
  296. package/types/node_modules/openai/resources/conversations/index.d.ts +3 -0
  297. package/types/node_modules/openai/resources/conversations/items.d.mts +367 -0
  298. package/types/node_modules/openai/resources/conversations/items.d.ts +367 -0
  299. package/types/node_modules/openai/resources/conversations.d.mts +2 -0
  300. package/types/node_modules/openai/resources/conversations.d.ts +2 -0
  301. package/types/node_modules/openai/resources/embeddings.d.mts +113 -0
  302. package/types/node_modules/openai/resources/embeddings.d.ts +113 -0
  303. package/types/node_modules/openai/resources/evals/evals.d.mts +735 -0
  304. package/types/node_modules/openai/resources/evals/evals.d.ts +735 -0
  305. package/types/node_modules/openai/resources/evals/index.d.mts +3 -0
  306. package/types/node_modules/openai/resources/evals/index.d.ts +3 -0
  307. package/types/node_modules/openai/resources/evals/runs/index.d.mts +3 -0
  308. package/types/node_modules/openai/resources/evals/runs/index.d.ts +3 -0
  309. package/types/node_modules/openai/resources/evals/runs/output-items.d.mts +382 -0
  310. package/types/node_modules/openai/resources/evals/runs/output-items.d.ts +382 -0
  311. package/types/node_modules/openai/resources/evals/runs/runs.d.mts +2290 -0
  312. package/types/node_modules/openai/resources/evals/runs/runs.d.ts +2290 -0
  313. package/types/node_modules/openai/resources/evals/runs.d.mts +2 -0
  314. package/types/node_modules/openai/resources/evals/runs.d.ts +2 -0
  315. package/types/node_modules/openai/resources/evals.d.mts +2 -0
  316. package/types/node_modules/openai/resources/evals.d.ts +2 -0
  317. package/types/node_modules/openai/resources/files.d.mts +164 -0
  318. package/types/node_modules/openai/resources/files.d.ts +164 -0
  319. package/types/node_modules/openai/resources/fine-tuning/alpha/alpha.d.mts +10 -0
  320. package/types/node_modules/openai/resources/fine-tuning/alpha/alpha.d.ts +10 -0
  321. package/types/node_modules/openai/resources/fine-tuning/alpha/graders.d.mts +119 -0
  322. package/types/node_modules/openai/resources/fine-tuning/alpha/graders.d.ts +119 -0
  323. package/types/node_modules/openai/resources/fine-tuning/alpha/index.d.mts +3 -0
  324. package/types/node_modules/openai/resources/fine-tuning/alpha/index.d.ts +3 -0
  325. package/types/node_modules/openai/resources/fine-tuning/alpha.d.mts +2 -0
  326. package/types/node_modules/openai/resources/fine-tuning/alpha.d.ts +2 -0
  327. package/types/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.d.mts +10 -0
  328. package/types/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.d.ts +10 -0
  329. package/types/node_modules/openai/resources/fine-tuning/checkpoints/index.d.mts +3 -0
  330. package/types/node_modules/openai/resources/fine-tuning/checkpoints/index.d.ts +3 -0
  331. package/types/node_modules/openai/resources/fine-tuning/checkpoints/permissions.d.mts +160 -0
  332. package/types/node_modules/openai/resources/fine-tuning/checkpoints/permissions.d.ts +160 -0
  333. package/types/node_modules/openai/resources/fine-tuning/checkpoints.d.mts +2 -0
  334. package/types/node_modules/openai/resources/fine-tuning/checkpoints.d.ts +2 -0
  335. package/types/node_modules/openai/resources/fine-tuning/fine-tuning.d.mts +22 -0
  336. package/types/node_modules/openai/resources/fine-tuning/fine-tuning.d.ts +22 -0
  337. package/types/node_modules/openai/resources/fine-tuning/index.d.mts +6 -0
  338. package/types/node_modules/openai/resources/fine-tuning/index.d.ts +6 -0
  339. package/types/node_modules/openai/resources/fine-tuning/jobs/checkpoints.d.mts +74 -0
  340. package/types/node_modules/openai/resources/fine-tuning/jobs/checkpoints.d.ts +74 -0
  341. package/types/node_modules/openai/resources/fine-tuning/jobs/index.d.mts +3 -0
  342. package/types/node_modules/openai/resources/fine-tuning/jobs/index.d.ts +3 -0
  343. package/types/node_modules/openai/resources/fine-tuning/jobs/jobs.d.mts +528 -0
  344. package/types/node_modules/openai/resources/fine-tuning/jobs/jobs.d.ts +528 -0
  345. package/types/node_modules/openai/resources/fine-tuning/jobs.d.mts +2 -0
  346. package/types/node_modules/openai/resources/fine-tuning/jobs.d.ts +2 -0
  347. package/types/node_modules/openai/resources/fine-tuning/methods.d.mts +120 -0
  348. package/types/node_modules/openai/resources/fine-tuning/methods.d.ts +120 -0
  349. package/types/node_modules/openai/resources/fine-tuning.d.mts +2 -0
  350. package/types/node_modules/openai/resources/fine-tuning.d.ts +2 -0
  351. package/types/node_modules/openai/resources/graders/grader-models.d.mts +304 -0
  352. package/types/node_modules/openai/resources/graders/grader-models.d.ts +304 -0
  353. package/types/node_modules/openai/resources/graders/graders.d.mts +10 -0
  354. package/types/node_modules/openai/resources/graders/graders.d.ts +10 -0
  355. package/types/node_modules/openai/resources/graders/index.d.mts +3 -0
  356. package/types/node_modules/openai/resources/graders/index.d.ts +3 -0
  357. package/types/node_modules/openai/resources/graders.d.mts +2 -0
  358. package/types/node_modules/openai/resources/graders.d.ts +2 -0
  359. package/types/node_modules/openai/resources/images.d.mts +653 -0
  360. package/types/node_modules/openai/resources/images.d.ts +653 -0
  361. package/types/node_modules/openai/resources/index.d.mts +22 -0
  362. package/types/node_modules/openai/resources/index.d.ts +22 -0
  363. package/types/node_modules/openai/resources/models.d.mts +52 -0
  364. package/types/node_modules/openai/resources/models.d.ts +52 -0
  365. package/types/node_modules/openai/resources/moderations.d.mts +295 -0
  366. package/types/node_modules/openai/resources/moderations.d.ts +295 -0
  367. package/types/node_modules/openai/resources/realtime/client-secrets.d.mts +594 -0
  368. package/types/node_modules/openai/resources/realtime/client-secrets.d.ts +594 -0
  369. package/types/node_modules/openai/resources/realtime/index.d.mts +3 -0
  370. package/types/node_modules/openai/resources/realtime/index.d.ts +3 -0
  371. package/types/node_modules/openai/resources/realtime/realtime.d.mts +3828 -0
  372. package/types/node_modules/openai/resources/realtime/realtime.d.ts +3828 -0
  373. package/types/node_modules/openai/resources/realtime.d.mts +2 -0
  374. package/types/node_modules/openai/resources/realtime.d.ts +2 -0
  375. package/types/node_modules/openai/resources/responses/index.d.mts +3 -0
  376. package/types/node_modules/openai/resources/responses/index.d.ts +3 -0
  377. package/types/node_modules/openai/resources/responses/input-items.d.mts +65 -0
  378. package/types/node_modules/openai/resources/responses/input-items.d.ts +65 -0
  379. package/types/node_modules/openai/resources/responses/responses.d.mts +4705 -0
  380. package/types/node_modules/openai/resources/responses/responses.d.ts +4705 -0
  381. package/types/node_modules/openai/resources/responses.d.mts +2 -0
  382. package/types/node_modules/openai/resources/responses.d.ts +2 -0
  383. package/types/node_modules/openai/resources/shared.d.mts +265 -0
  384. package/types/node_modules/openai/resources/shared.d.ts +265 -0
  385. package/types/node_modules/openai/resources/uploads/index.d.mts +3 -0
  386. package/types/node_modules/openai/resources/uploads/index.d.ts +3 -0
  387. package/types/node_modules/openai/resources/uploads/parts.d.mts +51 -0
  388. package/types/node_modules/openai/resources/uploads/parts.d.ts +51 -0
  389. package/types/node_modules/openai/resources/uploads/uploads.d.mts +157 -0
  390. package/types/node_modules/openai/resources/uploads/uploads.d.ts +157 -0
  391. package/types/node_modules/openai/resources/uploads.d.mts +2 -0
  392. package/types/node_modules/openai/resources/uploads.d.ts +2 -0
  393. package/types/node_modules/openai/resources/vector-stores/file-batches.d.mts +172 -0
  394. package/types/node_modules/openai/resources/vector-stores/file-batches.d.ts +172 -0
  395. package/types/node_modules/openai/resources/vector-stores/files.d.mts +231 -0
  396. package/types/node_modules/openai/resources/vector-stores/files.d.ts +231 -0
  397. package/types/node_modules/openai/resources/vector-stores/index.d.mts +4 -0
  398. package/types/node_modules/openai/resources/vector-stores/index.d.ts +4 -0
  399. package/types/node_modules/openai/resources/vector-stores/vector-stores.d.mts +373 -0
  400. package/types/node_modules/openai/resources/vector-stores/vector-stores.d.ts +373 -0
  401. package/types/node_modules/openai/resources/vector-stores.d.mts +2 -0
  402. package/types/node_modules/openai/resources/vector-stores.d.ts +2 -0
  403. package/types/node_modules/openai/resources/webhooks.d.mts +587 -0
  404. package/types/node_modules/openai/resources/webhooks.d.ts +587 -0
  405. package/types/node_modules/openai/resources.d.mts +2 -0
  406. package/types/node_modules/openai/resources.d.ts +2 -0
  407. package/types/node_modules/openai/src/_vendor/zod-to-json-schema/LICENSE +15 -0
  408. package/types/node_modules/openai/streaming.d.mts +2 -0
  409. package/types/node_modules/openai/streaming.d.ts +2 -0
  410. package/types/node_modules/openai/uploads.d.mts +2 -0
  411. package/types/node_modules/openai/uploads.d.ts +2 -0
  412. package/types/node_modules/openai/version.d.mts +2 -0
  413. package/types/node_modules/openai/version.d.ts +2 -0
@@ -0,0 +1,1627 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import * as CompletionsCompletionsAPI from "./completions.mjs";
3
+ import * as CompletionsAPI from "../../completions.mjs";
4
+ import * as Shared from "../../shared.mjs";
5
+ import * as MessagesAPI from "./messages.mjs";
6
+ import { MessageListParams, Messages } from "./messages.mjs";
7
+ import { APIPromise } from "../../../core/api-promise.mjs";
8
+ import { CursorPage, type CursorPageParams, PagePromise } from "../../../core/pagination.mjs";
9
+ import { Stream } from "../../../core/streaming.mjs";
10
+ import { RequestOptions } from "../../../internal/request-options.mjs";
11
+ import { ChatCompletionRunner } from "../../../lib/ChatCompletionRunner.mjs";
12
+ import { ChatCompletionStreamingRunner } from "../../../lib/ChatCompletionStreamingRunner.mjs";
13
+ import { RunnerOptions } from "../../../lib/AbstractChatCompletionRunner.mjs";
14
+ import { ChatCompletionToolRunnerParams } from "../../../lib/ChatCompletionRunner.mjs";
15
+ import { ChatCompletionStreamingToolRunnerParams } from "../../../lib/ChatCompletionStreamingRunner.mjs";
16
+ import { ChatCompletionStream, type ChatCompletionStreamParams } from "../../../lib/ChatCompletionStream.mjs";
17
+ import { ExtractParsedContentFromParams } from "../../../lib/parser.mjs";
18
+ export declare class Completions extends APIResource {
19
+ messages: MessagesAPI.Messages;
20
+ /**
21
+ * **Starting a new project?** We recommend trying
22
+ * [Responses](https://platform.openai.com/docs/api-reference/responses) to take
23
+ * advantage of the latest OpenAI platform features. Compare
24
+ * [Chat Completions with Responses](https://platform.openai.com/docs/guides/responses-vs-chat-completions?api-mode=responses).
25
+ *
26
+ * ---
27
+ *
28
+ * Creates a model response for the given chat conversation. Learn more in the
29
+ * [text generation](https://platform.openai.com/docs/guides/text-generation),
30
+ * [vision](https://platform.openai.com/docs/guides/vision), and
31
+ * [audio](https://platform.openai.com/docs/guides/audio) guides.
32
+ *
33
+ * Parameter support can differ depending on the model used to generate the
34
+ * response, particularly for newer reasoning models. Parameters that are only
35
+ * supported for reasoning models are noted below. For the current state of
36
+ * unsupported parameters in reasoning models,
37
+ * [refer to the reasoning guide](https://platform.openai.com/docs/guides/reasoning).
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const chatCompletion = await client.chat.completions.create(
42
+ * {
43
+ * messages: [{ content: 'string', role: 'developer' }],
44
+ * model: 'gpt-4o',
45
+ * },
46
+ * );
47
+ * ```
48
+ */
49
+ create(body: ChatCompletionCreateParamsNonStreaming, options?: RequestOptions): APIPromise<ChatCompletion>;
50
+ create(body: ChatCompletionCreateParamsStreaming, options?: RequestOptions): APIPromise<Stream<ChatCompletionChunk>>;
51
+ create(body: ChatCompletionCreateParamsBase, options?: RequestOptions): APIPromise<Stream<ChatCompletionChunk> | ChatCompletion>;
52
+ /**
53
+ * Get a stored chat completion. Only Chat Completions that have been created with
54
+ * the `store` parameter set to `true` will be returned.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * const chatCompletion =
59
+ * await client.chat.completions.retrieve('completion_id');
60
+ * ```
61
+ */
62
+ retrieve(completionID: string, options?: RequestOptions): APIPromise<ChatCompletion>;
63
+ /**
64
+ * Modify a stored chat completion. Only Chat Completions that have been created
65
+ * with the `store` parameter set to `true` can be modified. Currently, the only
66
+ * supported modification is to update the `metadata` field.
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * const chatCompletion = await client.chat.completions.update(
71
+ * 'completion_id',
72
+ * { metadata: { foo: 'string' } },
73
+ * );
74
+ * ```
75
+ */
76
+ update(completionID: string, body: ChatCompletionUpdateParams, options?: RequestOptions): APIPromise<ChatCompletion>;
77
+ /**
78
+ * List stored Chat Completions. Only Chat Completions that have been stored with
79
+ * the `store` parameter set to `true` will be returned.
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * // Automatically fetches more pages as needed.
84
+ * for await (const chatCompletion of client.chat.completions.list()) {
85
+ * // ...
86
+ * }
87
+ * ```
88
+ */
89
+ list(query?: ChatCompletionListParams | null | undefined, options?: RequestOptions): PagePromise<ChatCompletionsPage, ChatCompletion>;
90
+ /**
91
+ * Delete a stored chat completion. Only Chat Completions that have been created
92
+ * with the `store` parameter set to `true` can be deleted.
93
+ *
94
+ * @example
95
+ * ```ts
96
+ * const chatCompletionDeleted =
97
+ * await client.chat.completions.delete('completion_id');
98
+ * ```
99
+ */
100
+ delete(completionID: string, options?: RequestOptions): APIPromise<ChatCompletionDeleted>;
101
+ parse<Params extends ChatCompletionParseParams, ParsedT = ExtractParsedContentFromParams<Params>>(body: Params, options?: RequestOptions): APIPromise<ParsedChatCompletion<ParsedT>>;
102
+ /**
103
+ * A convenience helper for using tool calls with the /chat/completions endpoint
104
+ * which automatically calls the JavaScript functions you provide and sends their
105
+ * results back to the /chat/completions endpoint, looping as long as the model
106
+ * requests function calls.
107
+ *
108
+ * For more details and examples, see
109
+ * [the docs](https://github.com/openai/openai-node#automated-function-calls)
110
+ */
111
+ runTools<Params extends ChatCompletionToolRunnerParams<any>, ParsedT = ExtractParsedContentFromParams<Params>>(body: Params, options?: RunnerOptions): ChatCompletionRunner<ParsedT>;
112
+ runTools<Params extends ChatCompletionStreamingToolRunnerParams<any>, ParsedT = ExtractParsedContentFromParams<Params>>(body: Params, options?: RunnerOptions): ChatCompletionStreamingRunner<ParsedT>;
113
+ /**
114
+ * Creates a chat completion stream
115
+ */
116
+ stream<Params extends ChatCompletionStreamParams, ParsedT = ExtractParsedContentFromParams<Params>>(body: Params, options?: RequestOptions): ChatCompletionStream<ParsedT>;
117
+ }
118
+ export interface ParsedFunction extends ChatCompletionMessageFunctionToolCall.Function {
119
+ parsed_arguments?: unknown;
120
+ }
121
+ export interface ParsedFunctionToolCall extends ChatCompletionMessageFunctionToolCall {
122
+ function: ParsedFunction;
123
+ }
124
+ export interface ParsedChatCompletionMessage<ParsedT> extends ChatCompletionMessage {
125
+ parsed: ParsedT | null;
126
+ tool_calls?: Array<ParsedFunctionToolCall>;
127
+ }
128
+ export interface ParsedChoice<ParsedT> extends ChatCompletion.Choice {
129
+ message: ParsedChatCompletionMessage<ParsedT>;
130
+ }
131
+ export interface ParsedChatCompletion<ParsedT> extends ChatCompletion {
132
+ choices: Array<ParsedChoice<ParsedT>>;
133
+ }
134
+ export type ChatCompletionParseParams = ChatCompletionCreateParamsNonStreaming;
135
+ export { ChatCompletionStreamingRunner } from "../../../lib/ChatCompletionStreamingRunner.mjs";
136
+ export { type RunnableFunctionWithParse, type RunnableFunctionWithoutParse, ParsingToolFunction, } from "../../../lib/RunnableFunction.mjs";
137
+ export { type ChatCompletionToolRunnerParams } from "../../../lib/ChatCompletionRunner.mjs";
138
+ export { type ChatCompletionStreamingToolRunnerParams } from "../../../lib/ChatCompletionStreamingRunner.mjs";
139
+ export { ChatCompletionStream, type ChatCompletionStreamParams } from "../../../lib/ChatCompletionStream.mjs";
140
+ export { ChatCompletionRunner } from "../../../lib/ChatCompletionRunner.mjs";
141
+ export type ChatCompletionsPage = CursorPage<ChatCompletion>;
142
+ export type ChatCompletionStoreMessagesPage = CursorPage<ChatCompletionStoreMessage>;
143
+ /**
144
+ * Represents a chat completion response returned by model, based on the provided
145
+ * input.
146
+ */
147
+ export interface ChatCompletion {
148
+ /**
149
+ * A unique identifier for the chat completion.
150
+ */
151
+ id: string;
152
+ /**
153
+ * A list of chat completion choices. Can be more than one if `n` is greater
154
+ * than 1.
155
+ */
156
+ choices: Array<ChatCompletion.Choice>;
157
+ /**
158
+ * The Unix timestamp (in seconds) of when the chat completion was created.
159
+ */
160
+ created: number;
161
+ /**
162
+ * The model used for the chat completion.
163
+ */
164
+ model: string;
165
+ /**
166
+ * The object type, which is always `chat.completion`.
167
+ */
168
+ object: 'chat.completion';
169
+ /**
170
+ * Specifies the processing type used for serving the request.
171
+ *
172
+ * - If set to 'auto', then the request will be processed with the service tier
173
+ * configured in the Project settings. Unless otherwise configured, the Project
174
+ * will use 'default'.
175
+ * - If set to 'default', then the request will be processed with the standard
176
+ * pricing and performance for the selected model.
177
+ * - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
178
+ * '[priority](https://openai.com/api-priority-processing/)', then the request
179
+ * will be processed with the corresponding service tier.
180
+ * - When not set, the default behavior is 'auto'.
181
+ *
182
+ * When the `service_tier` parameter is set, the response body will include the
183
+ * `service_tier` value based on the processing mode actually used to serve the
184
+ * request. This response value may be different from the value set in the
185
+ * parameter.
186
+ */
187
+ service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | null;
188
+ /**
189
+ * @deprecated This fingerprint represents the backend configuration that the model
190
+ * runs with.
191
+ *
192
+ * Can be used in conjunction with the `seed` request parameter to understand when
193
+ * backend changes have been made that might impact determinism.
194
+ */
195
+ system_fingerprint?: string;
196
+ /**
197
+ * Usage statistics for the completion request.
198
+ */
199
+ usage?: CompletionsAPI.CompletionUsage;
200
+ }
201
+ export declare namespace ChatCompletion {
202
+ interface Choice {
203
+ /**
204
+ * The reason the model stopped generating tokens. This will be `stop` if the model
205
+ * hit a natural stop point or a provided stop sequence, `length` if the maximum
206
+ * number of tokens specified in the request was reached, `content_filter` if
207
+ * content was omitted due to a flag from our content filters, `tool_calls` if the
208
+ * model called a tool, or `function_call` (deprecated) if the model called a
209
+ * function.
210
+ */
211
+ finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call';
212
+ /**
213
+ * The index of the choice in the list of choices.
214
+ */
215
+ index: number;
216
+ /**
217
+ * Log probability information for the choice.
218
+ */
219
+ logprobs: Choice.Logprobs | null;
220
+ /**
221
+ * A chat completion message generated by the model.
222
+ */
223
+ message: CompletionsCompletionsAPI.ChatCompletionMessage;
224
+ }
225
+ namespace Choice {
226
+ /**
227
+ * Log probability information for the choice.
228
+ */
229
+ interface Logprobs {
230
+ /**
231
+ * A list of message content tokens with log probability information.
232
+ */
233
+ content: Array<CompletionsCompletionsAPI.ChatCompletionTokenLogprob> | null;
234
+ /**
235
+ * A list of message refusal tokens with log probability information.
236
+ */
237
+ refusal: Array<CompletionsCompletionsAPI.ChatCompletionTokenLogprob> | null;
238
+ }
239
+ }
240
+ }
241
+ /**
242
+ * Constrains the tools available to the model to a pre-defined set.
243
+ */
244
+ export interface ChatCompletionAllowedToolChoice {
245
+ /**
246
+ * Constrains the tools available to the model to a pre-defined set.
247
+ */
248
+ allowed_tools: ChatCompletionAllowedTools;
249
+ /**
250
+ * Allowed tool configuration type. Always `allowed_tools`.
251
+ */
252
+ type: 'allowed_tools';
253
+ }
254
+ /**
255
+ * Messages sent by the model in response to user messages.
256
+ */
257
+ export interface ChatCompletionAssistantMessageParam {
258
+ /**
259
+ * The role of the messages author, in this case `assistant`.
260
+ */
261
+ role: 'assistant';
262
+ /**
263
+ * Data about a previous audio response from the model.
264
+ * [Learn more](https://platform.openai.com/docs/guides/audio).
265
+ */
266
+ audio?: ChatCompletionAssistantMessageParam.Audio | null;
267
+ /**
268
+ * The contents of the assistant message. Required unless `tool_calls` or
269
+ * `function_call` is specified.
270
+ */
271
+ content?: string | Array<ChatCompletionContentPartText | ChatCompletionContentPartRefusal> | null;
272
+ /**
273
+ * @deprecated Deprecated and replaced by `tool_calls`. The name and arguments of a
274
+ * function that should be called, as generated by the model.
275
+ */
276
+ function_call?: ChatCompletionAssistantMessageParam.FunctionCall | null;
277
+ /**
278
+ * An optional name for the participant. Provides the model information to
279
+ * differentiate between participants of the same role.
280
+ */
281
+ name?: string;
282
+ /**
283
+ * The refusal message by the assistant.
284
+ */
285
+ refusal?: string | null;
286
+ /**
287
+ * The tool calls generated by the model, such as function calls.
288
+ */
289
+ tool_calls?: Array<ChatCompletionMessageToolCall>;
290
+ }
291
+ export declare namespace ChatCompletionAssistantMessageParam {
292
+ /**
293
+ * Data about a previous audio response from the model.
294
+ * [Learn more](https://platform.openai.com/docs/guides/audio).
295
+ */
296
+ interface Audio {
297
+ /**
298
+ * Unique identifier for a previous audio response from the model.
299
+ */
300
+ id: string;
301
+ }
302
+ /**
303
+ * @deprecated Deprecated and replaced by `tool_calls`. The name and arguments of a
304
+ * function that should be called, as generated by the model.
305
+ */
306
+ interface FunctionCall {
307
+ /**
308
+ * The arguments to call the function with, as generated by the model in JSON
309
+ * format. Note that the model does not always generate valid JSON, and may
310
+ * hallucinate parameters not defined by your function schema. Validate the
311
+ * arguments in your code before calling your function.
312
+ */
313
+ arguments: string;
314
+ /**
315
+ * The name of the function to call.
316
+ */
317
+ name: string;
318
+ }
319
+ }
320
+ /**
321
+ * If the audio output modality is requested, this object contains data about the
322
+ * audio response from the model.
323
+ * [Learn more](https://platform.openai.com/docs/guides/audio).
324
+ */
325
+ export interface ChatCompletionAudio {
326
+ /**
327
+ * Unique identifier for this audio response.
328
+ */
329
+ id: string;
330
+ /**
331
+ * Base64 encoded audio bytes generated by the model, in the format specified in
332
+ * the request.
333
+ */
334
+ data: string;
335
+ /**
336
+ * The Unix timestamp (in seconds) for when this audio response will no longer be
337
+ * accessible on the server for use in multi-turn conversations.
338
+ */
339
+ expires_at: number;
340
+ /**
341
+ * Transcript of the audio generated by the model.
342
+ */
343
+ transcript: string;
344
+ }
345
+ /**
346
+ * Parameters for audio output. Required when audio output is requested with
347
+ * `modalities: ["audio"]`.
348
+ * [Learn more](https://platform.openai.com/docs/guides/audio).
349
+ */
350
+ export interface ChatCompletionAudioParam {
351
+ /**
352
+ * Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`,
353
+ * or `pcm16`.
354
+ */
355
+ format: 'wav' | 'aac' | 'mp3' | 'flac' | 'opus' | 'pcm16';
356
+ /**
357
+ * The voice the model uses to respond. Supported voices are `alloy`, `ash`,
358
+ * `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, and `shimmer`.
359
+ */
360
+ voice: (string & {}) | 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse' | 'marin' | 'cedar';
361
+ }
362
+ /**
363
+ * Represents a streamed chunk of a chat completion response returned by the model,
364
+ * based on the provided input.
365
+ * [Learn more](https://platform.openai.com/docs/guides/streaming-responses).
366
+ */
367
+ export interface ChatCompletionChunk {
368
+ /**
369
+ * A unique identifier for the chat completion. Each chunk has the same ID.
370
+ */
371
+ id: string;
372
+ /**
373
+ * A list of chat completion choices. Can contain more than one elements if `n` is
374
+ * greater than 1. Can also be empty for the last chunk if you set
375
+ * `stream_options: {"include_usage": true}`.
376
+ */
377
+ choices: Array<ChatCompletionChunk.Choice>;
378
+ /**
379
+ * The Unix timestamp (in seconds) of when the chat completion was created. Each
380
+ * chunk has the same timestamp.
381
+ */
382
+ created: number;
383
+ /**
384
+ * The model to generate the completion.
385
+ */
386
+ model: string;
387
+ /**
388
+ * The object type, which is always `chat.completion.chunk`.
389
+ */
390
+ object: 'chat.completion.chunk';
391
+ /**
392
+ * Specifies the processing type used for serving the request.
393
+ *
394
+ * - If set to 'auto', then the request will be processed with the service tier
395
+ * configured in the Project settings. Unless otherwise configured, the Project
396
+ * will use 'default'.
397
+ * - If set to 'default', then the request will be processed with the standard
398
+ * pricing and performance for the selected model.
399
+ * - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
400
+ * '[priority](https://openai.com/api-priority-processing/)', then the request
401
+ * will be processed with the corresponding service tier.
402
+ * - When not set, the default behavior is 'auto'.
403
+ *
404
+ * When the `service_tier` parameter is set, the response body will include the
405
+ * `service_tier` value based on the processing mode actually used to serve the
406
+ * request. This response value may be different from the value set in the
407
+ * parameter.
408
+ */
409
+ service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | null;
410
+ /**
411
+ * @deprecated This fingerprint represents the backend configuration that the model
412
+ * runs with. Can be used in conjunction with the `seed` request parameter to
413
+ * understand when backend changes have been made that might impact determinism.
414
+ */
415
+ system_fingerprint?: string;
416
+ /**
417
+ * An optional field that will only be present when you set
418
+ * `stream_options: {"include_usage": true}` in your request. When present, it
419
+ * contains a null value **except for the last chunk** which contains the token
420
+ * usage statistics for the entire request.
421
+ *
422
+ * **NOTE:** If the stream is interrupted or cancelled, you may not receive the
423
+ * final usage chunk which contains the total token usage for the request.
424
+ */
425
+ usage?: CompletionsAPI.CompletionUsage | null;
426
+ }
427
+ export declare namespace ChatCompletionChunk {
428
+ interface Choice {
429
+ /**
430
+ * A chat completion delta generated by streamed model responses.
431
+ */
432
+ delta: Choice.Delta;
433
+ /**
434
+ * The reason the model stopped generating tokens. This will be `stop` if the model
435
+ * hit a natural stop point or a provided stop sequence, `length` if the maximum
436
+ * number of tokens specified in the request was reached, `content_filter` if
437
+ * content was omitted due to a flag from our content filters, `tool_calls` if the
438
+ * model called a tool, or `function_call` (deprecated) if the model called a
439
+ * function.
440
+ */
441
+ finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call' | null;
442
+ /**
443
+ * The index of the choice in the list of choices.
444
+ */
445
+ index: number;
446
+ /**
447
+ * Log probability information for the choice.
448
+ */
449
+ logprobs?: Choice.Logprobs | null;
450
+ }
451
+ namespace Choice {
452
+ /**
453
+ * A chat completion delta generated by streamed model responses.
454
+ */
455
+ interface Delta {
456
+ /**
457
+ * The contents of the chunk message.
458
+ */
459
+ content?: string | null;
460
+ /**
461
+ * @deprecated Deprecated and replaced by `tool_calls`. The name and arguments of a
462
+ * function that should be called, as generated by the model.
463
+ */
464
+ function_call?: Delta.FunctionCall;
465
+ /**
466
+ * The refusal message generated by the model.
467
+ */
468
+ refusal?: string | null;
469
+ /**
470
+ * The role of the author of this message.
471
+ */
472
+ role?: 'developer' | 'system' | 'user' | 'assistant' | 'tool';
473
+ tool_calls?: Array<Delta.ToolCall>;
474
+ }
475
+ namespace Delta {
476
+ /**
477
+ * @deprecated Deprecated and replaced by `tool_calls`. The name and arguments of a
478
+ * function that should be called, as generated by the model.
479
+ */
480
+ interface FunctionCall {
481
+ /**
482
+ * The arguments to call the function with, as generated by the model in JSON
483
+ * format. Note that the model does not always generate valid JSON, and may
484
+ * hallucinate parameters not defined by your function schema. Validate the
485
+ * arguments in your code before calling your function.
486
+ */
487
+ arguments?: string;
488
+ /**
489
+ * The name of the function to call.
490
+ */
491
+ name?: string;
492
+ }
493
+ interface ToolCall {
494
+ index: number;
495
+ /**
496
+ * The ID of the tool call.
497
+ */
498
+ id?: string;
499
+ function?: ToolCall.Function;
500
+ /**
501
+ * The type of the tool. Currently, only `function` is supported.
502
+ */
503
+ type?: 'function';
504
+ }
505
+ namespace ToolCall {
506
+ interface Function {
507
+ /**
508
+ * The arguments to call the function with, as generated by the model in JSON
509
+ * format. Note that the model does not always generate valid JSON, and may
510
+ * hallucinate parameters not defined by your function schema. Validate the
511
+ * arguments in your code before calling your function.
512
+ */
513
+ arguments?: string;
514
+ /**
515
+ * The name of the function to call.
516
+ */
517
+ name?: string;
518
+ }
519
+ }
520
+ }
521
+ /**
522
+ * Log probability information for the choice.
523
+ */
524
+ interface Logprobs {
525
+ /**
526
+ * A list of message content tokens with log probability information.
527
+ */
528
+ content: Array<CompletionsCompletionsAPI.ChatCompletionTokenLogprob> | null;
529
+ /**
530
+ * A list of message refusal tokens with log probability information.
531
+ */
532
+ refusal: Array<CompletionsCompletionsAPI.ChatCompletionTokenLogprob> | null;
533
+ }
534
+ }
535
+ }
536
+ /**
537
+ * Learn about
538
+ * [text inputs](https://platform.openai.com/docs/guides/text-generation).
539
+ */
540
+ export type ChatCompletionContentPart = ChatCompletionContentPartText | ChatCompletionContentPartImage | ChatCompletionContentPartInputAudio | ChatCompletionContentPart.File;
541
+ export declare namespace ChatCompletionContentPart {
542
+ /**
543
+ * Learn about [file inputs](https://platform.openai.com/docs/guides/text) for text
544
+ * generation.
545
+ */
546
+ interface File {
547
+ file: File.File;
548
+ /**
549
+ * The type of the content part. Always `file`.
550
+ */
551
+ type: 'file';
552
+ }
553
+ namespace File {
554
+ interface File {
555
+ /**
556
+ * The base64 encoded file data, used when passing the file to the model as a
557
+ * string.
558
+ */
559
+ file_data?: string;
560
+ /**
561
+ * The ID of an uploaded file to use as input.
562
+ */
563
+ file_id?: string;
564
+ /**
565
+ * The name of the file, used when passing the file to the model as a string.
566
+ */
567
+ filename?: string;
568
+ }
569
+ }
570
+ }
571
+ /**
572
+ * Learn about [image inputs](https://platform.openai.com/docs/guides/vision).
573
+ */
574
+ export interface ChatCompletionContentPartImage {
575
+ image_url: ChatCompletionContentPartImage.ImageURL;
576
+ /**
577
+ * The type of the content part.
578
+ */
579
+ type: 'image_url';
580
+ }
581
+ export declare namespace ChatCompletionContentPartImage {
582
+ interface ImageURL {
583
+ /**
584
+ * Either a URL of the image or the base64 encoded image data.
585
+ */
586
+ url: string;
587
+ /**
588
+ * Specifies the detail level of the image. Learn more in the
589
+ * [Vision guide](https://platform.openai.com/docs/guides/vision#low-or-high-fidelity-image-understanding).
590
+ */
591
+ detail?: 'auto' | 'low' | 'high';
592
+ }
593
+ }
594
+ /**
595
+ * Learn about [audio inputs](https://platform.openai.com/docs/guides/audio).
596
+ */
597
+ export interface ChatCompletionContentPartInputAudio {
598
+ input_audio: ChatCompletionContentPartInputAudio.InputAudio;
599
+ /**
600
+ * The type of the content part. Always `input_audio`.
601
+ */
602
+ type: 'input_audio';
603
+ }
604
+ export declare namespace ChatCompletionContentPartInputAudio {
605
+ interface InputAudio {
606
+ /**
607
+ * Base64 encoded audio data.
608
+ */
609
+ data: string;
610
+ /**
611
+ * The format of the encoded audio data. Currently supports "wav" and "mp3".
612
+ */
613
+ format: 'wav' | 'mp3';
614
+ }
615
+ }
616
+ export interface ChatCompletionContentPartRefusal {
617
+ /**
618
+ * The refusal message generated by the model.
619
+ */
620
+ refusal: string;
621
+ /**
622
+ * The type of the content part.
623
+ */
624
+ type: 'refusal';
625
+ }
626
+ /**
627
+ * Learn about
628
+ * [text inputs](https://platform.openai.com/docs/guides/text-generation).
629
+ */
630
+ export interface ChatCompletionContentPartText {
631
+ /**
632
+ * The text content.
633
+ */
634
+ text: string;
635
+ /**
636
+ * The type of the content part.
637
+ */
638
+ type: 'text';
639
+ }
640
+ /**
641
+ * A custom tool that processes input using a specified format.
642
+ */
643
+ export interface ChatCompletionCustomTool {
644
+ /**
645
+ * Properties of the custom tool.
646
+ */
647
+ custom: ChatCompletionCustomTool.Custom;
648
+ /**
649
+ * The type of the custom tool. Always `custom`.
650
+ */
651
+ type: 'custom';
652
+ }
653
+ export declare namespace ChatCompletionCustomTool {
654
+ /**
655
+ * Properties of the custom tool.
656
+ */
657
+ interface Custom {
658
+ /**
659
+ * The name of the custom tool, used to identify it in tool calls.
660
+ */
661
+ name: string;
662
+ /**
663
+ * Optional description of the custom tool, used to provide more context.
664
+ */
665
+ description?: string;
666
+ /**
667
+ * The input format for the custom tool. Default is unconstrained text.
668
+ */
669
+ format?: Custom.Text | Custom.Grammar;
670
+ }
671
+ namespace Custom {
672
+ /**
673
+ * Unconstrained free-form text.
674
+ */
675
+ interface Text {
676
+ /**
677
+ * Unconstrained text format. Always `text`.
678
+ */
679
+ type: 'text';
680
+ }
681
+ /**
682
+ * A grammar defined by the user.
683
+ */
684
+ interface Grammar {
685
+ /**
686
+ * Your chosen grammar.
687
+ */
688
+ grammar: Grammar.Grammar;
689
+ /**
690
+ * Grammar format. Always `grammar`.
691
+ */
692
+ type: 'grammar';
693
+ }
694
+ namespace Grammar {
695
+ /**
696
+ * Your chosen grammar.
697
+ */
698
+ interface Grammar {
699
+ /**
700
+ * The grammar definition.
701
+ */
702
+ definition: string;
703
+ /**
704
+ * The syntax of the grammar definition. One of `lark` or `regex`.
705
+ */
706
+ syntax: 'lark' | 'regex';
707
+ }
708
+ }
709
+ }
710
+ }
711
+ export interface ChatCompletionDeleted {
712
+ /**
713
+ * The ID of the chat completion that was deleted.
714
+ */
715
+ id: string;
716
+ /**
717
+ * Whether the chat completion was deleted.
718
+ */
719
+ deleted: boolean;
720
+ /**
721
+ * The type of object being deleted.
722
+ */
723
+ object: 'chat.completion.deleted';
724
+ }
725
+ /**
726
+ * Developer-provided instructions that the model should follow, regardless of
727
+ * messages sent by the user. With o1 models and newer, `developer` messages
728
+ * replace the previous `system` messages.
729
+ */
730
+ export interface ChatCompletionDeveloperMessageParam {
731
+ /**
732
+ * The contents of the developer message.
733
+ */
734
+ content: string | Array<ChatCompletionContentPartText>;
735
+ /**
736
+ * The role of the messages author, in this case `developer`.
737
+ */
738
+ role: 'developer';
739
+ /**
740
+ * An optional name for the participant. Provides the model information to
741
+ * differentiate between participants of the same role.
742
+ */
743
+ name?: string;
744
+ }
745
+ /**
746
+ * Specifying a particular function via `{"name": "my_function"}` forces the model
747
+ * to call that function.
748
+ */
749
+ export interface ChatCompletionFunctionCallOption {
750
+ /**
751
+ * The name of the function to call.
752
+ */
753
+ name: string;
754
+ }
755
+ /**
756
+ * @deprecated
757
+ */
758
+ export interface ChatCompletionFunctionMessageParam {
759
+ /**
760
+ * The contents of the function message.
761
+ */
762
+ content: string | null;
763
+ /**
764
+ * The name of the function to call.
765
+ */
766
+ name: string;
767
+ /**
768
+ * The role of the messages author, in this case `function`.
769
+ */
770
+ role: 'function';
771
+ }
772
+ /**
773
+ * A function tool that can be used to generate a response.
774
+ */
775
+ export interface ChatCompletionFunctionTool {
776
+ function: Shared.FunctionDefinition;
777
+ /**
778
+ * The type of the tool. Currently, only `function` is supported.
779
+ */
780
+ type: 'function';
781
+ }
782
+ /**
783
+ * A chat completion message generated by the model.
784
+ */
785
+ export interface ChatCompletionMessage {
786
+ /**
787
+ * The contents of the message.
788
+ */
789
+ content: string | null;
790
+ /**
791
+ * The refusal message generated by the model.
792
+ */
793
+ refusal: string | null;
794
+ /**
795
+ * The role of the author of this message.
796
+ */
797
+ role: 'assistant';
798
+ /**
799
+ * Annotations for the message, when applicable, as when using the
800
+ * [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat).
801
+ */
802
+ annotations?: Array<ChatCompletionMessage.Annotation>;
803
+ /**
804
+ * If the audio output modality is requested, this object contains data about the
805
+ * audio response from the model.
806
+ * [Learn more](https://platform.openai.com/docs/guides/audio).
807
+ */
808
+ audio?: ChatCompletionAudio | null;
809
+ /**
810
+ * @deprecated Deprecated and replaced by `tool_calls`. The name and arguments of a
811
+ * function that should be called, as generated by the model.
812
+ */
813
+ function_call?: ChatCompletionMessage.FunctionCall | null;
814
+ /**
815
+ * The tool calls generated by the model, such as function calls.
816
+ */
817
+ tool_calls?: Array<ChatCompletionMessageToolCall>;
818
+ }
819
+ export declare namespace ChatCompletionMessage {
820
+ /**
821
+ * A URL citation when using web search.
822
+ */
823
+ interface Annotation {
824
+ /**
825
+ * The type of the URL citation. Always `url_citation`.
826
+ */
827
+ type: 'url_citation';
828
+ /**
829
+ * A URL citation when using web search.
830
+ */
831
+ url_citation: Annotation.URLCitation;
832
+ }
833
+ namespace Annotation {
834
+ /**
835
+ * A URL citation when using web search.
836
+ */
837
+ interface URLCitation {
838
+ /**
839
+ * The index of the last character of the URL citation in the message.
840
+ */
841
+ end_index: number;
842
+ /**
843
+ * The index of the first character of the URL citation in the message.
844
+ */
845
+ start_index: number;
846
+ /**
847
+ * The title of the web resource.
848
+ */
849
+ title: string;
850
+ /**
851
+ * The URL of the web resource.
852
+ */
853
+ url: string;
854
+ }
855
+ }
856
+ /**
857
+ * @deprecated Deprecated and replaced by `tool_calls`. The name and arguments of a
858
+ * function that should be called, as generated by the model.
859
+ */
860
+ interface FunctionCall {
861
+ /**
862
+ * The arguments to call the function with, as generated by the model in JSON
863
+ * format. Note that the model does not always generate valid JSON, and may
864
+ * hallucinate parameters not defined by your function schema. Validate the
865
+ * arguments in your code before calling your function.
866
+ */
867
+ arguments: string;
868
+ /**
869
+ * The name of the function to call.
870
+ */
871
+ name: string;
872
+ }
873
+ }
874
+ /**
875
+ * A call to a custom tool created by the model.
876
+ */
877
+ export interface ChatCompletionMessageCustomToolCall {
878
+ /**
879
+ * The ID of the tool call.
880
+ */
881
+ id: string;
882
+ /**
883
+ * The custom tool that the model called.
884
+ */
885
+ custom: ChatCompletionMessageCustomToolCall.Custom;
886
+ /**
887
+ * The type of the tool. Always `custom`.
888
+ */
889
+ type: 'custom';
890
+ }
891
+ export declare namespace ChatCompletionMessageCustomToolCall {
892
+ /**
893
+ * The custom tool that the model called.
894
+ */
895
+ interface Custom {
896
+ /**
897
+ * The input for the custom tool call generated by the model.
898
+ */
899
+ input: string;
900
+ /**
901
+ * The name of the custom tool to call.
902
+ */
903
+ name: string;
904
+ }
905
+ }
906
+ /**
907
+ * A call to a function tool created by the model.
908
+ */
909
+ export interface ChatCompletionMessageFunctionToolCall {
910
+ /**
911
+ * The ID of the tool call.
912
+ */
913
+ id: string;
914
+ /**
915
+ * The function that the model called.
916
+ */
917
+ function: ChatCompletionMessageFunctionToolCall.Function;
918
+ /**
919
+ * The type of the tool. Currently, only `function` is supported.
920
+ */
921
+ type: 'function';
922
+ }
923
+ export declare namespace ChatCompletionMessageFunctionToolCall {
924
+ /**
925
+ * The function that the model called.
926
+ */
927
+ interface Function {
928
+ /**
929
+ * The arguments to call the function with, as generated by the model in JSON
930
+ * format. Note that the model does not always generate valid JSON, and may
931
+ * hallucinate parameters not defined by your function schema. Validate the
932
+ * arguments in your code before calling your function.
933
+ */
934
+ arguments: string;
935
+ /**
936
+ * The name of the function to call.
937
+ */
938
+ name: string;
939
+ }
940
+ }
941
+ /**
942
+ * Developer-provided instructions that the model should follow, regardless of
943
+ * messages sent by the user. With o1 models and newer, `developer` messages
944
+ * replace the previous `system` messages.
945
+ */
946
+ export type ChatCompletionMessageParam = ChatCompletionDeveloperMessageParam | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam;
947
+ /**
948
+ * A call to a function tool created by the model.
949
+ */
950
+ export type ChatCompletionMessageToolCall = ChatCompletionMessageFunctionToolCall | ChatCompletionMessageCustomToolCall;
951
+ export type ChatCompletionModality = 'text' | 'audio';
952
+ /**
953
+ * Specifies a tool the model should use. Use to force the model to call a specific
954
+ * function.
955
+ */
956
+ export interface ChatCompletionNamedToolChoice {
957
+ function: ChatCompletionNamedToolChoice.Function;
958
+ /**
959
+ * For function calling, the type is always `function`.
960
+ */
961
+ type: 'function';
962
+ }
963
+ export declare namespace ChatCompletionNamedToolChoice {
964
+ interface Function {
965
+ /**
966
+ * The name of the function to call.
967
+ */
968
+ name: string;
969
+ }
970
+ }
971
+ /**
972
+ * Specifies a tool the model should use. Use to force the model to call a specific
973
+ * custom tool.
974
+ */
975
+ export interface ChatCompletionNamedToolChoiceCustom {
976
+ custom: ChatCompletionNamedToolChoiceCustom.Custom;
977
+ /**
978
+ * For custom tool calling, the type is always `custom`.
979
+ */
980
+ type: 'custom';
981
+ }
982
+ export declare namespace ChatCompletionNamedToolChoiceCustom {
983
+ interface Custom {
984
+ /**
985
+ * The name of the custom tool to call.
986
+ */
987
+ name: string;
988
+ }
989
+ }
990
+ /**
991
+ * Static predicted output content, such as the content of a text file that is
992
+ * being regenerated.
993
+ */
994
+ export interface ChatCompletionPredictionContent {
995
+ /**
996
+ * The content that should be matched when generating a model response. If
997
+ * generated tokens would match this content, the entire model response can be
998
+ * returned much more quickly.
999
+ */
1000
+ content: string | Array<ChatCompletionContentPartText>;
1001
+ /**
1002
+ * The type of the predicted content you want to provide. This type is currently
1003
+ * always `content`.
1004
+ */
1005
+ type: 'content';
1006
+ }
1007
+ /**
1008
+ * The role of the author of a message
1009
+ */
1010
+ export type ChatCompletionRole = 'developer' | 'system' | 'user' | 'assistant' | 'tool' | 'function';
1011
+ /**
1012
+ * A chat completion message generated by the model.
1013
+ */
1014
+ export interface ChatCompletionStoreMessage extends ChatCompletionMessage {
1015
+ /**
1016
+ * The identifier of the chat message.
1017
+ */
1018
+ id: string;
1019
+ /**
1020
+ * If a content parts array was provided, this is an array of `text` and
1021
+ * `image_url` parts. Otherwise, null.
1022
+ */
1023
+ content_parts?: Array<ChatCompletionContentPartText | ChatCompletionContentPartImage> | null;
1024
+ }
1025
+ /**
1026
+ * Options for streaming response. Only set this when you set `stream: true`.
1027
+ */
1028
+ export interface ChatCompletionStreamOptions {
1029
+ /**
1030
+ * When true, stream obfuscation will be enabled. Stream obfuscation adds random
1031
+ * characters to an `obfuscation` field on streaming delta events to normalize
1032
+ * payload sizes as a mitigation to certain side-channel attacks. These obfuscation
1033
+ * fields are included by default, but add a small amount of overhead to the data
1034
+ * stream. You can set `include_obfuscation` to false to optimize for bandwidth if
1035
+ * you trust the network links between your application and the OpenAI API.
1036
+ */
1037
+ include_obfuscation?: boolean;
1038
+ /**
1039
+ * If set, an additional chunk will be streamed before the `data: [DONE]` message.
1040
+ * The `usage` field on this chunk shows the token usage statistics for the entire
1041
+ * request, and the `choices` field will always be an empty array.
1042
+ *
1043
+ * All other chunks will also include a `usage` field, but with a null value.
1044
+ * **NOTE:** If the stream is interrupted, you may not receive the final usage
1045
+ * chunk which contains the total token usage for the request.
1046
+ */
1047
+ include_usage?: boolean;
1048
+ }
1049
+ /**
1050
+ * Developer-provided instructions that the model should follow, regardless of
1051
+ * messages sent by the user. With o1 models and newer, use `developer` messages
1052
+ * for this purpose instead.
1053
+ */
1054
+ export interface ChatCompletionSystemMessageParam {
1055
+ /**
1056
+ * The contents of the system message.
1057
+ */
1058
+ content: string | Array<ChatCompletionContentPartText>;
1059
+ /**
1060
+ * The role of the messages author, in this case `system`.
1061
+ */
1062
+ role: 'system';
1063
+ /**
1064
+ * An optional name for the participant. Provides the model information to
1065
+ * differentiate between participants of the same role.
1066
+ */
1067
+ name?: string;
1068
+ }
1069
+ export interface ChatCompletionTokenLogprob {
1070
+ /**
1071
+ * The token.
1072
+ */
1073
+ token: string;
1074
+ /**
1075
+ * A list of integers representing the UTF-8 bytes representation of the token.
1076
+ * Useful in instances where characters are represented by multiple tokens and
1077
+ * their byte representations must be combined to generate the correct text
1078
+ * representation. Can be `null` if there is no bytes representation for the token.
1079
+ */
1080
+ bytes: Array<number> | null;
1081
+ /**
1082
+ * The log probability of this token, if it is within the top 20 most likely
1083
+ * tokens. Otherwise, the value `-9999.0` is used to signify that the token is very
1084
+ * unlikely.
1085
+ */
1086
+ logprob: number;
1087
+ /**
1088
+ * List of the most likely tokens and their log probability, at this token
1089
+ * position. In rare cases, there may be fewer than the number of requested
1090
+ * `top_logprobs` returned.
1091
+ */
1092
+ top_logprobs: Array<ChatCompletionTokenLogprob.TopLogprob>;
1093
+ }
1094
+ export declare namespace ChatCompletionTokenLogprob {
1095
+ interface TopLogprob {
1096
+ /**
1097
+ * The token.
1098
+ */
1099
+ token: string;
1100
+ /**
1101
+ * A list of integers representing the UTF-8 bytes representation of the token.
1102
+ * Useful in instances where characters are represented by multiple tokens and
1103
+ * their byte representations must be combined to generate the correct text
1104
+ * representation. Can be `null` if there is no bytes representation for the token.
1105
+ */
1106
+ bytes: Array<number> | null;
1107
+ /**
1108
+ * The log probability of this token, if it is within the top 20 most likely
1109
+ * tokens. Otherwise, the value `-9999.0` is used to signify that the token is very
1110
+ * unlikely.
1111
+ */
1112
+ logprob: number;
1113
+ }
1114
+ }
1115
+ /**
1116
+ * A function tool that can be used to generate a response.
1117
+ */
1118
+ export type ChatCompletionTool = ChatCompletionFunctionTool | ChatCompletionCustomTool;
1119
+ /**
1120
+ * Controls which (if any) tool is called by the model. `none` means the model will
1121
+ * not call any tool and instead generates a message. `auto` means the model can
1122
+ * pick between generating a message or calling one or more tools. `required` means
1123
+ * the model must call one or more tools. Specifying a particular tool via
1124
+ * `{"type": "function", "function": {"name": "my_function"}}` forces the model to
1125
+ * call that tool.
1126
+ *
1127
+ * `none` is the default when no tools are present. `auto` is the default if tools
1128
+ * are present.
1129
+ */
1130
+ export type ChatCompletionToolChoiceOption = 'none' | 'auto' | 'required' | ChatCompletionAllowedToolChoice | ChatCompletionNamedToolChoice | ChatCompletionNamedToolChoiceCustom;
1131
+ export interface ChatCompletionToolMessageParam {
1132
+ /**
1133
+ * The contents of the tool message.
1134
+ */
1135
+ content: string | Array<ChatCompletionContentPartText>;
1136
+ /**
1137
+ * The role of the messages author, in this case `tool`.
1138
+ */
1139
+ role: 'tool';
1140
+ /**
1141
+ * Tool call that this message is responding to.
1142
+ */
1143
+ tool_call_id: string;
1144
+ }
1145
+ /**
1146
+ * Messages sent by an end user, containing prompts or additional context
1147
+ * information.
1148
+ */
1149
+ export interface ChatCompletionUserMessageParam {
1150
+ /**
1151
+ * The contents of the user message.
1152
+ */
1153
+ content: string | Array<ChatCompletionContentPart>;
1154
+ /**
1155
+ * The role of the messages author, in this case `user`.
1156
+ */
1157
+ role: 'user';
1158
+ /**
1159
+ * An optional name for the participant. Provides the model information to
1160
+ * differentiate between participants of the same role.
1161
+ */
1162
+ name?: string;
1163
+ }
1164
+ /**
1165
+ * Constrains the tools available to the model to a pre-defined set.
1166
+ */
1167
+ export interface ChatCompletionAllowedTools {
1168
+ /**
1169
+ * Constrains the tools available to the model to a pre-defined set.
1170
+ *
1171
+ * `auto` allows the model to pick from among the allowed tools and generate a
1172
+ * message.
1173
+ *
1174
+ * `required` requires the model to call one or more of the allowed tools.
1175
+ */
1176
+ mode: 'auto' | 'required';
1177
+ /**
1178
+ * A list of tool definitions that the model should be allowed to call.
1179
+ *
1180
+ * For the Chat Completions API, the list of tool definitions might look like:
1181
+ *
1182
+ * ```json
1183
+ * [
1184
+ * { "type": "function", "function": { "name": "get_weather" } },
1185
+ * { "type": "function", "function": { "name": "get_time" } }
1186
+ * ]
1187
+ * ```
1188
+ */
1189
+ tools: Array<{
1190
+ [key: string]: unknown;
1191
+ }>;
1192
+ }
1193
+ export type ChatCompletionReasoningEffort = Shared.ReasoningEffort | null;
1194
+ export type ChatCompletionCreateParams = ChatCompletionCreateParamsNonStreaming | ChatCompletionCreateParamsStreaming;
1195
+ export interface ChatCompletionCreateParamsBase {
1196
+ /**
1197
+ * A list of messages comprising the conversation so far. Depending on the
1198
+ * [model](https://platform.openai.com/docs/models) you use, different message
1199
+ * types (modalities) are supported, like
1200
+ * [text](https://platform.openai.com/docs/guides/text-generation),
1201
+ * [images](https://platform.openai.com/docs/guides/vision), and
1202
+ * [audio](https://platform.openai.com/docs/guides/audio).
1203
+ */
1204
+ messages: Array<ChatCompletionMessageParam>;
1205
+ /**
1206
+ * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
1207
+ * wide range of models with different capabilities, performance characteristics,
1208
+ * and price points. Refer to the
1209
+ * [model guide](https://platform.openai.com/docs/models) to browse and compare
1210
+ * available models.
1211
+ */
1212
+ model: (string & {}) | Shared.ChatModel;
1213
+ /**
1214
+ * Parameters for audio output. Required when audio output is requested with
1215
+ * `modalities: ["audio"]`.
1216
+ * [Learn more](https://platform.openai.com/docs/guides/audio).
1217
+ */
1218
+ audio?: ChatCompletionAudioParam | null;
1219
+ /**
1220
+ * Number between -2.0 and 2.0. Positive values penalize new tokens based on their
1221
+ * existing frequency in the text so far, decreasing the model's likelihood to
1222
+ * repeat the same line verbatim.
1223
+ */
1224
+ frequency_penalty?: number | null;
1225
+ /**
1226
+ * @deprecated Deprecated in favor of `tool_choice`.
1227
+ *
1228
+ * Controls which (if any) function is called by the model.
1229
+ *
1230
+ * `none` means the model will not call a function and instead generates a message.
1231
+ *
1232
+ * `auto` means the model can pick between generating a message or calling a
1233
+ * function.
1234
+ *
1235
+ * Specifying a particular function via `{"name": "my_function"}` forces the model
1236
+ * to call that function.
1237
+ *
1238
+ * `none` is the default when no functions are present. `auto` is the default if
1239
+ * functions are present.
1240
+ */
1241
+ function_call?: 'none' | 'auto' | ChatCompletionFunctionCallOption;
1242
+ /**
1243
+ * @deprecated Deprecated in favor of `tools`.
1244
+ *
1245
+ * A list of functions the model may generate JSON inputs for.
1246
+ */
1247
+ functions?: Array<ChatCompletionCreateParams.Function>;
1248
+ /**
1249
+ * Modify the likelihood of specified tokens appearing in the completion.
1250
+ *
1251
+ * Accepts a JSON object that maps tokens (specified by their token ID in the
1252
+ * tokenizer) to an associated bias value from -100 to 100. Mathematically, the
1253
+ * bias is added to the logits generated by the model prior to sampling. The exact
1254
+ * effect will vary per model, but values between -1 and 1 should decrease or
1255
+ * increase likelihood of selection; values like -100 or 100 should result in a ban
1256
+ * or exclusive selection of the relevant token.
1257
+ */
1258
+ logit_bias?: {
1259
+ [key: string]: number;
1260
+ } | null;
1261
+ /**
1262
+ * Whether to return log probabilities of the output tokens or not. If true,
1263
+ * returns the log probabilities of each output token returned in the `content` of
1264
+ * `message`.
1265
+ */
1266
+ logprobs?: boolean | null;
1267
+ /**
1268
+ * An upper bound for the number of tokens that can be generated for a completion,
1269
+ * including visible output tokens and
1270
+ * [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).
1271
+ */
1272
+ max_completion_tokens?: number | null;
1273
+ /**
1274
+ * @deprecated The maximum number of [tokens](/tokenizer) that can be generated in
1275
+ * the chat completion. This value can be used to control
1276
+ * [costs](https://openai.com/api/pricing/) for text generated via API.
1277
+ *
1278
+ * This value is now deprecated in favor of `max_completion_tokens`, and is not
1279
+ * compatible with
1280
+ * [o-series models](https://platform.openai.com/docs/guides/reasoning).
1281
+ */
1282
+ max_tokens?: number | null;
1283
+ /**
1284
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful
1285
+ * for storing additional information about the object in a structured format, and
1286
+ * querying for objects via API or the dashboard.
1287
+ *
1288
+ * Keys are strings with a maximum length of 64 characters. Values are strings with
1289
+ * a maximum length of 512 characters.
1290
+ */
1291
+ metadata?: Shared.Metadata | null;
1292
+ /**
1293
+ * Output types that you would like the model to generate. Most models are capable
1294
+ * of generating text, which is the default:
1295
+ *
1296
+ * `["text"]`
1297
+ *
1298
+ * The `gpt-4o-audio-preview` model can also be used to
1299
+ * [generate audio](https://platform.openai.com/docs/guides/audio). To request that
1300
+ * this model generate both text and audio responses, you can use:
1301
+ *
1302
+ * `["text", "audio"]`
1303
+ */
1304
+ modalities?: Array<'text' | 'audio'> | null;
1305
+ /**
1306
+ * How many chat completion choices to generate for each input message. Note that
1307
+ * you will be charged based on the number of generated tokens across all of the
1308
+ * choices. Keep `n` as `1` to minimize costs.
1309
+ */
1310
+ n?: number | null;
1311
+ /**
1312
+ * Whether to enable
1313
+ * [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling)
1314
+ * during tool use.
1315
+ */
1316
+ parallel_tool_calls?: boolean;
1317
+ /**
1318
+ * Static predicted output content, such as the content of a text file that is
1319
+ * being regenerated.
1320
+ */
1321
+ prediction?: ChatCompletionPredictionContent | null;
1322
+ /**
1323
+ * Number between -2.0 and 2.0. Positive values penalize new tokens based on
1324
+ * whether they appear in the text so far, increasing the model's likelihood to
1325
+ * talk about new topics.
1326
+ */
1327
+ presence_penalty?: number | null;
1328
+ /**
1329
+ * Used by OpenAI to cache responses for similar requests to optimize your cache
1330
+ * hit rates. Replaces the `user` field.
1331
+ * [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
1332
+ */
1333
+ prompt_cache_key?: string;
1334
+ /**
1335
+ * Constrains effort on reasoning for
1336
+ * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
1337
+ * supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
1338
+ * effort can result in faster responses and fewer tokens used on reasoning in a
1339
+ * response.
1340
+ */
1341
+ reasoning_effort?: Shared.ReasoningEffort | null;
1342
+ /**
1343
+ * An object specifying the format that the model must output.
1344
+ *
1345
+ * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
1346
+ * Outputs which ensures the model will match your supplied JSON schema. Learn more
1347
+ * in the
1348
+ * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
1349
+ *
1350
+ * Setting to `{ "type": "json_object" }` enables the older JSON mode, which
1351
+ * ensures the message the model generates is valid JSON. Using `json_schema` is
1352
+ * preferred for models that support it.
1353
+ */
1354
+ response_format?: Shared.ResponseFormatText | Shared.ResponseFormatJSONSchema | Shared.ResponseFormatJSONObject;
1355
+ /**
1356
+ * A stable identifier used to help detect users of your application that may be
1357
+ * violating OpenAI's usage policies. The IDs should be a string that uniquely
1358
+ * identifies each user. We recommend hashing their username or email address, in
1359
+ * order to avoid sending us any identifying information.
1360
+ * [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
1361
+ */
1362
+ safety_identifier?: string;
1363
+ /**
1364
+ * @deprecated This feature is in Beta. If specified, our system will make a best
1365
+ * effort to sample deterministically, such that repeated requests with the same
1366
+ * `seed` and parameters should return the same result. Determinism is not
1367
+ * guaranteed, and you should refer to the `system_fingerprint` response parameter
1368
+ * to monitor changes in the backend.
1369
+ */
1370
+ seed?: number | null;
1371
+ /**
1372
+ * Specifies the processing type used for serving the request.
1373
+ *
1374
+ * - If set to 'auto', then the request will be processed with the service tier
1375
+ * configured in the Project settings. Unless otherwise configured, the Project
1376
+ * will use 'default'.
1377
+ * - If set to 'default', then the request will be processed with the standard
1378
+ * pricing and performance for the selected model.
1379
+ * - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
1380
+ * '[priority](https://openai.com/api-priority-processing/)', then the request
1381
+ * will be processed with the corresponding service tier.
1382
+ * - When not set, the default behavior is 'auto'.
1383
+ *
1384
+ * When the `service_tier` parameter is set, the response body will include the
1385
+ * `service_tier` value based on the processing mode actually used to serve the
1386
+ * request. This response value may be different from the value set in the
1387
+ * parameter.
1388
+ */
1389
+ service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority' | null;
1390
+ /**
1391
+ * Not supported with latest reasoning models `o3` and `o4-mini`.
1392
+ *
1393
+ * Up to 4 sequences where the API will stop generating further tokens. The
1394
+ * returned text will not contain the stop sequence.
1395
+ */
1396
+ stop?: string | null | Array<string>;
1397
+ /**
1398
+ * Whether or not to store the output of this chat completion request for use in
1399
+ * our [model distillation](https://platform.openai.com/docs/guides/distillation)
1400
+ * or [evals](https://platform.openai.com/docs/guides/evals) products.
1401
+ *
1402
+ * Supports text and image inputs. Note: image inputs over 8MB will be dropped.
1403
+ */
1404
+ store?: boolean | null;
1405
+ /**
1406
+ * If set to true, the model response data will be streamed to the client as it is
1407
+ * generated using
1408
+ * [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
1409
+ * See the
1410
+ * [Streaming section below](https://platform.openai.com/docs/api-reference/chat/streaming)
1411
+ * for more information, along with the
1412
+ * [streaming responses](https://platform.openai.com/docs/guides/streaming-responses)
1413
+ * guide for more information on how to handle the streaming events.
1414
+ */
1415
+ stream?: boolean | null;
1416
+ /**
1417
+ * Options for streaming response. Only set this when you set `stream: true`.
1418
+ */
1419
+ stream_options?: ChatCompletionStreamOptions | null;
1420
+ /**
1421
+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
1422
+ * make the output more random, while lower values like 0.2 will make it more
1423
+ * focused and deterministic. We generally recommend altering this or `top_p` but
1424
+ * not both.
1425
+ */
1426
+ temperature?: number | null;
1427
+ /**
1428
+ * Controls which (if any) tool is called by the model. `none` means the model will
1429
+ * not call any tool and instead generates a message. `auto` means the model can
1430
+ * pick between generating a message or calling one or more tools. `required` means
1431
+ * the model must call one or more tools. Specifying a particular tool via
1432
+ * `{"type": "function", "function": {"name": "my_function"}}` forces the model to
1433
+ * call that tool.
1434
+ *
1435
+ * `none` is the default when no tools are present. `auto` is the default if tools
1436
+ * are present.
1437
+ */
1438
+ tool_choice?: ChatCompletionToolChoiceOption;
1439
+ /**
1440
+ * A list of tools the model may call. You can provide either
1441
+ * [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
1442
+ * or [function tools](https://platform.openai.com/docs/guides/function-calling).
1443
+ */
1444
+ tools?: Array<ChatCompletionTool>;
1445
+ /**
1446
+ * An integer between 0 and 20 specifying the number of most likely tokens to
1447
+ * return at each token position, each with an associated log probability.
1448
+ * `logprobs` must be set to `true` if this parameter is used.
1449
+ */
1450
+ top_logprobs?: number | null;
1451
+ /**
1452
+ * An alternative to sampling with temperature, called nucleus sampling, where the
1453
+ * model considers the results of the tokens with top_p probability mass. So 0.1
1454
+ * means only the tokens comprising the top 10% probability mass are considered.
1455
+ *
1456
+ * We generally recommend altering this or `temperature` but not both.
1457
+ */
1458
+ top_p?: number | null;
1459
+ /**
1460
+ * @deprecated This field is being replaced by `safety_identifier` and
1461
+ * `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching
1462
+ * optimizations. A stable identifier for your end-users. Used to boost cache hit
1463
+ * rates by better bucketing similar requests and to help OpenAI detect and prevent
1464
+ * abuse.
1465
+ * [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
1466
+ */
1467
+ user?: string;
1468
+ /**
1469
+ * Constrains the verbosity of the model's response. Lower values will result in
1470
+ * more concise responses, while higher values will result in more verbose
1471
+ * responses. Currently supported values are `low`, `medium`, and `high`.
1472
+ */
1473
+ verbosity?: 'low' | 'medium' | 'high' | null;
1474
+ /**
1475
+ * This tool searches the web for relevant results to use in a response. Learn more
1476
+ * about the
1477
+ * [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat).
1478
+ */
1479
+ web_search_options?: ChatCompletionCreateParams.WebSearchOptions;
1480
+ }
1481
+ export declare namespace ChatCompletionCreateParams {
1482
+ /**
1483
+ * @deprecated
1484
+ */
1485
+ interface Function {
1486
+ /**
1487
+ * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain
1488
+ * underscores and dashes, with a maximum length of 64.
1489
+ */
1490
+ name: string;
1491
+ /**
1492
+ * A description of what the function does, used by the model to choose when and
1493
+ * how to call the function.
1494
+ */
1495
+ description?: string;
1496
+ /**
1497
+ * The parameters the functions accepts, described as a JSON Schema object. See the
1498
+ * [guide](https://platform.openai.com/docs/guides/function-calling) for examples,
1499
+ * and the
1500
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
1501
+ * documentation about the format.
1502
+ *
1503
+ * Omitting `parameters` defines a function with an empty parameter list.
1504
+ */
1505
+ parameters?: Shared.FunctionParameters;
1506
+ }
1507
+ /**
1508
+ * This tool searches the web for relevant results to use in a response. Learn more
1509
+ * about the
1510
+ * [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat).
1511
+ */
1512
+ interface WebSearchOptions {
1513
+ /**
1514
+ * High level guidance for the amount of context window space to use for the
1515
+ * search. One of `low`, `medium`, or `high`. `medium` is the default.
1516
+ */
1517
+ search_context_size?: 'low' | 'medium' | 'high';
1518
+ /**
1519
+ * Approximate location parameters for the search.
1520
+ */
1521
+ user_location?: WebSearchOptions.UserLocation | null;
1522
+ }
1523
+ namespace WebSearchOptions {
1524
+ /**
1525
+ * Approximate location parameters for the search.
1526
+ */
1527
+ interface UserLocation {
1528
+ /**
1529
+ * Approximate location parameters for the search.
1530
+ */
1531
+ approximate: UserLocation.Approximate;
1532
+ /**
1533
+ * The type of location approximation. Always `approximate`.
1534
+ */
1535
+ type: 'approximate';
1536
+ }
1537
+ namespace UserLocation {
1538
+ /**
1539
+ * Approximate location parameters for the search.
1540
+ */
1541
+ interface Approximate {
1542
+ /**
1543
+ * Free text input for the city of the user, e.g. `San Francisco`.
1544
+ */
1545
+ city?: string;
1546
+ /**
1547
+ * The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of
1548
+ * the user, e.g. `US`.
1549
+ */
1550
+ country?: string;
1551
+ /**
1552
+ * Free text input for the region of the user, e.g. `California`.
1553
+ */
1554
+ region?: string;
1555
+ /**
1556
+ * The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the
1557
+ * user, e.g. `America/Los_Angeles`.
1558
+ */
1559
+ timezone?: string;
1560
+ }
1561
+ }
1562
+ }
1563
+ type ChatCompletionCreateParamsNonStreaming = CompletionsCompletionsAPI.ChatCompletionCreateParamsNonStreaming;
1564
+ type ChatCompletionCreateParamsStreaming = CompletionsCompletionsAPI.ChatCompletionCreateParamsStreaming;
1565
+ }
1566
+ export interface ChatCompletionCreateParamsNonStreaming extends ChatCompletionCreateParamsBase {
1567
+ /**
1568
+ * If set to true, the model response data will be streamed to the client as it is
1569
+ * generated using
1570
+ * [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
1571
+ * See the
1572
+ * [Streaming section below](https://platform.openai.com/docs/api-reference/chat/streaming)
1573
+ * for more information, along with the
1574
+ * [streaming responses](https://platform.openai.com/docs/guides/streaming-responses)
1575
+ * guide for more information on how to handle the streaming events.
1576
+ */
1577
+ stream?: false | null;
1578
+ }
1579
+ export interface ChatCompletionCreateParamsStreaming extends ChatCompletionCreateParamsBase {
1580
+ /**
1581
+ * If set to true, the model response data will be streamed to the client as it is
1582
+ * generated using
1583
+ * [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
1584
+ * See the
1585
+ * [Streaming section below](https://platform.openai.com/docs/api-reference/chat/streaming)
1586
+ * for more information, along with the
1587
+ * [streaming responses](https://platform.openai.com/docs/guides/streaming-responses)
1588
+ * guide for more information on how to handle the streaming events.
1589
+ */
1590
+ stream: true;
1591
+ }
1592
+ export interface ChatCompletionUpdateParams {
1593
+ /**
1594
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful
1595
+ * for storing additional information about the object in a structured format, and
1596
+ * querying for objects via API or the dashboard.
1597
+ *
1598
+ * Keys are strings with a maximum length of 64 characters. Values are strings with
1599
+ * a maximum length of 512 characters.
1600
+ */
1601
+ metadata: Shared.Metadata | null;
1602
+ }
1603
+ export interface ChatCompletionListParams extends CursorPageParams {
1604
+ /**
1605
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful
1606
+ * for storing additional information about the object in a structured format, and
1607
+ * querying for objects via API or the dashboard.
1608
+ *
1609
+ * Keys are strings with a maximum length of 64 characters. Values are strings with
1610
+ * a maximum length of 512 characters.
1611
+ */
1612
+ metadata?: Shared.Metadata | null;
1613
+ /**
1614
+ * The model used to generate the Chat Completions.
1615
+ */
1616
+ model?: string;
1617
+ /**
1618
+ * Sort order for Chat Completions by timestamp. Use `asc` for ascending order or
1619
+ * `desc` for descending order. Defaults to `asc`.
1620
+ */
1621
+ order?: 'asc' | 'desc';
1622
+ }
1623
+ export declare namespace Completions {
1624
+ export { type ChatCompletion as ChatCompletion, type ChatCompletionAllowedToolChoice as ChatCompletionAllowedToolChoice, type ChatCompletionAssistantMessageParam as ChatCompletionAssistantMessageParam, type ChatCompletionAudio as ChatCompletionAudio, type ChatCompletionAudioParam as ChatCompletionAudioParam, type ChatCompletionChunk as ChatCompletionChunk, type ChatCompletionContentPart as ChatCompletionContentPart, type ChatCompletionContentPartImage as ChatCompletionContentPartImage, type ChatCompletionContentPartInputAudio as ChatCompletionContentPartInputAudio, type ChatCompletionContentPartRefusal as ChatCompletionContentPartRefusal, type ChatCompletionContentPartText as ChatCompletionContentPartText, type ChatCompletionCustomTool as ChatCompletionCustomTool, type ChatCompletionDeleted as ChatCompletionDeleted, type ChatCompletionDeveloperMessageParam as ChatCompletionDeveloperMessageParam, type ChatCompletionFunctionCallOption as ChatCompletionFunctionCallOption, type ChatCompletionFunctionMessageParam as ChatCompletionFunctionMessageParam, type ChatCompletionFunctionTool as ChatCompletionFunctionTool, type ChatCompletionMessage as ChatCompletionMessage, type ChatCompletionMessageCustomToolCall as ChatCompletionMessageCustomToolCall, type ChatCompletionMessageFunctionToolCall as ChatCompletionMessageFunctionToolCall, type ChatCompletionMessageParam as ChatCompletionMessageParam, type ChatCompletionMessageToolCall as ChatCompletionMessageToolCall, type ChatCompletionModality as ChatCompletionModality, type ChatCompletionNamedToolChoice as ChatCompletionNamedToolChoice, type ChatCompletionNamedToolChoiceCustom as ChatCompletionNamedToolChoiceCustom, type ChatCompletionPredictionContent as ChatCompletionPredictionContent, type ChatCompletionRole as ChatCompletionRole, type ChatCompletionStoreMessage as ChatCompletionStoreMessage, type ChatCompletionStreamOptions as ChatCompletionStreamOptions, type ChatCompletionSystemMessageParam as ChatCompletionSystemMessageParam, type ChatCompletionTokenLogprob as ChatCompletionTokenLogprob, type ChatCompletionTool as ChatCompletionTool, type ChatCompletionToolChoiceOption as ChatCompletionToolChoiceOption, type ChatCompletionToolMessageParam as ChatCompletionToolMessageParam, type ChatCompletionUserMessageParam as ChatCompletionUserMessageParam, type ChatCompletionAllowedTools as ChatCompletionAllowedTools, type ChatCompletionReasoningEffort as ChatCompletionReasoningEffort, type ChatCompletionsPage as ChatCompletionsPage, type ChatCompletionCreateParams as ChatCompletionCreateParams, type ChatCompletionCreateParamsNonStreaming as ChatCompletionCreateParamsNonStreaming, type ChatCompletionCreateParamsStreaming as ChatCompletionCreateParamsStreaming, type ChatCompletionUpdateParams as ChatCompletionUpdateParams, type ChatCompletionListParams as ChatCompletionListParams, };
1625
+ export { Messages as Messages, type MessageListParams as MessageListParams };
1626
+ }
1627
+ //# sourceMappingURL=completions.d.mts.map