@azure/ai-projects 1.0.0-beta.1 → 1.0.0-beta.3

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 (356) hide show
  1. package/LICENSE +4 -4
  2. package/README.md +244 -183
  3. package/dist/browser/agents/assistants.d.ts.map +1 -1
  4. package/dist/browser/agents/assistants.js +3 -1
  5. package/dist/browser/agents/assistants.js.map +1 -1
  6. package/dist/browser/agents/customModels.d.ts +4 -29
  7. package/dist/browser/agents/customModels.d.ts.map +1 -1
  8. package/dist/browser/agents/customModels.js.map +1 -1
  9. package/dist/browser/agents/files.d.ts +5 -4
  10. package/dist/browser/agents/files.d.ts.map +1 -1
  11. package/dist/browser/agents/files.js +55 -27
  12. package/dist/browser/agents/files.js.map +1 -1
  13. package/dist/browser/agents/index.d.ts +10 -10
  14. package/dist/browser/agents/index.d.ts.map +1 -1
  15. package/dist/browser/agents/index.js.map +1 -1
  16. package/dist/browser/agents/inputOutputs.d.ts +3 -3
  17. package/dist/browser/agents/inputOutputs.d.ts.map +1 -1
  18. package/dist/browser/agents/inputOutputs.js.map +1 -1
  19. package/dist/browser/agents/inputValidations.d.ts.map +1 -1
  20. package/dist/browser/agents/inputValidations.js +2 -1
  21. package/dist/browser/agents/inputValidations.js.map +1 -1
  22. package/dist/browser/agents/messages.js +2 -2
  23. package/dist/browser/agents/messages.js.map +1 -1
  24. package/dist/browser/agents/openAIError.d.ts.map +1 -1
  25. package/dist/browser/agents/openAIError.js +7 -1
  26. package/dist/browser/agents/openAIError.js.map +1 -1
  27. package/dist/browser/agents/poller.d.ts +8 -33
  28. package/dist/browser/agents/poller.d.ts.map +1 -1
  29. package/dist/browser/agents/poller.js +130 -53
  30. package/dist/browser/agents/poller.js.map +1 -1
  31. package/dist/browser/agents/streamingModels.d.ts +17 -15
  32. package/dist/browser/agents/streamingModels.d.ts.map +1 -1
  33. package/dist/browser/agents/streamingModels.js.map +1 -1
  34. package/dist/browser/agents/traceUtility.d.ts +3 -3
  35. package/dist/browser/agents/traceUtility.d.ts.map +1 -1
  36. package/dist/browser/agents/traceUtility.js.map +1 -1
  37. package/dist/browser/agents/utils.d.ts +53 -3
  38. package/dist/browser/agents/utils.d.ts.map +1 -1
  39. package/dist/browser/agents/utils.js +77 -2
  40. package/dist/browser/agents/utils.js.map +1 -1
  41. package/dist/browser/agents/vectorStores.d.ts +3 -4
  42. package/dist/browser/agents/vectorStores.d.ts.map +1 -1
  43. package/dist/browser/agents/vectorStores.js +44 -26
  44. package/dist/browser/agents/vectorStores.js.map +1 -1
  45. package/dist/browser/agents/vectorStoresFileBatches.d.ts +5 -4
  46. package/dist/browser/agents/vectorStoresFileBatches.d.ts.map +1 -1
  47. package/dist/browser/agents/vectorStoresFileBatches.js +46 -32
  48. package/dist/browser/agents/vectorStoresFileBatches.js.map +1 -1
  49. package/dist/browser/agents/vectorStoresFiles.d.ts +4 -4
  50. package/dist/browser/agents/vectorStoresFiles.d.ts.map +1 -1
  51. package/dist/browser/agents/vectorStoresFiles.js +57 -28
  52. package/dist/browser/agents/vectorStoresFiles.js.map +1 -1
  53. package/dist/browser/constants.d.ts +1 -1
  54. package/dist/browser/constants.js +1 -1
  55. package/dist/browser/constants.js.map +1 -1
  56. package/dist/browser/customization/convertModelsToWrite.d.ts.map +1 -1
  57. package/dist/browser/customization/convertModelsToWrite.js +42 -93
  58. package/dist/browser/customization/convertModelsToWrite.js.map +1 -1
  59. package/dist/browser/customization/convertOutputModelsFromWire.d.ts.map +1 -1
  60. package/dist/browser/customization/convertOutputModelsFromWire.js +51 -9
  61. package/dist/browser/customization/convertOutputModelsFromWire.js.map +1 -1
  62. package/dist/browser/customization/convertParametersToWire.d.ts +1 -1
  63. package/dist/browser/customization/convertParametersToWire.d.ts.map +1 -1
  64. package/dist/browser/customization/convertParametersToWire.js.map +1 -1
  65. package/dist/browser/customization/models.d.ts +146 -151
  66. package/dist/browser/customization/models.d.ts.map +1 -1
  67. package/dist/browser/customization/models.js.map +1 -1
  68. package/dist/browser/customization/outputModels.d.ts +188 -37
  69. package/dist/browser/customization/outputModels.d.ts.map +1 -1
  70. package/dist/browser/customization/outputModels.js.map +1 -1
  71. package/dist/browser/customization/streamingModels.d.ts +2 -1
  72. package/dist/browser/customization/streamingModels.d.ts.map +1 -1
  73. package/dist/browser/customization/streamingModels.js.map +1 -1
  74. package/dist/browser/customization/streamingWireModels.d.ts +2 -1
  75. package/dist/browser/customization/streamingWireModels.d.ts.map +1 -1
  76. package/dist/browser/customization/streamingWireModels.js.map +1 -1
  77. package/dist/browser/generated/src/models.d.ts +131 -150
  78. package/dist/browser/generated/src/models.d.ts.map +1 -1
  79. package/dist/browser/generated/src/models.js.map +1 -1
  80. package/dist/browser/generated/src/outputModels.d.ts +187 -36
  81. package/dist/browser/generated/src/outputModels.d.ts.map +1 -1
  82. package/dist/browser/generated/src/outputModels.js.map +1 -1
  83. package/dist/browser/generated/src/paginateHelper.d.ts +27 -2
  84. package/dist/browser/generated/src/paginateHelper.d.ts.map +1 -1
  85. package/dist/browser/generated/src/paginateHelper.js +98 -1
  86. package/dist/browser/generated/src/paginateHelper.js.map +1 -1
  87. package/dist/browser/generated/src/projectsClient.d.ts +2 -2
  88. package/dist/browser/generated/src/projectsClient.d.ts.map +1 -1
  89. package/dist/browser/generated/src/projectsClient.js +3 -3
  90. package/dist/browser/generated/src/projectsClient.js.map +1 -1
  91. package/dist/commonjs/agents/assistants.d.ts.map +1 -1
  92. package/dist/commonjs/agents/assistants.js +3 -1
  93. package/dist/commonjs/agents/assistants.js.map +1 -1
  94. package/dist/commonjs/agents/customModels.d.ts +4 -29
  95. package/dist/commonjs/agents/customModels.d.ts.map +1 -1
  96. package/dist/commonjs/agents/customModels.js.map +1 -1
  97. package/dist/commonjs/agents/files.d.ts +5 -4
  98. package/dist/commonjs/agents/files.d.ts.map +1 -1
  99. package/dist/commonjs/agents/files.js +55 -26
  100. package/dist/commonjs/agents/files.js.map +1 -1
  101. package/dist/commonjs/agents/index.d.ts +10 -10
  102. package/dist/commonjs/agents/index.d.ts.map +1 -1
  103. package/dist/commonjs/agents/index.js.map +1 -1
  104. package/dist/commonjs/agents/inputOutputs.d.ts +3 -3
  105. package/dist/commonjs/agents/inputOutputs.d.ts.map +1 -1
  106. package/dist/commonjs/agents/inputOutputs.js.map +1 -1
  107. package/dist/commonjs/agents/inputValidations.d.ts.map +1 -1
  108. package/dist/commonjs/agents/inputValidations.js +2 -1
  109. package/dist/commonjs/agents/inputValidations.js.map +1 -1
  110. package/dist/commonjs/agents/messages.js +2 -2
  111. package/dist/commonjs/agents/messages.js.map +1 -1
  112. package/dist/commonjs/agents/openAIError.d.ts.map +1 -1
  113. package/dist/commonjs/agents/openAIError.js +7 -1
  114. package/dist/commonjs/agents/openAIError.js.map +1 -1
  115. package/dist/commonjs/agents/poller.d.ts +8 -33
  116. package/dist/commonjs/agents/poller.d.ts.map +1 -1
  117. package/dist/commonjs/agents/poller.js +131 -55
  118. package/dist/commonjs/agents/poller.js.map +1 -1
  119. package/dist/commonjs/agents/streamingModels.d.ts +17 -15
  120. package/dist/commonjs/agents/streamingModels.d.ts.map +1 -1
  121. package/dist/commonjs/agents/streamingModels.js.map +1 -1
  122. package/dist/commonjs/agents/traceUtility.d.ts +3 -3
  123. package/dist/commonjs/agents/traceUtility.d.ts.map +1 -1
  124. package/dist/commonjs/agents/traceUtility.js.map +1 -1
  125. package/dist/commonjs/agents/utils.d.ts +53 -3
  126. package/dist/commonjs/agents/utils.d.ts.map +1 -1
  127. package/dist/commonjs/agents/utils.js +77 -2
  128. package/dist/commonjs/agents/utils.js.map +1 -1
  129. package/dist/commonjs/agents/vectorStores.d.ts +3 -4
  130. package/dist/commonjs/agents/vectorStores.d.ts.map +1 -1
  131. package/dist/commonjs/agents/vectorStores.js +43 -25
  132. package/dist/commonjs/agents/vectorStores.js.map +1 -1
  133. package/dist/commonjs/agents/vectorStoresFileBatches.d.ts +5 -4
  134. package/dist/commonjs/agents/vectorStoresFileBatches.d.ts.map +1 -1
  135. package/dist/commonjs/agents/vectorStoresFileBatches.js +46 -31
  136. package/dist/commonjs/agents/vectorStoresFileBatches.js.map +1 -1
  137. package/dist/commonjs/agents/vectorStoresFiles.d.ts +4 -4
  138. package/dist/commonjs/agents/vectorStoresFiles.d.ts.map +1 -1
  139. package/dist/commonjs/agents/vectorStoresFiles.js +56 -27
  140. package/dist/commonjs/agents/vectorStoresFiles.js.map +1 -1
  141. package/dist/commonjs/constants.d.ts +1 -1
  142. package/dist/commonjs/constants.js +1 -1
  143. package/dist/commonjs/constants.js.map +1 -1
  144. package/dist/commonjs/customization/convertModelsToWrite.d.ts.map +1 -1
  145. package/dist/commonjs/customization/convertModelsToWrite.js +42 -93
  146. package/dist/commonjs/customization/convertModelsToWrite.js.map +1 -1
  147. package/dist/commonjs/customization/convertOutputModelsFromWire.d.ts.map +1 -1
  148. package/dist/commonjs/customization/convertOutputModelsFromWire.js +51 -9
  149. package/dist/commonjs/customization/convertOutputModelsFromWire.js.map +1 -1
  150. package/dist/commonjs/customization/convertParametersToWire.d.ts +1 -1
  151. package/dist/commonjs/customization/convertParametersToWire.d.ts.map +1 -1
  152. package/dist/commonjs/customization/convertParametersToWire.js.map +1 -1
  153. package/dist/commonjs/customization/models.d.ts +146 -151
  154. package/dist/commonjs/customization/models.d.ts.map +1 -1
  155. package/dist/commonjs/customization/models.js.map +1 -1
  156. package/dist/commonjs/customization/outputModels.d.ts +188 -37
  157. package/dist/commonjs/customization/outputModels.d.ts.map +1 -1
  158. package/dist/commonjs/customization/outputModels.js.map +1 -1
  159. package/dist/commonjs/customization/streamingModels.d.ts +2 -1
  160. package/dist/commonjs/customization/streamingModels.d.ts.map +1 -1
  161. package/dist/commonjs/customization/streamingModels.js.map +1 -1
  162. package/dist/commonjs/customization/streamingWireModels.d.ts +2 -1
  163. package/dist/commonjs/customization/streamingWireModels.d.ts.map +1 -1
  164. package/dist/commonjs/customization/streamingWireModels.js.map +1 -1
  165. package/dist/commonjs/generated/src/models.d.ts +131 -150
  166. package/dist/commonjs/generated/src/models.d.ts.map +1 -1
  167. package/dist/commonjs/generated/src/models.js.map +1 -1
  168. package/dist/commonjs/generated/src/outputModels.d.ts +187 -36
  169. package/dist/commonjs/generated/src/outputModels.d.ts.map +1 -1
  170. package/dist/commonjs/generated/src/outputModels.js.map +1 -1
  171. package/dist/commonjs/generated/src/paginateHelper.d.ts +27 -2
  172. package/dist/commonjs/generated/src/paginateHelper.d.ts.map +1 -1
  173. package/dist/commonjs/generated/src/paginateHelper.js +99 -2
  174. package/dist/commonjs/generated/src/paginateHelper.js.map +1 -1
  175. package/dist/commonjs/generated/src/projectsClient.d.ts +2 -2
  176. package/dist/commonjs/generated/src/projectsClient.d.ts.map +1 -1
  177. package/dist/commonjs/generated/src/projectsClient.js +3 -3
  178. package/dist/commonjs/generated/src/projectsClient.js.map +1 -1
  179. package/dist/commonjs/tsdoc-metadata.json +1 -1
  180. package/dist/esm/agents/assistants.d.ts.map +1 -1
  181. package/dist/esm/agents/assistants.js +3 -1
  182. package/dist/esm/agents/assistants.js.map +1 -1
  183. package/dist/esm/agents/customModels.d.ts +4 -29
  184. package/dist/esm/agents/customModels.d.ts.map +1 -1
  185. package/dist/esm/agents/customModels.js.map +1 -1
  186. package/dist/esm/agents/files.d.ts +5 -4
  187. package/dist/esm/agents/files.d.ts.map +1 -1
  188. package/dist/esm/agents/files.js +55 -27
  189. package/dist/esm/agents/files.js.map +1 -1
  190. package/dist/esm/agents/index.d.ts +10 -10
  191. package/dist/esm/agents/index.d.ts.map +1 -1
  192. package/dist/esm/agents/index.js.map +1 -1
  193. package/dist/esm/agents/inputOutputs.d.ts +3 -3
  194. package/dist/esm/agents/inputOutputs.d.ts.map +1 -1
  195. package/dist/esm/agents/inputOutputs.js.map +1 -1
  196. package/dist/esm/agents/inputValidations.d.ts.map +1 -1
  197. package/dist/esm/agents/inputValidations.js +2 -1
  198. package/dist/esm/agents/inputValidations.js.map +1 -1
  199. package/dist/esm/agents/messages.js +2 -2
  200. package/dist/esm/agents/messages.js.map +1 -1
  201. package/dist/esm/agents/openAIError.d.ts.map +1 -1
  202. package/dist/esm/agents/openAIError.js +7 -1
  203. package/dist/esm/agents/openAIError.js.map +1 -1
  204. package/dist/esm/agents/poller.d.ts +8 -33
  205. package/dist/esm/agents/poller.d.ts.map +1 -1
  206. package/dist/esm/agents/poller.js +130 -53
  207. package/dist/esm/agents/poller.js.map +1 -1
  208. package/dist/esm/agents/streamingModels.d.ts +17 -15
  209. package/dist/esm/agents/streamingModels.d.ts.map +1 -1
  210. package/dist/esm/agents/streamingModels.js.map +1 -1
  211. package/dist/esm/agents/traceUtility.d.ts +3 -3
  212. package/dist/esm/agents/traceUtility.d.ts.map +1 -1
  213. package/dist/esm/agents/traceUtility.js.map +1 -1
  214. package/dist/esm/agents/utils.d.ts +53 -3
  215. package/dist/esm/agents/utils.d.ts.map +1 -1
  216. package/dist/esm/agents/utils.js +77 -2
  217. package/dist/esm/agents/utils.js.map +1 -1
  218. package/dist/esm/agents/vectorStores.d.ts +3 -4
  219. package/dist/esm/agents/vectorStores.d.ts.map +1 -1
  220. package/dist/esm/agents/vectorStores.js +44 -26
  221. package/dist/esm/agents/vectorStores.js.map +1 -1
  222. package/dist/esm/agents/vectorStoresFileBatches.d.ts +5 -4
  223. package/dist/esm/agents/vectorStoresFileBatches.d.ts.map +1 -1
  224. package/dist/esm/agents/vectorStoresFileBatches.js +46 -32
  225. package/dist/esm/agents/vectorStoresFileBatches.js.map +1 -1
  226. package/dist/esm/agents/vectorStoresFiles.d.ts +4 -4
  227. package/dist/esm/agents/vectorStoresFiles.d.ts.map +1 -1
  228. package/dist/esm/agents/vectorStoresFiles.js +57 -28
  229. package/dist/esm/agents/vectorStoresFiles.js.map +1 -1
  230. package/dist/esm/constants.d.ts +1 -1
  231. package/dist/esm/constants.js +1 -1
  232. package/dist/esm/constants.js.map +1 -1
  233. package/dist/esm/customization/convertModelsToWrite.d.ts.map +1 -1
  234. package/dist/esm/customization/convertModelsToWrite.js +42 -93
  235. package/dist/esm/customization/convertModelsToWrite.js.map +1 -1
  236. package/dist/esm/customization/convertOutputModelsFromWire.d.ts.map +1 -1
  237. package/dist/esm/customization/convertOutputModelsFromWire.js +51 -9
  238. package/dist/esm/customization/convertOutputModelsFromWire.js.map +1 -1
  239. package/dist/esm/customization/convertParametersToWire.d.ts +1 -1
  240. package/dist/esm/customization/convertParametersToWire.d.ts.map +1 -1
  241. package/dist/esm/customization/convertParametersToWire.js.map +1 -1
  242. package/dist/esm/customization/models.d.ts +146 -151
  243. package/dist/esm/customization/models.d.ts.map +1 -1
  244. package/dist/esm/customization/models.js.map +1 -1
  245. package/dist/esm/customization/outputModels.d.ts +188 -37
  246. package/dist/esm/customization/outputModels.d.ts.map +1 -1
  247. package/dist/esm/customization/outputModels.js.map +1 -1
  248. package/dist/esm/customization/streamingModels.d.ts +2 -1
  249. package/dist/esm/customization/streamingModels.d.ts.map +1 -1
  250. package/dist/esm/customization/streamingModels.js.map +1 -1
  251. package/dist/esm/customization/streamingWireModels.d.ts +2 -1
  252. package/dist/esm/customization/streamingWireModels.d.ts.map +1 -1
  253. package/dist/esm/customization/streamingWireModels.js.map +1 -1
  254. package/dist/esm/generated/src/models.d.ts +131 -150
  255. package/dist/esm/generated/src/models.d.ts.map +1 -1
  256. package/dist/esm/generated/src/models.js.map +1 -1
  257. package/dist/esm/generated/src/outputModels.d.ts +187 -36
  258. package/dist/esm/generated/src/outputModels.d.ts.map +1 -1
  259. package/dist/esm/generated/src/outputModels.js.map +1 -1
  260. package/dist/esm/generated/src/paginateHelper.d.ts +27 -2
  261. package/dist/esm/generated/src/paginateHelper.d.ts.map +1 -1
  262. package/dist/esm/generated/src/paginateHelper.js +98 -1
  263. package/dist/esm/generated/src/paginateHelper.js.map +1 -1
  264. package/dist/esm/generated/src/projectsClient.d.ts +2 -2
  265. package/dist/esm/generated/src/projectsClient.d.ts.map +1 -1
  266. package/dist/esm/generated/src/projectsClient.js +3 -3
  267. package/dist/esm/generated/src/projectsClient.js.map +1 -1
  268. package/dist/react-native/agents/assistants.d.ts.map +1 -1
  269. package/dist/react-native/agents/assistants.js +3 -1
  270. package/dist/react-native/agents/assistants.js.map +1 -1
  271. package/dist/react-native/agents/customModels.d.ts +4 -29
  272. package/dist/react-native/agents/customModels.d.ts.map +1 -1
  273. package/dist/react-native/agents/customModels.js.map +1 -1
  274. package/dist/react-native/agents/files.d.ts +5 -4
  275. package/dist/react-native/agents/files.d.ts.map +1 -1
  276. package/dist/react-native/agents/files.js +55 -27
  277. package/dist/react-native/agents/files.js.map +1 -1
  278. package/dist/react-native/agents/index.d.ts +10 -10
  279. package/dist/react-native/agents/index.d.ts.map +1 -1
  280. package/dist/react-native/agents/index.js.map +1 -1
  281. package/dist/react-native/agents/inputOutputs.d.ts +3 -3
  282. package/dist/react-native/agents/inputOutputs.d.ts.map +1 -1
  283. package/dist/react-native/agents/inputOutputs.js.map +1 -1
  284. package/dist/react-native/agents/inputValidations.d.ts.map +1 -1
  285. package/dist/react-native/agents/inputValidations.js +2 -1
  286. package/dist/react-native/agents/inputValidations.js.map +1 -1
  287. package/dist/react-native/agents/messages.js +2 -2
  288. package/dist/react-native/agents/messages.js.map +1 -1
  289. package/dist/react-native/agents/openAIError.d.ts.map +1 -1
  290. package/dist/react-native/agents/openAIError.js +7 -1
  291. package/dist/react-native/agents/openAIError.js.map +1 -1
  292. package/dist/react-native/agents/poller.d.ts +8 -33
  293. package/dist/react-native/agents/poller.d.ts.map +1 -1
  294. package/dist/react-native/agents/poller.js +130 -53
  295. package/dist/react-native/agents/poller.js.map +1 -1
  296. package/dist/react-native/agents/streamingModels.d.ts +17 -15
  297. package/dist/react-native/agents/streamingModels.d.ts.map +1 -1
  298. package/dist/react-native/agents/streamingModels.js.map +1 -1
  299. package/dist/react-native/agents/traceUtility.d.ts +3 -3
  300. package/dist/react-native/agents/traceUtility.d.ts.map +1 -1
  301. package/dist/react-native/agents/traceUtility.js.map +1 -1
  302. package/dist/react-native/agents/utils.d.ts +53 -3
  303. package/dist/react-native/agents/utils.d.ts.map +1 -1
  304. package/dist/react-native/agents/utils.js +77 -2
  305. package/dist/react-native/agents/utils.js.map +1 -1
  306. package/dist/react-native/agents/vectorStores.d.ts +3 -4
  307. package/dist/react-native/agents/vectorStores.d.ts.map +1 -1
  308. package/dist/react-native/agents/vectorStores.js +44 -26
  309. package/dist/react-native/agents/vectorStores.js.map +1 -1
  310. package/dist/react-native/agents/vectorStoresFileBatches.d.ts +5 -4
  311. package/dist/react-native/agents/vectorStoresFileBatches.d.ts.map +1 -1
  312. package/dist/react-native/agents/vectorStoresFileBatches.js +46 -32
  313. package/dist/react-native/agents/vectorStoresFileBatches.js.map +1 -1
  314. package/dist/react-native/agents/vectorStoresFiles.d.ts +4 -4
  315. package/dist/react-native/agents/vectorStoresFiles.d.ts.map +1 -1
  316. package/dist/react-native/agents/vectorStoresFiles.js +57 -28
  317. package/dist/react-native/agents/vectorStoresFiles.js.map +1 -1
  318. package/dist/react-native/constants.d.ts +1 -1
  319. package/dist/react-native/constants.js +1 -1
  320. package/dist/react-native/constants.js.map +1 -1
  321. package/dist/react-native/customization/convertModelsToWrite.d.ts.map +1 -1
  322. package/dist/react-native/customization/convertModelsToWrite.js +42 -93
  323. package/dist/react-native/customization/convertModelsToWrite.js.map +1 -1
  324. package/dist/react-native/customization/convertOutputModelsFromWire.d.ts.map +1 -1
  325. package/dist/react-native/customization/convertOutputModelsFromWire.js +51 -9
  326. package/dist/react-native/customization/convertOutputModelsFromWire.js.map +1 -1
  327. package/dist/react-native/customization/convertParametersToWire.d.ts +1 -1
  328. package/dist/react-native/customization/convertParametersToWire.d.ts.map +1 -1
  329. package/dist/react-native/customization/convertParametersToWire.js.map +1 -1
  330. package/dist/react-native/customization/models.d.ts +146 -151
  331. package/dist/react-native/customization/models.d.ts.map +1 -1
  332. package/dist/react-native/customization/models.js.map +1 -1
  333. package/dist/react-native/customization/outputModels.d.ts +188 -37
  334. package/dist/react-native/customization/outputModels.d.ts.map +1 -1
  335. package/dist/react-native/customization/outputModels.js.map +1 -1
  336. package/dist/react-native/customization/streamingModels.d.ts +2 -1
  337. package/dist/react-native/customization/streamingModels.d.ts.map +1 -1
  338. package/dist/react-native/customization/streamingModels.js.map +1 -1
  339. package/dist/react-native/customization/streamingWireModels.d.ts +2 -1
  340. package/dist/react-native/customization/streamingWireModels.d.ts.map +1 -1
  341. package/dist/react-native/customization/streamingWireModels.js.map +1 -1
  342. package/dist/react-native/generated/src/models.d.ts +131 -150
  343. package/dist/react-native/generated/src/models.d.ts.map +1 -1
  344. package/dist/react-native/generated/src/models.js.map +1 -1
  345. package/dist/react-native/generated/src/outputModels.d.ts +187 -36
  346. package/dist/react-native/generated/src/outputModels.d.ts.map +1 -1
  347. package/dist/react-native/generated/src/outputModels.js.map +1 -1
  348. package/dist/react-native/generated/src/paginateHelper.d.ts +27 -2
  349. package/dist/react-native/generated/src/paginateHelper.d.ts.map +1 -1
  350. package/dist/react-native/generated/src/paginateHelper.js +98 -1
  351. package/dist/react-native/generated/src/paginateHelper.js.map +1 -1
  352. package/dist/react-native/generated/src/projectsClient.d.ts +2 -2
  353. package/dist/react-native/generated/src/projectsClient.d.ts.map +1 -1
  354. package/dist/react-native/generated/src/projectsClient.js +3 -3
  355. package/dist/react-native/generated/src/projectsClient.js.map +1 -1
  356. package/package.json +33 -34
