@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,1044 @@
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import * as ThreadsAPI from "./threads.js";
3
+ import * as Shared from "../../shared.js";
4
+ import * as AssistantsAPI from "../assistants.js";
5
+ import * as MessagesAPI from "./messages.js";
6
+ import { Annotation, AnnotationDelta, FileCitationAnnotation, FileCitationDeltaAnnotation, FilePathAnnotation, FilePathDeltaAnnotation, ImageFile, ImageFileContentBlock, ImageFileDelta, ImageFileDeltaBlock, ImageURL, ImageURLContentBlock, ImageURLDelta, ImageURLDeltaBlock, Message as MessagesAPIMessage, MessageContent, MessageContentDelta, MessageContentPartParam, MessageCreateParams, MessageDeleteParams, MessageDeleted, MessageDelta, MessageDeltaEvent, MessageListParams, MessageRetrieveParams, MessageUpdateParams, Messages, MessagesPage, RefusalContentBlock, RefusalDeltaBlock, Text, TextContentBlock, TextContentBlockParam, TextDelta, TextDeltaBlock } from "./messages.js";
7
+ import * as RunsAPI from "./runs/runs.js";
8
+ import { RequiredActionFunctionToolCall, Run, RunCreateAndPollParams, RunCreateAndStreamParams, RunCancelParams, RunCreateParams, RunCreateParamsNonStreaming, RunCreateParamsStreaming, RunListParams, RunRetrieveParams, RunStatus, RunStreamParams, RunSubmitToolOutputsAndPollParams, RunSubmitToolOutputsParams, RunSubmitToolOutputsParamsNonStreaming, RunSubmitToolOutputsParamsStreaming, RunSubmitToolOutputsStreamParams, RunUpdateParams, Runs, RunsPage } from "./runs/runs.js";
9
+ import { APIPromise } from "../../../core/api-promise.js";
10
+ import { Stream } from "../../../core/streaming.js";
11
+ import { RequestOptions } from "../../../internal/request-options.js";
12
+ import { AssistantStream, ThreadCreateAndRunParamsBaseStream } from "../../../lib/AssistantStream.js";
13
+ /**
14
+ * @deprecated The Assistants API is deprecated in favor of the Responses API
15
+ */
16
+ export declare class Threads extends APIResource {
17
+ runs: RunsAPI.Runs;
18
+ messages: MessagesAPI.Messages;
19
+ /**
20
+ * Create a thread.
21
+ *
22
+ * @deprecated The Assistants API is deprecated in favor of the Responses API
23
+ */
24
+ create(body?: ThreadCreateParams | null | undefined, options?: RequestOptions): APIPromise<Thread>;
25
+ /**
26
+ * Retrieves a thread.
27
+ *
28
+ * @deprecated The Assistants API is deprecated in favor of the Responses API
29
+ */
30
+ retrieve(threadID: string, options?: RequestOptions): APIPromise<Thread>;
31
+ /**
32
+ * Modifies a thread.
33
+ *
34
+ * @deprecated The Assistants API is deprecated in favor of the Responses API
35
+ */
36
+ update(threadID: string, body: ThreadUpdateParams, options?: RequestOptions): APIPromise<Thread>;
37
+ /**
38
+ * Delete a thread.
39
+ *
40
+ * @deprecated The Assistants API is deprecated in favor of the Responses API
41
+ */
42
+ delete(threadID: string, options?: RequestOptions): APIPromise<ThreadDeleted>;
43
+ /**
44
+ * Create a thread and run it in one request.
45
+ *
46
+ * @deprecated The Assistants API is deprecated in favor of the Responses API
47
+ */
48
+ createAndRun(body: ThreadCreateAndRunParamsNonStreaming, options?: RequestOptions): APIPromise<RunsAPI.Run>;
49
+ createAndRun(body: ThreadCreateAndRunParamsStreaming, options?: RequestOptions): APIPromise<Stream<AssistantsAPI.AssistantStreamEvent>>;
50
+ createAndRun(body: ThreadCreateAndRunParamsBase, options?: RequestOptions): APIPromise<Stream<AssistantsAPI.AssistantStreamEvent> | RunsAPI.Run>;
51
+ /**
52
+ * A helper to create a thread, start a run and then poll for a terminal state.
53
+ * More information on Run lifecycles can be found here:
54
+ * https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps
55
+ */
56
+ createAndRunPoll(body: ThreadCreateAndRunParamsNonStreaming, options?: RequestOptions & {
57
+ pollIntervalMs?: number;
58
+ }): Promise<Threads.Run>;
59
+ /**
60
+ * Create a thread and stream the run back
61
+ */
62
+ createAndRunStream(body: ThreadCreateAndRunParamsBaseStream, options?: RequestOptions): AssistantStream;
63
+ }
64
+ /**
65
+ * Specifies the format that the model must output. Compatible with
66
+ * [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
67
+ * [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
68
+ * and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
69
+ *
70
+ * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
71
+ * Outputs which ensures the model will match your supplied JSON schema. Learn more
72
+ * in the
73
+ * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
74
+ *
75
+ * Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
76
+ * message the model generates is valid JSON.
77
+ *
78
+ * **Important:** when using JSON mode, you **must** also instruct the model to
79
+ * produce JSON yourself via a system or user message. Without this, the model may
80
+ * generate an unending stream of whitespace until the generation reaches the token
81
+ * limit, resulting in a long-running and seemingly "stuck" request. Also note that
82
+ * the message content may be partially cut off if `finish_reason="length"`, which
83
+ * indicates the generation exceeded `max_tokens` or the conversation exceeded the
84
+ * max context length.
85
+ */
86
+ export type AssistantResponseFormatOption = 'auto' | Shared.ResponseFormatText | Shared.ResponseFormatJSONObject | Shared.ResponseFormatJSONSchema;
87
+ /**
88
+ * Specifies a tool the model should use. Use to force the model to call a specific
89
+ * tool.
90
+ */
91
+ export interface AssistantToolChoice {
92
+ /**
93
+ * The type of the tool. If type is `function`, the function name must be set
94
+ */
95
+ type: 'function' | 'code_interpreter' | 'file_search';
96
+ function?: AssistantToolChoiceFunction;
97
+ }
98
+ export interface AssistantToolChoiceFunction {
99
+ /**
100
+ * The name of the function to call.
101
+ */
102
+ name: string;
103
+ }
104
+ /**
105
+ * Controls which (if any) tool is called by the model. `none` means the model will
106
+ * not call any tools and instead generates a message. `auto` is the default value
107
+ * and means the model can pick between generating a message or calling one or more
108
+ * tools. `required` means the model must call one or more tools before responding
109
+ * to the user. Specifying a particular tool like `{"type": "file_search"}` or
110
+ * `{"type": "function", "function": {"name": "my_function"}}` forces the model to
111
+ * call that tool.
112
+ */
113
+ export type AssistantToolChoiceOption = 'none' | 'auto' | 'required' | AssistantToolChoice;
114
+ /**
115
+ * Represents a thread that contains
116
+ * [messages](https://platform.openai.com/docs/api-reference/messages).
117
+ */
118
+ export interface Thread {
119
+ /**
120
+ * The identifier, which can be referenced in API endpoints.
121
+ */
122
+ id: string;
123
+ /**
124
+ * The Unix timestamp (in seconds) for when the thread was created.
125
+ */
126
+ created_at: number;
127
+ /**
128
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful
129
+ * for storing additional information about the object in a structured format, and
130
+ * querying for objects via API or the dashboard.
131
+ *
132
+ * Keys are strings with a maximum length of 64 characters. Values are strings with
133
+ * a maximum length of 512 characters.
134
+ */
135
+ metadata: Shared.Metadata | null;
136
+ /**
137
+ * The object type, which is always `thread`.
138
+ */
139
+ object: 'thread';
140
+ /**
141
+ * A set of resources that are made available to the assistant's tools in this
142
+ * thread. The resources are specific to the type of tool. For example, the
143
+ * `code_interpreter` tool requires a list of file IDs, while the `file_search`
144
+ * tool requires a list of vector store IDs.
145
+ */
146
+ tool_resources: Thread.ToolResources | null;
147
+ }
148
+ export declare namespace Thread {
149
+ /**
150
+ * A set of resources that are made available to the assistant's tools in this
151
+ * thread. The resources are specific to the type of tool. For example, the
152
+ * `code_interpreter` tool requires a list of file IDs, while the `file_search`
153
+ * tool requires a list of vector store IDs.
154
+ */
155
+ interface ToolResources {
156
+ code_interpreter?: ToolResources.CodeInterpreter;
157
+ file_search?: ToolResources.FileSearch;
158
+ }
159
+ namespace ToolResources {
160
+ interface CodeInterpreter {
161
+ /**
162
+ * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
163
+ * available to the `code_interpreter` tool. There can be a maximum of 20 files
164
+ * associated with the tool.
165
+ */
166
+ file_ids?: Array<string>;
167
+ }
168
+ interface FileSearch {
169
+ /**
170
+ * The
171
+ * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
172
+ * attached to this thread. There can be a maximum of 1 vector store attached to
173
+ * the thread.
174
+ */
175
+ vector_store_ids?: Array<string>;
176
+ }
177
+ }
178
+ }
179
+ export interface ThreadDeleted {
180
+ id: string;
181
+ deleted: boolean;
182
+ object: 'thread.deleted';
183
+ }
184
+ export interface ThreadCreateParams {
185
+ /**
186
+ * A list of [messages](https://platform.openai.com/docs/api-reference/messages) to
187
+ * start the thread with.
188
+ */
189
+ messages?: Array<ThreadCreateParams.Message>;
190
+ /**
191
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful
192
+ * for storing additional information about the object in a structured format, and
193
+ * querying for objects via API or the dashboard.
194
+ *
195
+ * Keys are strings with a maximum length of 64 characters. Values are strings with
196
+ * a maximum length of 512 characters.
197
+ */
198
+ metadata?: Shared.Metadata | null;
199
+ /**
200
+ * A set of resources that are made available to the assistant's tools in this
201
+ * thread. The resources are specific to the type of tool. For example, the
202
+ * `code_interpreter` tool requires a list of file IDs, while the `file_search`
203
+ * tool requires a list of vector store IDs.
204
+ */
205
+ tool_resources?: ThreadCreateParams.ToolResources | null;
206
+ }
207
+ export declare namespace ThreadCreateParams {
208
+ interface Message {
209
+ /**
210
+ * The text contents of the message.
211
+ */
212
+ content: string | Array<MessagesAPI.MessageContentPartParam>;
213
+ /**
214
+ * The role of the entity that is creating the message. Allowed values include:
215
+ *
216
+ * - `user`: Indicates the message is sent by an actual user and should be used in
217
+ * most cases to represent user-generated messages.
218
+ * - `assistant`: Indicates the message is generated by the assistant. Use this
219
+ * value to insert messages from the assistant into the conversation.
220
+ */
221
+ role: 'user' | 'assistant';
222
+ /**
223
+ * A list of files attached to the message, and the tools they should be added to.
224
+ */
225
+ attachments?: Array<Message.Attachment> | null;
226
+ /**
227
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful
228
+ * for storing additional information about the object in a structured format, and
229
+ * querying for objects via API or the dashboard.
230
+ *
231
+ * Keys are strings with a maximum length of 64 characters. Values are strings with
232
+ * a maximum length of 512 characters.
233
+ */
234
+ metadata?: Shared.Metadata | null;
235
+ }
236
+ namespace Message {
237
+ interface Attachment {
238
+ /**
239
+ * The ID of the file to attach to the message.
240
+ */
241
+ file_id?: string;
242
+ /**
243
+ * The tools to add this file to.
244
+ */
245
+ tools?: Array<AssistantsAPI.CodeInterpreterTool | Attachment.FileSearch>;
246
+ }
247
+ namespace Attachment {
248
+ interface FileSearch {
249
+ /**
250
+ * The type of tool being defined: `file_search`
251
+ */
252
+ type: 'file_search';
253
+ }
254
+ }
255
+ }
256
+ /**
257
+ * A set of resources that are made available to the assistant's tools in this
258
+ * thread. The resources are specific to the type of tool. For example, the
259
+ * `code_interpreter` tool requires a list of file IDs, while the `file_search`
260
+ * tool requires a list of vector store IDs.
261
+ */
262
+ interface ToolResources {
263
+ code_interpreter?: ToolResources.CodeInterpreter;
264
+ file_search?: ToolResources.FileSearch;
265
+ }
266
+ namespace ToolResources {
267
+ interface CodeInterpreter {
268
+ /**
269
+ * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
270
+ * available to the `code_interpreter` tool. There can be a maximum of 20 files
271
+ * associated with the tool.
272
+ */
273
+ file_ids?: Array<string>;
274
+ }
275
+ interface FileSearch {
276
+ /**
277
+ * The
278
+ * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
279
+ * attached to this thread. There can be a maximum of 1 vector store attached to
280
+ * the thread.
281
+ */
282
+ vector_store_ids?: Array<string>;
283
+ /**
284
+ * A helper to create a
285
+ * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
286
+ * with file_ids and attach it to this thread. There can be a maximum of 1 vector
287
+ * store attached to the thread.
288
+ */
289
+ vector_stores?: Array<FileSearch.VectorStore>;
290
+ }
291
+ namespace FileSearch {
292
+ interface VectorStore {
293
+ /**
294
+ * The chunking strategy used to chunk the file(s). If not set, will use the `auto`
295
+ * strategy.
296
+ */
297
+ chunking_strategy?: VectorStore.Auto | VectorStore.Static;
298
+ /**
299
+ * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
300
+ * add to the vector store. There can be a maximum of 10000 files in a vector
301
+ * store.
302
+ */
303
+ file_ids?: Array<string>;
304
+ /**
305
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful
306
+ * for storing additional information about the object in a structured format, and
307
+ * querying for objects via API or the dashboard.
308
+ *
309
+ * Keys are strings with a maximum length of 64 characters. Values are strings with
310
+ * a maximum length of 512 characters.
311
+ */
312
+ metadata?: Shared.Metadata | null;
313
+ }
314
+ namespace VectorStore {
315
+ /**
316
+ * The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
317
+ * `800` and `chunk_overlap_tokens` of `400`.
318
+ */
319
+ interface Auto {
320
+ /**
321
+ * Always `auto`.
322
+ */
323
+ type: 'auto';
324
+ }
325
+ interface Static {
326
+ static: Static.Static;
327
+ /**
328
+ * Always `static`.
329
+ */
330
+ type: 'static';
331
+ }
332
+ namespace Static {
333
+ interface Static {
334
+ /**
335
+ * The number of tokens that overlap between chunks. The default value is `400`.
336
+ *
337
+ * Note that the overlap must not exceed half of `max_chunk_size_tokens`.
338
+ */
339
+ chunk_overlap_tokens: number;
340
+ /**
341
+ * The maximum number of tokens in each chunk. The default value is `800`. The
342
+ * minimum value is `100` and the maximum value is `4096`.
343
+ */
344
+ max_chunk_size_tokens: number;
345
+ }
346
+ }
347
+ }
348
+ }
349
+ }
350
+ }
351
+ export interface ThreadUpdateParams {
352
+ /**
353
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful
354
+ * for storing additional information about the object in a structured format, and
355
+ * querying for objects via API or the dashboard.
356
+ *
357
+ * Keys are strings with a maximum length of 64 characters. Values are strings with
358
+ * a maximum length of 512 characters.
359
+ */
360
+ metadata?: Shared.Metadata | null;
361
+ /**
362
+ * A set of resources that are made available to the assistant's tools in this
363
+ * thread. The resources are specific to the type of tool. For example, the
364
+ * `code_interpreter` tool requires a list of file IDs, while the `file_search`
365
+ * tool requires a list of vector store IDs.
366
+ */
367
+ tool_resources?: ThreadUpdateParams.ToolResources | null;
368
+ }
369
+ export declare namespace ThreadUpdateParams {
370
+ /**
371
+ * A set of resources that are made available to the assistant's tools in this
372
+ * thread. The resources are specific to the type of tool. For example, the
373
+ * `code_interpreter` tool requires a list of file IDs, while the `file_search`
374
+ * tool requires a list of vector store IDs.
375
+ */
376
+ interface ToolResources {
377
+ code_interpreter?: ToolResources.CodeInterpreter;
378
+ file_search?: ToolResources.FileSearch;
379
+ }
380
+ namespace ToolResources {
381
+ interface CodeInterpreter {
382
+ /**
383
+ * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
384
+ * available to the `code_interpreter` tool. There can be a maximum of 20 files
385
+ * associated with the tool.
386
+ */
387
+ file_ids?: Array<string>;
388
+ }
389
+ interface FileSearch {
390
+ /**
391
+ * The
392
+ * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
393
+ * attached to this thread. There can be a maximum of 1 vector store attached to
394
+ * the thread.
395
+ */
396
+ vector_store_ids?: Array<string>;
397
+ }
398
+ }
399
+ }
400
+ export type ThreadCreateAndRunParams = ThreadCreateAndRunParamsNonStreaming | ThreadCreateAndRunParamsStreaming;
401
+ export interface ThreadCreateAndRunParamsBase {
402
+ /**
403
+ * The ID of the
404
+ * [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
405
+ * execute this run.
406
+ */
407
+ assistant_id: string;
408
+ /**
409
+ * Override the default system message of the assistant. This is useful for
410
+ * modifying the behavior on a per-run basis.
411
+ */
412
+ instructions?: string | null;
413
+ /**
414
+ * The maximum number of completion tokens that may be used over the course of the
415
+ * run. The run will make a best effort to use only the number of completion tokens
416
+ * specified, across multiple turns of the run. If the run exceeds the number of
417
+ * completion tokens specified, the run will end with status `incomplete`. See
418
+ * `incomplete_details` for more info.
419
+ */
420
+ max_completion_tokens?: number | null;
421
+ /**
422
+ * The maximum number of prompt tokens that may be used over the course of the run.
423
+ * The run will make a best effort to use only the number of prompt tokens
424
+ * specified, across multiple turns of the run. If the run exceeds the number of
425
+ * prompt tokens specified, the run will end with status `incomplete`. See
426
+ * `incomplete_details` for more info.
427
+ */
428
+ max_prompt_tokens?: number | null;
429
+ /**
430
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful
431
+ * for storing additional information about the object in a structured format, and
432
+ * querying for objects via API or the dashboard.
433
+ *
434
+ * Keys are strings with a maximum length of 64 characters. Values are strings with
435
+ * a maximum length of 512 characters.
436
+ */
437
+ metadata?: Shared.Metadata | null;
438
+ /**
439
+ * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to
440
+ * be used to execute this run. If a value is provided here, it will override the
441
+ * model associated with the assistant. If not, the model associated with the
442
+ * assistant will be used.
443
+ */
444
+ model?: (string & {}) | Shared.ChatModel | null;
445
+ /**
446
+ * Whether to enable
447
+ * [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling)
448
+ * during tool use.
449
+ */
450
+ parallel_tool_calls?: boolean;
451
+ /**
452
+ * Specifies the format that the model must output. Compatible with
453
+ * [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
454
+ * [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
455
+ * and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
456
+ *
457
+ * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
458
+ * Outputs which ensures the model will match your supplied JSON schema. Learn more
459
+ * in the
460
+ * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
461
+ *
462
+ * Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
463
+ * message the model generates is valid JSON.
464
+ *
465
+ * **Important:** when using JSON mode, you **must** also instruct the model to
466
+ * produce JSON yourself via a system or user message. Without this, the model may
467
+ * generate an unending stream of whitespace until the generation reaches the token
468
+ * limit, resulting in a long-running and seemingly "stuck" request. Also note that
469
+ * the message content may be partially cut off if `finish_reason="length"`, which
470
+ * indicates the generation exceeded `max_tokens` or the conversation exceeded the
471
+ * max context length.
472
+ */
473
+ response_format?: AssistantResponseFormatOption | null;
474
+ /**
475
+ * If `true`, returns a stream of events that happen during the Run as server-sent
476
+ * events, terminating when the Run enters a terminal state with a `data: [DONE]`
477
+ * message.
478
+ */
479
+ stream?: boolean | null;
480
+ /**
481
+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
482
+ * make the output more random, while lower values like 0.2 will make it more
483
+ * focused and deterministic.
484
+ */
485
+ temperature?: number | null;
486
+ /**
487
+ * Options to create a new thread. If no thread is provided when running a request,
488
+ * an empty thread will be created.
489
+ */
490
+ thread?: ThreadCreateAndRunParams.Thread;
491
+ /**
492
+ * Controls which (if any) tool is called by the model. `none` means the model will
493
+ * not call any tools and instead generates a message. `auto` is the default value
494
+ * and means the model can pick between generating a message or calling one or more
495
+ * tools. `required` means the model must call one or more tools before responding
496
+ * to the user. Specifying a particular tool like `{"type": "file_search"}` or
497
+ * `{"type": "function", "function": {"name": "my_function"}}` forces the model to
498
+ * call that tool.
499
+ */
500
+ tool_choice?: AssistantToolChoiceOption | null;
501
+ /**
502
+ * A set of resources that are used by the assistant's tools. The resources are
503
+ * specific to the type of tool. For example, the `code_interpreter` tool requires
504
+ * a list of file IDs, while the `file_search` tool requires a list of vector store
505
+ * IDs.
506
+ */
507
+ tool_resources?: ThreadCreateAndRunParams.ToolResources | null;
508
+ /**
509
+ * Override the tools the assistant can use for this run. This is useful for
510
+ * modifying the behavior on a per-run basis.
511
+ */
512
+ tools?: Array<AssistantsAPI.AssistantTool> | null;
513
+ /**
514
+ * An alternative to sampling with temperature, called nucleus sampling, where the
515
+ * model considers the results of the tokens with top_p probability mass. So 0.1
516
+ * means only the tokens comprising the top 10% probability mass are considered.
517
+ *
518
+ * We generally recommend altering this or temperature but not both.
519
+ */
520
+ top_p?: number | null;
521
+ /**
522
+ * Controls for how a thread will be truncated prior to the run. Use this to
523
+ * control the initial context window of the run.
524
+ */
525
+ truncation_strategy?: ThreadCreateAndRunParams.TruncationStrategy | null;
526
+ }
527
+ export declare namespace ThreadCreateAndRunParams {
528
+ /**
529
+ * Options to create a new thread. If no thread is provided when running a request,
530
+ * an empty thread will be created.
531
+ */
532
+ interface Thread {
533
+ /**
534
+ * A list of [messages](https://platform.openai.com/docs/api-reference/messages) to
535
+ * start the thread with.
536
+ */
537
+ messages?: Array<Thread.Message>;
538
+ /**
539
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful
540
+ * for storing additional information about the object in a structured format, and
541
+ * querying for objects via API or the dashboard.
542
+ *
543
+ * Keys are strings with a maximum length of 64 characters. Values are strings with
544
+ * a maximum length of 512 characters.
545
+ */
546
+ metadata?: Shared.Metadata | null;
547
+ /**
548
+ * A set of resources that are made available to the assistant's tools in this
549
+ * thread. The resources are specific to the type of tool. For example, the
550
+ * `code_interpreter` tool requires a list of file IDs, while the `file_search`
551
+ * tool requires a list of vector store IDs.
552
+ */
553
+ tool_resources?: Thread.ToolResources | null;
554
+ }
555
+ namespace Thread {
556
+ interface Message {
557
+ /**
558
+ * The text contents of the message.
559
+ */
560
+ content: string | Array<MessagesAPI.MessageContentPartParam>;
561
+ /**
562
+ * The role of the entity that is creating the message. Allowed values include:
563
+ *
564
+ * - `user`: Indicates the message is sent by an actual user and should be used in
565
+ * most cases to represent user-generated messages.
566
+ * - `assistant`: Indicates the message is generated by the assistant. Use this
567
+ * value to insert messages from the assistant into the conversation.
568
+ */
569
+ role: 'user' | 'assistant';
570
+ /**
571
+ * A list of files attached to the message, and the tools they should be added to.
572
+ */
573
+ attachments?: Array<Message.Attachment> | null;
574
+ /**
575
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful
576
+ * for storing additional information about the object in a structured format, and
577
+ * querying for objects via API or the dashboard.
578
+ *
579
+ * Keys are strings with a maximum length of 64 characters. Values are strings with
580
+ * a maximum length of 512 characters.
581
+ */
582
+ metadata?: Shared.Metadata | null;
583
+ }
584
+ namespace Message {
585
+ interface Attachment {
586
+ /**
587
+ * The ID of the file to attach to the message.
588
+ */
589
+ file_id?: string;
590
+ /**
591
+ * The tools to add this file to.
592
+ */
593
+ tools?: Array<AssistantsAPI.CodeInterpreterTool | Attachment.FileSearch>;
594
+ }
595
+ namespace Attachment {
596
+ interface FileSearch {
597
+ /**
598
+ * The type of tool being defined: `file_search`
599
+ */
600
+ type: 'file_search';
601
+ }
602
+ }
603
+ }
604
+ /**
605
+ * A set of resources that are made available to the assistant's tools in this
606
+ * thread. The resources are specific to the type of tool. For example, the
607
+ * `code_interpreter` tool requires a list of file IDs, while the `file_search`
608
+ * tool requires a list of vector store IDs.
609
+ */
610
+ interface ToolResources {
611
+ code_interpreter?: ToolResources.CodeInterpreter;
612
+ file_search?: ToolResources.FileSearch;
613
+ }
614
+ namespace ToolResources {
615
+ interface CodeInterpreter {
616
+ /**
617
+ * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
618
+ * available to the `code_interpreter` tool. There can be a maximum of 20 files
619
+ * associated with the tool.
620
+ */
621
+ file_ids?: Array<string>;
622
+ }
623
+ interface FileSearch {
624
+ /**
625
+ * The
626
+ * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
627
+ * attached to this thread. There can be a maximum of 1 vector store attached to
628
+ * the thread.
629
+ */
630
+ vector_store_ids?: Array<string>;
631
+ /**
632
+ * A helper to create a
633
+ * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
634
+ * with file_ids and attach it to this thread. There can be a maximum of 1 vector
635
+ * store attached to the thread.
636
+ */
637
+ vector_stores?: Array<FileSearch.VectorStore>;
638
+ }
639
+ namespace FileSearch {
640
+ interface VectorStore {
641
+ /**
642
+ * The chunking strategy used to chunk the file(s). If not set, will use the `auto`
643
+ * strategy.
644
+ */
645
+ chunking_strategy?: VectorStore.Auto | VectorStore.Static;
646
+ /**
647
+ * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
648
+ * add to the vector store. There can be a maximum of 10000 files in a vector
649
+ * store.
650
+ */
651
+ file_ids?: Array<string>;
652
+ /**
653
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful
654
+ * for storing additional information about the object in a structured format, and
655
+ * querying for objects via API or the dashboard.
656
+ *
657
+ * Keys are strings with a maximum length of 64 characters. Values are strings with
658
+ * a maximum length of 512 characters.
659
+ */
660
+ metadata?: Shared.Metadata | null;
661
+ }
662
+ namespace VectorStore {
663
+ /**
664
+ * The default strategy. This strategy currently uses a `max_chunk_size_tokens` of
665
+ * `800` and `chunk_overlap_tokens` of `400`.
666
+ */
667
+ interface Auto {
668
+ /**
669
+ * Always `auto`.
670
+ */
671
+ type: 'auto';
672
+ }
673
+ interface Static {
674
+ static: Static.Static;
675
+ /**
676
+ * Always `static`.
677
+ */
678
+ type: 'static';
679
+ }
680
+ namespace Static {
681
+ interface Static {
682
+ /**
683
+ * The number of tokens that overlap between chunks. The default value is `400`.
684
+ *
685
+ * Note that the overlap must not exceed half of `max_chunk_size_tokens`.
686
+ */
687
+ chunk_overlap_tokens: number;
688
+ /**
689
+ * The maximum number of tokens in each chunk. The default value is `800`. The
690
+ * minimum value is `100` and the maximum value is `4096`.
691
+ */
692
+ max_chunk_size_tokens: number;
693
+ }
694
+ }
695
+ }
696
+ }
697
+ }
698
+ }
699
+ /**
700
+ * A set of resources that are used by the assistant's tools. The resources are
701
+ * specific to the type of tool. For example, the `code_interpreter` tool requires
702
+ * a list of file IDs, while the `file_search` tool requires a list of vector store
703
+ * IDs.
704
+ */
705
+ interface ToolResources {
706
+ code_interpreter?: ToolResources.CodeInterpreter;
707
+ file_search?: ToolResources.FileSearch;
708
+ }
709
+ namespace ToolResources {
710
+ interface CodeInterpreter {
711
+ /**
712
+ * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
713
+ * available to the `code_interpreter` tool. There can be a maximum of 20 files
714
+ * associated with the tool.
715
+ */
716
+ file_ids?: Array<string>;
717
+ }
718
+ interface FileSearch {
719
+ /**
720
+ * The ID of the
721
+ * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
722
+ * attached to this assistant. There can be a maximum of 1 vector store attached to
723
+ * the assistant.
724
+ */
725
+ vector_store_ids?: Array<string>;
726
+ }
727
+ }
728
+ /**
729
+ * Controls for how a thread will be truncated prior to the run. Use this to
730
+ * control the initial context window of the run.
731
+ */
732
+ interface TruncationStrategy {
733
+ /**
734
+ * The truncation strategy to use for the thread. The default is `auto`. If set to
735
+ * `last_messages`, the thread will be truncated to the n most recent messages in
736
+ * the thread. When set to `auto`, messages in the middle of the thread will be
737
+ * dropped to fit the context length of the model, `max_prompt_tokens`.
738
+ */
739
+ type: 'auto' | 'last_messages';
740
+ /**
741
+ * The number of most recent messages from the thread when constructing the context
742
+ * for the run.
743
+ */
744
+ last_messages?: number | null;
745
+ }
746
+ type ThreadCreateAndRunParamsNonStreaming = ThreadsAPI.ThreadCreateAndRunParamsNonStreaming;
747
+ type ThreadCreateAndRunParamsStreaming = ThreadsAPI.ThreadCreateAndRunParamsStreaming;
748
+ }
749
+ export interface ThreadCreateAndRunParamsNonStreaming extends ThreadCreateAndRunParamsBase {
750
+ /**
751
+ * If `true`, returns a stream of events that happen during the Run as server-sent
752
+ * events, terminating when the Run enters a terminal state with a `data: [DONE]`
753
+ * message.
754
+ */
755
+ stream?: false | null;
756
+ }
757
+ export interface ThreadCreateAndRunParamsStreaming extends ThreadCreateAndRunParamsBase {
758
+ /**
759
+ * If `true`, returns a stream of events that happen during the Run as server-sent
760
+ * events, terminating when the Run enters a terminal state with a `data: [DONE]`
761
+ * message.
762
+ */
763
+ stream: true;
764
+ }
765
+ export interface ThreadCreateAndRunPollParams {
766
+ /**
767
+ * The ID of the
768
+ * [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
769
+ * execute this run.
770
+ */
771
+ assistant_id: string;
772
+ /**
773
+ * Override the default system message of the assistant. This is useful for
774
+ * modifying the behavior on a per-run basis.
775
+ */
776
+ instructions?: string | null;
777
+ /**
778
+ * The maximum number of completion tokens that may be used over the course of the
779
+ * run. The run will make a best effort to use only the number of completion tokens
780
+ * specified, across multiple turns of the run. If the run exceeds the number of
781
+ * completion tokens specified, the run will end with status `incomplete`. See
782
+ * `incomplete_details` for more info.
783
+ */
784
+ max_completion_tokens?: number | null;
785
+ /**
786
+ * The maximum number of prompt tokens that may be used over the course of the run.
787
+ * The run will make a best effort to use only the number of prompt tokens
788
+ * specified, across multiple turns of the run. If the run exceeds the number of
789
+ * prompt tokens specified, the run will end with status `incomplete`. See
790
+ * `incomplete_details` for more info.
791
+ */
792
+ max_prompt_tokens?: number | null;
793
+ /**
794
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful
795
+ * for storing additional information about the object in a structured format. Keys
796
+ * can be a maximum of 64 characters long and values can be a maxium of 512
797
+ * characters long.
798
+ */
799
+ metadata?: unknown | null;
800
+ /**
801
+ * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to
802
+ * be used to execute this run. If a value is provided here, it will override the
803
+ * model associated with the assistant. If not, the model associated with the
804
+ * assistant will be used.
805
+ */
806
+ model?: (string & {}) | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-0125-preview' | 'gpt-4-turbo-preview' | 'gpt-4-1106-preview' | 'gpt-4-vision-preview' | 'gpt-4' | 'gpt-4-0314' | 'gpt-4-0613' | 'gpt-4-32k' | 'gpt-4-32k-0314' | 'gpt-4-32k-0613' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-16k' | 'gpt-3.5-turbo-0613' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-16k-0613' | null;
807
+ /**
808
+ * Specifies the format that the model must output. Compatible with
809
+ * [GPT-4o](https://platform.openai.com/docs/models/gpt-4o),
810
+ * [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
811
+ * and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
812
+ *
813
+ * Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
814
+ * message the model generates is valid JSON.
815
+ *
816
+ * **Important:** when using JSON mode, you **must** also instruct the model to
817
+ * produce JSON yourself via a system or user message. Without this, the model may
818
+ * generate an unending stream of whitespace until the generation reaches the token
819
+ * limit, resulting in a long-running and seemingly "stuck" request. Also note that
820
+ * the message content may be partially cut off if `finish_reason="length"`, which
821
+ * indicates the generation exceeded `max_tokens` or the conversation exceeded the
822
+ * max context length.
823
+ */
824
+ response_format?: AssistantResponseFormatOption | null;
825
+ /**
826
+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
827
+ * make the output more random, while lower values like 0.2 will make it more
828
+ * focused and deterministic.
829
+ */
830
+ temperature?: number | null;
831
+ /**
832
+ * If no thread is provided, an empty thread will be created.
833
+ */
834
+ thread?: ThreadCreateAndRunPollParams.Thread;
835
+ /**
836
+ * Controls which (if any) tool is called by the model. `none` means the model will
837
+ * not call any tools and instead generates a message. `auto` is the default value
838
+ * and means the model can pick between generating a message or calling one or more
839
+ * tools. `required` means the model must call one or more tools before responding
840
+ * to the user. Specifying a particular tool like `{"type": "file_search"}` or
841
+ * `{"type": "function", "function": {"name": "my_function"}}` forces the model to
842
+ * call that tool.
843
+ */
844
+ tool_choice?: AssistantToolChoiceOption | null;
845
+ /**
846
+ * A set of resources that are used by the assistant's tools. The resources are
847
+ * specific to the type of tool. For example, the `code_interpreter` tool requires
848
+ * a list of file IDs, while the `file_search` tool requires a list of vector store
849
+ * IDs.
850
+ */
851
+ tool_resources?: ThreadCreateAndRunPollParams.ToolResources | null;
852
+ /**
853
+ * Override the tools the assistant can use for this run. This is useful for
854
+ * modifying the behavior on a per-run basis.
855
+ */
856
+ tools?: Array<AssistantsAPI.CodeInterpreterTool | AssistantsAPI.FileSearchTool | AssistantsAPI.FunctionTool> | null;
857
+ /**
858
+ * An alternative to sampling with temperature, called nucleus sampling, where the
859
+ * model considers the results of the tokens with top_p probability mass. So 0.1
860
+ * means only the tokens comprising the top 10% probability mass are considered.
861
+ *
862
+ * We generally recommend altering this or temperature but not both.
863
+ */
864
+ top_p?: number | null;
865
+ /**
866
+ * Controls for how a thread will be truncated prior to the run. Use this to
867
+ * control the intial context window of the run.
868
+ */
869
+ truncation_strategy?: ThreadCreateAndRunPollParams.TruncationStrategy | null;
870
+ }
871
+ export declare namespace ThreadCreateAndRunPollParams {
872
+ /**
873
+ * If no thread is provided, an empty thread will be created.
874
+ */
875
+ interface Thread {
876
+ /**
877
+ * A list of [messages](https://platform.openai.com/docs/api-reference/messages) to
878
+ * start the thread with.
879
+ */
880
+ messages?: Array<Thread.Message>;
881
+ /**
882
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful
883
+ * for storing additional information about the object in a structured format. Keys
884
+ * can be a maximum of 64 characters long and values can be a maxium of 512
885
+ * characters long.
886
+ */
887
+ metadata?: unknown | null;
888
+ /**
889
+ * A set of resources that are made available to the assistant's tools in this
890
+ * thread. The resources are specific to the type of tool. For example, the
891
+ * `code_interpreter` tool requires a list of file IDs, while the `file_search`
892
+ * tool requires a list of vector store IDs.
893
+ */
894
+ tool_resources?: Thread.ToolResources | null;
895
+ }
896
+ namespace Thread {
897
+ interface Message {
898
+ /**
899
+ * The text contents of the message.
900
+ */
901
+ content: string | Array<MessagesAPI.MessageContentPartParam>;
902
+ /**
903
+ * The role of the entity that is creating the message. Allowed values include:
904
+ *
905
+ * - `user`: Indicates the message is sent by an actual user and should be used in
906
+ * most cases to represent user-generated messages.
907
+ * - `assistant`: Indicates the message is generated by the assistant. Use this
908
+ * value to insert messages from the assistant into the conversation.
909
+ */
910
+ role: 'user' | 'assistant';
911
+ /**
912
+ * A list of files attached to the message, and the tools they should be added to.
913
+ */
914
+ attachments?: Array<Message.Attachment> | null;
915
+ /**
916
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful
917
+ * for storing additional information about the object in a structured format. Keys
918
+ * can be a maximum of 64 characters long and values can be a maxium of 512
919
+ * characters long.
920
+ */
921
+ metadata?: unknown | null;
922
+ }
923
+ namespace Message {
924
+ interface Attachment {
925
+ /**
926
+ * The ID of the file to attach to the message.
927
+ */
928
+ file_id?: string;
929
+ /**
930
+ * The tools to add this file to.
931
+ */
932
+ tools?: Array<AssistantsAPI.CodeInterpreterTool | AssistantsAPI.FileSearchTool>;
933
+ }
934
+ }
935
+ /**
936
+ * A set of resources that are made available to the assistant's tools in this
937
+ * thread. The resources are specific to the type of tool. For example, the
938
+ * `code_interpreter` tool requires a list of file IDs, while the `file_search`
939
+ * tool requires a list of vector store IDs.
940
+ */
941
+ interface ToolResources {
942
+ code_interpreter?: ToolResources.CodeInterpreter;
943
+ file_search?: ToolResources.FileSearch;
944
+ }
945
+ namespace ToolResources {
946
+ interface CodeInterpreter {
947
+ /**
948
+ * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
949
+ * available to the `code_interpreter` tool. There can be a maximum of 20 files
950
+ * associated with the tool.
951
+ */
952
+ file_ids?: Array<string>;
953
+ }
954
+ interface FileSearch {
955
+ /**
956
+ * The
957
+ * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
958
+ * attached to this thread. There can be a maximum of 1 vector store attached to
959
+ * the thread.
960
+ */
961
+ vector_store_ids?: Array<string>;
962
+ /**
963
+ * A helper to create a
964
+ * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
965
+ * with file_ids and attach it to this thread. There can be a maximum of 1 vector
966
+ * store attached to the thread.
967
+ */
968
+ vector_stores?: Array<FileSearch.VectorStore>;
969
+ }
970
+ namespace FileSearch {
971
+ interface VectorStore {
972
+ /**
973
+ * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
974
+ * add to the vector store. There can be a maximum of 10000 files in a vector
975
+ * store.
976
+ */
977
+ file_ids?: Array<string>;
978
+ /**
979
+ * Set of 16 key-value pairs that can be attached to a vector store. This can be
980
+ * useful for storing additional information about the vector store in a structured
981
+ * format. Keys can be a maximum of 64 characters long and values can be a maxium
982
+ * of 512 characters long.
983
+ */
984
+ metadata?: unknown;
985
+ }
986
+ }
987
+ }
988
+ }
989
+ /**
990
+ * A set of resources that are used by the assistant's tools. The resources are
991
+ * specific to the type of tool. For example, the `code_interpreter` tool requires
992
+ * a list of file IDs, while the `file_search` tool requires a list of vector store
993
+ * IDs.
994
+ */
995
+ interface ToolResources {
996
+ code_interpreter?: ToolResources.CodeInterpreter;
997
+ file_search?: ToolResources.FileSearch;
998
+ }
999
+ namespace ToolResources {
1000
+ interface CodeInterpreter {
1001
+ /**
1002
+ * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
1003
+ * available to the `code_interpreter` tool. There can be a maximum of 20 files
1004
+ * associated with the tool.
1005
+ */
1006
+ file_ids?: Array<string>;
1007
+ }
1008
+ interface FileSearch {
1009
+ /**
1010
+ * The ID of the
1011
+ * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
1012
+ * attached to this assistant. There can be a maximum of 1 vector store attached to
1013
+ * the assistant.
1014
+ */
1015
+ vector_store_ids?: Array<string>;
1016
+ }
1017
+ }
1018
+ /**
1019
+ * Controls for how a thread will be truncated prior to the run. Use this to
1020
+ * control the intial context window of the run.
1021
+ */
1022
+ interface TruncationStrategy {
1023
+ /**
1024
+ * The truncation strategy to use for the thread. The default is `auto`. If set to
1025
+ * `last_messages`, the thread will be truncated to the n most recent messages in
1026
+ * the thread. When set to `auto`, messages in the middle of the thread will be
1027
+ * dropped to fit the context length of the model, `max_prompt_tokens`.
1028
+ */
1029
+ type: 'auto' | 'last_messages';
1030
+ /**
1031
+ * The number of most recent messages from the thread when constructing the context
1032
+ * for the run.
1033
+ */
1034
+ last_messages?: number | null;
1035
+ }
1036
+ }
1037
+ export type ThreadCreateAndRunStreamParams = ThreadCreateAndRunParamsBaseStream;
1038
+ export declare namespace Threads {
1039
+ export { type AssistantResponseFormatOption as AssistantResponseFormatOption, type AssistantToolChoice as AssistantToolChoice, type AssistantToolChoiceFunction as AssistantToolChoiceFunction, type AssistantToolChoiceOption as AssistantToolChoiceOption, type Thread as Thread, type ThreadDeleted as ThreadDeleted, type ThreadCreateParams as ThreadCreateParams, type ThreadUpdateParams as ThreadUpdateParams, type ThreadCreateAndRunParams as ThreadCreateAndRunParams, type ThreadCreateAndRunParamsNonStreaming as ThreadCreateAndRunParamsNonStreaming, type ThreadCreateAndRunParamsStreaming as ThreadCreateAndRunParamsStreaming, type ThreadCreateAndRunPollParams, type ThreadCreateAndRunStreamParams, };
1040
+ export { Runs as Runs, type RequiredActionFunctionToolCall as RequiredActionFunctionToolCall, type Run as Run, type RunStatus as RunStatus, type RunsPage as RunsPage, type RunCreateParams as RunCreateParams, type RunCreateParamsNonStreaming as RunCreateParamsNonStreaming, type RunCreateParamsStreaming as RunCreateParamsStreaming, type RunRetrieveParams as RunRetrieveParams, type RunUpdateParams as RunUpdateParams, type RunListParams as RunListParams, type RunCancelParams as RunCancelParams, type RunCreateAndPollParams, type RunCreateAndStreamParams, type RunStreamParams, type RunSubmitToolOutputsParams as RunSubmitToolOutputsParams, type RunSubmitToolOutputsParamsNonStreaming as RunSubmitToolOutputsParamsNonStreaming, type RunSubmitToolOutputsParamsStreaming as RunSubmitToolOutputsParamsStreaming, type RunSubmitToolOutputsAndPollParams, type RunSubmitToolOutputsStreamParams, };
1041
+ export { Messages as Messages, type Annotation as Annotation, type AnnotationDelta as AnnotationDelta, type FileCitationAnnotation as FileCitationAnnotation, type FileCitationDeltaAnnotation as FileCitationDeltaAnnotation, type FilePathAnnotation as FilePathAnnotation, type FilePathDeltaAnnotation as FilePathDeltaAnnotation, type ImageFile as ImageFile, type ImageFileContentBlock as ImageFileContentBlock, type ImageFileDelta as ImageFileDelta, type ImageFileDeltaBlock as ImageFileDeltaBlock, type ImageURL as ImageURL, type ImageURLContentBlock as ImageURLContentBlock, type ImageURLDelta as ImageURLDelta, type ImageURLDeltaBlock as ImageURLDeltaBlock, type MessagesAPIMessage as Message, type MessageContent as MessageContent, type MessageContentDelta as MessageContentDelta, type MessageContentPartParam as MessageContentPartParam, type MessageDeleted as MessageDeleted, type MessageDelta as MessageDelta, type MessageDeltaEvent as MessageDeltaEvent, type RefusalContentBlock as RefusalContentBlock, type RefusalDeltaBlock as RefusalDeltaBlock, type Text as Text, type TextContentBlock as TextContentBlock, type TextContentBlockParam as TextContentBlockParam, type TextDelta as TextDelta, type TextDeltaBlock as TextDeltaBlock, type MessagesPage as MessagesPage, type MessageCreateParams as MessageCreateParams, type MessageRetrieveParams as MessageRetrieveParams, type MessageUpdateParams as MessageUpdateParams, type MessageListParams as MessageListParams, type MessageDeleteParams as MessageDeleteParams, };
1042
+ export { AssistantStream };
1043
+ }
1044
+ //# sourceMappingURL=threads.d.ts.map