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,996 +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 * as ChatCompletionsAPI from './completions';
7
- import * as CompletionsAPI from '../completions';
8
- import * as Shared from '../shared';
9
- import * as ChatAPI from './chat';
10
- import { Stream } from '../../streaming';
11
-
12
- export class Completions extends APIResource {
13
- /**
14
- * Creates a model response for the given chat conversation.
15
- */
16
- create(
17
- body: ChatCompletionCreateParamsNonStreaming,
18
- options?: Core.RequestOptions,
19
- ): APIPromise<ChatCompletion>;
20
- create(
21
- body: ChatCompletionCreateParamsStreaming,
22
- options?: Core.RequestOptions,
23
- ): APIPromise<Stream<ChatCompletionChunk>>;
24
- create(
25
- body: ChatCompletionCreateParamsBase,
26
- options?: Core.RequestOptions,
27
- ): APIPromise<Stream<ChatCompletionChunk> | ChatCompletion>;
28
- create(
29
- body: ChatCompletionCreateParams,
30
- options?: Core.RequestOptions,
31
- ): APIPromise<ChatCompletion> | APIPromise<Stream<ChatCompletionChunk>> {
32
- return this._client.post('/chat/completions', { body, ...options, stream: body.stream ?? false }) as
33
- | APIPromise<ChatCompletion>
34
- | APIPromise<Stream<ChatCompletionChunk>>;
35
- }
36
- }
37
-
38
- /**
39
- * Represents a chat completion response returned by model, based on the provided
40
- * input.
41
- */
42
- export interface ChatCompletion {
43
- /**
44
- * A unique identifier for the chat completion.
45
- */
46
- id: string;
47
-
48
- /**
49
- * A list of chat completion choices. Can be more than one if `n` is greater
50
- * than 1.
51
- */
52
- choices: Array<ChatCompletion.Choice>;
53
-
54
- /**
55
- * The Unix timestamp (in seconds) of when the chat completion was created.
56
- */
57
- created: number;
58
-
59
- /**
60
- * The model used for the chat completion.
61
- */
62
- model: string;
63
-
64
- /**
65
- * The object type, which is always `chat.completion`.
66
- */
67
- object: 'chat.completion';
68
-
69
- /**
70
- * This fingerprint represents the backend configuration that the model runs with.
71
- *
72
- * Can be used in conjunction with the `seed` request parameter to understand when
73
- * backend changes have been made that might impact determinism.
74
- */
75
- system_fingerprint?: string;
76
-
77
- /**
78
- * Usage statistics for the completion request.
79
- */
80
- usage?: CompletionsAPI.CompletionUsage;
81
- }
82
-
83
- export namespace ChatCompletion {
84
- export interface Choice {
85
- /**
86
- * The reason the model stopped generating tokens. This will be `stop` if the model
87
- * hit a natural stop point or a provided stop sequence, `length` if the maximum
88
- * number of tokens specified in the request was reached, `content_filter` if
89
- * content was omitted due to a flag from our content filters, `tool_calls` if the
90
- * model called a tool, or `function_call` (deprecated) if the model called a
91
- * function.
92
- */
93
- finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call';
94
-
95
- /**
96
- * The index of the choice in the list of choices.
97
- */
98
- index: number;
99
-
100
- /**
101
- * Log probability information for the choice.
102
- */
103
- logprobs: Choice.Logprobs | null;
104
-
105
- /**
106
- * A chat completion message generated by the model.
107
- */
108
- message: ChatCompletionsAPI.ChatCompletionMessage;
109
- }
110
-
111
- export namespace Choice {
112
- /**
113
- * Log probability information for the choice.
114
- */
115
- export interface Logprobs {
116
- /**
117
- * A list of message content tokens with log probability information.
118
- */
119
- content: Array<ChatCompletionsAPI.ChatCompletionTokenLogprob> | null;
120
- }
121
- }
122
- }
123
-
124
- export interface ChatCompletionAssistantMessageParam {
125
- /**
126
- * The role of the messages author, in this case `assistant`.
127
- */
128
- role: 'assistant';
129
-
130
- /**
131
- * The contents of the assistant message. Required unless `tool_calls` or
132
- * `function_call` is specified.
133
- */
134
- content?: string | null;
135
-
136
- /**
137
- * @deprecated: Deprecated and replaced by `tool_calls`. The name and arguments of
138
- * a function that should be called, as generated by the model.
139
- */
140
- function_call?: ChatCompletionAssistantMessageParam.FunctionCall;
141
-
142
- /**
143
- * An optional name for the participant. Provides the model information to
144
- * differentiate between participants of the same role.
145
- */
146
- name?: string;
147
-
148
- /**
149
- * The tool calls generated by the model, such as function calls.
150
- */
151
- tool_calls?: Array<ChatCompletionMessageToolCall>;
152
- }
153
-
154
- export namespace ChatCompletionAssistantMessageParam {
155
- /**
156
- * @deprecated: Deprecated and replaced by `tool_calls`. The name and arguments of
157
- * a function that should be called, as generated by the model.
158
- */
159
- export interface FunctionCall {
160
- /**
161
- * The arguments to call the function with, as generated by the model in JSON
162
- * format. Note that the model does not always generate valid JSON, and may
163
- * hallucinate parameters not defined by your function schema. Validate the
164
- * arguments in your code before calling your function.
165
- */
166
- arguments: string;
167
-
168
- /**
169
- * The name of the function to call.
170
- */
171
- name: string;
172
- }
173
- }
174
-
175
- /**
176
- * Represents a streamed chunk of a chat completion response returned by model,
177
- * based on the provided input.
178
- */
179
- export interface ChatCompletionChunk {
180
- /**
181
- * A unique identifier for the chat completion. Each chunk has the same ID.
182
- */
183
- id: string;
184
-
185
- /**
186
- * A list of chat completion choices. Can contain more than one elements if `n` is
187
- * greater than 1. Can also be empty for the last chunk if you set
188
- * `stream_options: {"include_usage": true}`.
189
- */
190
- choices: Array<ChatCompletionChunk.Choice>;
191
-
192
- /**
193
- * The Unix timestamp (in seconds) of when the chat completion was created. Each
194
- * chunk has the same timestamp.
195
- */
196
- created: number;
197
-
198
- /**
199
- * The model to generate the completion.
200
- */
201
- model: string;
202
-
203
- /**
204
- * The object type, which is always `chat.completion.chunk`.
205
- */
206
- object: 'chat.completion.chunk';
207
-
208
- /**
209
- * This fingerprint represents the backend configuration that the model runs with.
210
- * Can be used in conjunction with the `seed` request parameter to understand when
211
- * backend changes have been made that might impact determinism.
212
- */
213
- system_fingerprint?: string;
214
-
215
- /**
216
- * An optional field that will only be present when you set
217
- * `stream_options: {"include_usage": true}` in your request. When present, it
218
- * contains a null value except for the last chunk which contains the token usage
219
- * statistics for the entire request.
220
- */
221
- usage?: CompletionsAPI.CompletionUsage;
222
- }
223
-
224
- export namespace ChatCompletionChunk {
225
- export interface Choice {
226
- /**
227
- * A chat completion delta generated by streamed model responses.
228
- */
229
- delta: Choice.Delta;
230
-
231
- /**
232
- * The reason the model stopped generating tokens. This will be `stop` if the model
233
- * hit a natural stop point or a provided stop sequence, `length` if the maximum
234
- * number of tokens specified in the request was reached, `content_filter` if
235
- * content was omitted due to a flag from our content filters, `tool_calls` if the
236
- * model called a tool, or `function_call` (deprecated) if the model called a
237
- * function.
238
- */
239
- finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call' | null;
240
-
241
- /**
242
- * The index of the choice in the list of choices.
243
- */
244
- index: number;
245
-
246
- /**
247
- * Log probability information for the choice.
248
- */
249
- logprobs?: Choice.Logprobs | null;
250
- }
251
-
252
- export namespace Choice {
253
- /**
254
- * A chat completion delta generated by streamed model responses.
255
- */
256
- export interface Delta {
257
- /**
258
- * The contents of the chunk message.
259
- */
260
- content?: string | null;
261
-
262
- /**
263
- * @deprecated: Deprecated and replaced by `tool_calls`. The name and arguments of
264
- * a function that should be called, as generated by the model.
265
- */
266
- function_call?: Delta.FunctionCall;
267
-
268
- /**
269
- * The role of the author of this message.
270
- */
271
- role?: 'system' | 'user' | 'assistant' | 'tool';
272
-
273
- tool_calls?: Array<Delta.ToolCall>;
274
- }
275
-
276
- export namespace Delta {
277
- /**
278
- * @deprecated: Deprecated and replaced by `tool_calls`. The name and arguments of
279
- * a function that should be called, as generated by the model.
280
- */
281
- export interface FunctionCall {
282
- /**
283
- * The arguments to call the function with, as generated by the model in JSON
284
- * format. Note that the model does not always generate valid JSON, and may
285
- * hallucinate parameters not defined by your function schema. Validate the
286
- * arguments in your code before calling your function.
287
- */
288
- arguments?: string;
289
-
290
- /**
291
- * The name of the function to call.
292
- */
293
- name?: string;
294
- }
295
-
296
- export interface ToolCall {
297
- index: number;
298
-
299
- /**
300
- * The ID of the tool call.
301
- */
302
- id?: string;
303
-
304
- function?: ToolCall.Function;
305
-
306
- /**
307
- * The type of the tool. Currently, only `function` is supported.
308
- */
309
- type?: 'function';
310
- }
311
-
312
- export namespace ToolCall {
313
- export interface Function {
314
- /**
315
- * The arguments to call the function with, as generated by the model in JSON
316
- * format. Note that the model does not always generate valid JSON, and may
317
- * hallucinate parameters not defined by your function schema. Validate the
318
- * arguments in your code before calling your function.
319
- */
320
- arguments?: string;
321
-
322
- /**
323
- * The name of the function to call.
324
- */
325
- name?: string;
326
- }
327
- }
328
- }
329
-
330
- /**
331
- * Log probability information for the choice.
332
- */
333
- export interface Logprobs {
334
- /**
335
- * A list of message content tokens with log probability information.
336
- */
337
- content: Array<ChatCompletionsAPI.ChatCompletionTokenLogprob> | null;
338
- }
339
- }
340
- }
341
-
342
- export type ChatCompletionContentPart = ChatCompletionContentPartText | ChatCompletionContentPartImage;
343
-
344
- export interface ChatCompletionContentPartImage {
345
- image_url: ChatCompletionContentPartImage.ImageURL;
346
-
347
- /**
348
- * The type of the content part.
349
- */
350
- type: 'image_url';
351
- }
352
-
353
- export namespace ChatCompletionContentPartImage {
354
- export interface ImageURL {
355
- /**
356
- * Either a URL of the image or the base64 encoded image data.
357
- */
358
- url: string;
359
-
360
- /**
361
- * Specifies the detail level of the image. Learn more in the
362
- * [Vision guide](https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding).
363
- */
364
- detail?: 'auto' | 'low' | 'high';
365
- }
366
- }
367
-
368
- export interface ChatCompletionContentPartText {
369
- /**
370
- * The text content.
371
- */
372
- text: string;
373
-
374
- /**
375
- * The type of the content part.
376
- */
377
- type: 'text';
378
- }
379
-
380
- /**
381
- * Specifying a particular function via `{"name": "my_function"}` forces the model
382
- * to call that function.
383
- */
384
- export interface ChatCompletionFunctionCallOption {
385
- /**
386
- * The name of the function to call.
387
- */
388
- name: string;
389
- }
390
-
391
- /**
392
- * @deprecated
393
- */
394
- export interface ChatCompletionFunctionMessageParam {
395
- /**
396
- * The contents of the function message.
397
- */
398
- content: string | null;
399
-
400
- /**
401
- * The name of the function to call.
402
- */
403
- name: string;
404
-
405
- /**
406
- * The role of the messages author, in this case `function`.
407
- */
408
- role: 'function';
409
- }
410
-
411
- /**
412
- * A chat completion message generated by the model.
413
- */
414
- export interface ChatCompletionMessage {
415
- /**
416
- * The contents of the message.
417
- */
418
- content: string | null;
419
-
420
- /**
421
- * The role of the author of this message.
422
- */
423
- role: 'assistant';
424
-
425
- /**
426
- * @deprecated: Deprecated and replaced by `tool_calls`. The name and arguments of
427
- * a function that should be called, as generated by the model.
428
- */
429
- function_call?: ChatCompletionMessage.FunctionCall;
430
-
431
- /**
432
- * The tool calls generated by the model, such as function calls.
433
- */
434
- tool_calls?: Array<ChatCompletionMessageToolCall>;
435
- }
436
-
437
- export namespace ChatCompletionMessage {
438
- /**
439
- * @deprecated: Deprecated and replaced by `tool_calls`. The name and arguments of
440
- * a function that should be called, as generated by the model.
441
- */
442
- export interface FunctionCall {
443
- /**
444
- * The arguments to call the function with, as generated by the model in JSON
445
- * format. Note that the model does not always generate valid JSON, and may
446
- * hallucinate parameters not defined by your function schema. Validate the
447
- * arguments in your code before calling your function.
448
- */
449
- arguments: string;
450
-
451
- /**
452
- * The name of the function to call.
453
- */
454
- name: string;
455
- }
456
- }
457
-
458
- export type ChatCompletionMessageParam =
459
- | ChatCompletionSystemMessageParam
460
- | ChatCompletionUserMessageParam
461
- | ChatCompletionAssistantMessageParam
462
- | ChatCompletionToolMessageParam
463
- | ChatCompletionFunctionMessageParam;
464
-
465
- export interface ChatCompletionMessageToolCall {
466
- /**
467
- * The ID of the tool call.
468
- */
469
- id: string;
470
-
471
- /**
472
- * The function that the model called.
473
- */
474
- function: ChatCompletionMessageToolCall.Function;
475
-
476
- /**
477
- * The type of the tool. Currently, only `function` is supported.
478
- */
479
- type: 'function';
480
- }
481
-
482
- export namespace ChatCompletionMessageToolCall {
483
- /**
484
- * The function that the model called.
485
- */
486
- export interface Function {
487
- /**
488
- * The arguments to call the function with, as generated by the model in JSON
489
- * format. Note that the model does not always generate valid JSON, and may
490
- * hallucinate parameters not defined by your function schema. Validate the
491
- * arguments in your code before calling your function.
492
- */
493
- arguments: string;
494
-
495
- /**
496
- * The name of the function to call.
497
- */
498
- name: string;
499
- }
500
- }
501
-
502
- /**
503
- * Specifies a tool the model should use. Use to force the model to call a specific
504
- * function.
505
- */
506
- export interface ChatCompletionNamedToolChoice {
507
- function: ChatCompletionNamedToolChoice.Function;
508
-
509
- /**
510
- * The type of the tool. Currently, only `function` is supported.
511
- */
512
- type: 'function';
513
- }
514
-
515
- export namespace ChatCompletionNamedToolChoice {
516
- export interface Function {
517
- /**
518
- * The name of the function to call.
519
- */
520
- name: string;
521
- }
522
- }
523
-
524
- /**
525
- * The role of the author of a message
526
- */
527
- export type ChatCompletionRole = 'system' | 'user' | 'assistant' | 'tool' | 'function';
528
-
529
- /**
530
- * Options for streaming response. Only set this when you set `stream: true`.
531
- */
532
- export interface ChatCompletionStreamOptions {
533
- /**
534
- * If set, an additional chunk will be streamed before the `data: [DONE]` message.
535
- * The `usage` field on this chunk shows the token usage statistics for the entire
536
- * request, and the `choices` field will always be an empty array. All other chunks
537
- * will also include a `usage` field, but with a null value.
538
- */
539
- include_usage?: boolean;
540
- }
541
-
542
- export interface ChatCompletionSystemMessageParam {
543
- /**
544
- * The contents of the system message.
545
- */
546
- content: string;
547
-
548
- /**
549
- * The role of the messages author, in this case `system`.
550
- */
551
- role: 'system';
552
-
553
- /**
554
- * An optional name for the participant. Provides the model information to
555
- * differentiate between participants of the same role.
556
- */
557
- name?: string;
558
- }
559
-
560
- export interface ChatCompletionTokenLogprob {
561
- /**
562
- * The token.
563
- */
564
- token: string;
565
-
566
- /**
567
- * A list of integers representing the UTF-8 bytes representation of the token.
568
- * Useful in instances where characters are represented by multiple tokens and
569
- * their byte representations must be combined to generate the correct text
570
- * representation. Can be `null` if there is no bytes representation for the token.
571
- */
572
- bytes: Array<number> | null;
573
-
574
- /**
575
- * The log probability of this token, if it is within the top 20 most likely
576
- * tokens. Otherwise, the value `-9999.0` is used to signify that the token is very
577
- * unlikely.
578
- */
579
- logprob: number;
580
-
581
- /**
582
- * List of the most likely tokens and their log probability, at this token
583
- * position. In rare cases, there may be fewer than the number of requested
584
- * `top_logprobs` returned.
585
- */
586
- top_logprobs: Array<ChatCompletionTokenLogprob.TopLogprob>;
587
- }
588
-
589
- export namespace ChatCompletionTokenLogprob {
590
- export interface TopLogprob {
591
- /**
592
- * The token.
593
- */
594
- token: string;
595
-
596
- /**
597
- * A list of integers representing the UTF-8 bytes representation of the token.
598
- * Useful in instances where characters are represented by multiple tokens and
599
- * their byte representations must be combined to generate the correct text
600
- * representation. Can be `null` if there is no bytes representation for the token.
601
- */
602
- bytes: Array<number> | null;
603
-
604
- /**
605
- * The log probability of this token, if it is within the top 20 most likely
606
- * tokens. Otherwise, the value `-9999.0` is used to signify that the token is very
607
- * unlikely.
608
- */
609
- logprob: number;
610
- }
611
- }
612
-
613
- export interface ChatCompletionTool {
614
- function: Shared.FunctionDefinition;
615
-
616
- /**
617
- * The type of the tool. Currently, only `function` is supported.
618
- */
619
- type: 'function';
620
- }
621
-
622
- /**
623
- * Controls which (if any) tool is called by the model. `none` means the model will
624
- * not call any tool and instead generates a message. `auto` means the model can
625
- * pick between generating a message or calling one or more tools. `required` means
626
- * the model must call one or more tools. Specifying a particular tool via
627
- * `{"type": "function", "function": {"name": "my_function"}}` forces the model to
628
- * call that tool.
629
- *
630
- * `none` is the default when no tools are present. `auto` is the default if tools
631
- * are present.
632
- */
633
- export type ChatCompletionToolChoiceOption = 'none' | 'auto' | 'required' | ChatCompletionNamedToolChoice;
634
-
635
- export interface ChatCompletionToolMessageParam {
636
- /**
637
- * The contents of the tool message.
638
- */
639
- content: string;
640
-
641
- /**
642
- * The role of the messages author, in this case `tool`.
643
- */
644
- role: 'tool';
645
-
646
- /**
647
- * Tool call that this message is responding to.
648
- */
649
- tool_call_id: string;
650
- }
651
-
652
- export interface ChatCompletionUserMessageParam {
653
- /**
654
- * The contents of the user message.
655
- */
656
- content: string | Array<ChatCompletionContentPart>;
657
-
658
- /**
659
- * The role of the messages author, in this case `user`.
660
- */
661
- role: 'user';
662
-
663
- /**
664
- * An optional name for the participant. Provides the model information to
665
- * differentiate between participants of the same role.
666
- */
667
- name?: string;
668
- }
669
-
670
- /**
671
- * @deprecated ChatCompletionMessageParam should be used instead
672
- */
673
- export type CreateChatCompletionRequestMessage = ChatCompletionMessageParam;
674
-
675
- export type ChatCompletionCreateParams =
676
- | ChatCompletionCreateParamsNonStreaming
677
- | ChatCompletionCreateParamsStreaming;
678
-
679
- export interface ChatCompletionCreateParamsBase {
680
- /**
681
- * A list of messages comprising the conversation so far.
682
- * [Example Python code](https://cookbook.openai.com/examples/how_to_format_inputs_to_chatgpt_models).
683
- */
684
- messages: Array<ChatCompletionMessageParam>;
685
-
686
- /**
687
- * ID of the model to use. See the
688
- * [model endpoint compatibility](https://platform.openai.com/docs/models/model-endpoint-compatibility)
689
- * table for details on which models work with the Chat API.
690
- */
691
- model: (string & {}) | ChatAPI.ChatModel;
692
-
693
- /**
694
- * Number between -2.0 and 2.0. Positive values penalize new tokens based on their
695
- * existing frequency in the text so far, decreasing the model's likelihood to
696
- * repeat the same line verbatim.
697
- *
698
- * [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)
699
- */
700
- frequency_penalty?: number | null;
701
-
702
- /**
703
- * Deprecated in favor of `tool_choice`.
704
- *
705
- * Controls which (if any) function is called by the model. `none` means the model
706
- * will not call a function and instead generates a message. `auto` means the model
707
- * can pick between generating a message or calling a function. Specifying a
708
- * particular function via `{"name": "my_function"}` forces the model to call that
709
- * function.
710
- *
711
- * `none` is the default when no functions are present. `auto` is the default if
712
- * functions are present.
713
- */
714
- function_call?: 'none' | 'auto' | ChatCompletionFunctionCallOption;
715
-
716
- /**
717
- * Deprecated in favor of `tools`.
718
- *
719
- * A list of functions the model may generate JSON inputs for.
720
- */
721
- functions?: Array<ChatCompletionCreateParams.Function>;
722
-
723
- /**
724
- * Modify the likelihood of specified tokens appearing in the completion.
725
- *
726
- * Accepts a JSON object that maps tokens (specified by their token ID in the
727
- * tokenizer) to an associated bias value from -100 to 100. Mathematically, the
728
- * bias is added to the logits generated by the model prior to sampling. The exact
729
- * effect will vary per model, but values between -1 and 1 should decrease or
730
- * increase likelihood of selection; values like -100 or 100 should result in a ban
731
- * or exclusive selection of the relevant token.
732
- */
733
- logit_bias?: Record<string, number> | null;
734
-
735
- /**
736
- * Whether to return log probabilities of the output tokens or not. If true,
737
- * returns the log probabilities of each output token returned in the `content` of
738
- * `message`.
739
- */
740
- logprobs?: boolean | null;
741
-
742
- /**
743
- * The maximum number of [tokens](/tokenizer) that can be generated in the chat
744
- * completion.
745
- *
746
- * The total length of input tokens and generated tokens is limited by the model's
747
- * context length.
748
- * [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken)
749
- * for counting tokens.
750
- */
751
- max_tokens?: number | null;
752
-
753
- /**
754
- * How many chat completion choices to generate for each input message. Note that
755
- * you will be charged based on the number of generated tokens across all of the
756
- * choices. Keep `n` as `1` to minimize costs.
757
- */
758
- n?: number | null;
759
-
760
- /**
761
- * Number between -2.0 and 2.0. Positive values penalize new tokens based on
762
- * whether they appear in the text so far, increasing the model's likelihood to
763
- * talk about new topics.
764
- *
765
- * [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation/parameter-details)
766
- */
767
- presence_penalty?: number | null;
768
-
769
- /**
770
- * An object specifying the format that the model must output. Compatible with
771
- * [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo) and
772
- * all GPT-3.5 Turbo models newer than `gpt-3.5-turbo-1106`.
773
- *
774
- * Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
775
- * message the model generates is valid JSON.
776
- *
777
- * **Important:** when using JSON mode, you **must** also instruct the model to
778
- * produce JSON yourself via a system or user message. Without this, the model may
779
- * generate an unending stream of whitespace until the generation reaches the token
780
- * limit, resulting in a long-running and seemingly "stuck" request. Also note that
781
- * the message content may be partially cut off if `finish_reason="length"`, which
782
- * indicates the generation exceeded `max_tokens` or the conversation exceeded the
783
- * max context length.
784
- */
785
- response_format?: ChatCompletionCreateParams.ResponseFormat;
786
-
787
- /**
788
- * This feature is in Beta. If specified, our system will make a best effort to
789
- * sample deterministically, such that repeated requests with the same `seed` and
790
- * parameters should return the same result. Determinism is not guaranteed, and you
791
- * should refer to the `system_fingerprint` response parameter to monitor changes
792
- * in the backend.
793
- */
794
- seed?: number | null;
795
-
796
- /**
797
- * Up to 4 sequences where the API will stop generating further tokens.
798
- */
799
- stop?: string | null | Array<string>;
800
-
801
- /**
802
- * If set, partial message deltas will be sent, like in ChatGPT. Tokens will be
803
- * sent as data-only
804
- * [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
805
- * as they become available, with the stream terminated by a `data: [DONE]`
806
- * message.
807
- * [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).
808
- */
809
- stream?: boolean | null;
810
-
811
- /**
812
- * Options for streaming response. Only set this when you set `stream: true`.
813
- */
814
- stream_options?: ChatCompletionStreamOptions | null;
815
-
816
- /**
817
- * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
818
- * make the output more random, while lower values like 0.2 will make it more
819
- * focused and deterministic.
820
- *
821
- * We generally recommend altering this or `top_p` but not both.
822
- */
823
- temperature?: number | null;
824
-
825
- /**
826
- * Controls which (if any) tool is called by the model. `none` means the model will
827
- * not call any tool and instead generates a message. `auto` means the model can
828
- * pick between generating a message or calling one or more tools. `required` means
829
- * the model must call one or more tools. Specifying a particular tool via
830
- * `{"type": "function", "function": {"name": "my_function"}}` forces the model to
831
- * call that tool.
832
- *
833
- * `none` is the default when no tools are present. `auto` is the default if tools
834
- * are present.
835
- */
836
- tool_choice?: ChatCompletionToolChoiceOption;
837
-
838
- /**
839
- * A list of tools the model may call. Currently, only functions are supported as a
840
- * tool. Use this to provide a list of functions the model may generate JSON inputs
841
- * for. A max of 128 functions are supported.
842
- */
843
- tools?: Array<ChatCompletionTool>;
844
-
845
- /**
846
- * An integer between 0 and 20 specifying the number of most likely tokens to
847
- * return at each token position, each with an associated log probability.
848
- * `logprobs` must be set to `true` if this parameter is used.
849
- */
850
- top_logprobs?: number | null;
851
-
852
- /**
853
- * An alternative to sampling with temperature, called nucleus sampling, where the
854
- * model considers the results of the tokens with top_p probability mass. So 0.1
855
- * means only the tokens comprising the top 10% probability mass are considered.
856
- *
857
- * We generally recommend altering this or `temperature` but not both.
858
- */
859
- top_p?: number | null;
860
-
861
- /**
862
- * A unique identifier representing your end-user, which can help OpenAI to monitor
863
- * and detect abuse.
864
- * [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).
865
- */
866
- user?: string;
867
- }
868
-
869
- export namespace ChatCompletionCreateParams {
870
- /**
871
- * @deprecated
872
- */
873
- export interface Function {
874
- /**
875
- * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain
876
- * underscores and dashes, with a maximum length of 64.
877
- */
878
- name: string;
879
-
880
- /**
881
- * A description of what the function does, used by the model to choose when and
882
- * how to call the function.
883
- */
884
- description?: string;
885
-
886
- /**
887
- * The parameters the functions accepts, described as a JSON Schema object. See the
888
- * [guide](https://platform.openai.com/docs/guides/text-generation/function-calling)
889
- * for examples, and the
890
- * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
891
- * documentation about the format.
892
- *
893
- * Omitting `parameters` defines a function with an empty parameter list.
894
- */
895
- parameters?: Shared.FunctionParameters;
896
- }
897
-
898
- /**
899
- * An object specifying the format that the model must output. Compatible with
900
- * [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo) and
901
- * all GPT-3.5 Turbo models newer than `gpt-3.5-turbo-1106`.
902
- *
903
- * Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
904
- * message the model generates is valid JSON.
905
- *
906
- * **Important:** when using JSON mode, you **must** also instruct the model to
907
- * produce JSON yourself via a system or user message. Without this, the model may
908
- * generate an unending stream of whitespace until the generation reaches the token
909
- * limit, resulting in a long-running and seemingly "stuck" request. Also note that
910
- * the message content may be partially cut off if `finish_reason="length"`, which
911
- * indicates the generation exceeded `max_tokens` or the conversation exceeded the
912
- * max context length.
913
- */
914
- export interface ResponseFormat {
915
- /**
916
- * Must be one of `text` or `json_object`.
917
- */
918
- type?: 'text' | 'json_object';
919
- }
920
-
921
- export type ChatCompletionCreateParamsNonStreaming =
922
- ChatCompletionsAPI.ChatCompletionCreateParamsNonStreaming;
923
- export type ChatCompletionCreateParamsStreaming = ChatCompletionsAPI.ChatCompletionCreateParamsStreaming;
924
- }
925
-
926
- /**
927
- * @deprecated Use ChatCompletionCreateParams instead
928
- */
929
- export type CompletionCreateParams = ChatCompletionCreateParams;
930
-
931
- export interface ChatCompletionCreateParamsNonStreaming extends ChatCompletionCreateParamsBase {
932
- /**
933
- * If set, partial message deltas will be sent, like in ChatGPT. Tokens will be
934
- * sent as data-only
935
- * [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
936
- * as they become available, with the stream terminated by a `data: [DONE]`
937
- * message.
938
- * [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).
939
- */
940
- stream?: false | null;
941
- }
942
-
943
- /**
944
- * @deprecated Use ChatCompletionCreateParamsNonStreaming instead
945
- */
946
- export type CompletionCreateParamsNonStreaming = ChatCompletionCreateParamsNonStreaming;
947
-
948
- export interface ChatCompletionCreateParamsStreaming extends ChatCompletionCreateParamsBase {
949
- /**
950
- * If set, partial message deltas will be sent, like in ChatGPT. Tokens will be
951
- * sent as data-only
952
- * [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
953
- * as they become available, with the stream terminated by a `data: [DONE]`
954
- * message.
955
- * [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).
956
- */
957
- stream: true;
958
- }
959
-
960
- /**
961
- * @deprecated Use ChatCompletionCreateParamsStreaming instead
962
- */
963
- export type CompletionCreateParamsStreaming = ChatCompletionCreateParamsStreaming;
964
-
965
- export namespace Completions {
966
- export import ChatCompletion = ChatCompletionsAPI.ChatCompletion;
967
- export import ChatCompletionAssistantMessageParam = ChatCompletionsAPI.ChatCompletionAssistantMessageParam;
968
- export import ChatCompletionChunk = ChatCompletionsAPI.ChatCompletionChunk;
969
- export import ChatCompletionContentPart = ChatCompletionsAPI.ChatCompletionContentPart;
970
- export import ChatCompletionContentPartImage = ChatCompletionsAPI.ChatCompletionContentPartImage;
971
- export import ChatCompletionContentPartText = ChatCompletionsAPI.ChatCompletionContentPartText;
972
- export import ChatCompletionFunctionCallOption = ChatCompletionsAPI.ChatCompletionFunctionCallOption;
973
- export import ChatCompletionFunctionMessageParam = ChatCompletionsAPI.ChatCompletionFunctionMessageParam;
974
- export import ChatCompletionMessage = ChatCompletionsAPI.ChatCompletionMessage;
975
- export import ChatCompletionMessageParam = ChatCompletionsAPI.ChatCompletionMessageParam;
976
- export import ChatCompletionMessageToolCall = ChatCompletionsAPI.ChatCompletionMessageToolCall;
977
- export import ChatCompletionNamedToolChoice = ChatCompletionsAPI.ChatCompletionNamedToolChoice;
978
- export import ChatCompletionRole = ChatCompletionsAPI.ChatCompletionRole;
979
- export import ChatCompletionStreamOptions = ChatCompletionsAPI.ChatCompletionStreamOptions;
980
- export import ChatCompletionSystemMessageParam = ChatCompletionsAPI.ChatCompletionSystemMessageParam;
981
- export import ChatCompletionTokenLogprob = ChatCompletionsAPI.ChatCompletionTokenLogprob;
982
- export import ChatCompletionTool = ChatCompletionsAPI.ChatCompletionTool;
983
- export import ChatCompletionToolChoiceOption = ChatCompletionsAPI.ChatCompletionToolChoiceOption;
984
- export import ChatCompletionToolMessageParam = ChatCompletionsAPI.ChatCompletionToolMessageParam;
985
- export import ChatCompletionUserMessageParam = ChatCompletionsAPI.ChatCompletionUserMessageParam;
986
- /**
987
- * @deprecated ChatCompletionMessageParam should be used instead
988
- */
989
- export import CreateChatCompletionRequestMessage = ChatCompletionsAPI.CreateChatCompletionRequestMessage;
990
- export import ChatCompletionCreateParams = ChatCompletionsAPI.ChatCompletionCreateParams;
991
- export import CompletionCreateParams = ChatCompletionsAPI.CompletionCreateParams;
992
- export import ChatCompletionCreateParamsNonStreaming = ChatCompletionsAPI.ChatCompletionCreateParamsNonStreaming;
993
- export import CompletionCreateParamsNonStreaming = ChatCompletionsAPI.CompletionCreateParamsNonStreaming;
994
- export import ChatCompletionCreateParamsStreaming = ChatCompletionsAPI.ChatCompletionCreateParamsStreaming;
995
- export import CompletionCreateParamsStreaming = ChatCompletionsAPI.CompletionCreateParamsStreaming;
996
- }