@gleanwork/api-client 0.19.2 → 0.20.1

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 (267) hide show
  1. package/README.md +38 -0
  2. package/dist/commonjs/__tests__/summarize.test.js +2 -4
  3. package/dist/commonjs/__tests__/summarize.test.js.map +1 -1
  4. package/dist/commonjs/funcs/chatCreate.d.ts +2 -8
  5. package/dist/commonjs/funcs/chatCreate.d.ts.map +1 -1
  6. package/dist/commonjs/funcs/chatCreate.js +4 -13
  7. package/dist/commonjs/funcs/chatCreate.js.map +1 -1
  8. package/dist/commonjs/funcs/chatCreateStream.d.ts +20 -0
  9. package/dist/commonjs/funcs/chatCreateStream.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/chatCreateStream.js +134 -0
  11. package/dist/commonjs/funcs/chatCreateStream.js.map +1 -0
  12. package/dist/commonjs/lib/config.d.ts +3 -3
  13. package/dist/commonjs/lib/config.js +3 -3
  14. package/dist/commonjs/lib/event-streams.d.ts +23 -0
  15. package/dist/commonjs/lib/event-streams.d.ts.map +1 -0
  16. package/dist/commonjs/lib/event-streams.js +168 -0
  17. package/dist/commonjs/lib/event-streams.js.map +1 -0
  18. package/dist/commonjs/models/components/chatmessagefragment.d.ts +1 -1
  19. package/dist/commonjs/models/components/index.d.ts +15 -1
  20. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  21. package/dist/commonjs/models/components/index.js +15 -1
  22. package/dist/commonjs/models/components/index.js.map +1 -1
  23. package/dist/commonjs/models/components/platformchatcompletedresponse.d.ts +4 -4
  24. package/dist/commonjs/models/components/platformchatcompletedresponse.d.ts.map +1 -1
  25. package/dist/commonjs/models/components/platformchatcompletedresponse.js +4 -5
  26. package/dist/commonjs/models/components/platformchatcompletedresponse.js.map +1 -1
  27. package/dist/commonjs/models/components/platformchatfailedresponse.d.ts +44 -0
  28. package/dist/commonjs/models/components/platformchatfailedresponse.d.ts.map +1 -0
  29. package/dist/commonjs/models/components/platformchatfailedresponse.js +71 -0
  30. package/dist/commonjs/models/components/platformchatfailedresponse.js.map +1 -0
  31. package/dist/commonjs/models/components/platformchatresponseerror.d.ts +16 -0
  32. package/dist/commonjs/models/components/platformchatresponseerror.d.ts.map +1 -0
  33. package/dist/commonjs/models/components/platformchatresponseerror.js +52 -0
  34. package/dist/commonjs/models/components/platformchatresponseerror.js.map +1 -0
  35. package/dist/commonjs/models/components/platformchatstreameventserversentevent.d.ts +17 -0
  36. package/dist/commonjs/models/components/platformchatstreameventserversentevent.d.ts.map +1 -0
  37. package/dist/commonjs/models/components/platformchatstreameventserversentevent.js +62 -0
  38. package/dist/commonjs/models/components/platformchatstreameventserversentevent.js.map +1 -0
  39. package/dist/commonjs/models/components/platformchatstreamoutputtextdelta.d.ts +24 -0
  40. package/dist/commonjs/models/components/platformchatstreamoutputtextdelta.d.ts.map +1 -0
  41. package/dist/commonjs/models/components/platformchatstreamoutputtextdelta.js +58 -0
  42. package/dist/commonjs/models/components/platformchatstreamoutputtextdelta.js.map +1 -0
  43. package/dist/commonjs/models/components/platformchatstreamoutputtextdeltaserversentevent.d.ts +13 -0
  44. package/dist/commonjs/models/components/platformchatstreamoutputtextdeltaserversentevent.d.ts.map +1 -0
  45. package/dist/commonjs/models/components/platformchatstreamoutputtextdeltaserversentevent.js +64 -0
  46. package/dist/commonjs/models/components/platformchatstreamoutputtextdeltaserversentevent.js.map +1 -0
  47. package/dist/commonjs/models/components/platformchatstreamoutputtextdone.d.ts +24 -0
  48. package/dist/commonjs/models/components/platformchatstreamoutputtextdone.d.ts.map +1 -0
  49. package/dist/commonjs/models/components/platformchatstreamoutputtextdone.js +58 -0
  50. package/dist/commonjs/models/components/platformchatstreamoutputtextdone.js.map +1 -0
  51. package/dist/commonjs/models/components/platformchatstreamoutputtextdoneserversentevent.d.ts +13 -0
  52. package/dist/commonjs/models/components/platformchatstreamoutputtextdoneserversentevent.d.ts.map +1 -0
  53. package/dist/commonjs/models/components/platformchatstreamoutputtextdoneserversentevent.js +64 -0
  54. package/dist/commonjs/models/components/platformchatstreamoutputtextdoneserversentevent.js.map +1 -0
  55. package/dist/commonjs/models/components/platformchatstreamprogress.d.ts +29 -0
  56. package/dist/commonjs/models/components/platformchatstreamprogress.d.ts.map +1 -0
  57. package/dist/commonjs/models/components/platformchatstreamprogress.js +58 -0
  58. package/dist/commonjs/models/components/platformchatstreamprogress.js.map +1 -0
  59. package/dist/commonjs/models/components/platformchatstreamprogressserversentevent.d.ts +13 -0
  60. package/dist/commonjs/models/components/platformchatstreamprogressserversentevent.d.ts.map +1 -0
  61. package/dist/commonjs/models/components/platformchatstreamprogressserversentevent.js +64 -0
  62. package/dist/commonjs/models/components/platformchatstreamprogressserversentevent.js.map +1 -0
  63. package/dist/commonjs/models/components/platformchatstreamresponsecompleted.d.ts +25 -0
  64. package/dist/commonjs/models/components/platformchatstreamresponsecompleted.d.ts.map +1 -0
  65. package/dist/commonjs/models/components/platformchatstreamresponsecompleted.js +60 -0
  66. package/dist/commonjs/models/components/platformchatstreamresponsecompleted.js.map +1 -0
  67. package/dist/commonjs/models/components/platformchatstreamresponsecompletedserversentevent.d.ts +13 -0
  68. package/dist/commonjs/models/components/platformchatstreamresponsecompletedserversentevent.d.ts.map +1 -0
  69. package/dist/commonjs/models/components/platformchatstreamresponsecompletedserversentevent.js +64 -0
  70. package/dist/commonjs/models/components/platformchatstreamresponsecompletedserversentevent.js.map +1 -0
  71. package/dist/commonjs/models/components/platformchatstreamresponsecreated.d.ts +23 -0
  72. package/dist/commonjs/models/components/platformchatstreamresponsecreated.d.ts.map +1 -0
  73. package/dist/commonjs/models/components/platformchatstreamresponsecreated.js +57 -0
  74. package/dist/commonjs/models/components/platformchatstreamresponsecreated.js.map +1 -0
  75. package/dist/commonjs/models/components/platformchatstreamresponsecreatedserversentevent.d.ts +13 -0
  76. package/dist/commonjs/models/components/platformchatstreamresponsecreatedserversentevent.d.ts.map +1 -0
  77. package/dist/commonjs/models/components/platformchatstreamresponsecreatedserversentevent.js +64 -0
  78. package/dist/commonjs/models/components/platformchatstreamresponsecreatedserversentevent.js.map +1 -0
  79. package/dist/commonjs/models/components/platformchatstreamresponsefailed.d.ts +25 -0
  80. package/dist/commonjs/models/components/platformchatstreamresponsefailed.d.ts.map +1 -0
  81. package/dist/commonjs/models/components/platformchatstreamresponsefailed.js +59 -0
  82. package/dist/commonjs/models/components/platformchatstreamresponsefailed.js.map +1 -0
  83. package/dist/commonjs/models/components/platformchatstreamresponsefailedserversentevent.d.ts +13 -0
  84. package/dist/commonjs/models/components/platformchatstreamresponsefailedserversentevent.d.ts.map +1 -0
  85. package/dist/commonjs/models/components/platformchatstreamresponsefailedserversentevent.js +64 -0
  86. package/dist/commonjs/models/components/platformchatstreamresponsefailedserversentevent.js.map +1 -0
  87. package/dist/commonjs/models/operations/index.d.ts +1 -0
  88. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  89. package/dist/commonjs/models/operations/index.js +1 -0
  90. package/dist/commonjs/models/operations/index.js.map +1 -1
  91. package/dist/commonjs/models/operations/platformchatcreate.d.ts +41 -5
  92. package/dist/commonjs/models/operations/platformchatcreate.d.ts.map +1 -1
  93. package/dist/commonjs/models/operations/platformchatcreate.js +20 -7
  94. package/dist/commonjs/models/operations/platformchatcreate.js.map +1 -1
  95. package/dist/commonjs/models/operations/platformchatcreatestream.d.ts +45 -0
  96. package/dist/commonjs/models/operations/platformchatcreatestream.d.ts.map +1 -0
  97. package/dist/commonjs/models/{components/platformchatcreaterequest.js → operations/platformchatcreatestream.js} +17 -14
  98. package/dist/commonjs/models/operations/platformchatcreatestream.js.map +1 -0
  99. package/dist/commonjs/react-query/chatCreate.d.ts +5 -11
  100. package/dist/commonjs/react-query/chatCreate.d.ts.map +1 -1
  101. package/dist/commonjs/react-query/chatCreate.js +1 -4
  102. package/dist/commonjs/react-query/chatCreate.js.map +1 -1
  103. package/dist/commonjs/react-query/chatCreateStream.d.ts +31 -0
  104. package/dist/commonjs/react-query/chatCreateStream.d.ts.map +1 -0
  105. package/dist/commonjs/react-query/chatCreateStream.js +48 -0
  106. package/dist/commonjs/react-query/chatCreateStream.js.map +1 -0
  107. package/dist/commonjs/react-query/index.d.ts +1 -0
  108. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  109. package/dist/commonjs/react-query/index.js +1 -0
  110. package/dist/commonjs/react-query/index.js.map +1 -1
  111. package/dist/commonjs/sdk/chat.d.ts +10 -6
  112. package/dist/commonjs/sdk/chat.d.ts.map +1 -1
  113. package/dist/commonjs/sdk/chat.js +12 -4
  114. package/dist/commonjs/sdk/chat.js.map +1 -1
  115. package/dist/esm/__tests__/summarize.test.js +2 -4
  116. package/dist/esm/__tests__/summarize.test.js.map +1 -1
  117. package/dist/esm/funcs/chatCreate.d.ts +2 -8
  118. package/dist/esm/funcs/chatCreate.d.ts.map +1 -1
  119. package/dist/esm/funcs/chatCreate.js +4 -12
  120. package/dist/esm/funcs/chatCreate.js.map +1 -1
  121. package/dist/esm/funcs/chatCreateStream.d.ts +20 -0
  122. package/dist/esm/funcs/chatCreateStream.d.ts.map +1 -0
  123. package/dist/esm/funcs/chatCreateStream.js +98 -0
  124. package/dist/esm/funcs/chatCreateStream.js.map +1 -0
  125. package/dist/esm/lib/config.d.ts +3 -3
  126. package/dist/esm/lib/config.js +3 -3
  127. package/dist/esm/lib/event-streams.d.ts +23 -0
  128. package/dist/esm/lib/event-streams.d.ts.map +1 -0
  129. package/dist/esm/lib/event-streams.js +164 -0
  130. package/dist/esm/lib/event-streams.js.map +1 -0
  131. package/dist/esm/models/components/chatmessagefragment.d.ts +1 -1
  132. package/dist/esm/models/components/index.d.ts +15 -1
  133. package/dist/esm/models/components/index.d.ts.map +1 -1
  134. package/dist/esm/models/components/index.js +15 -1
  135. package/dist/esm/models/components/index.js.map +1 -1
  136. package/dist/esm/models/components/platformchatcompletedresponse.d.ts +4 -4
  137. package/dist/esm/models/components/platformchatcompletedresponse.d.ts.map +1 -1
  138. package/dist/esm/models/components/platformchatcompletedresponse.js +3 -4
  139. package/dist/esm/models/components/platformchatcompletedresponse.js.map +1 -1
  140. package/dist/esm/models/components/platformchatfailedresponse.d.ts +44 -0
  141. package/dist/esm/models/components/platformchatfailedresponse.d.ts.map +1 -0
  142. package/dist/esm/models/components/platformchatfailedresponse.js +34 -0
  143. package/dist/esm/models/components/platformchatfailedresponse.js.map +1 -0
  144. package/dist/esm/models/components/platformchatresponseerror.d.ts +16 -0
  145. package/dist/esm/models/components/platformchatresponseerror.d.ts.map +1 -0
  146. package/dist/esm/models/components/platformchatresponseerror.js +15 -0
  147. package/dist/esm/models/components/platformchatresponseerror.js.map +1 -0
  148. package/dist/esm/models/components/platformchatstreameventserversentevent.d.ts +17 -0
  149. package/dist/esm/models/components/platformchatstreameventserversentevent.d.ts.map +1 -0
  150. package/dist/esm/models/components/platformchatstreameventserversentevent.js +25 -0
  151. package/dist/esm/models/components/platformchatstreameventserversentevent.js.map +1 -0
  152. package/dist/esm/models/components/platformchatstreamoutputtextdelta.d.ts +24 -0
  153. package/dist/esm/models/components/platformchatstreamoutputtextdelta.d.ts.map +1 -0
  154. package/dist/esm/models/components/platformchatstreamoutputtextdelta.js +21 -0
  155. package/dist/esm/models/components/platformchatstreamoutputtextdelta.js.map +1 -0
  156. package/dist/esm/models/components/platformchatstreamoutputtextdeltaserversentevent.d.ts +13 -0
  157. package/dist/esm/models/components/platformchatstreamoutputtextdeltaserversentevent.d.ts.map +1 -0
  158. package/dist/esm/models/components/platformchatstreamoutputtextdeltaserversentevent.js +27 -0
  159. package/dist/esm/models/components/platformchatstreamoutputtextdeltaserversentevent.js.map +1 -0
  160. package/dist/esm/models/components/platformchatstreamoutputtextdone.d.ts +24 -0
  161. package/dist/esm/models/components/platformchatstreamoutputtextdone.d.ts.map +1 -0
  162. package/dist/esm/models/components/platformchatstreamoutputtextdone.js +21 -0
  163. package/dist/esm/models/components/platformchatstreamoutputtextdone.js.map +1 -0
  164. package/dist/esm/models/components/platformchatstreamoutputtextdoneserversentevent.d.ts +13 -0
  165. package/dist/esm/models/components/platformchatstreamoutputtextdoneserversentevent.d.ts.map +1 -0
  166. package/dist/esm/models/components/platformchatstreamoutputtextdoneserversentevent.js +27 -0
  167. package/dist/esm/models/components/platformchatstreamoutputtextdoneserversentevent.js.map +1 -0
  168. package/dist/esm/models/components/platformchatstreamprogress.d.ts +29 -0
  169. package/dist/esm/models/components/platformchatstreamprogress.d.ts.map +1 -0
  170. package/dist/esm/models/components/platformchatstreamprogress.js +21 -0
  171. package/dist/esm/models/components/platformchatstreamprogress.js.map +1 -0
  172. package/dist/esm/models/components/platformchatstreamprogressserversentevent.d.ts +13 -0
  173. package/dist/esm/models/components/platformchatstreamprogressserversentevent.d.ts.map +1 -0
  174. package/dist/esm/models/components/platformchatstreamprogressserversentevent.js +27 -0
  175. package/dist/esm/models/components/platformchatstreamprogressserversentevent.js.map +1 -0
  176. package/dist/esm/models/components/platformchatstreamresponsecompleted.d.ts +25 -0
  177. package/dist/esm/models/components/platformchatstreamresponsecompleted.d.ts.map +1 -0
  178. package/dist/esm/models/components/platformchatstreamresponsecompleted.js +23 -0
  179. package/dist/esm/models/components/platformchatstreamresponsecompleted.js.map +1 -0
  180. package/dist/esm/models/components/platformchatstreamresponsecompletedserversentevent.d.ts +13 -0
  181. package/dist/esm/models/components/platformchatstreamresponsecompletedserversentevent.d.ts.map +1 -0
  182. package/dist/esm/models/components/platformchatstreamresponsecompletedserversentevent.js +27 -0
  183. package/dist/esm/models/components/platformchatstreamresponsecompletedserversentevent.js.map +1 -0
  184. package/dist/esm/models/components/platformchatstreamresponsecreated.d.ts +23 -0
  185. package/dist/esm/models/components/platformchatstreamresponsecreated.d.ts.map +1 -0
  186. package/dist/esm/models/components/platformchatstreamresponsecreated.js +20 -0
  187. package/dist/esm/models/components/platformchatstreamresponsecreated.js.map +1 -0
  188. package/dist/esm/models/components/platformchatstreamresponsecreatedserversentevent.d.ts +13 -0
  189. package/dist/esm/models/components/platformchatstreamresponsecreatedserversentevent.d.ts.map +1 -0
  190. package/dist/esm/models/components/platformchatstreamresponsecreatedserversentevent.js +27 -0
  191. package/dist/esm/models/components/platformchatstreamresponsecreatedserversentevent.js.map +1 -0
  192. package/dist/esm/models/components/platformchatstreamresponsefailed.d.ts +25 -0
  193. package/dist/esm/models/components/platformchatstreamresponsefailed.d.ts.map +1 -0
  194. package/dist/esm/models/components/platformchatstreamresponsefailed.js +22 -0
  195. package/dist/esm/models/components/platformchatstreamresponsefailed.js.map +1 -0
  196. package/dist/esm/models/components/platformchatstreamresponsefailedserversentevent.d.ts +13 -0
  197. package/dist/esm/models/components/platformchatstreamresponsefailedserversentevent.d.ts.map +1 -0
  198. package/dist/esm/models/components/platformchatstreamresponsefailedserversentevent.js +27 -0
  199. package/dist/esm/models/components/platformchatstreamresponsefailedserversentevent.js.map +1 -0
  200. package/dist/esm/models/operations/index.d.ts +1 -0
  201. package/dist/esm/models/operations/index.d.ts.map +1 -1
  202. package/dist/esm/models/operations/index.js +1 -0
  203. package/dist/esm/models/operations/index.js.map +1 -1
  204. package/dist/esm/models/operations/platformchatcreate.d.ts +41 -5
  205. package/dist/esm/models/operations/platformchatcreate.d.ts.map +1 -1
  206. package/dist/esm/models/operations/platformchatcreate.js +17 -5
  207. package/dist/esm/models/operations/platformchatcreate.js.map +1 -1
  208. package/dist/esm/models/operations/platformchatcreatestream.d.ts +45 -0
  209. package/dist/esm/models/operations/platformchatcreatestream.d.ts.map +1 -0
  210. package/dist/esm/models/operations/platformchatcreatestream.js +28 -0
  211. package/dist/esm/models/operations/platformchatcreatestream.js.map +1 -0
  212. package/dist/esm/react-query/chatCreate.d.ts +5 -11
  213. package/dist/esm/react-query/chatCreate.d.ts.map +1 -1
  214. package/dist/esm/react-query/chatCreate.js +1 -2
  215. package/dist/esm/react-query/chatCreate.js.map +1 -1
  216. package/dist/esm/react-query/chatCreateStream.d.ts +31 -0
  217. package/dist/esm/react-query/chatCreateStream.d.ts.map +1 -0
  218. package/dist/esm/react-query/chatCreateStream.js +43 -0
  219. package/dist/esm/react-query/chatCreateStream.js.map +1 -0
  220. package/dist/esm/react-query/index.d.ts +1 -0
  221. package/dist/esm/react-query/index.d.ts.map +1 -1
  222. package/dist/esm/react-query/index.js +1 -0
  223. package/dist/esm/react-query/index.js.map +1 -1
  224. package/dist/esm/sdk/chat.d.ts +10 -6
  225. package/dist/esm/sdk/chat.d.ts.map +1 -1
  226. package/dist/esm/sdk/chat.js +11 -2
  227. package/dist/esm/sdk/chat.js.map +1 -1
  228. package/jsr.json +2 -1
  229. package/package.json +1 -1
  230. package/src/__tests__/summarize.test.ts +2 -4
  231. package/src/funcs/chatCreate.ts +11 -20
  232. package/src/funcs/chatCreateStream.ts +197 -0
  233. package/src/lib/config.ts +3 -3
  234. package/src/lib/event-streams.ts +192 -0
  235. package/src/models/components/chatmessagefragment.ts +1 -1
  236. package/src/models/components/index.ts +15 -1
  237. package/src/models/components/platformchatcompletedresponse.ts +9 -6
  238. package/src/models/components/platformchatfailedresponse.ts +92 -0
  239. package/src/models/components/platformchatresponseerror.ts +39 -0
  240. package/src/models/components/platformchatstreameventserversentevent.ts +69 -0
  241. package/src/models/components/platformchatstreamoutputtextdelta.ts +55 -0
  242. package/src/models/components/platformchatstreamoutputtextdeltaserversentevent.ts +55 -0
  243. package/src/models/components/platformchatstreamoutputtextdone.ts +55 -0
  244. package/src/models/components/platformchatstreamoutputtextdoneserversentevent.ts +55 -0
  245. package/src/models/components/platformchatstreamprogress.ts +59 -0
  246. package/src/models/components/platformchatstreamprogressserversentevent.ts +54 -0
  247. package/src/models/components/platformchatstreamresponsecompleted.ts +59 -0
  248. package/src/models/components/platformchatstreamresponsecompletedserversentevent.ts +55 -0
  249. package/src/models/components/platformchatstreamresponsecreated.ts +53 -0
  250. package/src/models/components/platformchatstreamresponsecreatedserversentevent.ts +55 -0
  251. package/src/models/components/platformchatstreamresponsefailed.ts +59 -0
  252. package/src/models/components/platformchatstreamresponsefailedserversentevent.ts +55 -0
  253. package/src/models/operations/index.ts +1 -0
  254. package/src/models/operations/platformchatcreate.ts +75 -17
  255. package/src/models/operations/platformchatcreatestream.ts +96 -0
  256. package/src/react-query/chatCreate.ts +6 -8
  257. package/src/react-query/chatCreateStream.ts +115 -0
  258. package/src/react-query/index.ts +1 -0
  259. package/src/sdk/chat.ts +24 -7
  260. package/dist/commonjs/models/components/platformchatcreaterequest.d.ts +0 -50
  261. package/dist/commonjs/models/components/platformchatcreaterequest.d.ts.map +0 -1
  262. package/dist/commonjs/models/components/platformchatcreaterequest.js.map +0 -1
  263. package/dist/esm/models/components/platformchatcreaterequest.d.ts +0 -50
  264. package/dist/esm/models/components/platformchatcreaterequest.d.ts.map +0 -1
  265. package/dist/esm/models/components/platformchatcreaterequest.js +0 -25
  266. package/dist/esm/models/components/platformchatcreaterequest.js.map +0 -1
  267. package/src/models/components/platformchatcreaterequest.ts +0 -90