@@ -1,8 +1,8 @@
1
- import type { AzureAISearchToolDefinition, CodeInterpreterToolDefinition, FileSearchToolDefinition, FileSearchToolDefinitionDetails, FunctionDefinition, FunctionToolDefinition, RequiredActionOutput, RequiredToolCallOutput, ToolDefinition, ToolDefinitionOutputParent, ToolResources, VectorStoreConfigurations, VectorStoreDataSource } from "./inputOutputs.js";
1
+ import type { AzureAISearchToolDefinition, AzureFunctionToolDefinition, CodeInterpreterToolDefinition, FileSearchToolDefinition, FileSearchToolDefinitionDetails, FunctionDefinition, FunctionToolDefinition, OpenApiFunctionDefinition, OpenApiToolDefinition, RequiredActionOutput, RequiredToolCallOutput, ToolDefinition, ToolDefinitionOutputParent, ToolResources, VectorStoreConfigurations, VectorStoreDataSource, AzureFunctionStorageQueue, AzureFunctionDefinition } from "./inputOutputs.js";
2
2
  /**
3
3
  * Determines if the given output is of the specified type.
4
4
  *
5
- * @template T - The type to check against, which extends one of the possible output parent types.
5
+ * @typeParam T - The type to check against, which extends one of the possible output parent types.
6
6
  * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.
7
7
  * @param type - The type to check the action against.
8
8
  * @returns A boolean indicating whether the action is of the specified type.
@@ -17,7 +17,9 @@ export declare enum connectionToolType {
17
17
  /** Microsoft Fabric tool */
