modelmix 2.2.8 → 2.3.8

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 (542) hide show
  1. package/README.md +19 -6
  2. package/demo/demo.mjs +24 -16
  3. package/demo/lmstudio.mjs +1 -1
  4. package/demo/node_modules/.package-lock.json +0 -47
  5. package/demo/package-lock.json +1 -50
  6. package/demo/package.json +1 -3
  7. package/demo/prompt.md +25 -0
  8. package/demo/stream.mjs +3 -3
  9. package/index.js +88 -2
  10. package/package.json +4 -2
  11. package/demo/node_modules/debug/LICENSE +0 -20
  12. package/demo/node_modules/debug/README.md +0 -481
  13. package/demo/node_modules/debug/node_modules/ms/index.js +0 -162
  14. package/demo/node_modules/debug/node_modules/ms/license.md +0 -21
  15. package/demo/node_modules/debug/node_modules/ms/package.json +0 -37
  16. package/demo/node_modules/debug/node_modules/ms/readme.md +0 -60
  17. package/demo/node_modules/debug/package.json +0 -59
  18. package/demo/node_modules/debug/src/browser.js +0 -269
  19. package/demo/node_modules/debug/src/common.js +0 -274
  20. package/demo/node_modules/debug/src/index.js +0 -10
  21. package/demo/node_modules/debug/src/node.js +0 -263
  22. package/demo/node_modules/lemonlog/README.md +0 -133
  23. package/demo/node_modules/lemonlog/demo/demo.js +0 -31
  24. package/demo/node_modules/lemonlog/index.js +0 -94
  25. package/demo/node_modules/lemonlog/package.json +0 -31
  26. package/demo/node_modules/openai/CHANGELOG.md +0 -1176
  27. package/demo/node_modules/openai/LICENSE +0 -201
  28. package/demo/node_modules/openai/README.md +0 -616
  29. package/demo/node_modules/openai/_shims/MultipartBody.d.ts +0 -9
  30. package/demo/node_modules/openai/_shims/MultipartBody.d.ts.map +0 -1
  31. package/demo/node_modules/openai/_shims/MultipartBody.js +0 -16
  32. package/demo/node_modules/openai/_shims/MultipartBody.js.map +0 -1
  33. package/demo/node_modules/openai/_shims/MultipartBody.mjs +0 -12
  34. package/demo/node_modules/openai/_shims/MultipartBody.mjs.map +0 -1
  35. package/demo/node_modules/openai/_shims/README.md +0 -46
  36. package/demo/node_modules/openai/_shims/auto/runtime-bun.d.ts +0 -5
  37. package/demo/node_modules/openai/_shims/auto/runtime-bun.d.ts.map +0 -1
  38. package/demo/node_modules/openai/_shims/auto/runtime-bun.js +0 -21
  39. package/demo/node_modules/openai/_shims/auto/runtime-bun.js.map +0 -1
  40. package/demo/node_modules/openai/_shims/auto/runtime-bun.mjs +0 -2
  41. package/demo/node_modules/openai/_shims/auto/runtime-bun.mjs.map +0 -1
  42. package/demo/node_modules/openai/_shims/auto/runtime-node.d.ts +0 -5
  43. package/demo/node_modules/openai/_shims/auto/runtime-node.d.ts.map +0 -1
  44. package/demo/node_modules/openai/_shims/auto/runtime-node.js +0 -21
  45. package/demo/node_modules/openai/_shims/auto/runtime-node.js.map +0 -1
  46. package/demo/node_modules/openai/_shims/auto/runtime-node.mjs +0 -2
  47. package/demo/node_modules/openai/_shims/auto/runtime-node.mjs.map +0 -1
  48. package/demo/node_modules/openai/_shims/auto/runtime.d.ts +0 -5
  49. package/demo/node_modules/openai/_shims/auto/runtime.d.ts.map +0 -1
  50. package/demo/node_modules/openai/_shims/auto/runtime.js +0 -21
  51. package/demo/node_modules/openai/_shims/auto/runtime.js.map +0 -1
  52. package/demo/node_modules/openai/_shims/auto/runtime.mjs +0 -2
  53. package/demo/node_modules/openai/_shims/auto/runtime.mjs.map +0 -1
  54. package/demo/node_modules/openai/_shims/auto/types-node.d.ts +0 -5
  55. package/demo/node_modules/openai/_shims/auto/types-node.d.ts.map +0 -1
  56. package/demo/node_modules/openai/_shims/auto/types-node.js +0 -21
  57. package/demo/node_modules/openai/_shims/auto/types-node.js.map +0 -1
  58. package/demo/node_modules/openai/_shims/auto/types-node.mjs +0 -2
  59. package/demo/node_modules/openai/_shims/auto/types-node.mjs.map +0 -1
  60. package/demo/node_modules/openai/_shims/auto/types.d.ts +0 -101
  61. package/demo/node_modules/openai/_shims/auto/types.js +0 -3
  62. package/demo/node_modules/openai/_shims/auto/types.mjs +0 -3
  63. package/demo/node_modules/openai/_shims/bun-runtime.d.ts +0 -6
  64. package/demo/node_modules/openai/_shims/bun-runtime.d.ts.map +0 -1
  65. package/demo/node_modules/openai/_shims/bun-runtime.js +0 -14
  66. package/demo/node_modules/openai/_shims/bun-runtime.js.map +0 -1
  67. package/demo/node_modules/openai/_shims/bun-runtime.mjs +0 -10
  68. package/demo/node_modules/openai/_shims/bun-runtime.mjs.map +0 -1
  69. package/demo/node_modules/openai/_shims/index.d.ts +0 -81
  70. package/demo/node_modules/openai/_shims/index.js +0 -13
  71. package/demo/node_modules/openai/_shims/index.mjs +0 -7
  72. package/demo/node_modules/openai/_shims/manual-types.d.ts +0 -12
  73. package/demo/node_modules/openai/_shims/manual-types.js +0 -3
  74. package/demo/node_modules/openai/_shims/manual-types.mjs +0 -3
  75. package/demo/node_modules/openai/_shims/node-runtime.d.ts +0 -3
  76. package/demo/node_modules/openai/_shims/node-runtime.d.ts.map +0 -1
  77. package/demo/node_modules/openai/_shims/node-runtime.js +0 -90
  78. package/demo/node_modules/openai/_shims/node-runtime.js.map +0 -1
  79. package/demo/node_modules/openai/_shims/node-runtime.mjs +0 -56
  80. package/demo/node_modules/openai/_shims/node-runtime.mjs.map +0 -1
  81. package/demo/node_modules/openai/_shims/node-types.d.ts +0 -42
  82. package/demo/node_modules/openai/_shims/node-types.js +0 -3
  83. package/demo/node_modules/openai/_shims/node-types.mjs +0 -3
  84. package/demo/node_modules/openai/_shims/registry.d.ts +0 -37
  85. package/demo/node_modules/openai/_shims/registry.d.ts.map +0 -1
  86. package/demo/node_modules/openai/_shims/registry.js +0 -41
  87. package/demo/node_modules/openai/_shims/registry.js.map +0 -1
  88. package/demo/node_modules/openai/_shims/registry.mjs +0 -37
  89. package/demo/node_modules/openai/_shims/registry.mjs.map +0 -1
  90. package/demo/node_modules/openai/_shims/web-runtime.d.ts +0 -5
  91. package/demo/node_modules/openai/_shims/web-runtime.d.ts.map +0 -1
  92. package/demo/node_modules/openai/_shims/web-runtime.js +0 -78
  93. package/demo/node_modules/openai/_shims/web-runtime.js.map +0 -1
  94. package/demo/node_modules/openai/_shims/web-runtime.mjs +0 -71
  95. package/demo/node_modules/openai/_shims/web-runtime.mjs.map +0 -1
  96. package/demo/node_modules/openai/_shims/web-types.d.ts +0 -83
  97. package/demo/node_modules/openai/_shims/web-types.js +0 -3
  98. package/demo/node_modules/openai/_shims/web-types.mjs +0 -3
  99. package/demo/node_modules/openai/bin/cli +0 -49
  100. package/demo/node_modules/openai/core.d.ts +0 -239
  101. package/demo/node_modules/openai/core.d.ts.map +0 -1
  102. package/demo/node_modules/openai/core.js +0 -879
  103. package/demo/node_modules/openai/core.js.map +0 -1
  104. package/demo/node_modules/openai/core.mjs +0 -848
  105. package/demo/node_modules/openai/core.mjs.map +0 -1
  106. package/demo/node_modules/openai/error.d.ts +0 -57
  107. package/demo/node_modules/openai/error.d.ts.map +0 -1
  108. package/demo/node_modules/openai/error.js +0 -148
  109. package/demo/node_modules/openai/error.js.map +0 -1
  110. package/demo/node_modules/openai/error.mjs +0 -132
  111. package/demo/node_modules/openai/error.mjs.map +0 -1
  112. package/demo/node_modules/openai/index.d.mts +0 -267
  113. package/demo/node_modules/openai/index.d.ts +0 -267
  114. package/demo/node_modules/openai/index.d.ts.map +0 -1
  115. package/demo/node_modules/openai/index.js +0 -262
  116. package/demo/node_modules/openai/index.js.map +0 -1
  117. package/demo/node_modules/openai/index.mjs +0 -232
  118. package/demo/node_modules/openai/index.mjs.map +0 -1
  119. package/demo/node_modules/openai/lib/AbstractAssistantStreamRunner.d.ts +0 -74
  120. package/demo/node_modules/openai/lib/AbstractAssistantStreamRunner.d.ts.map +0 -1
  121. package/demo/node_modules/openai/lib/AbstractAssistantStreamRunner.js +0 -246
  122. package/demo/node_modules/openai/lib/AbstractAssistantStreamRunner.js.map +0 -1
  123. package/demo/node_modules/openai/lib/AbstractAssistantStreamRunner.mjs +0 -242
  124. package/demo/node_modules/openai/lib/AbstractAssistantStreamRunner.mjs.map +0 -1
  125. package/demo/node_modules/openai/lib/AbstractChatCompletionRunner.d.ts +0 -114
  126. package/demo/node_modules/openai/lib/AbstractChatCompletionRunner.d.ts.map +0 -1
  127. package/demo/node_modules/openai/lib/AbstractChatCompletionRunner.js +0 -519
  128. package/demo/node_modules/openai/lib/AbstractChatCompletionRunner.js.map +0 -1
  129. package/demo/node_modules/openai/lib/AbstractChatCompletionRunner.mjs +0 -515
  130. package/demo/node_modules/openai/lib/AbstractChatCompletionRunner.mjs.map +0 -1
  131. package/demo/node_modules/openai/lib/AssistantStream.d.ts +0 -58
  132. package/demo/node_modules/openai/lib/AssistantStream.d.ts.map +0 -1
  133. package/demo/node_modules/openai/lib/AssistantStream.js +0 -548
  134. package/demo/node_modules/openai/lib/AssistantStream.js.map +0 -1
  135. package/demo/node_modules/openai/lib/AssistantStream.mjs +0 -521
  136. package/demo/node_modules/openai/lib/AssistantStream.mjs.map +0 -1
  137. package/demo/node_modules/openai/lib/ChatCompletionRunFunctions.test.d.ts +0 -2
  138. package/demo/node_modules/openai/lib/ChatCompletionRunFunctions.test.d.ts.map +0 -1
  139. package/demo/node_modules/openai/lib/ChatCompletionRunFunctions.test.js +0 -2177
  140. package/demo/node_modules/openai/lib/ChatCompletionRunFunctions.test.js.map +0 -1
  141. package/demo/node_modules/openai/lib/ChatCompletionRunFunctions.test.mjs +0 -2172
  142. package/demo/node_modules/openai/lib/ChatCompletionRunFunctions.test.mjs.map +0 -1
  143. package/demo/node_modules/openai/lib/ChatCompletionRunner.d.ts +0 -19
  144. package/demo/node_modules/openai/lib/ChatCompletionRunner.d.ts.map +0 -1
  145. package/demo/node_modules/openai/lib/ChatCompletionRunner.js +0 -34
  146. package/demo/node_modules/openai/lib/ChatCompletionRunner.js.map +0 -1
  147. package/demo/node_modules/openai/lib/ChatCompletionRunner.mjs +0 -30
  148. package/demo/node_modules/openai/lib/ChatCompletionRunner.mjs.map +0 -1
  149. package/demo/node_modules/openai/lib/ChatCompletionStream.d.ts +0 -149
  150. package/demo/node_modules/openai/lib/ChatCompletionStream.d.ts.map +0 -1
  151. package/demo/node_modules/openai/lib/ChatCompletionStream.js +0 -312
  152. package/demo/node_modules/openai/lib/ChatCompletionStream.js.map +0 -1
  153. package/demo/node_modules/openai/lib/ChatCompletionStream.mjs +0 -308
  154. package/demo/node_modules/openai/lib/ChatCompletionStream.mjs.map +0 -1
  155. package/demo/node_modules/openai/lib/ChatCompletionStreamingRunner.d.ts +0 -22
  156. package/demo/node_modules/openai/lib/ChatCompletionStreamingRunner.d.ts.map +0 -1
  157. package/demo/node_modules/openai/lib/ChatCompletionStreamingRunner.js +0 -32
  158. package/demo/node_modules/openai/lib/ChatCompletionStreamingRunner.js.map +0 -1
  159. package/demo/node_modules/openai/lib/ChatCompletionStreamingRunner.mjs +0 -28
  160. package/demo/node_modules/openai/lib/ChatCompletionStreamingRunner.mjs.map +0 -1
  161. package/demo/node_modules/openai/lib/RunnableFunction.d.ts +0 -95
  162. package/demo/node_modules/openai/lib/RunnableFunction.d.ts.map +0 -1
  163. package/demo/node_modules/openai/lib/RunnableFunction.js +0 -35
  164. package/demo/node_modules/openai/lib/RunnableFunction.js.map +0 -1
  165. package/demo/node_modules/openai/lib/RunnableFunction.mjs +0 -29
  166. package/demo/node_modules/openai/lib/RunnableFunction.mjs.map +0 -1
  167. package/demo/node_modules/openai/lib/Util.d.ts +0 -5
  168. package/demo/node_modules/openai/lib/Util.d.ts.map +0 -1
  169. package/demo/node_modules/openai/lib/Util.js +0 -26
  170. package/demo/node_modules/openai/lib/Util.js.map +0 -1
  171. package/demo/node_modules/openai/lib/Util.mjs +0 -22
  172. package/demo/node_modules/openai/lib/Util.mjs.map +0 -1
  173. package/demo/node_modules/openai/lib/chatCompletionUtils.d.ts +0 -6
  174. package/demo/node_modules/openai/lib/chatCompletionUtils.d.ts.map +0 -1
  175. package/demo/node_modules/openai/lib/chatCompletionUtils.js +0 -20
  176. package/demo/node_modules/openai/lib/chatCompletionUtils.js.map +0 -1
  177. package/demo/node_modules/openai/lib/chatCompletionUtils.mjs +0 -13
  178. package/demo/node_modules/openai/lib/chatCompletionUtils.mjs.map +0 -1
  179. package/demo/node_modules/openai/lib/jsonschema.d.ts +0 -106
  180. package/demo/node_modules/openai/lib/jsonschema.d.ts.map +0 -1
  181. package/demo/node_modules/openai/lib/jsonschema.js +0 -11
  182. package/demo/node_modules/openai/lib/jsonschema.js.map +0 -1
  183. package/demo/node_modules/openai/lib/jsonschema.mjs +0 -10
  184. package/demo/node_modules/openai/lib/jsonschema.mjs.map +0 -1
  185. package/demo/node_modules/openai/package.json +0 -105
  186. package/demo/node_modules/openai/pagination.d.ts +0 -37
  187. package/demo/node_modules/openai/pagination.d.ts.map +0 -1
  188. package/demo/node_modules/openai/pagination.js +0 -64
  189. package/demo/node_modules/openai/pagination.js.map +0 -1
  190. package/demo/node_modules/openai/pagination.mjs +0 -59
  191. package/demo/node_modules/openai/pagination.mjs.map +0 -1
  192. package/demo/node_modules/openai/resource.d.ts +0 -6
  193. package/demo/node_modules/openai/resource.d.ts.map +0 -1
  194. package/demo/node_modules/openai/resource.js +0 -11
  195. package/demo/node_modules/openai/resource.js.map +0 -1
  196. package/demo/node_modules/openai/resource.mjs +0 -7
  197. package/demo/node_modules/openai/resource.mjs.map +0 -1
  198. package/demo/node_modules/openai/resources/audio/audio.d.ts +0 -20
  199. package/demo/node_modules/openai/resources/audio/audio.d.ts.map +0 -1
  200. package/demo/node_modules/openai/resources/audio/audio.js +0 -46
  201. package/demo/node_modules/openai/resources/audio/audio.js.map +0 -1
  202. package/demo/node_modules/openai/resources/audio/audio.mjs +0 -19
  203. package/demo/node_modules/openai/resources/audio/audio.mjs.map +0 -1
  204. package/demo/node_modules/openai/resources/audio/index.d.ts +0 -5
  205. package/demo/node_modules/openai/resources/audio/index.d.ts.map +0 -1
  206. package/demo/node_modules/openai/resources/audio/index.js +0 -13
  207. package/demo/node_modules/openai/resources/audio/index.js.map +0 -1
  208. package/demo/node_modules/openai/resources/audio/index.mjs +0 -6
  209. package/demo/node_modules/openai/resources/audio/index.mjs.map +0 -1
  210. package/demo/node_modules/openai/resources/audio/speech.d.ts +0 -42
  211. package/demo/node_modules/openai/resources/audio/speech.d.ts.map +0 -1
  212. package/demo/node_modules/openai/resources/audio/speech.js +0 -17
  213. package/demo/node_modules/openai/resources/audio/speech.js.map +0 -1
  214. package/demo/node_modules/openai/resources/audio/speech.mjs +0 -13
  215. package/demo/node_modules/openai/resources/audio/speech.mjs.map +0 -1
  216. package/demo/node_modules/openai/resources/audio/transcriptions.d.ts +0 -71
  217. package/demo/node_modules/openai/resources/audio/transcriptions.d.ts.map +0 -1
  218. package/demo/node_modules/openai/resources/audio/transcriptions.js +0 -18
  219. package/demo/node_modules/openai/resources/audio/transcriptions.js.map +0 -1
  220. package/demo/node_modules/openai/resources/audio/transcriptions.mjs +0 -14
  221. package/demo/node_modules/openai/resources/audio/transcriptions.mjs.map +0 -1
  222. package/demo/node_modules/openai/resources/audio/translations.d.ts +0 -50
  223. package/demo/node_modules/openai/resources/audio/translations.d.ts.map +0 -1
  224. package/demo/node_modules/openai/resources/audio/translations.js +0 -18
  225. package/demo/node_modules/openai/resources/audio/translations.js.map +0 -1
  226. package/demo/node_modules/openai/resources/audio/translations.mjs +0 -14
  227. package/demo/node_modules/openai/resources/audio/translations.mjs.map +0 -1
  228. package/demo/node_modules/openai/resources/batches.d.ts +0 -189
  229. package/demo/node_modules/openai/resources/batches.d.ts.map +0 -1
  230. package/demo/node_modules/openai/resources/batches.js +0 -65
  231. package/demo/node_modules/openai/resources/batches.js.map +0 -1
  232. package/demo/node_modules/openai/resources/batches.mjs +0 -37
  233. package/demo/node_modules/openai/resources/batches.mjs.map +0 -1
  234. package/demo/node_modules/openai/resources/beta/assistants.d.ts +0 -1048
  235. package/demo/node_modules/openai/resources/beta/assistants.d.ts.map +0 -1
  236. package/demo/node_modules/openai/resources/beta/assistants.js +0 -89
  237. package/demo/node_modules/openai/resources/beta/assistants.js.map +0 -1
  238. package/demo/node_modules/openai/resources/beta/assistants.mjs +0 -61
  239. package/demo/node_modules/openai/resources/beta/assistants.mjs.map +0 -1
  240. package/demo/node_modules/openai/resources/beta/beta.d.ts +0 -53
  241. package/demo/node_modules/openai/resources/beta/beta.d.ts.map +0 -1
  242. package/demo/node_modules/openai/resources/beta/beta.js +0 -51
  243. package/demo/node_modules/openai/resources/beta/beta.js.map +0 -1
  244. package/demo/node_modules/openai/resources/beta/beta.mjs +0 -24
  245. package/demo/node_modules/openai/resources/beta/beta.mjs.map +0 -1
  246. package/demo/node_modules/openai/resources/beta/chat/chat.d.ts +0 -9
  247. package/demo/node_modules/openai/resources/beta/chat/chat.d.ts.map +0 -1
  248. package/demo/node_modules/openai/resources/beta/chat/chat.js +0 -40
  249. package/demo/node_modules/openai/resources/beta/chat/chat.js.map +0 -1
  250. package/demo/node_modules/openai/resources/beta/chat/chat.mjs +0 -13
  251. package/demo/node_modules/openai/resources/beta/chat/chat.mjs.map +0 -1
  252. package/demo/node_modules/openai/resources/beta/chat/completions.d.ts +0 -37
  253. package/demo/node_modules/openai/resources/beta/chat/completions.d.ts.map +0 -1
  254. package/demo/node_modules/openai/resources/beta/chat/completions.js +0 -39
  255. package/demo/node_modules/openai/resources/beta/chat/completions.js.map +0 -1
  256. package/demo/node_modules/openai/resources/beta/chat/completions.mjs +0 -30
  257. package/demo/node_modules/openai/resources/beta/chat/completions.mjs.map +0 -1
  258. package/demo/node_modules/openai/resources/beta/chat/index.d.ts +0 -3
  259. package/demo/node_modules/openai/resources/beta/chat/index.d.ts.map +0 -1
  260. package/demo/node_modules/openai/resources/beta/chat/index.js +0 -9
  261. package/demo/node_modules/openai/resources/beta/chat/index.js.map +0 -1
  262. package/demo/node_modules/openai/resources/beta/chat/index.mjs +0 -4
  263. package/demo/node_modules/openai/resources/beta/chat/index.mjs.map +0 -1
  264. package/demo/node_modules/openai/resources/beta/index.d.ts +0 -6
  265. package/demo/node_modules/openai/resources/beta/index.d.ts.map +0 -1
  266. package/demo/node_modules/openai/resources/beta/index.js +0 -17
  267. package/demo/node_modules/openai/resources/beta/index.js.map +0 -1
  268. package/demo/node_modules/openai/resources/beta/index.mjs +0 -7
  269. package/demo/node_modules/openai/resources/beta/index.mjs.map +0 -1
  270. package/demo/node_modules/openai/resources/beta/threads/index.d.ts +0 -4
  271. package/demo/node_modules/openai/resources/beta/threads/index.d.ts.map +0 -1
  272. package/demo/node_modules/openai/resources/beta/threads/index.js +0 -13
  273. package/demo/node_modules/openai/resources/beta/threads/index.js.map +0 -1
  274. package/demo/node_modules/openai/resources/beta/threads/index.mjs +0 -5
  275. package/demo/node_modules/openai/resources/beta/threads/index.mjs.map +0 -1
  276. package/demo/node_modules/openai/resources/beta/threads/messages.d.ts +0 -552
  277. package/demo/node_modules/openai/resources/beta/threads/messages.d.ts.map +0 -1
  278. package/demo/node_modules/openai/resources/beta/threads/messages.js +0 -89
  279. package/demo/node_modules/openai/resources/beta/threads/messages.js.map +0 -1
  280. package/demo/node_modules/openai/resources/beta/threads/messages.mjs +0 -61
  281. package/demo/node_modules/openai/resources/beta/threads/messages.mjs.map +0 -1
  282. package/demo/node_modules/openai/resources/beta/threads/runs/index.d.ts +0 -3
  283. package/demo/node_modules/openai/resources/beta/threads/runs/index.d.ts.map +0 -1
  284. package/demo/node_modules/openai/resources/beta/threads/runs/index.js +0 -11
  285. package/demo/node_modules/openai/resources/beta/threads/runs/index.js.map +0 -1
  286. package/demo/node_modules/openai/resources/beta/threads/runs/index.mjs +0 -4
  287. package/demo/node_modules/openai/resources/beta/threads/runs/index.mjs.map +0 -1
  288. package/demo/node_modules/openai/resources/beta/threads/runs/runs.d.ts +0 -1194
  289. package/demo/node_modules/openai/resources/beta/threads/runs/runs.d.ts.map +0 -1
  290. package/demo/node_modules/openai/resources/beta/threads/runs/runs.js +0 -190
  291. package/demo/node_modules/openai/resources/beta/threads/runs/runs.js.map +0 -1
  292. package/demo/node_modules/openai/resources/beta/threads/runs/runs.mjs +0 -162
  293. package/demo/node_modules/openai/resources/beta/threads/runs/runs.mjs.map +0 -1
  294. package/demo/node_modules/openai/resources/beta/threads/runs/steps.d.ts +0 -520
  295. package/demo/node_modules/openai/resources/beta/threads/runs/steps.d.ts.map +0 -1
  296. package/demo/node_modules/openai/resources/beta/threads/runs/steps.js +0 -60
  297. package/demo/node_modules/openai/resources/beta/threads/runs/steps.js.map +0 -1
  298. package/demo/node_modules/openai/resources/beta/threads/runs/steps.mjs +0 -32
  299. package/demo/node_modules/openai/resources/beta/threads/runs/steps.mjs.map +0 -1
  300. package/demo/node_modules/openai/resources/beta/threads/threads.d.ts +0 -1240
  301. package/demo/node_modules/openai/resources/beta/threads/threads.d.ts.map +0 -1
  302. package/demo/node_modules/openai/resources/beta/threads/threads.js +0 -108
  303. package/demo/node_modules/openai/resources/beta/threads/threads.js.map +0 -1
  304. package/demo/node_modules/openai/resources/beta/threads/threads.mjs +0 -81
  305. package/demo/node_modules/openai/resources/beta/threads/threads.mjs.map +0 -1
  306. package/demo/node_modules/openai/resources/beta/vector-stores/file-batches.d.ts +0 -142
  307. package/demo/node_modules/openai/resources/beta/vector-stores/file-batches.d.ts.map +0 -1
  308. package/demo/node_modules/openai/resources/beta/vector-stores/file-batches.js +0 -129
  309. package/demo/node_modules/openai/resources/beta/vector-stores/file-batches.js.map +0 -1
  310. package/demo/node_modules/openai/resources/beta/vector-stores/file-batches.mjs +0 -125
  311. package/demo/node_modules/openai/resources/beta/vector-stores/file-batches.mjs.map +0 -1
  312. package/demo/node_modules/openai/resources/beta/vector-stores/files.d.ts +0 -154
  313. package/demo/node_modules/openai/resources/beta/vector-stores/files.d.ts.map +0 -1
  314. package/demo/node_modules/openai/resources/beta/vector-stores/files.js +0 -149
  315. package/demo/node_modules/openai/resources/beta/vector-stores/files.js.map +0 -1
  316. package/demo/node_modules/openai/resources/beta/vector-stores/files.mjs +0 -121
  317. package/demo/node_modules/openai/resources/beta/vector-stores/files.mjs.map +0 -1
  318. package/demo/node_modules/openai/resources/beta/vector-stores/index.d.ts +0 -4
  319. package/demo/node_modules/openai/resources/beta/vector-stores/index.d.ts.map +0 -1
  320. package/demo/node_modules/openai/resources/beta/vector-stores/index.js +0 -13
  321. package/demo/node_modules/openai/resources/beta/vector-stores/index.js.map +0 -1
  322. package/demo/node_modules/openai/resources/beta/vector-stores/index.mjs +0 -5
  323. package/demo/node_modules/openai/resources/beta/vector-stores/index.mjs.map +0 -1
  324. package/demo/node_modules/openai/resources/beta/vector-stores/vector-stores.d.ts +0 -233
  325. package/demo/node_modules/openai/resources/beta/vector-stores/vector-stores.d.ts.map +0 -1
  326. package/demo/node_modules/openai/resources/beta/vector-stores/vector-stores.js +0 -99
  327. package/demo/node_modules/openai/resources/beta/vector-stores/vector-stores.js.map +0 -1
  328. package/demo/node_modules/openai/resources/beta/vector-stores/vector-stores.mjs +0 -71
  329. package/demo/node_modules/openai/resources/beta/vector-stores/vector-stores.mjs.map +0 -1
  330. package/demo/node_modules/openai/resources/chat/chat.d.ts +0 -42
  331. package/demo/node_modules/openai/resources/chat/chat.d.ts.map +0 -1
  332. package/demo/node_modules/openai/resources/chat/chat.js +0 -40
  333. package/demo/node_modules/openai/resources/chat/chat.js.map +0 -1
  334. package/demo/node_modules/openai/resources/chat/chat.mjs +0 -13
  335. package/demo/node_modules/openai/resources/chat/chat.mjs.map +0 -1
  336. package/demo/node_modules/openai/resources/chat/completions.d.ts +0 -845
  337. package/demo/node_modules/openai/resources/chat/completions.d.ts.map +0 -1
  338. package/demo/node_modules/openai/resources/chat/completions.js +0 -14
  339. package/demo/node_modules/openai/resources/chat/completions.js.map +0 -1
  340. package/demo/node_modules/openai/resources/chat/completions.mjs +0 -10
  341. package/demo/node_modules/openai/resources/chat/completions.mjs.map +0 -1
  342. package/demo/node_modules/openai/resources/chat/index.d.ts +0 -3
  343. package/demo/node_modules/openai/resources/chat/index.d.ts.map +0 -1
  344. package/demo/node_modules/openai/resources/chat/index.js +0 -9
  345. package/demo/node_modules/openai/resources/chat/index.js.map +0 -1
  346. package/demo/node_modules/openai/resources/chat/index.mjs +0 -4
  347. package/demo/node_modules/openai/resources/chat/index.mjs.map +0 -1
  348. package/demo/node_modules/openai/resources/completions.d.ts +0 -272
  349. package/demo/node_modules/openai/resources/completions.d.ts.map +0 -1
  350. package/demo/node_modules/openai/resources/completions.js +0 -14
  351. package/demo/node_modules/openai/resources/completions.js.map +0 -1
  352. package/demo/node_modules/openai/resources/completions.mjs +0 -10
  353. package/demo/node_modules/openai/resources/completions.mjs.map +0 -1
  354. package/demo/node_modules/openai/resources/embeddings.d.ts +0 -103
  355. package/demo/node_modules/openai/resources/embeddings.d.ts.map +0 -1
  356. package/demo/node_modules/openai/resources/embeddings.js +0 -17
  357. package/demo/node_modules/openai/resources/embeddings.js.map +0 -1
  358. package/demo/node_modules/openai/resources/embeddings.mjs +0 -13
  359. package/demo/node_modules/openai/resources/embeddings.mjs.map +0 -1
  360. package/demo/node_modules/openai/resources/files.d.ts +0 -140
  361. package/demo/node_modules/openai/resources/files.d.ts.map +0 -1
  362. package/demo/node_modules/openai/resources/files.js +0 -120
  363. package/demo/node_modules/openai/resources/files.js.map +0 -1
  364. package/demo/node_modules/openai/resources/files.mjs +0 -92
  365. package/demo/node_modules/openai/resources/files.mjs.map +0 -1
  366. package/demo/node_modules/openai/resources/fine-tuning/fine-tuning.d.ts +0 -19
  367. package/demo/node_modules/openai/resources/fine-tuning/fine-tuning.d.ts.map +0 -1
  368. package/demo/node_modules/openai/resources/fine-tuning/fine-tuning.js +0 -42
  369. package/demo/node_modules/openai/resources/fine-tuning/fine-tuning.js.map +0 -1
  370. package/demo/node_modules/openai/resources/fine-tuning/fine-tuning.mjs +0 -15
  371. package/demo/node_modules/openai/resources/fine-tuning/fine-tuning.mjs.map +0 -1
  372. package/demo/node_modules/openai/resources/fine-tuning/index.d.ts +0 -3
  373. package/demo/node_modules/openai/resources/fine-tuning/index.d.ts.map +0 -1
  374. package/demo/node_modules/openai/resources/fine-tuning/index.js +0 -11
  375. package/demo/node_modules/openai/resources/fine-tuning/index.js.map +0 -1
  376. package/demo/node_modules/openai/resources/fine-tuning/index.mjs +0 -4
  377. package/demo/node_modules/openai/resources/fine-tuning/index.mjs.map +0 -1
  378. package/demo/node_modules/openai/resources/fine-tuning/jobs/checkpoints.d.ts +0 -69
  379. package/demo/node_modules/openai/resources/fine-tuning/jobs/checkpoints.d.ts.map +0 -1
  380. package/demo/node_modules/openai/resources/fine-tuning/jobs/checkpoints.js +0 -47
  381. package/demo/node_modules/openai/resources/fine-tuning/jobs/checkpoints.js.map +0 -1
  382. package/demo/node_modules/openai/resources/fine-tuning/jobs/checkpoints.mjs +0 -19
  383. package/demo/node_modules/openai/resources/fine-tuning/jobs/checkpoints.mjs.map +0 -1
  384. package/demo/node_modules/openai/resources/fine-tuning/jobs/index.d.ts +0 -3
  385. package/demo/node_modules/openai/resources/fine-tuning/jobs/index.d.ts.map +0 -1
  386. package/demo/node_modules/openai/resources/fine-tuning/jobs/index.js +0 -12
  387. package/demo/node_modules/openai/resources/fine-tuning/jobs/index.js.map +0 -1
  388. package/demo/node_modules/openai/resources/fine-tuning/jobs/index.mjs +0 -4
  389. package/demo/node_modules/openai/resources/fine-tuning/jobs/index.mjs.map +0 -1
  390. package/demo/node_modules/openai/resources/fine-tuning/jobs/jobs.d.ts +0 -362
  391. package/demo/node_modules/openai/resources/fine-tuning/jobs/jobs.d.ts.map +0 -1
  392. package/demo/node_modules/openai/resources/fine-tuning/jobs/jobs.js +0 -93
  393. package/demo/node_modules/openai/resources/fine-tuning/jobs/jobs.js.map +0 -1
  394. package/demo/node_modules/openai/resources/fine-tuning/jobs/jobs.mjs +0 -64
  395. package/demo/node_modules/openai/resources/fine-tuning/jobs/jobs.mjs.map +0 -1
  396. package/demo/node_modules/openai/resources/images.d.ts +0 -174
  397. package/demo/node_modules/openai/resources/images.d.ts.map +0 -1
  398. package/demo/node_modules/openai/resources/images.js +0 -30
  399. package/demo/node_modules/openai/resources/images.js.map +0 -1
  400. package/demo/node_modules/openai/resources/images.mjs +0 -26
  401. package/demo/node_modules/openai/resources/images.mjs.map +0 -1
  402. package/demo/node_modules/openai/resources/index.d.ts +0 -13
  403. package/demo/node_modules/openai/resources/index.d.ts.map +0 -1
  404. package/demo/node_modules/openai/resources/index.js +0 -44
  405. package/demo/node_modules/openai/resources/index.js.map +0 -1
  406. package/demo/node_modules/openai/resources/index.mjs +0 -14
  407. package/demo/node_modules/openai/resources/index.mjs.map +0 -1
  408. package/demo/node_modules/openai/resources/models.d.ts +0 -58
  409. package/demo/node_modules/openai/resources/models.d.ts.map +0 -1
  410. package/demo/node_modules/openai/resources/models.js +0 -64
  411. package/demo/node_modules/openai/resources/models.js.map +0 -1
  412. package/demo/node_modules/openai/resources/models.mjs +0 -36
  413. package/demo/node_modules/openai/resources/models.mjs.map +0 -1
  414. package/demo/node_modules/openai/resources/moderations.d.ts +0 -176
  415. package/demo/node_modules/openai/resources/moderations.d.ts.map +0 -1
  416. package/demo/node_modules/openai/resources/moderations.js +0 -17
  417. package/demo/node_modules/openai/resources/moderations.js.map +0 -1
  418. package/demo/node_modules/openai/resources/moderations.mjs +0 -13
  419. package/demo/node_modules/openai/resources/moderations.mjs.map +0 -1
  420. package/demo/node_modules/openai/resources/shared.d.ts +0 -39
  421. package/demo/node_modules/openai/resources/shared.d.ts.map +0 -1
  422. package/demo/node_modules/openai/resources/shared.js +0 -4
  423. package/demo/node_modules/openai/resources/shared.js.map +0 -1
  424. package/demo/node_modules/openai/resources/shared.mjs +0 -3
  425. package/demo/node_modules/openai/resources/shared.mjs.map +0 -1
  426. package/demo/node_modules/openai/shims/node.d.ts +0 -29
  427. package/demo/node_modules/openai/shims/node.d.ts.map +0 -1
  428. package/demo/node_modules/openai/shims/node.js +0 -31
  429. package/demo/node_modules/openai/shims/node.js.map +0 -1
  430. package/demo/node_modules/openai/shims/node.mjs +0 -5
  431. package/demo/node_modules/openai/shims/node.mjs.map +0 -1
  432. package/demo/node_modules/openai/shims/web.d.ts +0 -26
  433. package/demo/node_modules/openai/shims/web.d.ts.map +0 -1
  434. package/demo/node_modules/openai/shims/web.js +0 -31
  435. package/demo/node_modules/openai/shims/web.js.map +0 -1
  436. package/demo/node_modules/openai/shims/web.mjs +0 -5
  437. package/demo/node_modules/openai/shims/web.mjs.map +0 -1
  438. package/demo/node_modules/openai/src/_shims/MultipartBody.ts +0 -9
  439. package/demo/node_modules/openai/src/_shims/README.md +0 -46
  440. package/demo/node_modules/openai/src/_shims/auto/runtime-bun.ts +0 -4
  441. package/demo/node_modules/openai/src/_shims/auto/runtime-node.ts +0 -4
  442. package/demo/node_modules/openai/src/_shims/auto/runtime.ts +0 -4
  443. package/demo/node_modules/openai/src/_shims/auto/types-node.ts +0 -4
  444. package/demo/node_modules/openai/src/_shims/auto/types.d.ts +0 -101
  445. package/demo/node_modules/openai/src/_shims/auto/types.js +0 -3
  446. package/demo/node_modules/openai/src/_shims/auto/types.mjs +0 -3
  447. package/demo/node_modules/openai/src/_shims/bun-runtime.ts +0 -14
  448. package/demo/node_modules/openai/src/_shims/index.d.ts +0 -81
  449. package/demo/node_modules/openai/src/_shims/index.js +0 -13
  450. package/demo/node_modules/openai/src/_shims/index.mjs +0 -7
  451. package/demo/node_modules/openai/src/_shims/manual-types.d.ts +0 -12
  452. package/demo/node_modules/openai/src/_shims/manual-types.js +0 -3
  453. package/demo/node_modules/openai/src/_shims/manual-types.mjs +0 -3
  454. package/demo/node_modules/openai/src/_shims/node-runtime.ts +0 -83
  455. package/demo/node_modules/openai/src/_shims/node-types.d.ts +0 -42
  456. package/demo/node_modules/openai/src/_shims/node-types.js +0 -3
  457. package/demo/node_modules/openai/src/_shims/node-types.mjs +0 -3
  458. package/demo/node_modules/openai/src/_shims/registry.ts +0 -65
  459. package/demo/node_modules/openai/src/_shims/web-runtime.ts +0 -103
  460. package/demo/node_modules/openai/src/_shims/web-types.d.ts +0 -83
  461. package/demo/node_modules/openai/src/_shims/web-types.js +0 -3
  462. package/demo/node_modules/openai/src/_shims/web-types.mjs +0 -3
  463. package/demo/node_modules/openai/src/core.ts +0 -1162
  464. package/demo/node_modules/openai/src/error.ts +0 -158
  465. package/demo/node_modules/openai/src/index.ts +0 -502
  466. package/demo/node_modules/openai/src/lib/.keep +0 -4
  467. package/demo/node_modules/openai/src/lib/AbstractAssistantStreamRunner.ts +0 -340
  468. package/demo/node_modules/openai/src/lib/AbstractChatCompletionRunner.ts +0 -682
  469. package/demo/node_modules/openai/src/lib/AssistantStream.ts +0 -723
  470. package/demo/node_modules/openai/src/lib/ChatCompletionRunFunctions.test.ts +0 -2328
  471. package/demo/node_modules/openai/src/lib/ChatCompletionRunner.ts +0 -68
  472. package/demo/node_modules/openai/src/lib/ChatCompletionStream.ts +0 -494
  473. package/demo/node_modules/openai/src/lib/ChatCompletionStreamingRunner.ts +0 -68
  474. package/demo/node_modules/openai/src/lib/RunnableFunction.ts +0 -134
  475. package/demo/node_modules/openai/src/lib/Util.ts +0 -23
  476. package/demo/node_modules/openai/src/lib/chatCompletionUtils.ts +0 -28
  477. package/demo/node_modules/openai/src/lib/jsonschema.ts +0 -148
  478. package/demo/node_modules/openai/src/pagination.ts +0 -98
  479. package/demo/node_modules/openai/src/resource.ts +0 -11
  480. package/demo/node_modules/openai/src/resources/audio/audio.ts +0 -23
  481. package/demo/node_modules/openai/src/resources/audio/index.ts +0 -6
  482. package/demo/node_modules/openai/src/resources/audio/speech.ts +0 -52
  483. package/demo/node_modules/openai/src/resources/audio/transcriptions.ts +0 -84
  484. package/demo/node_modules/openai/src/resources/audio/translations.ts +0 -61
  485. package/demo/node_modules/openai/src/resources/batches.ts +0 -252
  486. package/demo/node_modules/openai/src/resources/beta/assistants.ts +0 -1315
  487. package/demo/node_modules/openai/src/resources/beta/beta.ts +0 -56
  488. package/demo/node_modules/openai/src/resources/beta/chat/chat.ts +0 -12
  489. package/demo/node_modules/openai/src/resources/beta/chat/completions.ts +0 -106
  490. package/demo/node_modules/openai/src/resources/beta/chat/index.ts +0 -4
  491. package/demo/node_modules/openai/src/resources/beta/index.ts +0 -48
  492. package/demo/node_modules/openai/src/resources/beta/threads/index.ts +0 -72
  493. package/demo/node_modules/openai/src/resources/beta/threads/messages.ts +0 -706
  494. package/demo/node_modules/openai/src/resources/beta/threads/runs/index.ts +0 -44
  495. package/demo/node_modules/openai/src/resources/beta/threads/runs/runs.ts +0 -1627
  496. package/demo/node_modules/openai/src/resources/beta/threads/runs/steps.ts +0 -641
  497. package/demo/node_modules/openai/src/resources/beta/threads/threads.ts +0 -1536
  498. package/demo/node_modules/openai/src/resources/beta/vector-stores/file-batches.ts +0 -293
  499. package/demo/node_modules/openai/src/resources/beta/vector-stores/files.ts +0 -284
  500. package/demo/node_modules/openai/src/resources/beta/vector-stores/index.ts +0 -25
  501. package/demo/node_modules/openai/src/resources/beta/vector-stores/vector-stores.ts +0 -318
  502. package/demo/node_modules/openai/src/resources/chat/chat.ts +0 -67
  503. package/demo/node_modules/openai/src/resources/chat/completions.ts +0 -996
  504. package/demo/node_modules/openai/src/resources/chat/index.ts +0 -33
  505. package/demo/node_modules/openai/src/resources/completions.ts +0 -329
  506. package/demo/node_modules/openai/src/resources/embeddings.ts +0 -125
  507. package/demo/node_modules/openai/src/resources/files.ts +0 -214
  508. package/demo/node_modules/openai/src/resources/fine-tuning/fine-tuning.ts +0 -22
  509. package/demo/node_modules/openai/src/resources/fine-tuning/index.ts +0 -16
  510. package/demo/node_modules/openai/src/resources/fine-tuning/jobs/checkpoints.ts +0 -108
  511. package/demo/node_modules/openai/src/resources/fine-tuning/jobs/index.ts +0 -21
  512. package/demo/node_modules/openai/src/resources/fine-tuning/jobs/jobs.ts +0 -458
  513. package/demo/node_modules/openai/src/resources/images.ts +0 -215
  514. package/demo/node_modules/openai/src/resources/index.ts +0 -45
  515. package/demo/node_modules/openai/src/resources/models.ts +0 -76
  516. package/demo/node_modules/openai/src/resources/moderations.ts +0 -214
  517. package/demo/node_modules/openai/src/resources/shared.ts +0 -47
  518. package/demo/node_modules/openai/src/shims/node.ts +0 -50
  519. package/demo/node_modules/openai/src/shims/web.ts +0 -50
  520. package/demo/node_modules/openai/src/streaming.ts +0 -508
  521. package/demo/node_modules/openai/src/tsconfig.json +0 -11
  522. package/demo/node_modules/openai/src/uploads.ts +0 -248
  523. package/demo/node_modules/openai/src/version.ts +0 -1
  524. package/demo/node_modules/openai/streaming.d.ts +0 -41
  525. package/demo/node_modules/openai/streaming.d.ts.map +0 -1
  526. package/demo/node_modules/openai/streaming.js +0 -433
  527. package/demo/node_modules/openai/streaming.js.map +0 -1
  528. package/demo/node_modules/openai/streaming.mjs +0 -426
  529. package/demo/node_modules/openai/streaming.mjs.map +0 -1
  530. package/demo/node_modules/openai/uploads.d.ts +0 -75
  531. package/demo/node_modules/openai/uploads.d.ts.map +0 -1
  532. package/demo/node_modules/openai/uploads.js +0 -165
  533. package/demo/node_modules/openai/uploads.js.map +0 -1
  534. package/demo/node_modules/openai/uploads.mjs +0 -152
  535. package/demo/node_modules/openai/uploads.mjs.map +0 -1
  536. package/demo/node_modules/openai/version.d.ts +0 -2
  537. package/demo/node_modules/openai/version.d.ts.map +0 -1
  538. package/demo/node_modules/openai/version.js +0 -5
  539. package/demo/node_modules/openai/version.js.map +0 -1
  540. package/demo/node_modules/openai/version.mjs +0 -2
  541. package/demo/node_modules/openai/version.mjs.map +0 -1
  542. package/demo/watson.png +0 -0