@@ -0,0 +1,96 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 7b911127469b
4
+ */
5
+
6
+ import * as z from "zod/v3";
7
+ import * as components from "../components/index.js";
8
+
9
+ /**
10
+ * Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
11
+ *
12
+ * @remarks
13
+ */
14
+ export type PlatformChatCreateStreamInput =
15
+ | string
16
+ | Array<components.PlatformChatInputMessage>;
17
+
18
+ export type PlatformChatCreateStreamRequest = {
19
+ /**
20
+ * Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
21
+ *
22
+ * @remarks
23
+ */
24
+ input: string | Array<components.PlatformChatInputMessage>;
25
+ stream?: true | undefined;
26
+ /**
27
+ * When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
28
+ *
29
+ * @remarks
30
+ */
31
+ store?: boolean | undefined;
32
+ /**
33
+ * Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
34
+ *
35
+ * @remarks
36
+ */
37
+ conversation_id?: string | undefined;
38
+ };
39
+
40
+ /** @internal */
41
+ export type PlatformChatCreateStreamInput$Outbound =
42
+ | string
43
+ | Array<components.PlatformChatInputMessage$Outbound>;
44
+
45
+ /** @internal */
46
+ export const PlatformChatCreateStreamInput$outboundSchema: z.ZodType<
47
+ PlatformChatCreateStreamInput$Outbound,
48
+ z.ZodTypeDef,
49
+ PlatformChatCreateStreamInput
50
+ > = z.union([
51
+ z.string(),
52
+ z.array(components.PlatformChatInputMessage$outboundSchema),
53
+ ]);
54
+
55
+ export function platformChatCreateStreamInputToJSON(
56
+ platformChatCreateStreamInput: PlatformChatCreateStreamInput,
57
+ ): string {
58
+ return JSON.stringify(
59
+ PlatformChatCreateStreamInput$outboundSchema.parse(
60
+ platformChatCreateStreamInput,
61
+ ),
62
+ );
63
+ }
64
+
65
+ /** @internal */
66
+ export type PlatformChatCreateStreamRequest$Outbound = {
67
+ input: string | Array<components.PlatformChatInputMessage$Outbound>;
68
+ stream: true;
69
+ store: boolean;
70
+ conversation_id?: string | undefined;
71
+ };
72
+
73
+ /** @internal */
74
+ export const PlatformChatCreateStreamRequest$outboundSchema: z.ZodType<
75
+ PlatformChatCreateStreamRequest$Outbound,
76
+ z.ZodTypeDef,
77
+ PlatformChatCreateStreamRequest
78
+ > = z.object({
79
+ input: z.union([
80
+ z.string(),
81
+ z.array(components.PlatformChatInputMessage$outboundSchema),
82
+ ]),
83
+ stream: z.literal(true).default(true as const),
84
+ store: z.boolean().default(true),
85
+ conversation_id: z.string().optional(),
86
+ });
87
+
88
+ export function platformChatCreateStreamRequestToJSON(
89
+ platformChatCreateStreamRequest: PlatformChatCreateStreamRequest,
90
+ ): string {
91
+ return JSON.stringify(
92
+ PlatformChatCreateStreamRequest$outboundSchema.parse(
93
+ platformChatCreateStreamRequest,
94
+ ),
95
+ );
96
+ }
@@ -9,7 +9,7 @@ import {
9
9
  UseMutationResult,
10
10
  } from "@tanstack/react-query";