18
18
  MicrosoftFabric = "microsoft_fabric",
19
19
  /** Sharepoint tool */
20
- SharepointGrounding = "sharepoint_grounding"
20
+ SharepointGrounding = "sharepoint_grounding",
21
+ /** Azure Function tool */
22
+ AzureFunction = "azure_function"
21
23
  }
22
24
  /**
23
25
  * Utility class for creating various tools.
@@ -58,6 +60,19 @@ export declare class ToolUtility {
58
60
  definition: CodeInterpreterToolDefinition;
59
61
  resources: ToolResources;
60
62
  };
63
+ /**
64
+ * Creates an Azure Function tool
65
+ * @param name - The name of the Azure Function.
66
+ * @param description - The description of the Azure Function.
67
+ * @param parameters - The parameters of the Azure Function.
68
+ * @param inputQueue - The input queue configuration.
69
+ * @param outputQueue - The output queue configuration.
70
+ * @returns An object containing the definition and resources for the Azure Function tool.
71
+ */
72
+ static createAzureFunctionTool(name: string, description: string, parameters: unknown, inputQueue: AzureFunctionStorageQueue, outputQueue: AzureFunctionStorageQueue, definitionDetails: AzureFunctionDefinition): {
73
+ definition: AzureFunctionToolDefinition;
74
+ resources: ToolResources;
75
+ };
61
76
  /**
62
77
  * Creates an Azure AI search tool
63
78
  *
@@ -80,6 +95,16 @@ export declare class ToolUtility {
80
95
  static createFunctionTool(functionDefinition: FunctionDefinition): {
81
96
  definition: FunctionToolDefinition;
82
97
  };
98
+ /**
99
+ * Creates an OpenApi tool
100
+ *
101
+ * @param openApiFunctionDefinition - The OpenApi function definition to use.
102
+ *
103
+ * @returns An object containing the definition for the OpenApi tool.
104
+ */
105
+ static createOpenApiTool(openApiFunctionDefinition: OpenApiFunctionDefinition): {
106
+ definition: OpenApiToolDefinition;
107
+ };
83
108
  }