@@ -1,1536 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import * as Core from '../../../core';
4
- import { APIPromise } from '../../../core';
5
- import { APIResource } from '../../../resource';
6
- import { isRequestOptions } from '../../../core';
7
- import { AssistantStream, ThreadCreateAndRunParamsBaseStream } from '../../../lib/AssistantStream';
8
- import * as ThreadsAPI from './threads';
9
- import * as AssistantsAPI from '../assistants';
10
- import * as MessagesAPI from './messages';
11
- import * as RunsAPI from './runs/runs';
12
- import { Stream } from '../../../streaming';
13
-
14
- export class Threads extends APIResource {
15
- runs: RunsAPI.Runs = new RunsAPI.Runs(this._client);
16
- messages: MessagesAPI.Messages = new MessagesAPI.Messages(this._client);
17
-
18
- /**
19
- * Create a thread.
20
- */
21
- create(body?: ThreadCreateParams, options?: Core.RequestOptions): Core.APIPromise<Thread>;
22
- create(options?: Core.RequestOptions): Core.APIPromise<Thread>;
23
- create(
24
- body: ThreadCreateParams | Core.RequestOptions = {},
25
- options?: Core.RequestOptions,
26
- ): Core.APIPromise<Thread> {
27
- if (isRequestOptions(body)) {
28
- return this.create({}, body);
29
- }
30
- return this._client.post('/threads', {
31
- body,
32
- ...options,
33
- headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
34
- });
35
- }
36
-
37
- /**
38
- * Retrieves a thread.
39
- */
40
- retrieve(threadId: string, options?: Core.RequestOptions): Core.APIPromise<Thread> {
41
- return this._client.get(`/threads/${threadId}`, {
42
- ...options,
43
- headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
44
- });
45
- }
46
-
47
- /**
48
- * Modifies a thread.
49
- */
50
- update(threadId: string, body: ThreadUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Thread> {
51
- return this._client.post(`/threads/${threadId}`, {
52
- body,
53
- ...options,
54
- headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
55
- });
56
- }
57
-
58
- /**
59
- * Delete a thread.
60
- */
61
- del(threadId: string, options?: Core.RequestOptions): Core.APIPromise<ThreadDeleted> {
62
- return this._client.delete(`/threads/${threadId}`, {
63
- ...options,
64
- headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
65
- });
66
- }
67
-
68
- /**
69
- * Create a thread and run it in one request.
70
- */
71
- createAndRun(
72
- body: ThreadCreateAndRunParamsNonStreaming,
73
- options?: Core.RequestOptions,
74
- ): APIPromise<RunsAPI.Run>;
75
- createAndRun(
76
- body: ThreadCreateAndRunParamsStreaming,
77
- options?: Core.RequestOptions,
78
- ): APIPromise<Stream<AssistantsAPI.AssistantStreamEvent>>;
79
- createAndRun(
80
- body: ThreadCreateAndRunParamsBase,
81
- options?: Core.RequestOptions,
82
- ): APIPromise<Stream<AssistantsAPI.AssistantStreamEvent> | RunsAPI.Run>;
83
- createAndRun(
84
- body: ThreadCreateAndRunParams,
85
- options?: Core.RequestOptions,
86
- ): APIPromise<RunsAPI.Run> | APIPromise<Stream<AssistantsAPI.AssistantStreamEvent>> {
87
- return this._client.post('/threads/runs', {
88
- body,
89
- ...options,
90
- headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
91
- stream: body.stream ?? false,
92
- }) as APIPromise<RunsAPI.Run> | APIPromise<Stream<AssistantsAPI.AssistantStreamEvent>>;
93
- }
94
-
95
- /**
96
- * A helper to create a thread, start a run and then poll for a terminal state.
97
- * More information on Run lifecycles can be found here:
98
- * https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps
99
- */
100
- async createAndRunPoll(
101
- body: ThreadCreateAndRunParamsNonStreaming,
102
- options?: Core.RequestOptions & { pollIntervalMs?: number },
103
- ): Promise<Threads.Run> {
104
- const run = await this.createAndRun(body, options);
105
- return await this.runs.poll(run.thread_id, run.id, options);
106
- }
107
-
108
- /**
109
- * Create a thread and stream the run back
110
- */
111
- createAndRunStream(
112
- body: ThreadCreateAndRunParamsBaseStream,
113
- options?: Core.RequestOptions,
114
- ): AssistantStream {
115
- return AssistantStream.createThreadAssistantStream(body, this._client.beta.threads, options);
116
- }
117
- }
118
-
119
- /**
120
- * An object describing the expected output of the model. If `json_object` only
121
- * `function` type `tools` are allowed to be passed to the Run. If `text` the model
122
- * can return text or any value needed.
123
- */
124
- export interface AssistantResponseFormat {
125
- /**
126
- * Must be one of `text` or `json_object`.
127
- */
128
- type?: 'text' | 'json_object';
129
- }
130
-
131
- /**
132
- * Specifies the format that the model must output. Compatible with
133
- * [GPT-4o](https://platform.openai.com/docs/models/gpt-4o),
134
- * [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
135
- * and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
136
- *
137
- * Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
138
- * message the model generates is valid JSON.
139
- *
140
- * **Important:** when using JSON mode, you **must** also instruct the model to
141
- * produce JSON yourself via a system or user message. Without this, the model may
142
- * generate an unending stream of whitespace until the generation reaches the token
143
- * limit, resulting in a long-running and seemingly "stuck" request. Also note that
144
- * the message content may be partially cut off if `finish_reason="length"`, which
145
- * indicates the generation exceeded `max_tokens` or the conversation exceeded the
146
- * max context length.
147
- */
148
- export type AssistantResponseFormatOption = 'none' | 'auto' | AssistantResponseFormat;
149
-
150
- /**
151
- * Specifies a tool the model should use. Use to force the model to call a specific
152
- * tool.
153
- */
154
- export interface AssistantToolChoice {
155
- /**
156
- * The type of the tool. If type is `function`, the function name must be set
157
- */
158
- type: 'function' | 'code_interpreter' | 'file_search';
159
-
160
- function?: AssistantToolChoiceFunction;
161
- }
162
-
163
- export interface AssistantToolChoiceFunction {
164
- /**
165
- * The name of the function to call.
166
- */
167
- name: string;
168
- }
169
-
170
- /**
171
- * Controls which (if any) tool is called by the model. `none` means the model will
172
- * not call any tools and instead generates a message. `auto` is the default value
173
- * and means the model can pick between generating a message or calling one or more
174
- * tools. `required` means the model must call one or more tools before responding
175
- * to the user. Specifying a particular tool like `{"type": "file_search"}` or
176
- * `{"type": "function", "function": {"name": "my_function"}}` forces the model to
177
- * call that tool.
178
- */
179
- export type AssistantToolChoiceOption = 'none' | 'auto' | 'required' | AssistantToolChoice;
180
-
181
- /**
182
- * Represents a thread that contains
183
- * [messages](https://platform.openai.com/docs/api-reference/messages).
184
- */
185
- export interface Thread {
186
- /**
187
- * The identifier, which can be referenced in API endpoints.
188
- */
189
- id: string;
190
-
191
- /**
192
- * The Unix timestamp (in seconds) for when the thread was created.
193
- */
194
- created_at: number;
195
-
196
- /**
197
- * Set of 16 key-value pairs that can be attached to an object. This can be useful
198
- * for storing additional information about the object in a structured format. Keys
199
- * can be a maximum of 64 characters long and values can be a maxium of 512
200
- * characters long.
201
- */
202
- metadata: unknown | null;
203
-
204
- /**
205
- * The object type, which is always `thread`.
206
- */
207
- object: 'thread';
208
-
209
- /**
210
- * A set of resources that are made available to the assistant's tools in this
211
- * thread. The resources are specific to the type of tool. For example, the
212
- * `code_interpreter` tool requires a list of file IDs, while the `file_search`
213
- * tool requires a list of vector store IDs.
214
- */
215
- tool_resources: Thread.ToolResources | null;
216
- }
217
-
218
- export namespace Thread {
219
- /**
220
- * A set of resources that are made available to the assistant's tools in this
221
- * thread. The resources are specific to the type of tool. For example, the
222
- * `code_interpreter` tool requires a list of file IDs, while the `file_search`
223
- * tool requires a list of vector store IDs.
224
- */
225
- export interface ToolResources {
226
- code_interpreter?: ToolResources.CodeInterpreter;
227
-
228
- file_search?: ToolResources.FileSearch;
229
- }
230
-
231
- export namespace ToolResources {
232
- export interface CodeInterpreter {
233
- /**
234
- * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
235
- * available to the `code_interpreter` tool. There can be a maximum of 20 files
236
- * associated with the tool.
237
- */
238
- file_ids?: Array<string>;
239
- }
240
-
241
- export interface FileSearch {
242
- /**
243
- * The
244
- * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
245
- * attached to this thread. There can be a maximum of 1 vector store attached to
246
- * the thread.
247
- */
248
- vector_store_ids?: Array<string>;
249
- }
250
- }
251
- }
252
-
253
- export interface ThreadDeleted {
254
- id: string;
255
-
256
- deleted: boolean;
257
-
258
- object: 'thread.deleted';
259
- }
260
-
261
- export interface ThreadCreateParams {
262
- /**
263
- * A list of [messages](https://platform.openai.com/docs/api-reference/messages) to
264
- * start the thread with.
265
- */
266
- messages?: Array<ThreadCreateParams.Message>;
267
-
268
- /**
269
- * Set of 16 key-value pairs that can be attached to an object. This can be useful
270
- * for storing additional information about the object in a structured format. Keys
271
- * can be a maximum of 64 characters long and values can be a maxium of 512
272
- * characters long.
273
- */
274
- metadata?: unknown | null;
275
-
276
- /**
277
- * A set of resources that are made available to the assistant's tools in this
278
- * thread. The resources are specific to the type of tool. For example, the
279
- * `code_interpreter` tool requires a list of file IDs, while the `file_search`
280
- * tool requires a list of vector store IDs.
281
- */
282
- tool_resources?: ThreadCreateParams.ToolResources | null;
283
- }
284
-
285
- export namespace ThreadCreateParams {
286
- export interface Message {
287
- /**
288
- * The text contents of the message.
289
- */
290
- content: string | Array<MessagesAPI.MessageContentPartParam>;
291
-
292
- /**
293
- * The role of the entity that is creating the message. Allowed values include:
294
- *
295
- * - `user`: Indicates the message is sent by an actual user and should be used in
296
- * most cases to represent user-generated messages.
297
- * - `assistant`: Indicates the message is generated by the assistant. Use this
298
- * value to insert messages from the assistant into the conversation.
299
- */
300
- role: 'user' | 'assistant';
301
-
302
- /**
303
- * A list of files attached to the message, and the tools they should be added to.
304
- */
305
- attachments?: Array<Message.Attachment> | null;
306
-
307
- /**
308
- * Set of 16 key-value pairs that can be attached to an object. This can be useful
309
- * for storing additional information about the object in a structured format. Keys
310
- * can be a maximum of 64 characters long and values can be a maxium of 512
311
- * characters long.
312
- */
313
- metadata?: unknown | null;
314
- }
315
-
316
- export namespace Message {
317
- export interface Attachment {
318
- /**
319
- * The ID of the file to attach to the message.
320
- */
321
- file_id?: string;
322
-
323
- /**
324
- * The tools to add this file to.
325
- */
326
- tools?: Array<AssistantsAPI.CodeInterpreterTool | AssistantsAPI.FileSearchTool>;
327
- }
328
- }
329
-
330
- /**
331
- * A set of resources that are made available to the assistant's tools in this
332
- * thread. The resources are specific to the type of tool. For example, the
333
- * `code_interpreter` tool requires a list of file IDs, while the `file_search`
334
- * tool requires a list of vector store IDs.
335
- */
336
- export interface ToolResources {
337
- code_interpreter?: ToolResources.CodeInterpreter;
338
-
339
- file_search?: ToolResources.FileSearch;
340
- }
341
-
342
- export namespace ToolResources {
343
- export interface CodeInterpreter {
344
- /**
345
- * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
346
- * available to the `code_interpreter` tool. There can be a maximum of 20 files
347
- * associated with the tool.
348
- */
349
- file_ids?: Array<string>;
350
- }
351
-
352
- export interface FileSearch {
353
- /**
354
- * The
355
- * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
356
- * attached to this thread. There can be a maximum of 1 vector store attached to
357
- * the thread.
358
- */
359
- vector_store_ids?: Array<string>;
360
-
361
- /**
362
- * A helper to create a
363
- * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
364
- * with file_ids and attach it to this thread. There can be a maximum of 1 vector
365
- * store attached to the thread.
366
- */
367
- vector_stores?: Array<FileSearch.VectorStore>;
368
- }
369
-
370
- export namespace FileSearch {
371
- export interface VectorStore {
372
- /**
373
- * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
374
- * add to the vector store. There can be a maximum of 10000 files in a vector
375
- * store.
376
- */
377
- file_ids?: Array<string>;
378
-
379
- /**
380
- * Set of 16 key-value pairs that can be attached to a vector store. This can be
381
- * useful for storing additional information about the vector store in a structured
382
- * format. Keys can be a maximum of 64 characters long and values can be a maxium
383
- * of 512 characters long.
384
- */
385
- metadata?: unknown;
386
- }
387
- }
388
- }
389
- }
390
-
391
- export interface ThreadUpdateParams {
392
- /**
393
- * Set of 16 key-value pairs that can be attached to an object. This can be useful
394
- * for storing additional information about the object in a structured format. Keys
395
- * can be a maximum of 64 characters long and values can be a maxium of 512
396
- * characters long.
397
- */
398
- metadata?: unknown | null;
399
-
400
- /**
401
- * A set of resources that are made available to the assistant's tools in this
402
- * thread. The resources are specific to the type of tool. For example, the
403
- * `code_interpreter` tool requires a list of file IDs, while the `file_search`
404
- * tool requires a list of vector store IDs.
405
- */
406
- tool_resources?: ThreadUpdateParams.ToolResources | null;
407
- }
408
-
409
- export namespace ThreadUpdateParams {
410
- /**
411
- * A set of resources that are made available to the assistant's tools in this
412
- * thread. The resources are specific to the type of tool. For example, the
413
- * `code_interpreter` tool requires a list of file IDs, while the `file_search`
414
- * tool requires a list of vector store IDs.
415
- */
416
- export interface ToolResources {
417
- code_interpreter?: ToolResources.CodeInterpreter;
418
-
419
- file_search?: ToolResources.FileSearch;
420
- }
421
-
422
- export namespace ToolResources {
423
- export interface CodeInterpreter {
424
- /**
425
- * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
426
- * available to the `code_interpreter` tool. There can be a maximum of 20 files
427
- * associated with the tool.
428
- */
429
- file_ids?: Array<string>;
430
- }
431
-
432
- export interface FileSearch {
433
- /**
434
- * The
435
- * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
436
- * attached to this thread. There can be a maximum of 1 vector store attached to
437
- * the thread.
438
- */
439
- vector_store_ids?: Array<string>;
440
- }
441
- }
442
- }
443
-
444
- export type ThreadCreateAndRunParams =
445
- | ThreadCreateAndRunParamsNonStreaming
446
- | ThreadCreateAndRunParamsStreaming;
447
-
448
- export interface ThreadCreateAndRunParamsBase {
449
- /**
450
- * The ID of the
451
- * [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
452
- * execute this run.
453
- */
454
- assistant_id: string;
455
-
456
- /**
457
- * Override the default system message of the assistant. This is useful for
458
- * modifying the behavior on a per-run basis.
459
- */
460
- instructions?: string | null;
461
-
462
- /**
463
- * The maximum number of completion tokens that may be used over the course of the
464
- * run. The run will make a best effort to use only the number of completion tokens
465
- * specified, across multiple turns of the run. If the run exceeds the number of
466
- * completion tokens specified, the run will end with status `incomplete`. See
467
- * `incomplete_details` for more info.
468
- */
469
- max_completion_tokens?: number | null;
470
-
471
- /**
472
- * The maximum number of prompt tokens that may be used over the course of the run.
473
- * The run will make a best effort to use only the number of prompt tokens
474
- * specified, across multiple turns of the run. If the run exceeds the number of
475
- * prompt tokens specified, the run will end with status `incomplete`. See
476
- * `incomplete_details` for more info.
477
- */
478
- max_prompt_tokens?: number | null;
479
-
480
- /**
481
- * Set of 16 key-value pairs that can be attached to an object. This can be useful
482
- * for storing additional information about the object in a structured format. Keys
483
- * can be a maximum of 64 characters long and values can be a maxium of 512
484
- * characters long.
485
- */
486
- metadata?: unknown | null;
487
-
488
- /**
489
- * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to
490
- * be used to execute this run. If a value is provided here, it will override the
491
- * model associated with the assistant. If not, the model associated with the
492
- * assistant will be used.
493
- */
494
- model?:
495
- | (string & {})
496
- | 'gpt-4o'
497
- | 'gpt-4o-2024-05-13'
498
- | 'gpt-4-turbo'
499
- | 'gpt-4-turbo-2024-04-09'
500
- | 'gpt-4-0125-preview'
501
- | 'gpt-4-turbo-preview'
502
- | 'gpt-4-1106-preview'
503
- | 'gpt-4-vision-preview'
504
- | 'gpt-4'
505
- | 'gpt-4-0314'
506
- | 'gpt-4-0613'
507
- | 'gpt-4-32k'
508
- | 'gpt-4-32k-0314'
509
- | 'gpt-4-32k-0613'
510
- | 'gpt-3.5-turbo'
511
- | 'gpt-3.5-turbo-16k'
512
- | 'gpt-3.5-turbo-0613'
513
- | 'gpt-3.5-turbo-1106'
514
- | 'gpt-3.5-turbo-0125'
515
- | 'gpt-3.5-turbo-16k-0613'
516
- | null;
517
-
518
- /**
519
- * Specifies the format that the model must output. Compatible with
520
- * [GPT-4o](https://platform.openai.com/docs/models/gpt-4o),
521
- * [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
522
- * and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
523
- *
524
- * Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
525
- * message the model generates is valid JSON.
526
- *
527
- * **Important:** when using JSON mode, you **must** also instruct the model to
528
- * produce JSON yourself via a system or user message. Without this, the model may
529
- * generate an unending stream of whitespace until the generation reaches the token
530
- * limit, resulting in a long-running and seemingly "stuck" request. Also note that
531
- * the message content may be partially cut off if `finish_reason="length"`, which
532
- * indicates the generation exceeded `max_tokens` or the conversation exceeded the
533
- * max context length.
534
- */
535
- response_format?: AssistantResponseFormatOption | null;
536
-
537
- /**
538
- * If `true`, returns a stream of events that happen during the Run as server-sent
539
- * events, terminating when the Run enters a terminal state with a `data: [DONE]`
540
- * message.
541
- */
542
- stream?: boolean | null;
543
-
544
- /**
545
- * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
546
- * make the output more random, while lower values like 0.2 will make it more
547
- * focused and deterministic.
548
- */
549
- temperature?: number | null;
550
-
551
- /**
552
- * If no thread is provided, an empty thread will be created.
553
- */
554
- thread?: ThreadCreateAndRunParams.Thread;
555
-
556
- /**
557
- * Controls which (if any) tool is called by the model. `none` means the model will
558
- * not call any tools and instead generates a message. `auto` is the default value
559
- * and means the model can pick between generating a message or calling one or more
560
- * tools. `required` means the model must call one or more tools before responding
561
- * to the user. Specifying a particular tool like `{"type": "file_search"}` or
562
- * `{"type": "function", "function": {"name": "my_function"}}` forces the model to
563
- * call that tool.
564
- */
565
- tool_choice?: AssistantToolChoiceOption | null;
566
-
567
- /**
568
- * A set of resources that are used by the assistant's tools. The resources are
569
- * specific to the type of tool. For example, the `code_interpreter` tool requires
570
- * a list of file IDs, while the `file_search` tool requires a list of vector store
571
- * IDs.
572
- */
573
- tool_resources?: ThreadCreateAndRunParams.ToolResources | null;
574
-
575
- /**
576
- * Override the tools the assistant can use for this run. This is useful for
577
- * modifying the behavior on a per-run basis.
578
- */
579
- tools?: Array<
580
- AssistantsAPI.CodeInterpreterTool | AssistantsAPI.FileSearchTool | AssistantsAPI.FunctionTool
581
- > | null;
582
-
583
- /**
584
- * An alternative to sampling with temperature, called nucleus sampling, where the
585
- * model considers the results of the tokens with top_p probability mass. So 0.1
586
- * means only the tokens comprising the top 10% probability mass are considered.
587
- *
588
- * We generally recommend altering this or temperature but not both.
589
- */
590
- top_p?: number | null;
591
-
592
- /**
593
- * Controls for how a thread will be truncated prior to the run. Use this to
594
- * control the intial context window of the run.
595
- */
596
- truncation_strategy?: ThreadCreateAndRunParams.TruncationStrategy | null;
597
- }
598
-
599
- export namespace ThreadCreateAndRunParams {
600
- /**
601
- * If no thread is provided, an empty thread will be created.
602
- */
603
- export interface Thread {
604
- /**
605
- * A list of [messages](https://platform.openai.com/docs/api-reference/messages) to
606
- * start the thread with.
607
- */
608
- messages?: Array<Thread.Message>;
609
-
610
- /**
611
- * Set of 16 key-value pairs that can be attached to an object. This can be useful
612
- * for storing additional information about the object in a structured format. Keys
613
- * can be a maximum of 64 characters long and values can be a maxium of 512
614
- * characters long.
615
- */
616
- metadata?: unknown | null;
617
-
618
- /**
619
- * A set of resources that are made available to the assistant's tools in this
620
- * thread. The resources are specific to the type of tool. For example, the
621
- * `code_interpreter` tool requires a list of file IDs, while the `file_search`
622
- * tool requires a list of vector store IDs.
623
- */
624
- tool_resources?: Thread.ToolResources | null;
625
- }
626
-
627
- export namespace Thread {
628
- export interface Message {
629
- /**
630
- * The text contents of the message.
631
- */
632
- content: string | Array<MessagesAPI.MessageContentPartParam>;
633
-
634
- /**
635
- * The role of the entity that is creating the message. Allowed values include:
636
- *
637
- * - `user`: Indicates the message is sent by an actual user and should be used in
638
- * most cases to represent user-generated messages.
639
- * - `assistant`: Indicates the message is generated by the assistant. Use this
640
- * value to insert messages from the assistant into the conversation.
641
- */
642
- role: 'user' | 'assistant';
643
-
644
- /**
645
- * A list of files attached to the message, and the tools they should be added to.
646
- */
647
- attachments?: Array<Message.Attachment> | null;
648
-
649
- /**
650
- * Set of 16 key-value pairs that can be attached to an object. This can be useful
651
- * for storing additional information about the object in a structured format. Keys
652
- * can be a maximum of 64 characters long and values can be a maxium of 512
653
- * characters long.
654
- */
655
- metadata?: unknown | null;
656
- }
657
-
658
- export namespace Message {
659
- export interface Attachment {
660
- /**
661
- * The ID of the file to attach to the message.
662
- */
663
- file_id?: string;
664
-
665
- /**
666
- * The tools to add this file to.
667
- */
668
- tools?: Array<AssistantsAPI.CodeInterpreterTool | AssistantsAPI.FileSearchTool>;
669
- }
670
- }
671
-
672
- /**
673
- * A set of resources that are made available to the assistant's tools in this
674
- * thread. The resources are specific to the type of tool. For example, the
675
- * `code_interpreter` tool requires a list of file IDs, while the `file_search`
676
- * tool requires a list of vector store IDs.
677
- */
678
- export interface ToolResources {
679
- code_interpreter?: ToolResources.CodeInterpreter;
680
-
681
- file_search?: ToolResources.FileSearch;
682
- }
683
-
684
- export namespace ToolResources {
685
- export interface CodeInterpreter {
686
- /**
687
- * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
688
- * available to the `code_interpreter` tool. There can be a maximum of 20 files
689
- * associated with the tool.
690
- */
691
- file_ids?: Array<string>;
692
- }
693
-
694
- export interface FileSearch {
695
- /**
696
- * The
697
- * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
698
- * attached to this thread. There can be a maximum of 1 vector store attached to
699
- * the thread.
700
- */
701
- vector_store_ids?: Array<string>;
702
-
703
- /**
704
- * A helper to create a
705
- * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
706
- * with file_ids and attach it to this thread. There can be a maximum of 1 vector
707
- * store attached to the thread.
708
- */
709
- vector_stores?: Array<FileSearch.VectorStore>;
710
- }
711
-
712
- export namespace FileSearch {
713
- export interface VectorStore {
714
- /**
715
- * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
716
- * add to the vector store. There can be a maximum of 10000 files in a vector
717
- * store.
718
- */
719
- file_ids?: Array<string>;
720
-
721
- /**
722
- * Set of 16 key-value pairs that can be attached to a vector store. This can be
723
- * useful for storing additional information about the vector store in a structured
724
- * format. Keys can be a maximum of 64 characters long and values can be a maxium
725
- * of 512 characters long.
726
- */
727
- metadata?: unknown;
728
- }
729
- }
730
- }
731
- }
732
-
733
- /**
734
- * A set of resources that are used by the assistant's tools. The resources are
735
- * specific to the type of tool. For example, the `code_interpreter` tool requires
736
- * a list of file IDs, while the `file_search` tool requires a list of vector store
737
- * IDs.
738
- */
739
- export interface ToolResources {
740
- code_interpreter?: ToolResources.CodeInterpreter;
741
-
742
- file_search?: ToolResources.FileSearch;
743
- }
744
-
745
- export namespace ToolResources {
746
- export interface CodeInterpreter {
747
- /**
748
- * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
749
- * available to the `code_interpreter` tool. There can be a maximum of 20 files
750
- * associated with the tool.
751
- */
752
- file_ids?: Array<string>;
753
- }
754
-
755
- export interface FileSearch {
756
- /**
757
- * The ID of the
758
- * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
759
- * attached to this assistant. There can be a maximum of 1 vector store attached to
760
- * the assistant.
761
- */
762
- vector_store_ids?: Array<string>;
763
- }
764
- }
765
-
766
- /**
767
- * Controls for how a thread will be truncated prior to the run. Use this to
768
- * control the intial context window of the run.
769
- */
770
- export interface TruncationStrategy {
771
- /**
772
- * The truncation strategy to use for the thread. The default is `auto`. If set to
773
- * `last_messages`, the thread will be truncated to the n most recent messages in
774
- * the thread. When set to `auto`, messages in the middle of the thread will be
775
- * dropped to fit the context length of the model, `max_prompt_tokens`.
776
- */
777
- type: 'auto' | 'last_messages';
778
-
779
- /**
780
- * The number of most recent messages from the thread when constructing the context
781
- * for the run.
782
- */
783
- last_messages?: number | null;
784
- }
785
-
786
- export type ThreadCreateAndRunParamsNonStreaming = ThreadsAPI.ThreadCreateAndRunParamsNonStreaming;
787
- export type ThreadCreateAndRunParamsStreaming = ThreadsAPI.ThreadCreateAndRunParamsStreaming;
788
- }
789
-
790
- export interface ThreadCreateAndRunParamsNonStreaming extends ThreadCreateAndRunParamsBase {
791
- /**
792
- * If `true`, returns a stream of events that happen during the Run as server-sent
793
- * events, terminating when the Run enters a terminal state with a `data: [DONE]`
794
- * message.
795
- */
796
- stream?: false | null;
797
- }
798
-
799
- export interface ThreadCreateAndRunParamsStreaming extends ThreadCreateAndRunParamsBase {
800
- /**
801
- * If `true`, returns a stream of events that happen during the Run as server-sent
802
- * events, terminating when the Run enters a terminal state with a `data: [DONE]`
803
- * message.
804
- */
805
- stream: true;
806
- }
807
-
808
- export interface ThreadCreateAndRunPollParams {
809
- /**
810
- * The ID of the
811
- * [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
812
- * execute this run.
813
- */
814
- assistant_id: string;
815
-
816
- /**
817
- * Override the default system message of the assistant. This is useful for
818
- * modifying the behavior on a per-run basis.
819
- */
820
- instructions?: string | null;
821
-
822
- /**
823
- * The maximum number of completion tokens that may be used over the course of the
824
- * run. The run will make a best effort to use only the number of completion tokens
825
- * specified, across multiple turns of the run. If the run exceeds the number of
826
- * completion tokens specified, the run will end with status `incomplete`. See
827
- * `incomplete_details` for more info.
828
- */
829
- max_completion_tokens?: number | null;
830
-
831
- /**
832
- * The maximum number of prompt tokens that may be used over the course of the run.
833
- * The run will make a best effort to use only the number of prompt tokens
834
- * specified, across multiple turns of the run. If the run exceeds the number of
835
- * prompt tokens specified, the run will end with status `incomplete`. See
836
- * `incomplete_details` for more info.
837
- */
838
- max_prompt_tokens?: number | null;
839
-
840
- /**
841
- * Set of 16 key-value pairs that can be attached to an object. This can be useful
842
- * for storing additional information about the object in a structured format. Keys
843
- * can be a maximum of 64 characters long and values can be a maxium of 512
844
- * characters long.
845
- */
846
- metadata?: unknown | null;
847
-
848
- /**
849
- * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to
850
- * be used to execute this run. If a value is provided here, it will override the
851
- * model associated with the assistant. If not, the model associated with the
852
- * assistant will be used.
853
- */
854
- model?:
855
- | (string & {})
856
- | 'gpt-4o'
857
- | 'gpt-4o-2024-05-13'
858
- | 'gpt-4-turbo'
859
- | 'gpt-4-turbo-2024-04-09'
860
- | 'gpt-4-0125-preview'
861
- | 'gpt-4-turbo-preview'
862
- | 'gpt-4-1106-preview'
863
- | 'gpt-4-vision-preview'
864
- | 'gpt-4'
865
- | 'gpt-4-0314'
866
- | 'gpt-4-0613'
867
- | 'gpt-4-32k'
868
- | 'gpt-4-32k-0314'
869
- | 'gpt-4-32k-0613'
870
- | 'gpt-3.5-turbo'
871
- | 'gpt-3.5-turbo-16k'
872
- | 'gpt-3.5-turbo-0613'
873
- | 'gpt-3.5-turbo-1106'
874
- | 'gpt-3.5-turbo-0125'
875
- | 'gpt-3.5-turbo-16k-0613'
876
- | null;
877
-
878
- /**
879
- * Specifies the format that the model must output. Compatible with
880
- * [GPT-4o](https://platform.openai.com/docs/models/gpt-4o),
881
- * [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
882
- * and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
883
- *
884
- * Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
885
- * message the model generates is valid JSON.
886
- *
887
- * **Important:** when using JSON mode, you **must** also instruct the model to
888
- * produce JSON yourself via a system or user message. Without this, the model may
889
- * generate an unending stream of whitespace until the generation reaches the token
890
- * limit, resulting in a long-running and seemingly "stuck" request. Also note that
891
- * the message content may be partially cut off if `finish_reason="length"`, which
892
- * indicates the generation exceeded `max_tokens` or the conversation exceeded the
893
- * max context length.
894
- */
895
- response_format?: AssistantResponseFormatOption | null;
896
-
897
- /**
898
- * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
899
- * make the output more random, while lower values like 0.2 will make it more
900
- * focused and deterministic.
901
- */
902
- temperature?: number | null;
903
-
904
- /**
905
- * If no thread is provided, an empty thread will be created.
906
- */
907
- thread?: ThreadCreateAndRunPollParams.Thread;
908
-
909
- /**
910
- * Controls which (if any) tool is called by the model. `none` means the model will
911
- * not call any tools and instead generates a message. `auto` is the default value
912
- * and means the model can pick between generating a message or calling one or more
913
- * tools. `required` means the model must call one or more tools before responding
914
- * to the user. Specifying a particular tool like `{"type": "file_search"}` or
915
- * `{"type": "function", "function": {"name": "my_function"}}` forces the model to
916
- * call that tool.
917
- */
918
- tool_choice?: AssistantToolChoiceOption | null;
919
-
920
- /**
921
- * A set of resources that are used by the assistant's tools. The resources are
922
- * specific to the type of tool. For example, the `code_interpreter` tool requires
923
- * a list of file IDs, while the `file_search` tool requires a list of vector store
924
- * IDs.
925
- */
926
- tool_resources?: ThreadCreateAndRunPollParams.ToolResources | null;
927
-
928
- /**
929
- * Override the tools the assistant can use for this run. This is useful for
930
- * modifying the behavior on a per-run basis.
931
- */
932
- tools?: Array<
933
- AssistantsAPI.CodeInterpreterTool | AssistantsAPI.FileSearchTool | AssistantsAPI.FunctionTool
934
- > | null;
935
-
936
- /**
937
- * An alternative to sampling with temperature, called nucleus sampling, where the
938
- * model considers the results of the tokens with top_p probability mass. So 0.1
939
- * means only the tokens comprising the top 10% probability mass are considered.
940
- *
941
- * We generally recommend altering this or temperature but not both.
942
- */
943
- top_p?: number | null;
944
-
945
- /**
946
- * Controls for how a thread will be truncated prior to the run. Use this to
947
- * control the intial context window of the run.
948
- */
949
- truncation_strategy?: ThreadCreateAndRunPollParams.TruncationStrategy | null;
950
- }
951
-
952
- export namespace ThreadCreateAndRunPollParams {
953
- /**
954
- * If no thread is provided, an empty thread will be created.
955
- */
956
- export interface Thread {
957
- /**
958
- * A list of [messages](https://platform.openai.com/docs/api-reference/messages) to
959
- * start the thread with.
960
- */
961
- messages?: Array<Thread.Message>;
962
-
963
- /**
964
- * Set of 16 key-value pairs that can be attached to an object. This can be useful
965
- * for storing additional information about the object in a structured format. Keys
966
- * can be a maximum of 64 characters long and values can be a maxium of 512
967
- * characters long.
968
- */
969
- metadata?: unknown | null;
970
-
971
- /**
972
- * A set of resources that are made available to the assistant's tools in this
973
- * thread. The resources are specific to the type of tool. For example, the
974
- * `code_interpreter` tool requires a list of file IDs, while the `file_search`
975
- * tool requires a list of vector store IDs.
976
- */
977
- tool_resources?: Thread.ToolResources | null;
978
- }
979
-
980
- export namespace Thread {
981
- export interface Message {
982
- /**
983
- * The text contents of the message.
984
- */
985
- content: string | Array<MessagesAPI.MessageContentPartParam>;
986
-
987
- /**
988
- * The role of the entity that is creating the message. Allowed values include:
989
- *
990
- * - `user`: Indicates the message is sent by an actual user and should be used in
991
- * most cases to represent user-generated messages.
992
- * - `assistant`: Indicates the message is generated by the assistant. Use this
993
- * value to insert messages from the assistant into the conversation.
994
- */
995
- role: 'user' | 'assistant';
996
-
997
- /**
998
- * A list of files attached to the message, and the tools they should be added to.
999
- */
1000
- attachments?: Array<Message.Attachment> | null;
1001
-
1002
- /**
1003
- * Set of 16 key-value pairs that can be attached to an object. This can be useful
1004
- * for storing additional information about the object in a structured format. Keys
1005
- * can be a maximum of 64 characters long and values can be a maxium of 512
1006
- * characters long.
1007
- */
1008
- metadata?: unknown | null;
1009
- }
1010
-
1011
- export namespace Message {
1012
- export interface Attachment {
1013
- /**
1014
- * The ID of the file to attach to the message.
1015
- */
1016
- file_id?: string;
1017
-
1018
- /**
1019
- * The tools to add this file to.
1020
- */
1021
- tools?: Array<AssistantsAPI.CodeInterpreterTool | AssistantsAPI.FileSearchTool>;
1022
- }
1023
- }
1024
-
1025
- /**
1026
- * A set of resources that are made available to the assistant's tools in this
1027
- * thread. The resources are specific to the type of tool. For example, the
1028
- * `code_interpreter` tool requires a list of file IDs, while the `file_search`
1029
- * tool requires a list of vector store IDs.
1030
- */
1031
- export interface ToolResources {
1032
- code_interpreter?: ToolResources.CodeInterpreter;
1033
-
1034
- file_search?: ToolResources.FileSearch;
1035
- }
1036
-
1037
- export namespace ToolResources {
1038
- export interface CodeInterpreter {
1039
- /**
1040
- * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
1041
- * available to the `code_interpreter` tool. There can be a maximum of 20 files
1042
- * associated with the tool.
1043
- */
1044
- file_ids?: Array<string>;
1045
- }
1046
-
1047
- export interface FileSearch {
1048
- /**
1049
- * The
1050
- * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
1051
- * attached to this thread. There can be a maximum of 1 vector store attached to
1052
- * the thread.
1053
- */
1054
- vector_store_ids?: Array<string>;
1055
-
1056
- /**
1057
- * A helper to create a
1058
- * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
1059
- * with file_ids and attach it to this thread. There can be a maximum of 1 vector
1060
- * store attached to the thread.
1061
- */
1062
- vector_stores?: Array<FileSearch.VectorStore>;
1063
- }
1064
-
1065
- export namespace FileSearch {
1066
- export interface VectorStore {
1067
- /**
1068
- * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
1069
- * add to the vector store. There can be a maximum of 10000 files in a vector
1070
- * store.
1071
- */
1072
- file_ids?: Array<string>;
1073
-
1074
- /**
1075
- * Set of 16 key-value pairs that can be attached to a vector store. This can be
1076
- * useful for storing additional information about the vector store in a structured
1077
- * format. Keys can be a maximum of 64 characters long and values can be a maxium
1078
- * of 512 characters long.
1079
- */
1080
- metadata?: unknown;
1081
- }
1082
- }
1083
- }
1084
- }
1085
-
1086
- /**
1087
- * A set of resources that are used by the assistant's tools. The resources are
1088
- * specific to the type of tool. For example, the `code_interpreter` tool requires
1089
- * a list of file IDs, while the `file_search` tool requires a list of vector store
1090
- * IDs.
1091
- */
1092
- export interface ToolResources {
1093
- code_interpreter?: ToolResources.CodeInterpreter;
1094
-
1095
- file_search?: ToolResources.FileSearch;
1096
- }
1097
-
1098
- export namespace ToolResources {
1099
- export interface CodeInterpreter {
1100
- /**
1101
- * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
1102
- * available to the `code_interpreter` tool. There can be a maximum of 20 files
1103
- * associated with the tool.
1104
- */
1105
- file_ids?: Array<string>;
1106
- }
1107
-
1108
- export interface FileSearch {
1109
- /**
1110
- * The ID of the
1111
- * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
1112
- * attached to this assistant. There can be a maximum of 1 vector store attached to
1113
- * the assistant.
1114
- */
1115
- vector_store_ids?: Array<string>;
1116
- }
1117
- }
1118
-
1119
- /**
1120
- * Controls for how a thread will be truncated prior to the run. Use this to
1121
- * control the intial context window of the run.
1122
- */
1123
- export interface TruncationStrategy {
1124
- /**
1125
- * The truncation strategy to use for the thread. The default is `auto`. If set to
1126
- * `last_messages`, the thread will be truncated to the n most recent messages in
1127
- * the thread. When set to `auto`, messages in the middle of the thread will be
1128
- * dropped to fit the context length of the model, `max_prompt_tokens`.
1129
- */
1130
- type: 'auto' | 'last_messages';
1131
-
1132
- /**
1133
- * The number of most recent messages from the thread when constructing the context
1134
- * for the run.
1135
- */
1136
- last_messages?: number | null;
1137
- }
1138
- }
1139
-
1140
- export interface ThreadCreateAndRunStreamParams {
1141
- /**
1142
- * The ID of the
1143
- * [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
1144
- * execute this run.
1145
- */
1146
- assistant_id: string;
1147
-
1148
- /**
1149
- * Override the default system message of the assistant. This is useful for
1150
- * modifying the behavior on a per-run basis.
1151
- */
1152
- instructions?: string | null;
1153
-
1154
- /**
1155
- * The maximum number of completion tokens that may be used over the course of the
1156
- * run. The run will make a best effort to use only the number of completion tokens
1157
- * specified, across multiple turns of the run. If the run exceeds the number of
1158
- * completion tokens specified, the run will end with status `incomplete`. See
1159
- * `incomplete_details` for more info.
1160
- */
1161
- max_completion_tokens?: number | null;
1162
-
1163
- /**
1164
- * The maximum number of prompt tokens that may be used over the course of the run.
1165
- * The run will make a best effort to use only the number of prompt tokens
1166
- * specified, across multiple turns of the run. If the run exceeds the number of
1167
- * prompt tokens specified, the run will end with status `incomplete`. See
1168
- * `incomplete_details` for more info.
1169
- */
1170
- max_prompt_tokens?: number | null;
1171
-
1172
- /**
1173
- * Set of 16 key-value pairs that can be attached to an object. This can be useful
1174
- * for storing additional information about the object in a structured format. Keys
1175
- * can be a maximum of 64 characters long and values can be a maxium of 512
1176
- * characters long.
1177
- */
1178
- metadata?: unknown | null;
1179
-
1180
- /**
1181
- * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to
1182
- * be used to execute this run. If a value is provided here, it will override the
1183
- * model associated with the assistant. If not, the model associated with the
1184
- * assistant will be used.
1185
- */
1186
- model?:
1187
- | (string & {})
1188
- | 'gpt-4o'
1189
- | 'gpt-4o-2024-05-13'
1190
- | 'gpt-4-turbo'
1191
- | 'gpt-4-turbo-2024-04-09'
1192
- | 'gpt-4-0125-preview'
1193
- | 'gpt-4-turbo-preview'
1194
- | 'gpt-4-1106-preview'
1195
- | 'gpt-4-vision-preview'
1196
- | 'gpt-4'
1197
- | 'gpt-4-0314'
1198
- | 'gpt-4-0613'
1199
- | 'gpt-4-32k'
1200
- | 'gpt-4-32k-0314'
1201
- | 'gpt-4-32k-0613'
1202
- | 'gpt-3.5-turbo'
1203
- | 'gpt-3.5-turbo-16k'
1204
- | 'gpt-3.5-turbo-0613'
1205
- | 'gpt-3.5-turbo-1106'
1206
- | 'gpt-3.5-turbo-0125'
1207
- | 'gpt-3.5-turbo-16k-0613'
1208
- | null;
1209
-
1210
- /**
1211
- * Specifies the format that the model must output. Compatible with
1212
- * [GPT-4o](https://platform.openai.com/docs/models/gpt-4o),
1213
- * [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
1214
- * and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
1215
- *
1216
- * Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
1217
- * message the model generates is valid JSON.
1218
- *
1219
- * **Important:** when using JSON mode, you **must** also instruct the model to
1220
- * produce JSON yourself via a system or user message. Without this, the model may
1221
- * generate an unending stream of whitespace until the generation reaches the token
1222
- * limit, resulting in a long-running and seemingly "stuck" request. Also note that
1223
- * the message content may be partially cut off if `finish_reason="length"`, which
1224
- * indicates the generation exceeded `max_tokens` or the conversation exceeded the
1225
- * max context length.
1226
- */
1227
- response_format?: AssistantResponseFormatOption | null;
1228
-
1229
- /**
1230
- * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
1231
- * make the output more random, while lower values like 0.2 will make it more
1232
- * focused and deterministic.
1233
- */
1234
- temperature?: number | null;
1235
-
1236
- /**
1237
- * If no thread is provided, an empty thread will be created.
1238
- */
1239
- thread?: ThreadCreateAndRunStreamParams.Thread;
1240
-
1241
- /**
1242
- * Controls which (if any) tool is called by the model. `none` means the model will
1243
- * not call any tools and instead generates a message. `auto` is the default value
1244
- * and means the model can pick between generating a message or calling one or more
1245
- * tools. `required` means the model must call one or more tools before responding
1246
- * to the user. Specifying a particular tool like `{"type": "file_search"}` or
1247
- * `{"type": "function", "function": {"name": "my_function"}}` forces the model to
1248
- * call that tool.
1249
- */
1250
- tool_choice?: AssistantToolChoiceOption | null;
1251
-
1252
- /**
1253
- * A set of resources that are used by the assistant's tools. The resources are
1254
- * specific to the type of tool. For example, the `code_interpreter` tool requires
1255
- * a list of file IDs, while the `file_search` tool requires a list of vector store
1256
- * IDs.
1257
- */
1258
- tool_resources?: ThreadCreateAndRunStreamParams.ToolResources | null;
1259
-
1260
- /**
1261
- * Override the tools the assistant can use for this run. This is useful for
1262
- * modifying the behavior on a per-run basis.
1263
- */
1264
- tools?: Array<
1265
- AssistantsAPI.CodeInterpreterTool | AssistantsAPI.FileSearchTool | AssistantsAPI.FunctionTool
1266
- > | null;
1267
-
1268
- /**
1269
- * An alternative to sampling with temperature, called nucleus sampling, where the
1270
- * model considers the results of the tokens with top_p probability mass. So 0.1
1271
- * means only the tokens comprising the top 10% probability mass are considered.
1272
- *
1273
- * We generally recommend altering this or temperature but not both.
1274
- */
1275
- top_p?: number | null;
1276
-
1277
- /**
1278
- * Controls for how a thread will be truncated prior to the run. Use this to
1279
- * control the intial context window of the run.
1280
- */
1281
- truncation_strategy?: ThreadCreateAndRunStreamParams.TruncationStrategy | null;
1282
- }
1283
-
1284
- export namespace ThreadCreateAndRunStreamParams {
1285
- /**
1286
- * If no thread is provided, an empty thread will be created.
1287
- */
1288
- export interface Thread {
1289
- /**
1290
- * A list of [messages](https://platform.openai.com/docs/api-reference/messages) to
1291
- * start the thread with.
1292
- */
1293
- messages?: Array<Thread.Message>;
1294
-
1295
- /**
1296
- * Set of 16 key-value pairs that can be attached to an object. This can be useful
1297
- * for storing additional information about the object in a structured format. Keys
1298
- * can be a maximum of 64 characters long and values can be a maxium of 512
1299
- * characters long.
1300
- */
1301
- metadata?: unknown | null;
1302
-
1303
- /**
1304
- * A set of resources that are made available to the assistant's tools in this
1305
- * thread. The resources are specific to the type of tool. For example, the
1306
- * `code_interpreter` tool requires a list of file IDs, while the `file_search`
1307
- * tool requires a list of vector store IDs.
1308
- */
1309
- tool_resources?: Thread.ToolResources | null;
1310
- }
1311
-
1312
- export namespace Thread {
1313
- export interface Message {
1314
- /**
1315
- * The text contents of the message.
1316
- */
1317
- content: string | Array<MessagesAPI.MessageContentPartParam>;
1318
-
1319
- /**
1320
- * The role of the entity that is creating the message. Allowed values include:
1321
- *
1322
- * - `user`: Indicates the message is sent by an actual user and should be used in
1323
- * most cases to represent user-generated messages.
1324
- * - `assistant`: Indicates the message is generated by the assistant. Use this
1325
- * value to insert messages from the assistant into the conversation.
1326
- */
1327
- role: 'user' | 'assistant';
1328
-
1329
- /**
1330
- * A list of files attached to the message, and the tools they should be added to.
1331
- */
1332
- attachments?: Array<Message.Attachment> | null;
1333
-
1334
- /**
1335
- * Set of 16 key-value pairs that can be attached to an object. This can be useful
1336
- * for storing additional information about the object in a structured format. Keys
1337
- * can be a maximum of 64 characters long and values can be a maxium of 512
1338
- * characters long.
1339
- */
1340
- metadata?: unknown | null;
1341
- }
1342
-
1343
- export namespace Message {
1344
- export interface Attachment {
1345
- /**
1346
- * The ID of the file to attach to the message.
1347
- */
1348
- file_id?: string;
1349
-
1350
- /**
1351
- * The tools to add this file to.
1352
- */
1353
- tools?: Array<AssistantsAPI.CodeInterpreterTool | AssistantsAPI.FileSearchTool>;
1354
- }
1355
- }
1356
-
1357
- /**
1358
- * A set of resources that are made available to the assistant's tools in this
1359
- * thread. The resources are specific to the type of tool. For example, the
1360
- * `code_interpreter` tool requires a list of file IDs, while the `file_search`
1361
- * tool requires a list of vector store IDs.
1362
- */
1363
- export interface ToolResources {
1364
- code_interpreter?: ToolResources.CodeInterpreter;
1365
-
1366
- file_search?: ToolResources.FileSearch;
1367
- }
1368
-
1369
- export namespace ToolResources {
1370
- export interface CodeInterpreter {
1371
- /**
1372
- * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
1373
- * available to the `code_interpreter` tool. There can be a maximum of 20 files
1374
- * associated with the tool.
1375
- */
1376
- file_ids?: Array<string>;
1377
- }
1378
-
1379
- export interface FileSearch {
1380
- /**
1381
- * The
1382
- * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
1383
- * attached to this thread. There can be a maximum of 1 vector store attached to
1384
- * the thread.
1385
- */
1386
- vector_store_ids?: Array<string>;
1387
-
1388
- /**
1389
- * A helper to create a
1390
- * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
1391
- * with file_ids and attach it to this thread. There can be a maximum of 1 vector
1392
- * store attached to the thread.
1393
- */
1394
- vector_stores?: Array<FileSearch.VectorStore>;
1395
- }
1396
-
1397
- export namespace FileSearch {
1398
- export interface VectorStore {
1399
- /**
1400
- * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
1401
- * add to the vector store. There can be a maximum of 10000 files in a vector
1402
- * store.
1403
- */
1404
- file_ids?: Array<string>;
1405
-
1406
- /**
1407
- * Set of 16 key-value pairs that can be attached to a vector store. This can be
1408
- * useful for storing additional information about the vector store in a structured
1409
- * format. Keys can be a maximum of 64 characters long and values can be a maxium
1410
- * of 512 characters long.
1411
- */
1412
- metadata?: unknown;
1413
- }
1414
- }
1415
- }
1416
- }
1417
-
1418
- /**
1419
- * A set of resources that are used by the assistant's tools. The resources are
1420
- * specific to the type of tool. For example, the `code_interpreter` tool requires
1421
- * a list of file IDs, while the `file_search` tool requires a list of vector store
1422
- * IDs.
1423
- */
1424
- export interface ToolResources {
1425
- code_interpreter?: ToolResources.CodeInterpreter;
1426
-
1427
- file_search?: ToolResources.FileSearch;
1428
- }
1429
-
1430
- export namespace ToolResources {
1431
- export interface CodeInterpreter {
1432
- /**
1433
- * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
1434
- * available to the `code_interpreter` tool. There can be a maximum of 20 files
1435
- * associated with the tool.
1436
- */
1437
- file_ids?: Array<string>;
1438
- }
1439
-
1440
- export interface FileSearch {
1441
- /**
1442
- * The ID of the
1443
- * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
1444
- * attached to this assistant. There can be a maximum of 1 vector store attached to
1445
- * the assistant.
1446
- */
1447
- vector_store_ids?: Array<string>;
1448
- }
1449
- }
1450
-
1451
- /**
1452
- * Controls for how a thread will be truncated prior to the run. Use this to
1453
- * control the intial context window of the run.
1454
- */
1455
- export interface TruncationStrategy {
1456
- /**
1457
- * The truncation strategy to use for the thread. The default is `auto`. If set to
1458
- * `last_messages`, the thread will be truncated to the n most recent messages in
1459
- * the thread. When set to `auto`, messages in the middle of the thread will be
1460
- * dropped to fit the context length of the model, `max_prompt_tokens`.
1461
- */
1462
- type: 'auto' | 'last_messages';
1463
-
1464
- /**
1465
- * The number of most recent messages from the thread when constructing the context
1466
- * for the run.
1467
- */
1468
- last_messages?: number | null;
1469
- }
1470
- }
1471
-
1472
- export namespace Threads {
1473
- export import AssistantResponseFormat = ThreadsAPI.AssistantResponseFormat;
1474
- export import AssistantResponseFormatOption = ThreadsAPI.AssistantResponseFormatOption;
1475
- export import AssistantToolChoice = ThreadsAPI.AssistantToolChoice;
1476
- export import AssistantToolChoiceFunction = ThreadsAPI.AssistantToolChoiceFunction;
1477
- export import AssistantToolChoiceOption = ThreadsAPI.AssistantToolChoiceOption;
1478
- export import Thread = ThreadsAPI.Thread;
1479
- export import ThreadDeleted = ThreadsAPI.ThreadDeleted;
1480
- export import ThreadCreateParams = ThreadsAPI.ThreadCreateParams;
1481
- export import ThreadUpdateParams = ThreadsAPI.ThreadUpdateParams;
1482
- export import ThreadCreateAndRunParams = ThreadsAPI.ThreadCreateAndRunParams;
1483
- export import ThreadCreateAndRunParamsNonStreaming = ThreadsAPI.ThreadCreateAndRunParamsNonStreaming;
1484
- export import ThreadCreateAndRunParamsStreaming = ThreadsAPI.ThreadCreateAndRunParamsStreaming;
1485
- export import ThreadCreateAndRunPollParams = ThreadsAPI.ThreadCreateAndRunPollParams;
1486
- export import ThreadCreateAndRunStreamParams = ThreadsAPI.ThreadCreateAndRunStreamParams;
1487
- export import Runs = RunsAPI.Runs;
1488
- export import RequiredActionFunctionToolCall = RunsAPI.RequiredActionFunctionToolCall;
1489
- export import Run = RunsAPI.Run;
1490
- export import RunStatus = RunsAPI.RunStatus;
1491
- export import RunsPage = RunsAPI.RunsPage;
1492
- export import RunCreateParams = RunsAPI.RunCreateParams;
1493
- export import RunCreateParamsNonStreaming = RunsAPI.RunCreateParamsNonStreaming;
1494
- export import RunCreateParamsStreaming = RunsAPI.RunCreateParamsStreaming;
1495
- export import RunUpdateParams = RunsAPI.RunUpdateParams;
1496
- export import RunListParams = RunsAPI.RunListParams;
1497
- export import RunCreateAndPollParams = RunsAPI.RunCreateAndPollParams;
1498
- export import RunCreateAndStreamParams = RunsAPI.RunCreateAndStreamParams;
1499
- export import RunStreamParams = RunsAPI.RunStreamParams;
1500
- export import RunSubmitToolOutputsParams = RunsAPI.RunSubmitToolOutputsParams;
1501
- export import RunSubmitToolOutputsParamsNonStreaming = RunsAPI.RunSubmitToolOutputsParamsNonStreaming;
1502
- export import RunSubmitToolOutputsParamsStreaming = RunsAPI.RunSubmitToolOutputsParamsStreaming;
1503
- export import RunSubmitToolOutputsAndPollParams = RunsAPI.RunSubmitToolOutputsAndPollParams;
1504
- export import RunSubmitToolOutputsStreamParams = RunsAPI.RunSubmitToolOutputsStreamParams;
1505
- export import Messages = MessagesAPI.Messages;
1506
- export import Annotation = MessagesAPI.Annotation;
1507
- export import AnnotationDelta = MessagesAPI.AnnotationDelta;
1508
- export import FileCitationAnnotation = MessagesAPI.FileCitationAnnotation;
1509
- export import FileCitationDeltaAnnotation = MessagesAPI.FileCitationDeltaAnnotation;
1510
- export import FilePathAnnotation = MessagesAPI.FilePathAnnotation;
1511
- export import FilePathDeltaAnnotation = MessagesAPI.FilePathDeltaAnnotation;
1512
- export import ImageFile = MessagesAPI.ImageFile;
1513
- export import ImageFileContentBlock = MessagesAPI.ImageFileContentBlock;
1514
- export import ImageFileDelta = MessagesAPI.ImageFileDelta;
1515
- export import ImageFileDeltaBlock = MessagesAPI.ImageFileDeltaBlock;
1516
- export import ImageURL = MessagesAPI.ImageURL;
1517
- export import ImageURLContentBlock = MessagesAPI.ImageURLContentBlock;
1518
- export import ImageURLDelta = MessagesAPI.ImageURLDelta;
1519
- export import ImageURLDeltaBlock = MessagesAPI.ImageURLDeltaBlock;
1520
- export import Message = MessagesAPI.Message;
1521
- export import MessageContent = MessagesAPI.MessageContent;
1522
- export import MessageContentDelta = MessagesAPI.MessageContentDelta;
1523
- export import MessageContentPartParam = MessagesAPI.MessageContentPartParam;
1524
- export import MessageDeleted = MessagesAPI.MessageDeleted;
1525
- export import MessageDelta = MessagesAPI.MessageDelta;
1526
- export import MessageDeltaEvent = MessagesAPI.MessageDeltaEvent;
1527
- export import Text = MessagesAPI.Text;
1528
- export import TextContentBlock = MessagesAPI.TextContentBlock;
1529
- export import TextContentBlockParam = MessagesAPI.TextContentBlockParam;
1530
- export import TextDelta = MessagesAPI.TextDelta;
1531
- export import TextDeltaBlock = MessagesAPI.TextDeltaBlock;
1532
- export import MessagesPage = MessagesAPI.MessagesPage;
1533
- export import MessageCreateParams = MessagesAPI.MessageCreateParams;
1534
- export import MessageUpdateParams = MessagesAPI.MessageUpdateParams;
1535
- export import MessageListParams = MessagesAPI.MessageListParams;
1536
- }