11
11
  import { GleanCore } from "../core.js";
12
- import { chatCreate, CreateAcceptEnum } from "../funcs/chatCreate.js";
12
+ import { chatCreate } from "../funcs/chatCreate.js";
13
13
  import { combineSignals } from "../lib/primitives.js";
14
14
  import { RequestOptions } from "../lib/sdks.js";
15
15
  import * as components from "../models/components/index.js";
@@ -29,14 +29,12 @@ import { unwrapAsync } from "../types/fp.js";
29
29
  import { useGleanContext } from "./_context.js";
30
30
  import { MutationHookOptions } from "./_types.js";
31
31
 
32
- export { CreateAcceptEnum } from "../funcs/chatCreate.js";
33
-
34
32
  export type ChatCreateMutationVariables = {
35
- request: components.PlatformChatCreateRequest;
36
- options?: RequestOptions & { acceptHeaderOverride?: CreateAcceptEnum };
33
+ request: operations.PlatformChatCreateRequest;
34
+ options?: RequestOptions;
37
35
  };
38
36
 
39
- export type ChatCreateMutationData = operations.PlatformChatCreateResponse;
37
+ export type ChatCreateMutationData = components.PlatformChatCompletedResponse;
40
38
 
41
39
  export type ChatCreateMutationError =