84
109
  /**
85
110
  * Represents a set of tools with their definitions and resources.
@@ -137,5 +162,30 @@ export declare class ToolSet {
137
162
  definition: AzureAISearchToolDefinition;
138
163
  resources: ToolResources;
139
164
  };
165
+ /**
166
+ * Adds an OpenApi tool to the tool set.
167
+ *
168
+ * @param openApiFunctionDefinition - The OpenApi function definition to use.
169
+ *
170
+ * @returns An object containing the definition for the OpenApi tool
171
+ */
172
+ addOpenApiTool(openApiFunctionDefinition: OpenApiFunctionDefinition): {
173
+ definition: OpenApiToolDefinition;
174
+ };
175
+ /**
176
+ * Adds an Azure Function tool to the tool set.
177
+ *
178
+ * @param name - The name of the Azure Function.
179
+ * @param description - The description of the Azure Function.
180
+ * @param parameters - The parameters of the Azure Function.
181
+ * @param inputQueue - The input queue configuration.
182
+ * @param outputQueue - The output queue configuration.
183
+ *
184
+ * @returns An object containing the definition and resources for the Azure Function tool.
185
+ */
186
+ addAzureFunctionTool(name: string, description: string, parameters: unknown, inputQueue: AzureFunctionStorageQueue, outputQueue: AzureFunctionStorageQueue, definitionDetails: AzureFunctionDefinition): {
187
+ definition: AzureFunctionToolDefinition;
188
+ resources: ToolResources;
189
+ };
140
190
  }
141
191
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,EAC/B,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,cAAc,EACd,0BAA0B,EAC1B,aAAa,EACb,yBAAyB,EACzB,qBAAqB,EACtB,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;;;;;;OAOG;IACH,oBAAoB,CAClB,iBAAiB,EAAE,MAAM,EACzB,SAAS,EAAE,MAAM,GAChB;QAAE,UAAU,EAAE,2BAA2B,CAAC;QAAC,SAAS,EAAE,aAAa,CAAA;KAAE;IAOxE;;;;;;OAMG;IACH,cAAc,CAAC,yBAAyB,EAAE,yBAAyB,GAAG;QACpE,UAAU,EAAE,qBAAqB,CAAC;KACnC;IAMD;;;;;;;;;;OAUG;IACH,oBAAoB,CAClB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,OAAO,EACnB,UAAU,EAAE,yBAAyB,EACrC,WAAW,EAAE,yBAAyB,EACtC,iBAAiB,EAAE,uBAAuB,GACzC;QAAE,UAAU,EAAE,2BAA2B,CAAC;QAAC,SAAS,EAAE,aAAa,CAAA;KAAE;CAazE"}
@@ -7,7 +7,7 @@ exports.isOutputOfType = isOutputOfType;
7
7
  /**
8
8
  * Determines if the given output is of the specified type.
9
9
  *
10
- * @template T - The type to check against, which extends one of the possible output parent types.
10
+ * @typeParam T - The type to check against, which extends one of the possible output parent types.
11
11
  * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.
12
12
  * @param type - The type to check the action against.
13
13
  * @returns A boolean indicating whether the action is of the specified type.
@@ -24,7 +24,15 @@ var connectionToolType;
24
24
  connectionToolType["MicrosoftFabric"] = "microsoft_fabric";
25
25
  /** Sharepoint tool */
26
26
  connectionToolType["SharepointGrounding"] = "sharepoint_grounding";
27
+ /** Azure Function tool */
28
+ connectionToolType["AzureFunction"] = "azure_function";
27
29
  })(connectionToolType || (exports.connectionToolType = connectionToolType = {}));
30
+ const toolMap = {
31
+ bing_grounding: "bingGrounding",
32
+ microsoft_fabric: "microsoftFabric",
33
+ sharepoint_grounding: "sharepointGrounding",
34
+ azure_function: "azureFunction",
35
+ };
28
36
  /**
29
37
  * Utility class for creating various tools.
30
38
  */
@@ -40,7 +48,7 @@ class ToolUtility {
40
48
  return {
41
49
  definition: {
42
50
  type: toolType,
43
- [toolType]: {
51
+ [toolMap[toolType]]: {
44
52
  connections: connectionIds.map((connectionId) => ({ connectionId: connectionId })),
45
53
  },
46
54
  },
@@ -78,6 +86,29 @@ class ToolUtility {
78
86
  resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },
79
87
  };
80
88
  }
89
+ /**
90
+ * Creates an Azure Function tool
91
+ * @param name - The name of the Azure Function.
92
+ * @param description - The description of the Azure Function.
93
+ * @param parameters - The parameters of the Azure Function.
94
+ * @param inputQueue - The input queue configuration.
95
+ * @param outputQueue - The output queue configuration.
96
+ * @returns An object containing the definition and resources for the Azure Function tool.
97
+ */
98
+ static createAzureFunctionTool(name, description, parameters, inputQueue, outputQueue, definitionDetails) {
99
+ return {
100
+ definition: { type: "azure_function", azureFunction: definitionDetails },
101
+ resources: {
102
+ azureFunction: {
103
+ name: name,
104
+ description: description,
105
+ parameters: parameters,
106
+ inputQueue: inputQueue,
107
+ outputQueue: outputQueue,
108
+ },
109
+ },
110
+ };
111
+ }
81
112
  /**
82
113
  * Creates an Azure AI search tool
83
114
  *
@@ -111,6 +142,21 @@ class ToolUtility {
111
142
  },
112
143
  };
113
144
  }
145
+ /**
146
+ * Creates an OpenApi tool
147
+ *
148
+ * @param openApiFunctionDefinition - The OpenApi function definition to use.
149
+ *
150
+ * @returns An object containing the definition for the OpenApi tool.
151
+ */
152
+ static createOpenApiTool(openApiFunctionDefinition) {
153
+ return {
154
+ definition: {
155
+ type: "openapi",
156
+ openapi: openApiFunctionDefinition,
157
+ },
158
+ };
159
+ }
114
160
  }
115
161
  exports.ToolUtility = ToolUtility;
116
162
  /**
@@ -179,6 +225,35 @@ class ToolSet {
179
225
  this.toolResources = Object.assign(Object.assign({}, this.toolResources), tool.resources);
180
226
  return tool;
181
227
  }
228
+ /**
229
+ * Adds an OpenApi tool to the tool set.
230
+ *
231
+ * @param openApiFunctionDefinition - The OpenApi function definition to use.
232
+ *
233
+ * @returns An object containing the definition for the OpenApi tool
234
+ */
235
+ addOpenApiTool(openApiFunctionDefinition) {
236
+ const tool = ToolUtility.createOpenApiTool(openApiFunctionDefinition);
237
+ this.toolDefinitions.push(tool.definition);
238
+ return tool;
239
+ }
240
+ /**
241
+ * Adds an Azure Function tool to the tool set.
242
+ *
243
+ * @param name - The name of the Azure Function.
244
+ * @param description - The description of the Azure Function.
245
+ * @param parameters - The parameters of the Azure Function.
246
+ * @param inputQueue - The input queue configuration.
247
+ * @param outputQueue - The output queue configuration.
248
+ *
249
+ * @returns An object containing the definition and resources for the Azure Function tool.
250
+ */
251
+ addAzureFunctionTool(name, description, parameters, inputQueue, outputQueue, definitionDetails) {
252
+ const tool = ToolUtility.createAzureFunctionTool(name, description, parameters, inputQueue, outputQueue, definitionDetails);
253
+ this.toolDefinitions.push(tool.definition);
254
+ this.toolResources = Object.assign(Object.assign({}, this.toolResources), tool.resources);
255
+ return tool;
256
+ }
182
257
  }
183
258
  exports.ToolSet = ToolSet;
184
259
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA0BlC,wCAKC;AAbD;;;;;;;GAOG;AACH,SAAgB,cAAc,CAC5B,MAAkF,EAClF,IAAY;IAEZ,OAAO,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAC9B,CAAC;AAED,2DAA2D;AAC3D,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,iCAAiC;IACjC,sDAAgC,CAAA;IAChC,4BAA4B;IAC5B,0DAAoC,CAAA;IACpC,sBAAsB;IACtB,kEAA4C,CAAA;AAC9C,CAAC,EAPW,kBAAkB,kCAAlB,kBAAkB,QAO7B;AAED;;GAEG;AACH,MAAa,WAAW;IACtB;;;;;;OAMG;IACH,MAAM,CAAC,oBAAoB,CACzB,QAA4B,EAC5B,aAAuB;QAEvB,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,CAAC;IAED;;;;;;;OAOG;IACH,oBAAoB,CAClB,iBAAyB,EACzB,SAAiB;QAEjB,MAAM,IAAI,GAAG,WAAW,CAAC,uBAAuB,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;QAC/E,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA/ED,0BA+EC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AzureAISearchToolDefinition,\n CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n RequiredActionOutput,\n RequiredToolCallOutput,\n ToolDefinition,\n ToolDefinitionOutputParent,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n} from \"./inputOutputs.js\";\n\n/**\n * Determines if the given output is of the specified type.\n *\n * @template T - The type to check against, which extends one of the possible output parent types.\n * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.\n * @param type - The type to check the action against.\n * @returns A boolean indicating whether the action is of the specified type.\n */\nexport function isOutputOfType<T extends { type: string }>(\n output: RequiredActionOutput | RequiredToolCallOutput | ToolDefinitionOutputParent,\n type: string,\n): output is T {\n return output.type === type;\n}\n\n/** Types of connection tools used to configure an agent */\nexport enum connectionToolType {\n /** Bing grounding search tool */\n BingGrounding = \"bing_grounding\",\n /** Microsoft Fabric tool */\n MicrosoftFabric = \"microsoft_fabric\",\n /** Sharepoint tool */\n SharepointGrounding = \"sharepoint_grounding\",\n}\n\n/**\n * Utility class for creating various tools.\n */\nexport class ToolUtility {\n /**\n * Creates a connection tool\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n * @returns An object containing the definition for the connection tool\n */\n static createConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n return {\n definition: {\n type: toolType,\n [toolType]: {\n connections: connectionIds.map((connectionId) => ({ connectionId: connectionId })),\n },\n },\n };\n }\n\n /**\n * Creates a file search tool\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n static createFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"file_search\", fileSearch: definitionDetails },\n resources: { fileSearch: { vectorStoreIds: vectorStoreIds, vectorStores: vectorStores } },\n };\n }\n\n /**\n * Creates a code interpreter tool\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool.\n */\n static createCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n if (fileIds && dataSources) {\n throw new Error(\"Cannot specify both fileIds and dataSources\");\n }\n\n return {\n definition: { type: \"code_interpreter\" },\n resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },\n };\n }\n\n /**\n * Creates an Azure AI search tool\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool.\n */\n static createAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexes: [{ indexConnectionId: indexConnectionId, indexName: indexName }],\n },\n },\n };\n }\n\n /**\n * Creates a function tool\n *\n * @param functionDefinition - The function definition to use.\n *\n * @returns An object containing the definition for the function tool.\n */\n static createFunctionTool(functionDefinition: FunctionDefinition): {\n definition: FunctionToolDefinition;\n } {\n return {\n definition: {\n type: \"function\",\n function: functionDefinition,\n },\n };\n }\n}\n\n/**\n * Represents a set of tools with their definitions and resources.\n */\nexport class ToolSet {\n /** A list of tool definitions that have been added to the tool set. */\n toolDefinitions: ToolDefinition[] = [];\n\n /** A collection of resources associated with the tools in the tool set. */\n toolResources: ToolResources = {};\n\n /**\n * Adds a connection tool to the tool set.\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n *\n * @returns An object containing the definition for the connection tool\n */\n addConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n const tool = ToolUtility.createConnectionTool(toolType, connectionIds);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds a file search tool to the tool set.\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n addFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createFileSearchTool(vectorStoreIds, vectorStores, definitionDetails);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds a code interpreter tool to the tool set.\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool\n */\n addCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createCodeInterpreterTool(fileIds, dataSources);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds an Azure AI search tool to the tool set.\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool\n */\n addAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createAzureAISearchTool(indexConnectionId, indexName);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA+BlC,wCAKC;AAbD;;;;;;;GAOG;AACH,SAAgB,cAAc,CAC5B,MAAkF,EAClF,IAAY;IAEZ,OAAO,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAC9B,CAAC;AAED,2DAA2D;AAC3D,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,iCAAiC;IACjC,sDAAgC,CAAA;IAChC,4BAA4B;IAC5B,0DAAoC,CAAA;IACpC,sBAAsB;IACtB,kEAA4C,CAAA;IAC5C,0BAA0B;IAC1B,sDAAgC,CAAA;AAClC,CAAC,EATW,kBAAkB,kCAAlB,kBAAkB,QAS7B;AAED,MAAM,OAAO,GAAG;IACd,cAAc,EAAE,eAAe;IAC/B,gBAAgB,EAAE,iB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AC;QACtE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;OAUG;IACH,oBAAoB,CAClB,IAAY,EACZ,WAAmB,EACnB,UAAmB,EACnB,UAAqC,EACrC,WAAsC,EACtC,iBAA0C;QAE1C,MAAM,IAAI,GAAG,WAAW,CAAC,uBAAuB,CAC9C,IAAI,EACJ,WAAW,EACX,UAAU,EACV,UAAU,EACV,WAAW,EACX,iBAAiB,CAClB,CAAC;QACF,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA9HD,0BA8HC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AzureAISearchToolDefinition,\n AzureFunctionToolDefinition,\n CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n OpenApiFunctionDefinition,\n OpenApiToolDefinition,\n RequiredActionOutput,\n RequiredToolCallOutput,\n ToolDefinition,\n ToolDefinitionOutputParent,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n AzureFunctionStorageQueue,\n AzureFunctionDefinition,\n} from \"./inputOutputs.js\";\n\n/**\n * Determines if the given output is of the specified type.\n *\n * @typeParam T - The type to check against, which extends one of the possible output parent types.\n * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.\n * @param type - The type to check the action against.\n * @returns A boolean indicating whether the action is of the specified type.\n */\nexport function isOutputOfType<T extends { type: string }>(\n output: RequiredActionOutput | RequiredToolCallOutput | ToolDefinitionOutputParent,\n type: string,\n): output is T {\n return output.type === type;\n}\n\n/** Types of connection tools used to configure an agent */\nexport enum connectionToolType {\n /** Bing grounding search tool */\n BingGrounding = \"bing_grounding\",\n /** Microsoft Fabric tool */\n MicrosoftFabric = \"microsoft_fabric\",\n /** Sharepoint tool */\n SharepointGrounding = \"sharepoint_grounding\",\n /** Azure Function tool */\n AzureFunction = \"azure_function\",\n}\n\nconst toolMap = {\n bing_grounding: \"bingGrounding\",\n microsoft_fabric: \"microsoftFabric\",\n sharepoint_grounding: \"sharepointGrounding\",\n azure_function: \"azureFunction\",\n};\n\n/**\n * Utility class for creating various tools.\n */\nexport class ToolUtility {\n /**\n * Creates a connection tool\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n * @returns An object containing the definition for the connection tool\n */\n static createConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n return {\n definition: {\n type: toolType,\n [toolMap[toolType]]: {\n connections: connectionIds.map((connectionId) => ({ connectionId: connectionId })),\n },\n },\n };\n }\n\n /**\n * Creates a file search tool\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n static createFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"file_search\", fileSearch: definitionDetails },\n resources: { fileSearch: { vectorStoreIds: vectorStoreIds, vectorStores: vectorStores } },\n };\n }\n\n /**\n * Creates a code interpreter tool\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool.\n */\n static createCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n if (fileIds && dataSources) {\n throw new Error(\"Cannot specify both fileIds and dataSources\");\n }\n\n return {\n definition: { type: \"code_interpreter\" },\n resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },\n };\n }\n\n /**\n * Creates an Azure Function tool\n * @param name - The name of the Azure Function.\n * @param description - The description of the Azure Function.\n * @param parameters - The parameters of the Azure Function.\n * @param inputQueue - The input queue configuration.\n * @param outputQueue - The output queue configuration.\n * @returns An object containing the definition and resources for the Azure Function tool.\n */\n static createAzureFunctionTool(\n name: string,\n description: string,\n parameters: unknown,\n inputQueue: AzureFunctionStorageQueue,\n outputQueue: AzureFunctionStorageQueue,\n definitionDetails: AzureFunctionDefinition,\n ): { definition: AzureFunctionToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_function\", azureFunction: definitionDetails },\n resources: {\n azureFunction: {\n name: name,\n description: description,\n parameters: parameters,\n inputQueue: inputQueue,\n outputQueue: outputQueue,\n },\n },\n };\n }\n /**\n * Creates an Azure AI search tool\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool.\n */\n static createAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexes: [{ indexConnectionId: indexConnectionId, indexName: indexName }],\n },\n },\n };\n }\n\n /**\n * Creates a function tool\n *\n * @param functionDefinition - The function definition to use.\n *\n * @returns An object containing the definition for the function tool.\n */\n static createFunctionTool(functionDefinition: FunctionDefinition): {\n definition: FunctionToolDefinition;\n } {\n return {\n definition: {\n type: \"function\",\n function: functionDefinition,\n },\n };\n }\n\n /**\n * Creates an OpenApi tool\n *\n * @param openApiFunctionDefinition - The OpenApi function definition to use.\n *\n * @returns An object containing the definition for the OpenApi tool.\n */\n static createOpenApiTool(openApiFunctionDefinition: OpenApiFunctionDefinition): {\n definition: OpenApiToolDefinition;\n } {\n return {\n definition: {\n type: \"openapi\",\n openapi: openApiFunctionDefinition,\n },\n };\n }\n}\n\n/**\n * Represents a set of tools with their definitions and resources.\n */\nexport class ToolSet {\n /** A list of tool definitions that have been added to the tool set. */\n toolDefinitions: ToolDefinition[] = [];\n\n /** A collection of resources associated with the tools in the tool set. */\n toolResources: ToolResources = {};\n\n /**\n * Adds a connection tool to the tool set.\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n *\n * @returns An object containing the definition for the connection tool\n */\n addConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n const tool = ToolUtility.createConnectionTool(toolType, connectionIds);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds a file search tool to the tool set.\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n addFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createFileSearchTool(vectorStoreIds, vectorStores, definitionDetails);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds a code interpreter tool to the tool set.\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool\n */\n addCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createCodeInterpreterTool(fileIds, dataSources);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds an Azure AI search tool to the tool set.\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool\n */\n addAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createAzureAISearchTool(indexConnectionId, indexName);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds an OpenApi tool to the tool set.\n *\n * @param openApiFunctionDefinition - The OpenApi function definition to use.\n *\n * @returns An object containing the definition for the OpenApi tool\n */\n addOpenApiTool(openApiFunctionDefinition: OpenApiFunctionDefinition): {\n definition: OpenApiToolDefinition;\n } {\n const tool = ToolUtility.createOpenApiTool(openApiFunctionDefinition);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds an Azure Function tool to the tool set.\n *\n * @param name - The name of the Azure Function.\n * @param description - The description of the Azure Function.\n * @param parameters - The parameters of the Azure Function.\n * @param inputQueue - The input queue configuration.\n * @param outputQueue - The output queue configuration.\n *\n * @returns An object containing the definition and resources for the Azure Function tool.\n */\n addAzureFunctionTool(\n name: string,\n description: string,\n parameters: unknown,\n inputQueue: AzureFunctionStorageQueue,\n outputQueue: AzureFunctionStorageQueue,\n definitionDetails: AzureFunctionDefinition,\n ): { definition: AzureFunctionToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createAzureFunctionTool(\n name,\n description,\n parameters,\n inputQueue,\n outputQueue,\n definitionDetails,\n );\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n}\n"]}
@@ -1,12 +1,11 @@
1
1
  import type { Client } from "@azure-rest/core-client";
2
2
  import type { OpenAIPageableListOfVectorStoreOutput, VectorStoreDeletionStatusOutput, VectorStoreOutput } from "../customization/outputModels.js";
3
- import type { CreateVectorStoreWithPollingOptionalParams } from "./customModels.js";
4
3
  import { type CreateVectorStoreOptionalParams, type DeleteVectorStoreOptionalParams, type GetVectorStoreOptionalParams, type ListVectorStoresOptionalParams, type UpdateVectorStoreOptionalParams } from "./customModels.js";