42
40
  | errors.PlatformProblemDetailError
@@ -53,7 +51,7 @@ export type ChatCreateMutationError =
53
51
  * Create a chat response
54
52
  *
55
53
  * @remarks
56
- * Run an assistant turn. Set `stream` to true to receive server-sent events; otherwise the response is a typed JSON response object.
54
+ * Run an assistant turn. The default response is JSON. HTTP clients request server-sent events by setting `stream` to true in the JSON body. An `Accept: text/event-stream` header does not replace `stream`.
57
55
  */
58
56
  export function useChatCreateMutation(
59
57
  options?: MutationHookOptions<
@@ -79,7 +77,7 @@ export function mutationKeyChatCreate(): MutationKey {
79
77
 
80
78
  export function buildChatCreateMutation(
81
79
  client$: GleanCore,
82
- hookOptions?: RequestOptions & { acceptHeaderOverride?: CreateAcceptEnum },
80
+ hookOptions?: RequestOptions,
83
81
  ): {
84
82
  mutationKey: MutationKey;
85
83
  mutationFn: (
@@ -0,0 +1,115 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 3f9fb5fbb84c
4
+ */
5
+
6
+ import {
7
+ MutationKey,
8
+ useMutation,
9
+ UseMutationResult,
10
+ } from "@tanstack/react-query";
11
+ import { GleanCore } from "../core.js";
12
+ import { chatCreateStream } from "../funcs/chatCreateStream.js";
13
+ import { EventStream } from "../lib/event-streams.js";
14
+ import { combineSignals } from "../lib/primitives.js";
15
+ import { RequestOptions } from "../lib/sdks.js";
16
+ import * as components from "../models/components/index.js";
17
+ import { GleanBaseError } from "../models/errors/gleanbaseerror.js";
18
+ import {
19
+ ConnectionError,
20
+ InvalidRequestError,
21
+ RequestAbortedError,
22
+ RequestTimeoutError,
23
+ UnexpectedClientError,
24
+ } from "../models/errors/httpclienterrors.js";
25
+ import * as errors from "../models/errors/index.js";
26
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
27
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
28
+ import * as operations from "../models/operations/index.js";
29
+ import { unwrapAsync } from "../types/fp.js";
30
+ import { useGleanContext } from "./_context.js";
31
+ import { MutationHookOptions } from "./_types.js";
32
+
33
+ export type ChatCreateStreamMutationVariables = {
34
+ request: operations.PlatformChatCreateStreamRequest;
35
+ options?: RequestOptions;
36
+ };
37
+
38
+ export type ChatCreateStreamMutationData = EventStream<
39
+ components.PlatformChatStreamEventServerSentEvent
40
+ >;
41
+
42
+ export type ChatCreateStreamMutationError =
43
+ | errors.PlatformProblemDetailError
44
+ | GleanBaseError
45
+ | ResponseValidationError
46
+ | ConnectionError
47
+ | RequestAbortedError
48
+ | RequestTimeoutError
49
+ | InvalidRequestError
50
+ | UnexpectedClientError
51
+ | SDKValidationError;
52
+
53
+ /**
54
+ * SDK-only logical operation. HTTP clients must call the base path; the URL fragment is not sent. Create a chat response
55
+ *
56
+ * @remarks
57
+ * SDK-only logical operation. HTTP clients must call the base path; the URL fragment is not sent. Run an assistant turn. The default response is JSON. HTTP clients request server-sent events by setting `stream` to true in the JSON body. An `Accept: text/event-stream` header does not replace `stream`.
58
+ */
59
+ export function useChatCreateStreamMutation(
60
+ options?: MutationHookOptions<
61
+ ChatCreateStreamMutationData,
62
+ ChatCreateStreamMutationError,
63
+ ChatCreateStreamMutationVariables
64
+ >,
65
+ ): UseMutationResult<
66
+ ChatCreateStreamMutationData,
67
+ ChatCreateStreamMutationError,
68
+ ChatCreateStreamMutationVariables
69
+ > {
70
+ const client = useGleanContext();
71
+ return useMutation({
72
+ ...buildChatCreateStreamMutation(client, options),
73
+ ...options,
74
+ });
75
+ }
76
+
77
+ export function mutationKeyChatCreateStream(): MutationKey {
78
+ return ["@gleanwork/api-client", "chat", "createStream"];
79
+ }
80
+
81
+ export function buildChatCreateStreamMutation(
82
+ client$: GleanCore,
83
+ hookOptions?: RequestOptions,
84
+ ): {
85
+ mutationKey: MutationKey;
86
+ mutationFn: (
87
+ variables: ChatCreateStreamMutationVariables,
88
+ ) => Promise<ChatCreateStreamMutationData>;
89
+ } {
90
+ return {
91
+ mutationKey: mutationKeyChatCreateStream(),
92
+ mutationFn: function chatCreateStreamMutationFn({
93
+ request,
94
+ options,
95
+ }): Promise<ChatCreateStreamMutationData> {
96
+ const mergedOptions = {
97
+ ...hookOptions,
98
+ ...options,
99
+ fetchOptions: {
100
+ ...hookOptions?.fetchOptions,
101
+ ...options?.fetchOptions,
102
+ signal: combineSignals(
103
+ hookOptions?.fetchOptions?.signal,
104
+ options?.fetchOptions?.signal,
105
+ ),
106
+ },
107
+ };
108
+ return unwrapAsync(chatCreateStream(
109
+ client$,
110
+ request,
111
+ mergedOptions,
112
+ ));
113
+ },
114
+ };
115
+ }
@@ -11,6 +11,7 @@ export * from "./agentsGet.js";
11
11
  export * from "./agentsGetSchemas.js";
12
12
  export * from "./agentsSearch.js";
13
13
  export * from "./chatCreate.js";
14
+ export * from "./chatCreateStream.js";
14
15
  export * from "./clientActivityFeedback.js";
15
16
  export * from "./clientActivityReport.js";
16
17
  export * from "./clientAgentsCreate.js";
package/src/sdk/chat.ts CHANGED
@@ -3,29 +3,46 @@
3
3
  * @generated-id: c56babc22a20
4
4
  */
5
5
 
6
- import { chatCreate, CreateAcceptEnum } from "../funcs/chatCreate.js";
6
+ import { chatCreate } from "../funcs/chatCreate.js";
7
+ import { chatCreateStream } from "../funcs/chatCreateStream.js";
8
+ import { EventStream } from "../lib/event-streams.js";
7
9
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
8
10
  import * as components from "../models/components/index.js";
9
11
  import * as operations from "../models/operations/index.js";
10
12
  import { unwrapAsync } from "../types/fp.js";
11
13
 
12
- export { CreateAcceptEnum } from "../funcs/chatCreate.js";
13
-
14
14
  export class Chat extends ClientSDK {
15
15
  /**
16
16
  * Create a chat response
17
17
  *
18
18
  * @remarks
19
- * Run an assistant turn. Set `stream` to true to receive server-sent events; otherwise the response is a typed JSON response object.
19
+ * Run an assistant turn. The default response is JSON. HTTP clients request server-sent events by setting `stream` to true in the JSON body. An `Accept: text/event-stream` header does not replace `stream`.
20
20
  */
21
21
  async create(
22
- request: components.PlatformChatCreateRequest,
23
- options?: RequestOptions & { acceptHeaderOverride?: CreateAcceptEnum },
24
- ): Promise<operations.PlatformChatCreateResponse> {
22
+ request: operations.PlatformChatCreateRequest,
23
+ options?: RequestOptions,
24
+ ): Promise<components.PlatformChatCompletedResponse> {
25
25
  return unwrapAsync(chatCreate(
26
26
  this,
27
27
  request,
28
28
  options,
29
29
  ));
30
30
  }
31
+
32
+ /**
33
+ * SDK-only logical operation. HTTP clients must call the base path; the URL fragment is not sent. Create a chat response
34
+ *
35
+ * @remarks
36
+ * SDK-only logical operation. HTTP clients must call the base path; the URL fragment is not sent. Run an assistant turn. The default response is JSON. HTTP clients request server-sent events by setting `stream` to true in the JSON body. An `Accept: text/event-stream` header does not replace `stream`.
37
+ */
38
+ async createStream(
39
+ request: operations.PlatformChatCreateStreamRequest,
40
+ options?: RequestOptions,
41
+ ): Promise<EventStream<components.PlatformChatStreamEventServerSentEvent>> {
42
+ return unwrapAsync(chatCreateStream(
43
+ this,
44
+ request,
45
+ options,
46
+ ));
47
+ }
31
48
  }
@@ -1,50 +0,0 @@
1
- import * as z from "zod/v3";
2
- import { PlatformChatInputMessage, PlatformChatInputMessage$Outbound } from "./platformchatinputmessage.js";
3
- /**
4
- * Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
5
- *
6
- * @remarks
7
- */
8
- export type Input = string | Array<PlatformChatInputMessage>;
9
- export type PlatformChatCreateRequest = {
10
- /**
11
- * Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
12
- *
13
- * @remarks
14
- */
15
- input: string | Array<PlatformChatInputMessage>;
16
- /**
17
- * When true, respond with `text/event-stream`. When false or omitted, respond with `application/json`.
18
- *
19
- * @remarks
20
- */
21
- stream?: boolean | undefined;
22
- /**
23
- * When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
24
- *
25
- * @remarks
26
- */
27
- store?: boolean | undefined;
28
- /**
29
- * Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
30
- *
31
- * @remarks
32
- */
33
- conversation_id?: string | undefined;
34
- };
35
- /** @internal */
36
- export type Input$Outbound = string | Array<PlatformChatInputMessage$Outbound>;
37
- /** @internal */
38
- export declare const Input$outboundSchema: z.ZodType<Input$Outbound, z.ZodTypeDef, Input>;
39
- export declare function inputToJSON(input: Input): string;
40
- /** @internal */
41
- export type PlatformChatCreateRequest$Outbound = {
42
- input: string | Array<PlatformChatInputMessage$Outbound>;
43
- stream: boolean;
44
- store: boolean;
45
- conversation_id?: string | undefined;
46
- };
47
- /** @internal */
48
- export declare const PlatformChatCreateRequest$outboundSchema: z.ZodType<PlatformChatCreateRequest$Outbound, z.ZodTypeDef, PlatformChatCreateRequest>;
49
- export declare function platformChatCreateRequestToJSON(platformChatCreateRequest: PlatformChatCreateRequest): string;
50
- //# sourceMappingURL=platformchatcreaterequest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platformchatcreaterequest.d.ts","sourceRoot":"","sources":["../../../../src/models/components/platformchatcreaterequest.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EACL,wBAAwB,EACxB,iCAAiC,EAElC,MAAM,+BAA+B,CAAC;AAEvC;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC,wBAAwB,CAAC,CAAC;AAE7D,MAAM,MAAM,yBAAyB,GAAG;IACtC;;;;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAChD;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,CAAC,iCAAiC,CAAC,CAAC;AAE/E,gBAAgB;AAChB,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAC1C,cAAc,EACd,CAAC,CAAC,UAAU,EACZ,KAAK,CACoE,CAAC;AAE5E,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAEhD;AAED,gBAAgB;AAChB,MAAM,MAAM,kCAAkC,GAAG;IAC/C,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACzD,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,wCAAwC,EAAE,CAAC,CAAC,OAAO,CAC9D,kCAAkC,EAClC,CAAC,CAAC,UAAU,EACZ,yBAAyB,CASzB,CAAC;AAEH,wBAAgB,+BAA+B,CAC7C,yBAAyB,EAAE,yBAAyB,GACnD,MAAM,CAIR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"platformchatcreaterequest.js","sourceRoot":"","sources":["../../../../src/models/components/platformchatcreaterequest.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDH,kCAEC;AAyBD,0EAMC;AApFD,0CAA4B;AAC5B,+EAIuC;AAuCvC,gBAAgB;AACH,QAAA,oBAAoB,GAI7B,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,qEAAuC,CAAC,CAAC,CAAC,CAAC;AAE5E,SAAgB,WAAW,CAAC,KAAY;IACtC,OAAO,IAAI,CAAC,SAAS,CAAC,4BAAoB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC3D,CAAC;AAUD,gBAAgB;AACH,QAAA,wCAAwC,GAIjD,CAAC,CAAC,MAAM,CAAC;IACX,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;QACb,CAAC,CAAC,MAAM,EAAE;QACV,CAAC,CAAC,KAAK,CAAC,qEAAuC,CAAC;KACjD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAClC,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAChC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAEH,SAAgB,+BAA+B,CAC7C,yBAAoD;IAEpD,OAAO,IAAI,CAAC,SAAS,CACnB,gDAAwC,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAC1E,CAAC;AACJ,CAAC"}
@@ -1,50 +0,0 @@
1
- import * as z from "zod/v3";
2
- import { PlatformChatInputMessage, PlatformChatInputMessage$Outbound } from "./platformchatinputmessage.js";
3
- /**
4
- * Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
5
- *
6
- * @remarks
7
- */
8
- export type Input = string | Array<PlatformChatInputMessage>;
9
- export type PlatformChatCreateRequest = {
10
- /**
11
- * Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
12
- *
13
- * @remarks
14
- */
15
- input: string | Array<PlatformChatInputMessage>;
16
- /**
17
- * When true, respond with `text/event-stream`. When false or omitted, respond with `application/json`.
18
- *
19
- * @remarks
20
- */
21
- stream?: boolean | undefined;
22
- /**
23
- * When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
24
- *
25
- * @remarks
26
- */
27
- store?: boolean | undefined;
28
- /**
29
- * Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
30
- *
31
- * @remarks
32
- */
33
- conversation_id?: string | undefined;
34
- };
35
- /** @internal */
36
- export type Input$Outbound = string | Array<PlatformChatInputMessage$Outbound>;
37
- /** @internal */
38
- export declare const Input$outboundSchema: z.ZodType<Input$Outbound, z.ZodTypeDef, Input>;
39
- export declare function inputToJSON(input: Input): string;
40
- /** @internal */
41
- export type PlatformChatCreateRequest$Outbound = {
42
- input: string | Array<PlatformChatInputMessage$Outbound>;
43
- stream: boolean;
44
- store: boolean;
45
- conversation_id?: string | undefined;
46
- };
47
- /** @internal */
48
- export declare const PlatformChatCreateRequest$outboundSchema: z.ZodType<PlatformChatCreateRequest$Outbound, z.ZodTypeDef, PlatformChatCreateRequest>;
49
- export declare function platformChatCreateRequestToJSON(platformChatCreateRequest: PlatformChatCreateRequest): string;
50
- //# sourceMappingURL=platformchatcreaterequest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platformchatcreaterequest.d.ts","sourceRoot":"","sources":["../../../../src/models/components/platformchatcreaterequest.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EACL,wBAAwB,EACxB,iCAAiC,EAElC,MAAM,+BAA+B,CAAC;AAEvC;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC,wBAAwB,CAAC,CAAC;AAE7D,MAAM,MAAM,yBAAyB,GAAG;IACtC;;;;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAChD;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,CAAC,iCAAiC,CAAC,CAAC;AAE/E,gBAAgB;AAChB,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAC1C,cAAc,EACd,CAAC,CAAC,UAAU,EACZ,KAAK,CACoE,CAAC;AAE5E,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAEhD;AAED,gBAAgB;AAChB,MAAM,MAAM,kCAAkC,GAAG;IAC/C,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACzD,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,wCAAwC,EAAE,CAAC,CAAC,OAAO,CAC9D,kCAAkC,EAClC,CAAC,CAAC,UAAU,EACZ,yBAAyB,CASzB,CAAC;AAEH,wBAAgB,+BAA+B,CAC7C,yBAAyB,EAAE,yBAAyB,GACnD,MAAM,CAIR"}
@@ -1,25 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: a0537d504f7f
4
- */
5
- import * as z from "zod/v3";
6
- import { PlatformChatInputMessage$outboundSchema, } from "./platformchatinputmessage.js";
7
- /** @internal */
8
- export const Input$outboundSchema = z.union([z.string(), z.array(PlatformChatInputMessage$outboundSchema)]);
9
- export function inputToJSON(input) {
10
- return JSON.stringify(Input$outboundSchema.parse(input));
11
- }
12
- /** @internal */
13
- export const PlatformChatCreateRequest$outboundSchema = z.object({
14
- input: z.union([
15
- z.string(),
16
- z.array(PlatformChatInputMessage$outboundSchema),
17
- ]),
18
- stream: z.boolean().default(false),
19
- store: z.boolean().default(true),
20
- conversation_id: z.string().optional(),
21
- });
22
- export function platformChatCreateRequestToJSON(platformChatCreateRequest) {
23
- return JSON.stringify(PlatformChatCreateRequest$outboundSchema.parse(platformChatCreateRequest));
24
- }
25
- //# sourceMappingURL=platformchatcreaterequest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platformchatcreaterequest.js","sourceRoot":"","sources":["../../../../src/models/components/platformchatcreaterequest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAGL,uCAAuC,GACxC,MAAM,+BAA+B,CAAC;AAuCvC,gBAAgB;AAChB,MAAM,CAAC,MAAM,oBAAoB,GAI7B,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC,CAAC,CAAC;AAE5E,MAAM,UAAU,WAAW,CAAC,KAAY;IACtC,OAAO,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC3D,CAAC;AAUD,gBAAgB;AAChB,MAAM,CAAC,MAAM,wCAAwC,GAIjD,CAAC,CAAC,MAAM,CAAC;IACX,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;QACb,CAAC,CAAC,MAAM,EAAE;QACV,CAAC,CAAC,KAAK,CAAC,uCAAuC,CAAC;KACjD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAClC,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAChC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAEH,MAAM,UAAU,+BAA+B,CAC7C,yBAAoD;IAEpD,OAAO,IAAI,CAAC,SAAS,CACnB,wCAAwC,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAC1E,CAAC;AACJ,CAAC"}
@@ -1,90 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: a0537d504f7f
4
- */
5
-
6
- import * as z from "zod/v3";
7
- import {
8
- PlatformChatInputMessage,
9
- PlatformChatInputMessage$Outbound,
10
- PlatformChatInputMessage$outboundSchema,
11
- } from "./platformchatinputmessage.js";
12
-
13
- /**
14
- * Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
15
- *
16
- * @remarks
17
- */
18
- export type Input = string | Array<PlatformChatInputMessage>;
19
-
20
- export type PlatformChatCreateRequest = {
21
- /**
22
- * Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
23
- *
24
- * @remarks
25
- */
26
- input: string | Array<PlatformChatInputMessage>;
27
- /**
28
- * When true, respond with `text/event-stream`. When false or omitted, respond with `application/json`.
29
- *
30
- * @remarks
31
- */
32
- stream?: boolean | undefined;
33
- /**
34
- * When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
35
- *
36
- * @remarks
37
- */
38
- store?: boolean | undefined;
39
- /**
40
- * Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
41
- *
42
- * @remarks
43
- */
44
- conversation_id?: string | undefined;
45
- };
46
-
47
- /** @internal */
48
- export type Input$Outbound = string | Array<PlatformChatInputMessage$Outbound>;
49
-
50
- /** @internal */
51
- export const Input$outboundSchema: z.ZodType<
52
- Input$Outbound,
53
- z.ZodTypeDef,
54
- Input
55
- > = z.union([z.string(), z.array(PlatformChatInputMessage$outboundSchema)]);
56
-
57
- export function inputToJSON(input: Input): string {
58
- return JSON.stringify(Input$outboundSchema.parse(input));
59
- }
60
-
61
- /** @internal */
62
- export type PlatformChatCreateRequest$Outbound = {
63
- input: string | Array<PlatformChatInputMessage$Outbound>;
64
- stream: boolean;
65
- store: boolean;
66
- conversation_id?: string | undefined;
67
- };
68
-
69
- /** @internal */
70
- export const PlatformChatCreateRequest$outboundSchema: z.ZodType<
71
- PlatformChatCreateRequest$Outbound,
72
- z.ZodTypeDef,
73
- PlatformChatCreateRequest
74
- > = z.object({
75
- input: z.union([
76
- z.string(),
77
- z.array(PlatformChatInputMessage$outboundSchema),
78
- ]),
79
- stream: z.boolean().default(false),
80
- store: z.boolean().default(true),
81
- conversation_id: z.string().optional(),
82
- });
83
-
84
- export function platformChatCreateRequestToJSON(
85
- platformChatCreateRequest: PlatformChatCreateRequest,
86
- ): string {
87
- return JSON.stringify(
88
- PlatformChatCreateRequest$outboundSchema.parse(platformChatCreateRequest),
89
- );
90
- }