5
- import type { PollerLike, PollOperationState } from "@azure/core-lro";
4
+ import type { OperationState, PollerLike } from "@azure/core-lro";
6
5
  /** Returns a list of vector stores. */
7
6
  export declare function listVectorStores(context: Client, options?: ListVectorStoresOptionalParams): Promise<OpenAIPageableListOfVectorStoreOutput>;
8
7
  /** Creates a vector store. */
9
- export declare function createVectorStore(context: Client, options?: CreateVectorStoreOptionalParams): Promise<VectorStoreOutput>;
8
+ export declare function createVectorStore(context: Client, options?: CreateVectorStoreOptionalParams): PollerLike<OperationState<VectorStoreOutput>, VectorStoreOutput>;
10
9
  /** Returns the vector store object matching the specified ID. */
11
10
  export declare function getVectorStore(context: Client, vectorStoreId: string, options?: GetVectorStoreOptionalParams): Promise<VectorStoreOutput>;
12
11
  /** The ID of the vector store to modify. */
@@ -16,5 +15,5 @@ export declare function deleteVectorStore(context: Client, vectorStoreId: string
16
15
  /**
17
16
  * Creates a vector store and poll.
18
17
  */
19
- export declare function createVectorStoreAndPoll(context: Client, options?: CreateVectorStoreWithPollingOptionalParams): PollerLike<PollOperationState<VectorStoreOutput>, VectorStoreOutput>;
18
+ export declare function createVectorStoreAndPoll(context: Client, options?: CreateVectorStoreOptionalParams): PollerLike<OperationState<VectorStoreOutput>, VectorStoreOutput>;
20
19
  //# sourceMappingURL=vectorStores.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":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AO,GAAE,+BAAoC,GAC5C,OAAO,CAAC,+BAA+B,CAAC,CAc1C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,+BAAoC,GAC5C,UAAU,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,CAWlE"}
@@ -28,14 +28,18 @@ async function listVectorStores(context, options = {}) {
28
28
  return ConvertFromWire.convertOpenAIPageableListOfVectorStoreOutput(result.body);
29
29
  }
30
30
  /** Creates a vector store. */
31
- async function createVectorStore(context, options = {}) {
32
- const createOptions = Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { body: ConvertToWire.convertVectorStoreOptions(options) });
33
- validateCreateVectorStoreParameters(createOptions);
34
- const result = await context.path("/vector_stores").post(createOptions);
35
- if (!expectedStatuses.includes(result.status)) {
36
- throw (0, openAIError_js_1.createOpenAIError)(result);
37
- }
38
- return ConvertFromWire.convertVectorStoreOutput(result.body);
31
+ function createVectorStore(context, options = {}) {
32
+ var _a;
33
+ return (0, poller_js_1.createPoller)({
34
+ initOperation: async () => {
35
+ return createVectorStoreInternal(context, options);
36
+ },
37
+ pollOperation: async (currentResult) => {
38
+ return getVectorStore(context, currentResult.id, options);
39
+ },
40
+ getOperationStatus: getLroOperationStatus,
41
+ intervalInMs: (_a = options.pollingOptions) === null || _a === void 0 ? void 0 : _a.sleepIntervalInMs,
42
+ });
39
43
  }
40
44
  /** Returns the vector store object matching the specified ID. */
41
45
  async function getVectorStore(context, vectorStoreId, options = {}) {
@@ -78,25 +82,39 @@ async function deleteVectorStore(context, vectorStoreId, options = {}) {
78
82
  * Creates a vector store and poll.
79
83
  */
80
84
  function createVectorStoreAndPoll(context, options = {}) {
81
- async function updateCreateVectorStorePoll(currentResult) {
82
- let vectorStore;
83
- if (!currentResult) {
84
- vectorStore = await createVectorStore(context, options);
85
- }
86
- else {
87
- const getOptions = Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options));
88
- vectorStore = await getVectorStore(context, currentResult.id, getOptions);
89
- }
90
- return {
91
- result: vectorStore,
92
- completed: vectorStore.status !== "in_progress",
93
- };
94
- }
95
- return new poller_js_1.AgentsPoller({
96
- update: updateCreateVectorStorePoll,
97
- pollingOptions: options.pollingOptions,
85
+ var _a;
86
+ return (0, poller_js_1.createPoller)({
87
+ initOperation: async () => {
88
+ return createVectorStoreInternal(context, options);
89
+ },
90
+ pollOperation: async (currentResult) => {
91
+ return getVectorStore(context, currentResult.id, options);
92
+ },
93
+ getOperationStatus: getLroOperationStatus,
94
+ intervalInMs: (_a = options.pollingOptions) === null || _a === void 0 ? void 0 : _a.sleepIntervalInMs,
98
95
  });
99
96
  }
97
+ async function createVectorStoreInternal(context, options = {}) {
98
+ const createOptions = Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { body: ConvertToWire.convertVectorStoreOptions(options) });
99
+ validateCreateVectorStoreParameters(createOptions);
100
+ const result = await context.path("/vector_stores").post(createOptions);
101
+ if (!expectedStatuses.includes(result.status)) {
102
+ throw (0, openAIError_js_1.createOpenAIError)(result);
103
+ }
104
+ return ConvertFromWire.convertVectorStoreOutput(result.body);
105
+ }
106
+ function getLroOperationStatus(result) {
107
+ switch (result.status) {
108
+ case "in_progress":
109
+ return "running";
110
+ case "completed":
111
+ return "succeeded";
112
+ case "expired":
113
+ return "failed";
114
+ default:
115
+ return "failed";
116
+ }
117
+ }
100
118
  function validateListVectorStoresParameters(options) {
101
119
  var _a, _b;
102
120
  if ((_a = options === null || options === void 0 ? void 0 : options.queryParameters) === null || _a === void 0 ? void 0 : _a.limit) {
@@ -1 +1 @@
1
- {"version":3,"file":"vectorStores.js","sourceRoot":"","sources":["../../../src/agents/vectorStores.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAuClC,4CAgBC;AAGD,8CAgBC;AAGD,wCAkBC;AAGD,8CAoBC;AAGD,8CAkBC;AAKD,4DA0BC;;AAv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;;IAC9E,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,IAAA,mCAAa,EAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,IAAA,mCAAa,EAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC;AAED,SAAS,mCAAmC,CAAC,OAAqC;;IAChF,IACE,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,iBAAiB;QAChC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,EAC9D,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;IAClF,CAAC;IACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,QAAQ,EAAE,CAAC;QAC5B,IAAA,sCAAgB,EAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC;AAED,SAAS,mCAAmC,CAAC,OAAqC;;IAChF,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,QAAQ,EAAE,CAAC;QAC5B,IAAA,sCAAgB,EAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client } from \"@azure-rest/core-client\";\nimport { operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nimport type {\n ListVectorStoresParameters,\n CreateVectorStoreParameters,\n ModifyVectorStoreParameters,\n} from \"../generated/src/parameters.js\";\nimport type {\n OpenAIPageableListOfVectorStoreOutput,\n VectorStoreDeletionStatusOutput,\n VectorStoreOutput,\n} from \"../customization/outputModels.js\";\nimport { AgentsPoller } from \"./poller.js\";\nimport type { CreateVectorStoreWithPollingOptionalParams } from \"./customModels.js\";\nimport {\n type CreateVectorStoreOptionalParams,\n type DeleteVectorStoreOptionalParams,\n type GetVectorStoreOptionalParams,\n type ListVectorStoresOptionalParams,\n type UpdateVectorStoreOptionalParams,\n} from \"./customModels.js\";\nimport {\n validateLimit,\n validateMetadata,\n validateOrder,\n validateVectorStoreId,\n} from \"./inputValidations.js\";\nimport type * as GeneratedParameters from \"../generated/src/parameters.js\";\nimport * as ConvertFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport * as ConvertToWire from \"../customization/convertModelsToWrite.js\";\nimport { convertToListQueryParameters } from \"../customization/convertParametersToWire.js\";\nimport { createOpenAIError } from \"./openAIError.js\";\nimport type { PollerLike, PollOperationState } from \"@azure/core-lro\";\n\nconst expectedStatuses = [\"200\"];\n\n/** Returns a list of vector stores. */\nexport async function listVectorStores(\n context: Client,\n options: ListVectorStoresOptionalParams = {},\n): Promise<OpenAIPageableListOfVectorStoreOutput> {\n const listOptions: GeneratedParameters.ListVectorStoresParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: convertToListQueryParameters(options),\n };\n\n validateListVectorStoresParameters(listOptions);\n const result = await context.path(\"/vector_stores\").get(listOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertOpenAIPageableListOfVectorStoreOutput(result.body);\n}\n\n/** Creates a vector store. */\nexport async function createVectorStore(\n context: Client,\n options: CreateVectorStoreOptionalParams = {},\n): Promise<VectorStoreOutput> {\n const createOptions: GeneratedParameters.CreateVectorStoreParameters = {\n ...operationOptionsToRequestParameters(options),\n body: ConvertToWire.convertVectorStoreOptions(options),\n };\n\n validateCreateVectorStoreParameters(createOptions);\n const result = await context.path(\"/vector_stores\").post(createOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreOutput(result.body);\n}\n\n/** Returns the vector store object matching the specified ID. */\nexport async function getVectorStore(\n context: Client,\n vectorStoreId: string,\n options: GetVectorStoreOptionalParams = {},\n): Promise<VectorStoreOutput> {\n const getOptions: GeneratedParameters.GetVectorStoreParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateVectorStoreId(vectorStoreId);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}\", vectorStoreId)\n .get(getOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreOutput(result.body);\n}\n\n/** The ID of the vector store to modify. */\nexport async function modifyVectorStore(\n context: Client,\n vectorStoreId: string,\n options: UpdateVectorStoreOptionalParams = {},\n): Promise<VectorStoreOutput> {\n const modifyOptions: GeneratedParameters.ModifyVectorStoreParameters = {\n ...operationOptionsToRequestParameters(options),\n body: ConvertToWire.convertVectorStoreUpdateOptions(options),\n };\n\n validateVectorStoreId(vectorStoreId);\n validateModifyVectorStoreParameters(modifyOptions);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}\", vectorStoreId)\n .post(modifyOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreOutput(result.body);\n}\n\n/** Deletes the vector store object matching the specified ID. */\nexport async function deleteVectorStore(\n context: Client,\n vectorStoreId: string,\n options: DeleteVectorStoreOptionalParams = {},\n): Promise<VectorStoreDeletionStatusOutput> {\n const deleteOptions: GeneratedParameters.DeleteVectorStoreParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateVectorStoreId(vectorStoreId);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}\", vectorStoreId)\n .delete(deleteOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreDeletionStatusOutput(result.body);\n}\n\n/**\n * Creates a vector store and poll.\n */\nexport function createVectorStoreAndPoll(\n context: Client,\n options: CreateVectorStoreWithPollingOptionalParams = {},\n): PollerLike<PollOperationState<VectorStoreOutput>, VectorStoreOutput> {\n async function updateCreateVectorStorePoll(\n currentResult?: VectorStoreOutput,\n ): Promise<{ result: VectorStoreOutput; completed: boolean }> {\n let vectorStore: VectorStoreOutput;\n if (!currentResult) {\n vectorStore = await createVectorStore(context, options);\n } else {\n const getOptions: GetVectorStoreOptionalParams = {\n ...operationOptionsToRequestParameters(options),\n };\n vectorStore = await getVectorStore(context, currentResult.id, getOptions);\n }\n return {\n result: vectorStore,\n completed: vectorStore.status !== \"in_progress\",\n };\n }\n\n return new AgentsPoller<VectorStoreOutput>({\n update: updateCreateVectorStorePoll,\n pollingOptions: options.pollingOptions,\n });\n}\n\nfunction validateListVectorStoresParameters(options?: ListVectorStoresParameters): void {\n if (options?.queryParameters?.limit) {\n validateLimit(options.queryParameters.limit);\n }\n if (options?.queryParameters?.order) {\n validateOrder(options.queryParameters.order);\n }\n}\n\nfunction validateCreateVectorStoreParameters(options?: CreateVectorStoreParameters): void {\n if (\n options?.body?.chunking_strategy &&\n (!options.body.file_ids || options.body.file_ids.length === 0)\n ) {\n throw new Error(\"Chunking strategy is only applicable if fileIds is non-empty\");\n }\n if (options?.body?.metadata) {\n validateMetadata(options.body.metadata);\n }\n}\n\nfunction validateModifyVectorStoreParameters(options?: ModifyVectorStoreParameters): void {\n if (options?.body?.metadata) {\n validateMetadata(options.body.metadata);\n }\n}\n"]}
1
+ {"version":3,"file":"vectorStores.js","sourceRoot":"","sources":["../../../src/agents/vectorStores.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAsClC,4CAgBC;AAGD,8CAcC;AAGD,wCAkBC;AAGD,8CAoBC;AAGD,8CAkBC;AAKD,4DAcC;;AAxJD,yDAA8E;AAW9E,2CAA2C;AAQ3C,+DAK+B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,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC;AAED,SAAS,mCAAmC,CAAC,OAAqC;;IAChF,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,QAAQ,EAAE,CAAC;QAC5B,IAAA,sCAAgB,EAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client } from \"@azure-rest/core-client\";\nimport { operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nimport type {\n ListVectorStoresParameters,\n CreateVectorStoreParameters,\n ModifyVectorStoreParameters,\n} from \"../generated/src/parameters.js\";\nimport type {\n OpenAIPageableListOfVectorStoreOutput,\n VectorStoreDeletionStatusOutput,\n VectorStoreOutput,\n} from \"../customization/outputModels.js\";\nimport { createPoller } from \"./poller.js\";\nimport {\n type CreateVectorStoreOptionalParams,\n type DeleteVectorStoreOptionalParams,\n type GetVectorStoreOptionalParams,\n type ListVectorStoresOptionalParams,\n type UpdateVectorStoreOptionalParams,\n} from \"./customModels.js\";\nimport {\n validateLimit,\n validateMetadata,\n validateOrder,\n validateVectorStoreId,\n} from \"./inputValidations.js\";\nimport type * as GeneratedParameters from \"../generated/src/parameters.js\";\nimport * as ConvertFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport * as ConvertToWire from \"../customization/convertModelsToWrite.js\";\nimport { convertToListQueryParameters } from \"../customization/convertParametersToWire.js\";\nimport { createOpenAIError } from \"./openAIError.js\";\nimport type { OperationState, OperationStatus, PollerLike } from \"@azure/core-lro\";\n\nconst expectedStatuses = [\"200\"];\n\n/** Returns a list of vector stores. */\nexport async function listVectorStores(\n context: Client,\n options: ListVectorStoresOptionalParams = {},\n): Promise<OpenAIPageableListOfVectorStoreOutput> {\n const listOptions: GeneratedParameters.ListVectorStoresParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: convertToListQueryParameters(options),\n };\n\n validateListVectorStoresParameters(listOptions);\n const result = await context.path(\"/vector_stores\").get(listOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertOpenAIPageableListOfVectorStoreOutput(result.body);\n}\n\n/** Creates a vector store. */\nexport function createVectorStore(\n context: Client,\n options: CreateVectorStoreOptionalParams = {},\n): PollerLike<OperationState<VectorStoreOutput>, VectorStoreOutput> {\n return createPoller<VectorStoreOutput>({\n initOperation: async () => {\n return createVectorStoreInternal(context, options);\n },\n pollOperation: async (currentResult: VectorStoreOutput) => {\n return getVectorStore(context, currentResult.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n intervalInMs: options.pollingOptions?.sleepIntervalInMs,\n });\n}\n\n/** Returns the vector store object matching the specified ID. */\nexport async function getVectorStore(\n context: Client,\n vectorStoreId: string,\n options: GetVectorStoreOptionalParams = {},\n): Promise<VectorStoreOutput> {\n const getOptions: GeneratedParameters.GetVectorStoreParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateVectorStoreId(vectorStoreId);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}\", vectorStoreId)\n .get(getOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreOutput(result.body);\n}\n\n/** The ID of the vector store to modify. */\nexport async function modifyVectorStore(\n context: Client,\n vectorStoreId: string,\n options: UpdateVectorStoreOptionalParams = {},\n): Promise<VectorStoreOutput> {\n const modifyOptions: GeneratedParameters.ModifyVectorStoreParameters = {\n ...operationOptionsToRequestParameters(options),\n body: ConvertToWire.convertVectorStoreUpdateOptions(options),\n };\n\n validateVectorStoreId(vectorStoreId);\n validateModifyVectorStoreParameters(modifyOptions);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}\", vectorStoreId)\n .post(modifyOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreOutput(result.body);\n}\n\n/** Deletes the vector store object matching the specified ID. */\nexport async function deleteVectorStore(\n context: Client,\n vectorStoreId: string,\n options: DeleteVectorStoreOptionalParams = {},\n): Promise<VectorStoreDeletionStatusOutput> {\n const deleteOptions: GeneratedParameters.DeleteVectorStoreParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateVectorStoreId(vectorStoreId);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}\", vectorStoreId)\n .delete(deleteOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreDeletionStatusOutput(result.body);\n}\n\n/**\n * Creates a vector store and poll.\n */\nexport function createVectorStoreAndPoll(\n context: Client,\n options: CreateVectorStoreOptionalParams = {},\n): PollerLike<OperationState<VectorStoreOutput>, VectorStoreOutput> {\n return createPoller<VectorStoreOutput>({\n initOperation: async () => {\n return createVectorStoreInternal(context, options);\n },\n pollOperation: async (currentResult: VectorStoreOutput) => {\n return getVectorStore(context, currentResult.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n intervalInMs: options.pollingOptions?.sleepIntervalInMs,\n });\n}\n\nasync function createVectorStoreInternal(\n context: Client,\n options: CreateVectorStoreOptionalParams = {},\n): Promise<VectorStoreOutput> {\n const createOptions: GeneratedParameters.CreateVectorStoreParameters = {\n ...operationOptionsToRequestParameters(options),\n body: ConvertToWire.convertVectorStoreOptions(options),\n };\n\n validateCreateVectorStoreParameters(createOptions);\n const result = await context.path(\"/vector_stores\").post(createOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreOutput(result.body);\n}\n\nfunction getLroOperationStatus(result: VectorStoreOutput): OperationStatus {\n switch (result.status) {\n case \"in_progress\":\n return \"running\";\n case \"completed\":\n return \"succeeded\";\n case \"expired\":\n return \"failed\";\n default:\n return \"failed\";\n }\n}\n\nfunction validateListVectorStoresParameters(options?: ListVectorStoresParameters): void {\n if (options?.queryParameters?.limit) {\n validateLimit(options.queryParameters.limit);\n }\n if (options?.queryParameters?.order) {\n validateOrder(options.queryParameters.order);\n }\n}\n\nfunction validateCreateVectorStoreParameters(options?: CreateVectorStoreParameters): void {\n if (\n options?.body?.chunking_strategy &&\n (!options.body.file_ids || options.body.file_ids.length === 0)\n ) {\n throw new Error(\"Chunking strategy is only applicable if fileIds is non-empty\");\n }\n if (options?.body?.metadata) {\n validateMetadata(options.body.metadata);\n }\n}\n\nfunction validateModifyVectorStoreParameters(options?: ModifyVectorStoreParameters): void {\n if (options?.body?.metadata) {\n validateMetadata(options.body.metadata);\n }\n}\n"]}
@@ -1,9 +1,9 @@
1
1
  import type { Client } from "@azure-rest/core-client";
2
2
  import type { OpenAIPageableListOfVectorStoreFileOutput, VectorStoreFileBatchOutput } from "../customization/outputModels.js";
3
- import type { CancelVectorStoreFileBatchOptionalParams, CreateVectorStoreFileBatchOptionalParams, CreateVectorStoreFileBatchWithPollingOptionalParams, GetVectorStoreFileBatchOptionalParams, ListVectorStoreFileBatchFilesOptionalParams } from "./customModels.js";
4
- import type { PollerLike, PollOperationState } from "@azure/core-lro";
3
+ import type { CancelVectorStoreFileBatchOptionalParams, CreateVectorStoreFileBatchOptionalParams, GetVectorStoreFileBatchOptionalParams, ListVectorStoreFileBatchFilesOptionalParams } from "./customModels.js";
4
+ import type { PollerLike, OperationState } from "@azure/core-lro";
5
5
  /** Create a vector store file batch. */
6
- export declare function createVectorStoreFileBatch(context: Client, vectorStoreId: string, options?: CreateVectorStoreFileBatchOptionalParams): Promise<VectorStoreFileBatchOutput>;
6
+ export declare function createVectorStoreFileBatch(context: Client, vectorStoreId: string, options?: CreateVectorStoreFileBatchOptionalParams): PollerLike<OperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput>;
7
7
  /** Retrieve a vector store file batch. */
8
8
  export declare function getVectorStoreFileBatch(context: Client, vectorStoreId: string, batchId: string, options?: GetVectorStoreFileBatchOptionalParams): Promise<VectorStoreFileBatchOutput>;
9
9
  /** Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. */
@@ -11,5 +11,6 @@ export declare function cancelVectorStoreFileBatch(context: Client, vectorStoreI
11
11
  /** Returns a list of vector store files in a batch. */
12
12
  export declare function listVectorStoreFileBatchFiles(context: Client, vectorStoreId: string, batchId: string, options?: ListVectorStoreFileBatchFilesOptionalParams): Promise<OpenAIPageableListOfVectorStoreFileOutput>;
13
13
  /** Create a vector store file batch and poll. */
14
- export declare function createVectorStoreFileBatchAndPoll(context: Client, vectorStoreId: string, options?: CreateVectorStoreFileBatchWithPollingOptionalParams): PollerLike<PollOperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput>;
14
+ export declare function createVectorStoreFileBatchAndPoll(context: Client, vectorStoreId: string, options?: CreateVectorStoreFileBatchOptionalParams): PollerLike<OperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput>;
15
+ export declare function createVectorStoreFileBatchInternal(context: Client, vectorStoreId: string, options?: CreateVectorStoreFileBatchOptionalParams): Promise<VectorStoreFileBatchOutput>;
15
16
  //# sourceMappingURL=vectorStoresFileBatches.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vectorStoresFileBatches.d.ts","sourceRoot":"","sources":["../../../src/agents/vectorStoresFileBatches.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EACV,yCAAyC,EACzC,0BAA0B,EAC3B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EACV,wCAAwC,EACxC,wCAAwC,EACxC,mDAAmD,EACnD,qCAAqC,EACrC,2CAA2C,EAC5C,MAAM,mBAAmB,CAAC;AAc3B,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAItE,wCAAwC;AACxC,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,wCAA6C,GACrD,OAAO,CAAC,0BAA0B,CAAC,CAerC;AAED,0CAA0C;AAC1C,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,qCAA0C,GAClD,OAAO,CAAC,0BAA0B,CAAC,CASrC;AAED,2HAA2H;AAC3H,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,wCAA6C,GACrD,OAAO,CAAC,0BAA0B,CAAC,CASrC;AAED,uDAAuD;AACvD,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,2CAAgD,GACxD,OAAO,CAAC,yCAAyC,CAAC,CAkBpD;AAED,iDAAiD;AACjD,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,mDAAwD,GAChE,UAAU,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,EAAE,0BAA0B,CAAC,CAiCxF"}
1
+ {"version":3,"file":"vectorStoresFileBatches.d.ts","sourceRoot":"","sources":["../../../src/agents/vectorStoresFileBatches.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EACV,yCAAyC,EACzC,0BAA0B,EAC3B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EACV,wCAAwC,EACxC,wCAAwC,EACxC,qCAAqC,EACrC,2CAA2C,EAC5C,MAAM,mBAAmB,CAAC;AAc3B,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAmB,MAAM,iBAAiB,CAAC;AAInF,wCAAwC;AACxC,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,wCAA6C,GACrD,UAAU,CAAC,cAAc,CAAC,0BAA0B,CAAC,EAAE,0BAA0B,CAAC,CAWpF;AAED,0CAA0C;AAC1C,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,qCAA0C,GAClD,OAAO,CAAC,0BAA0B,CAAC,CASrC;AAED,2HAA2H;AAC3H,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,wCAA6C,GACrD,OAAO,CAAC,0BAA0B,CAAC,CASrC;AAED,uDAAuD;AACvD,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,2CAAgD,GACxD,OAAO,CAAC,yCAAyC,CAAC,CAkBpD;AAED,iDAAiD;AACjD,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,wCAA6C,GACrD,UAAU,CAAC,cAAc,CAAC,0BAA0B,CAAC,EAAE,0BAA0B,CAAC,CAWpF;AAED,wBAAsB,kCAAkC,CACtD,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,wCAA6C,GACrD,OAAO,CAAC,0BAA0B,CAAC,CAerC"}
@@ -7,6 +7,7 @@ exports.getVectorStoreFileBatch = getVectorStoreFileBatch;
7
7
  exports.cancelVectorStoreFileBatch = cancelVectorStoreFileBatch;
8
8
  exports.listVectorStoreFileBatchFiles = listVectorStoreFileBatchFiles;
9
9
  exports.createVectorStoreFileBatchAndPoll = createVectorStoreFileBatchAndPoll;
10
+ exports.createVectorStoreFileBatchInternal = createVectorStoreFileBatchInternal;
10
11
  const tslib_1 = require("tslib");
11
12
  const core_client_1 = require("@azure-rest/core-client");
12
13
  const poller_js_1 = require("./poller.js");
@@ -16,17 +17,18 @@ const ConvertParamsToWire = tslib_1.__importStar(require("../customization/conve
16
17
  const openAIError_js_1 = require("./openAIError.js");
17
18
  const expectedStatuses = ["200"];
18
19
  /** Create a vector store file batch. */
19
- async function createVectorStoreFileBatch(context, vectorStoreId, options = {}) {
20
- const createOptions = Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), ConvertParamsToWire.convertCreateVectorStoreFileBatchParam({ body: options }));
21
- (0, inputValidations_js_1.validateVectorStoreId)(vectorStoreId);
22
- validateCreateVectorStoreFileBatchParameters(createOptions);
23
- const result = await context
24
- .path("/vector_stores/{vectorStoreId}/file_batches", vectorStoreId)
25
- .post(createOptions);
26
- if (!expectedStatuses.includes(result.status)) {
27
- throw (0, openAIError_js_1.createOpenAIError)(result);
28
- }
29
- return ConvertFromWire.convertVectorStoreFileBatchOutput(result.body);
20
+ function createVectorStoreFileBatch(context, vectorStoreId, options = {}) {
21
+ var _a;
22
+ return (0, poller_js_1.createPoller)({
23
+ initOperation: async () => {
24
+ return createVectorStoreFileBatchInternal(context, vectorStoreId, options);
25
+ },
26
+ pollOperation: async (currentResult) => {
27
+ return getVectorStoreFileBatch(context, vectorStoreId, currentResult.id, options);
28
+ },
29
+ getOperationStatus: getLroOperationStatus,
30
+ intervalInMs: (_a = options.pollingOptions) === null || _a === void 0 ? void 0 : _a.sleepIntervalInMs,
31
+ });
30
32
  }
31
33
  /** Retrieve a vector store file batch. */
32
34
  async function getVectorStoreFileBatch(context, vectorStoreId, batchId, options = {}) {
@@ -66,28 +68,41 @@ async function listVectorStoreFileBatchFiles(context, vectorStoreId, batchId, op
66
68
  }
67
69
  /** Create a vector store file batch and poll. */
68
70
  function createVectorStoreFileBatchAndPoll(context, vectorStoreId, options = {}) {
69
- async function updateCreateVectorStoreFileBatchPoll(currentResult) {
70
- let vectorStore;
71
- if (!currentResult) {
72
- vectorStore = await createVectorStoreFileBatch(context, vectorStoreId, options);
73
- }
74
- else {
75
- vectorStore = await getVectorStoreFileBatch(context, vectorStoreId, currentResult.id, options);
76
- }
77
- return {
78
- result: vectorStore,
79
- completed: vectorStore.status !== "in_progress",
80
- };
71
+ var _a;
72
+ return (0, poller_js_1.createPoller)({
73
+ initOperation: async () => {
74
+ return createVectorStoreFileBatchInternal(context, vectorStoreId, options);
75
+ },
76
+ pollOperation: async (currentResult) => {
77
+ return getVectorStoreFileBatch(context, vectorStoreId, currentResult.id, options);
78
+ },
79
+ getOperationStatus: getLroOperationStatus,
80
+ intervalInMs: (_a = options.pollingOptions) === null || _a === void 0 ? void 0 : _a.sleepIntervalInMs,
81
+ });
82
+ }
83
+ async function createVectorStoreFileBatchInternal(context, vectorStoreId, options = {}) {
84
+ const createOptions = Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), ConvertParamsToWire.convertCreateVectorStoreFileBatchParam({ body: options }));
85
+ (0, inputValidations_js_1.validateVectorStoreId)(vectorStoreId);
86
+ validateCreateVectorStoreFileBatchParameters(createOptions);
87
+ const result = await context
88
+ .path("/vector_stores/{vectorStoreId}/file_batches", vectorStoreId)
89
+ .post(createOptions);
90
+ if (!expectedStatuses.includes(result.status)) {
91
+ throw (0, openAIError_js_1.createOpenAIError)(result);
81
92
  }
82
- async function cancelCreateVectorStoreFileBatchPoll(currentResult) {
83
- const result = await cancelVectorStoreFileBatch(context, vectorStoreId, currentResult.id);
84
- return result.status === "cancelled";
93
+ return ConvertFromWire.convertVectorStoreFileBatchOutput(result.body);
94
+ }
95
+ function getLroOperationStatus(result) {
96
+ switch (result.status) {
97
+ case "in_progress":
98
+ return "running";
99
+ case "completed":
100
+ return "succeeded";
101
+ case "cancelled":
102
+ return "canceled";
103
+ default:
104
+ return "failed";
85
105
  }
86
- return new poller_js_1.AgentsPoller({
87
- update: updateCreateVectorStoreFileBatchPoll,
88
- cancel: cancelCreateVectorStoreFileBatchPoll,
89
- pollingOptions: options.pollingOptions,
90
- });
91
106
  }
92
107
  function validateBatchId(batchId) {
93
108
  if (!batchId) {