@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
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Determines if the given output is of the specified type.
5
5
  *
6
- * @template T - The type to check against, which extends one of the possible output parent types.
6
+ * @typeParam T - The type to check against, which extends one of the possible output parent types.
7
7
  * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.
8
8
  * @param type - The type to check the action against.
9
9
  * @returns A boolean indicating whether the action is of the specified type.
@@ -20,7 +20,15 @@ export var connectionToolType;
20
20
  connectionToolType["MicrosoftFabric"] = "microsoft_fabric";
21
21
  /** Sharepoint tool */
22
22
  connectionToolType["SharepointGrounding"] = "sharepoint_grounding";
23
+ /** Azure Function tool */
24
+ connectionToolType["AzureFunction"] = "azure_function";
23
25
  })(connectionToolType || (connectionToolType = {}));
26
+ const toolMap = {
27
+ bing_grounding: "bingGrounding",
28
+ microsoft_fabric: "microsoftFabric",
29
+ sharepoint_grounding: "sharepointGrounding",
30
+ azure_function: "azureFunction",
31
+ };
24
32
  /**
25
33
  * Utility class for creating various tools.
26
34
  */
@@ -36,7 +44,7 @@ export class ToolUtility {
36
44
  return {
37
45
  definition: {
38
46
  type: toolType,
39
- [toolType]: {
47
+ [toolMap[toolType]]: {
40
48
  connections: connectionIds.map((connectionId) => ({ connectionId: connectionId })),
41
49
  },
42
50
  },
@@ -74,6 +82,29 @@ export class ToolUtility {
74
82
  resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },
75
83
  };
76
84
  }
85
+ /**
86
+ * Creates an Azure Function tool
87
+ * @param name - The name of the Azure Function.
88
+ * @param description - The description of the Azure Function.
89
+ * @param parameters - The parameters of the Azure Function.
90
+ * @param inputQueue - The input queue configuration.
91
+ * @param outputQueue - The output queue configuration.
92
+ * @returns An object containing the definition and resources for the Azure Function tool.
93
+ */
94
+ static createAzureFunctionTool(name, description, parameters, inputQueue, outputQueue, definitionDetails) {
95
+ return {
96
+ definition: { type: "azure_function", azureFunction: definitionDetails },
97
+ resources: {
98
+ azureFunction: {
99
+ name: name,
100
+ description: description,
101
+ parameters: parameters,
102
+ inputQueue: inputQueue,
103
+ outputQueue: outputQueue,
104
+ },
105
+ },
106
+ };
107
+ }
77
108
  /**
78
109
  * Creates an Azure AI search tool
79
110
  *
@@ -107,6 +138,21 @@ export class ToolUtility {
107
138
  },
108
139
  };
109
140
  }
141
+ /**
142
+ * Creates an OpenApi tool
143
+ *
144
+ * @param openApiFunctionDefinition - The OpenApi function definition to use.
145
+ *
146
+ * @returns An object containing the definition for the OpenApi tool.
147
+ */
148
+ static createOpenApiTool(openApiFunctionDefinition) {
149
+ return {
150
+ definition: {
151
+ type: "openapi",
152
+ openapi: openApiFunctionDefinition,
153
+ },
154
+ };
155
+ }
110
156
  }
111
157
  /**
112
158
  * Represents a set of tools with their definitions and resources.
@@ -174,5 +220,34 @@ export class ToolSet {
174
220
  this.toolResources = Object.assign(Object.assign({}, this.toolResources), tool.resources);
175
221
  return tool;
176
222
  }
223
+ /**
224
+ * Adds an OpenApi tool to the tool set.
225
+ *
226
+ * @param openApiFunctionDefinition - The OpenApi function definition to use.
227
+ *
228
+ * @returns An object containing the definition for the OpenApi tool
229
+ */
230
+ addOpenApiTool(openApiFunctionDefinition) {
231
+ const tool = ToolUtility.createOpenApiTool(openApiFunctionDefinition);
232
+ this.toolDefinitions.push(tool.definition);
233
+ return tool;
234
+ }
235
+ /**
236
+ * Adds an Azure Function tool to the tool set.
237
+ *
238
+ * @param name - The name of the Azure Function.
239
+ * @param description - The description of the Azure Function.
240
+ * @param parameters - The parameters of the Azure Function.
241
+ * @param inputQueue - The input queue configuration.
242
+ * @param outputQueue - The output queue configuration.
243
+ *
244
+ * @returns An object containing the definition and resources for the Azure Function tool.
245
+ */
246
+ addAzureFunctionTool(name, description, parameters, inputQueue, outputQueue, definitionDetails) {
247
+ const tool = ToolUtility.createAzureFunctionTool(name, description, parameters, inputQueue, outputQueue, definitionDetails);
248
+ this.toolDefinitions.push(tool.definition);
249
+ this.toolResources = Object.assign(Object.assign({}, this.toolResources), tool.resources);
250
+ return tool;
251
+ }
177
252
  }
178
253
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAkBlC;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAkF,EAClF,IAAY;IAEZ,OAAO,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAC9B,CAAC;AAED,2DAA2D;AAC3D,MAAM,CAAN,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,iCAAiC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G,WAAW,CAAC,yBAAyB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QACzE,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;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","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;AAuBlC;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAkF,EAClF,IAAY;IAEZ,OAAO,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAC9B,CAAC;AAED,2DAA2D;AAC3D,MAAM,CAAN,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,iCAAiC;IACjC,sDAAgC,C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,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACH,cAAc,CAAC,yBAAoD;QAGjE,MAAM,IAAI,GAAG,WAAW,CAAC,iBAAiB,CAAC,yBAAyB,CAAC,CAAC;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","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":"vectorStores.d.ts","sourceRoot":"","sources":["../../../src/agents/vectorStores.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAOtD,OAAO,KAAK,EACV,qCAAqC,EACrC,+BAA+B,EAC/B,iBAAiB,EAClB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EAAE,0CAA0C,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,EACL,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACrC,MAAM,mBAAmB,CAAC;AAY3B,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAItE,uCAAuC;AACvC,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,8BAAmC,GAC3C,OAAO,CAAC,qCAAqC,CAAC,CAahD;AAED,8BAA8B;AAC9B,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,+BAAoC,GAC5C,OAAO,CAAC,iBAAiB,CAAC,CAa5B;AAED,iEAAiE;AACjE,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,4BAAiC,GACzC,OAAO,CAAC,iBAAiB,CAAC,CAc5B;AAED,4CAA4C;AAC5C,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,+BAAoC,GAC5C,OAAO,CAAC,iBAAiB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AiB,CACrC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,+BAAoC,GAC5C,OAAO,CAAC,iBAAiB,CAAC,CAgB5B;AAED,iEAAiE;AACjE,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,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"}
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  import { operationOptionsToRequestParameters } from "@azure-rest/core-client";
4
- import { AgentsPoller } from "./poller.js";
4
+ import { createPoller } from "./poller.js";
5
5
  import { validateLimit, validateMetadata, validateOrder, validateVectorStoreId, } from "./inputValidations.js";
6
6
  import * as ConvertFromWire from "../customization/convertOutputModelsFromWire.js";
7
7
  import * as ConvertToWire from "../customization/convertModelsToWrite.js";
@@ -19,14 +19,18 @@ export async function listVectorStores(context, options = {}) {
19
19
  return ConvertFromWire.convertOpenAIPageableListOfVectorStoreOutput(result.body);
20
20
  }
21
21
  /** Creates a vector store. */
22
- export async function createVectorStore(context, options = {}) {
23
- const createOptions = Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: ConvertToWire.convertVectorStoreOptions(options) });
24
- validateCreateVectorStoreParameters(createOptions);
25
- const result = await context.path("/vector_stores").post(createOptions);
26
- if (!expectedStatuses.includes(result.status)) {
27
- throw createOpenAIError(result);
28
- }
29
- return ConvertFromWire.convertVectorStoreOutput(result.body);
22
+ export function createVectorStore(context, options = {}) {
23
+ var _a;
24
+ return createPoller({
25
+ initOperation: async () => {
26
+ return createVectorStoreInternal(context, options);
27
+ },
28
+ pollOperation: async (currentResult) => {
29
+ return getVectorStore(context, currentResult.id, options);
30
+ },
31
+ getOperationStatus: getLroOperationStatus,
32
+ intervalInMs: (_a = options.pollingOptions) === null || _a === void 0 ? void 0 : _a.sleepIntervalInMs,
33
+ });
30
34
  }
31
35
  /** Returns the vector store object matching the specified ID. */
32
36
  export async function getVectorStore(context, vectorStoreId, options = {}) {
@@ -69,25 +73,39 @@ export async function deleteVectorStore(context, vectorStoreId, options = {}) {
69
73
  * Creates a vector store and poll.
70
74
  */
71
75
  export function createVectorStoreAndPoll(context, options = {}) {
72
- async function updateCreateVectorStorePoll(currentResult) {
73
- let vectorStore;
74
- if (!currentResult) {
75
- vectorStore = await createVectorStore(context, options);
76
- }
77
- else {
78
- const getOptions = Object.assign({}, operationOptionsToRequestParameters(options));
79
- vectorStore = await getVectorStore(context, currentResult.id, getOptions);
80
- }
81
- return {
82
- result: vectorStore,
83
- completed: vectorStore.status !== "in_progress",
84
- };
85
- }
86
- return new AgentsPoller({
87
- update: updateCreateVectorStorePoll,
88
- pollingOptions: options.pollingOptions,
76
+ var _a;
77
+ return createPoller({
78
+ initOperation: async () => {
79
+ return createVectorStoreInternal(context, options);
80
+ },
81
+ pollOperation: async (currentResult) => {
82
+ return getVectorStore(context, currentResult.id, options);
83
+ },
84
+ getOperationStatus: getLroOperationStatus,
85
+ intervalInMs: (_a = options.pollingOptions) === null || _a === void 0 ? void 0 : _a.sleepIntervalInMs,
89
86
  });
90
87
  }
88
+ async function createVectorStoreInternal(context, options = {}) {
89
+ const createOptions = Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: ConvertToWire.convertVectorStoreOptions(options) });
90
+ validateCreateVectorStoreParameters(createOptions);
91
+ const result = await context.path("/vector_stores").post(createOptions);
92
+ if (!expectedStatuses.includes(result.status)) {
93
+ throw createOpenAIError(result);
94
+ }
95
+ return ConvertFromWire.convertVectorStoreOutput(result.body);
96
+ }
97
+ function getLroOperationStatus(result) {
98
+ switch (result.status) {
99
+ case "in_progress":
100
+ return "running";
101
+ case "completed":
102
+ return "succeeded";
103
+ case "expired":
104
+ return "failed";
105
+ default:
106
+ return "failed";
107
+ }
108
+ }
91
109
  function validateListVectorStoresParameters(options) {
92
110
  var _a, _b;
93
111
  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;AAGlC,OAAO,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAC;AAW9E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAS3C,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,eAAe,MAAM,iDAAiD,CAAC;AACnF,OAAO,KAAK,aAAa,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;AAEjC,uCAAuC;AACvC,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAAe,EACf,UAA0C,EAAE;IAE5C,MAAM,WAAW,mCACZ,mCAAmC,CAAC,OAAO,CAAC,KAC/C,eAAe,EAAE,4BAA4B,CAAC,OAAO,CAAC,GACvD,CAAC;IAEF,kCAAkC,CAAC,WAAW,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAErE,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,iBAAiB,CAAC,MAAM,CAAC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ACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,QAAQ,EAAE,CAAC;QAC5B,gBAAgB,CAAC,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,gBAAgB,CAAC,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;AAGlC,OAAO,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAC;AAW9E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAQ3C,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,eAAe,MAAM,iDAAiD,CAAC;AACnF,OAAO,KAAK,aAAa,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;AAEjC,uCAAuC;AACvC,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAAe,EACf,UAA0C,EAAE;IAE5C,MAAM,WAAW,mCACZ,mCAAmC,CAAC,OAAO,CAAC,KAC/C,eAAe,EAAE,4BAA4B,CAAC,OAAO,CAAC,GACvD,CAAC;IAEF,kCAAkC,CAAC,WAAW,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAErE,IAAI,CAAC,gB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E,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,aAAa,CAAC,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,aAAa,CAAC,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,gBAAgB,CAAC,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,gBAAgB,CAAC,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"}
@@ -1,24 +1,25 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  import { operationOptionsToRequestParameters } from "@azure-rest/core-client";
4
- import { AgentsPoller } from "./poller.js";
4
+ import { createPoller } from "./poller.js";
5
5
  import { validateFileStatusFilter, validateLimit, validateOrder, validateVectorStoreId, } from "./inputValidations.js";
6
6
  import * as ConvertFromWire from "../customization/convertOutputModelsFromWire.js";
7
7
  import * as ConvertParamsToWire from "../customization/convertParametersToWire.js";
8
8
  import { createOpenAIError } from "./openAIError.js";
9
9
  const expectedStatuses = ["200"];
10
10
  /** Create a vector store file batch. */
11
- export async function createVectorStoreFileBatch(context, vectorStoreId, options = {}) {
12
- const createOptions = Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), ConvertParamsToWire.convertCreateVectorStoreFileBatchParam({ body: options }));
13
- validateVectorStoreId(vectorStoreId);
14
- validateCreateVectorStoreFileBatchParameters(createOptions);
15
- const result = await context
16
- .path("/vector_stores/{vectorStoreId}/file_batches", vectorStoreId)
17
- .post(createOptions);
18
- if (!expectedStatuses.includes(result.status)) {
19
- throw createOpenAIError(result);
20
- }
21
- return ConvertFromWire.convertVectorStoreFileBatchOutput(result.body);
11
+ export function createVectorStoreFileBatch(context, vectorStoreId, options = {}) {
12
+ var _a;
13
+ return createPoller({
14
+ initOperation: async () => {
15
+ return createVectorStoreFileBatchInternal(context, vectorStoreId, options);
16
+ },
17
+ pollOperation: async (currentResult) => {
18
+ return getVectorStoreFileBatch(context, vectorStoreId, currentResult.id, options);
19
+ },
20
+ getOperationStatus: getLroOperationStatus,
21
+ intervalInMs: (_a = options.pollingOptions) === null || _a === void 0 ? void 0 : _a.sleepIntervalInMs,
22
+ });
22
23
  }
23
24
  /** Retrieve a vector store file batch. */
24
25
  export async function getVectorStoreFileBatch(context, vectorStoreId, batchId, options = {}) {
@@ -58,28 +59,41 @@ export async function listVectorStoreFileBatchFiles(context, vectorStoreId, batc
58
59
  }
59
60
  /** Create a vector store file batch and poll. */
60
61
  export function createVectorStoreFileBatchAndPoll(context, vectorStoreId, options = {}) {
61
- async function updateCreateVectorStoreFileBatchPoll(currentResult) {
62
- let vectorStore;
63
- if (!currentResult) {
64
- vectorStore = await createVectorStoreFileBatch(context, vectorStoreId, options);
65
- }
66
- else {
67
- vectorStore = await getVectorStoreFileBatch(context, vectorStoreId, currentResult.id, options);
68
- }
69
- return {
70
- result: vectorStore,
71
- completed: vectorStore.status !== "in_progress",
72
- };
62
+ var _a;
63
+ return createPoller({
64
+ initOperation: async () => {
65
+ return createVectorStoreFileBatchInternal(context, vectorStoreId, options);
66
+ },
67
+ pollOperation: async (currentResult) => {
68
+ return getVectorStoreFileBatch(context, vectorStoreId, currentResult.id, options);
69
+ },
70
+ getOperationStatus: getLroOperationStatus,
71
+ intervalInMs: (_a = options.pollingOptions) === null || _a === void 0 ? void 0 : _a.sleepIntervalInMs,
72
+ });
73
+ }
74
+ export async function createVectorStoreFileBatchInternal(context, vectorStoreId, options = {}) {
75
+ const createOptions = Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), ConvertParamsToWire.convertCreateVectorStoreFileBatchParam({ body: options }));
76
+ validateVectorStoreId(vectorStoreId);
77
+ validateCreateVectorStoreFileBatchParameters(createOptions);
78
+ const result = await context
79
+ .path("/vector_stores/{vectorStoreId}/file_batches", vectorStoreId)
80
+ .post(createOptions);
81
+ if (!expectedStatuses.includes(result.status)) {
82
+ throw createOpenAIError(result);
73
83
  }
74
- async function cancelCreateVectorStoreFileBatchPoll(currentResult) {
75
- const result = await cancelVectorStoreFileBatch(context, vectorStoreId, currentResult.id);
76
- return result.status === "cancelled";
84
+ return ConvertFromWire.convertVectorStoreFileBatchOutput(result.body);
85
+ }
86
+ function getLroOperationStatus(result) {
87
+ switch (result.status) {
88
+ case "in_progress":
89
+ return "running";
90
+ case "completed":
91
+ return "succeeded";
92
+ case "cancelled":
93
+ return "canceled";
94
+ default:
95
+ return "failed";
77
96
  }
78
- return new AgentsPoller({
79
- update: updateCreateVectorStoreFileBatchPoll,
80
- cancel: cancelCreateVectorStoreFileBatchPoll,
81
- pollingOptions: options.pollingOptions,
82
- });
83
97
  }
84
98
  function validateBatchId(batchId) {
85
99
  if (!batchId) {
@@ -1 +1 @@
1
- {"version":3,"file":"vectorStoresFileBatches.js","sourceRoot":"","sources":["../../../src/agents/vectorStoresFileBatches.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAC;AAK9E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAQ3C,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,aAAa,EACb,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,eAAe,MAAM,iDAAiD,CAAC;AACnF,OAAO,KAAK,mBAAmB,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;AAEjC,wCAAwC;AACxC,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,OAAe,EACf,aAAqB,EACrB,UAAoD,EAAE;IAEtD,MAAM,aAAa,mCACd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AC,MAAM,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,aAAa,CAAC,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,aAAa,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,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 OpenAIPageableListOfVectorStoreFileOutput,\n VectorStoreFileBatchOutput,\n} from \"../customization/outputModels.js\";\nimport { AgentsPoller } from \"./poller.js\";\nimport type {\n CancelVectorStoreFileBatchOptionalParams,\n CreateVectorStoreFileBatchOptionalParams,\n CreateVectorStoreFileBatchWithPollingOptionalParams,\n GetVectorStoreFileBatchOptionalParams,\n ListVectorStoreFileBatchFilesOptionalParams,\n} from \"./customModels.js\";\nimport {\n validateFileStatusFilter,\n validateLimit,\n validateOrder,\n validateVectorStoreId,\n} from \"./inputValidations.js\";\nimport type {\n CreateVectorStoreFileBatchParameters,\n ListVectorStoreFileBatchFilesParameters,\n} from \"../generated/src/parameters.js\";\nimport * as ConvertFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport * as ConvertParamsToWire from \"../customization/convertParametersToWire.js\";\nimport { createOpenAIError } from \"./openAIError.js\";\nimport type { PollerLike, PollOperationState } from \"@azure/core-lro\";\n\nconst expectedStatuses = [\"200\"];\n\n/** Create a vector store file batch. */\nexport async function createVectorStoreFileBatch(\n context: Client,\n vectorStoreId: string,\n options: CreateVectorStoreFileBatchOptionalParams = {},\n): Promise<VectorStoreFileBatchOutput> {\n const createOptions: CreateVectorStoreFileBatchParameters = {\n ...operationOptionsToRequestParameters(options),\n ...ConvertParamsToWire.convertCreateVectorStoreFileBatchParam({ body: options }),\n };\n\n validateVectorStoreId(vectorStoreId);\n validateCreateVectorStoreFileBatchParameters(createOptions);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/file_batches\", vectorStoreId)\n .post(createOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreFileBatchOutput(result.body);\n}\n\n/** Retrieve a vector store file batch. */\nexport async function getVectorStoreFileBatch(\n context: Client,\n vectorStoreId: string,\n batchId: string,\n options: GetVectorStoreFileBatchOptionalParams = {},\n): Promise<VectorStoreFileBatchOutput> {\n validateVectorStoreId(vectorStoreId);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/file_batches/{batchId}\", vectorStoreId, batchId)\n .get(options);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreFileBatchOutput(result.body);\n}\n\n/** Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. */\nexport async function cancelVectorStoreFileBatch(\n context: Client,\n vectorStoreId: string,\n batchId: string,\n options: CancelVectorStoreFileBatchOptionalParams = {},\n): Promise<VectorStoreFileBatchOutput> {\n validateVectorStoreId(vectorStoreId);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/file_batches/{batchId}/cancel\", vectorStoreId, batchId)\n .post(options);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreFileBatchOutput(result.body);\n}\n\n/** Returns a list of vector store files in a batch. */\nexport async function listVectorStoreFileBatchFiles(\n context: Client,\n vectorStoreId: string,\n batchId: string,\n options: ListVectorStoreFileBatchFilesOptionalParams = {},\n): Promise<OpenAIPageableListOfVectorStoreFileOutput> {\n const listOptions: ListVectorStoreFileBatchFilesParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: ConvertParamsToWire.convertListVectorStoreFileBatchFilesQueryParamProperties(\n options,\n ) as Record<string, string>,\n };\n\n validateVectorStoreId(vectorStoreId);\n validateBatchId(batchId);\n validateListVectorStoreFileBatchFilesParameters(listOptions);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/file_batches/{batchId}/files\", vectorStoreId, batchId)\n .get(listOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertOpenAIPageableListOfVectorStoreFileOutput(result.body);\n}\n\n/** Create a vector store file batch and poll. */\nexport function createVectorStoreFileBatchAndPoll(\n context: Client,\n vectorStoreId: string,\n options: CreateVectorStoreFileBatchWithPollingOptionalParams = {},\n): PollerLike<PollOperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput> {\n async function updateCreateVectorStoreFileBatchPoll(\n currentResult?: VectorStoreFileBatchOutput,\n ): Promise<{ result: VectorStoreFileBatchOutput; completed: boolean }> {\n let vectorStore: VectorStoreFileBatchOutput;\n if (!currentResult) {\n vectorStore = await createVectorStoreFileBatch(context, vectorStoreId, options);\n } else {\n vectorStore = await getVectorStoreFileBatch(\n context,\n vectorStoreId,\n currentResult.id,\n options,\n );\n }\n return {\n result: vectorStore,\n completed: vectorStore.status !== \"in_progress\",\n };\n }\n\n async function cancelCreateVectorStoreFileBatchPoll(\n currentResult: VectorStoreFileBatchOutput,\n ): Promise<boolean> {\n const result = await cancelVectorStoreFileBatch(context, vectorStoreId, currentResult.id);\n return result.status === \"cancelled\";\n }\n\n return new AgentsPoller<VectorStoreFileBatchOutput>({\n update: updateCreateVectorStoreFileBatchPoll,\n cancel: cancelCreateVectorStoreFileBatchPoll,\n pollingOptions: options.pollingOptions,\n });\n}\n\nfunction validateBatchId(batchId: string): void {\n if (!batchId) {\n throw new Error(\"Batch ID is required\");\n }\n}\n\nfunction validateCreateVectorStoreFileBatchParameters(\n options?: CreateVectorStoreFileBatchParameters,\n): 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 are included\");\n }\n}\n\nfunction validateListVectorStoreFileBatchFilesParameters(\n options?: ListVectorStoreFileBatchFilesParameters,\n): void {\n if (options?.queryParameters?.filter) {\n validateFileStatusFilter(options.queryParameters.filter);\n }\n if (options?.queryParameters?.limit) {\n validateLimit(options.queryParameters.limit);\n }\n if (options?.queryParameters?.order) {\n validateOrder(options.queryParameters.order);\n }\n}\n"]}
1
+ {"version":3,"file":"vectorStoresFileBatches.js","sourceRoot":"","sources":["../../../src/agents/vectorStoresFileBatches.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAC;AAK9E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAO3C,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,aAAa,EACb,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,eAAe,MAAM,iDAAiD,CAAC;AACnF,OAAO,KAAK,mBAAmB,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;AAEjC,wCAAwC;AACxC,MAAM,UAAU,0BAA0B,CACxC,OAAe,EACf,aAAqB,EACrB,UAAoD,EAAE;;IAEtD,OAAO,YAAY,CAA6B;QAC9C,aAAa,EAAE,KAAK,IAAI,EAAE;YACxB,OAAO,kCAAkC,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;QAC7E,CAAC;QACD,aAAa,EAAE,KAAK,EAAE,aAAyC,EAAE,EAAE;YACjE,OAAO,uBAAuB,CAAC,OAAO,EAAE,aAAa,EAAE,aAAa,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACpF,CAAC;QACD,kBAAkB,EAAE,qBAAqB;Q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O,CAAE,eAAe,0CAAE,MAAM,EAAE,CAAC;QACrC,wBAAwB,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,aAAa,CAAC,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,aAAa,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,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 OpenAIPageableListOfVectorStoreFileOutput,\n VectorStoreFileBatchOutput,\n} from \"../customization/outputModels.js\";\nimport { createPoller } from \"./poller.js\";\nimport type {\n CancelVectorStoreFileBatchOptionalParams,\n CreateVectorStoreFileBatchOptionalParams,\n GetVectorStoreFileBatchOptionalParams,\n ListVectorStoreFileBatchFilesOptionalParams,\n} from \"./customModels.js\";\nimport {\n validateFileStatusFilter,\n validateLimit,\n validateOrder,\n validateVectorStoreId,\n} from \"./inputValidations.js\";\nimport type {\n CreateVectorStoreFileBatchParameters,\n ListVectorStoreFileBatchFilesParameters,\n} from \"../generated/src/parameters.js\";\nimport * as ConvertFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport * as ConvertParamsToWire from \"../customization/convertParametersToWire.js\";\nimport { createOpenAIError } from \"./openAIError.js\";\nimport type { PollerLike, OperationState, OperationStatus } from \"@azure/core-lro\";\n\nconst expectedStatuses = [\"200\"];\n\n/** Create a vector store file batch. */\nexport function createVectorStoreFileBatch(\n context: Client,\n vectorStoreId: string,\n options: CreateVectorStoreFileBatchOptionalParams = {},\n): PollerLike<OperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput> {\n return createPoller<VectorStoreFileBatchOutput>({\n initOperation: async () => {\n return createVectorStoreFileBatchInternal(context, vectorStoreId, options);\n },\n pollOperation: async (currentResult: VectorStoreFileBatchOutput) => {\n return getVectorStoreFileBatch(context, vectorStoreId, currentResult.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n intervalInMs: options.pollingOptions?.sleepIntervalInMs,\n });\n}\n\n/** Retrieve a vector store file batch. */\nexport async function getVectorStoreFileBatch(\n context: Client,\n vectorStoreId: string,\n batchId: string,\n options: GetVectorStoreFileBatchOptionalParams = {},\n): Promise<VectorStoreFileBatchOutput> {\n validateVectorStoreId(vectorStoreId);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/file_batches/{batchId}\", vectorStoreId, batchId)\n .get(options);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreFileBatchOutput(result.body);\n}\n\n/** Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. */\nexport async function cancelVectorStoreFileBatch(\n context: Client,\n vectorStoreId: string,\n batchId: string,\n options: CancelVectorStoreFileBatchOptionalParams = {},\n): Promise<VectorStoreFileBatchOutput> {\n validateVectorStoreId(vectorStoreId);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/file_batches/{batchId}/cancel\", vectorStoreId, batchId)\n .post(options);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreFileBatchOutput(result.body);\n}\n\n/** Returns a list of vector store files in a batch. */\nexport async function listVectorStoreFileBatchFiles(\n context: Client,\n vectorStoreId: string,\n batchId: string,\n options: ListVectorStoreFileBatchFilesOptionalParams = {},\n): Promise<OpenAIPageableListOfVectorStoreFileOutput> {\n const listOptions: ListVectorStoreFileBatchFilesParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: ConvertParamsToWire.convertListVectorStoreFileBatchFilesQueryParamProperties(\n options,\n ) as Record<string, string>,\n };\n\n validateVectorStoreId(vectorStoreId);\n validateBatchId(batchId);\n validateListVectorStoreFileBatchFilesParameters(listOptions);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/file_batches/{batchId}/files\", vectorStoreId, batchId)\n .get(listOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertOpenAIPageableListOfVectorStoreFileOutput(result.body);\n}\n\n/** Create a vector store file batch and poll. */\nexport function createVectorStoreFileBatchAndPoll(\n context: Client,\n vectorStoreId: string,\n options: CreateVectorStoreFileBatchOptionalParams = {},\n): PollerLike<OperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput> {\n return createPoller<VectorStoreFileBatchOutput>({\n initOperation: async () => {\n return createVectorStoreFileBatchInternal(context, vectorStoreId, options);\n },\n pollOperation: async (currentResult: VectorStoreFileBatchOutput) => {\n return getVectorStoreFileBatch(context, vectorStoreId, currentResult.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n intervalInMs: options.pollingOptions?.sleepIntervalInMs,\n });\n}\n\nexport async function createVectorStoreFileBatchInternal(\n context: Client,\n vectorStoreId: string,\n options: CreateVectorStoreFileBatchOptionalParams = {},\n): Promise<VectorStoreFileBatchOutput> {\n const createOptions: CreateVectorStoreFileBatchParameters = {\n ...operationOptionsToRequestParameters(options),\n ...ConvertParamsToWire.convertCreateVectorStoreFileBatchParam({ body: options }),\n };\n\n validateVectorStoreId(vectorStoreId);\n validateCreateVectorStoreFileBatchParameters(createOptions);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/file_batches\", vectorStoreId)\n .post(createOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreFileBatchOutput(result.body);\n}\n\nfunction getLroOperationStatus(result: VectorStoreFileBatchOutput): OperationStatus {\n switch (result.status) {\n case \"in_progress\":\n return \"running\";\n case \"completed\":\n return \"succeeded\";\n case \"cancelled\":\n return \"canceled\";\n default:\n return \"failed\";\n }\n}\n\nfunction validateBatchId(batchId: string): void {\n if (!batchId) {\n throw new Error(\"Batch ID is required\");\n }\n}\n\nfunction validateCreateVectorStoreFileBatchParameters(\n options?: CreateVectorStoreFileBatchParameters,\n): 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 are included\");\n }\n}\n\nfunction validateListVectorStoreFileBatchFilesParameters(\n options?: ListVectorStoreFileBatchFilesParameters,\n): void {\n if (options?.queryParameters?.filter) {\n validateFileStatusFilter(options.queryParameters.filter);\n }\n if (options?.queryParameters?.limit) {\n validateLimit(options.queryParameters.limit);\n }\n if (options?.queryParameters?.order) {\n validateOrder(options.queryParameters.order);\n }\n}\n"]}
@@ -1,11 +1,11 @@
1
1
  import type { Client } from "@azure-rest/core-client";
2
2
  import type { OpenAIPageableListOfVectorStoreFileOutput, VectorStoreFileDeletionStatusOutput, VectorStoreFileOutput } from "../customization/outputModels.js";
3
- import type { CreateVectorStoreFileOptionalParams, CreateVectorStoreFileWithPollingOptionalParams, DeleteVectorStoreFileOptionalParams, GetVectorStoreFileOptionalParams, ListVectorStoreFilesOptionalParams } from "./customModels.js";
4
- import type { PollerLike, PollOperationState } from "@azure/core-lro";
3
+ import type { CreateVectorStoreFileOptionalParams, DeleteVectorStoreFileOptionalParams, GetVectorStoreFileOptionalParams, ListVectorStoreFilesOptionalParams } from "./customModels.js";
4
+ import type { OperationState, PollerLike } from "@azure/core-lro";
5
5
  /** Returns a list of vector store files. */
6
6
  export declare function listVectorStoreFiles(context: Client, vectorStoreId: string, options?: ListVectorStoreFilesOptionalParams): Promise<OpenAIPageableListOfVectorStoreFileOutput>;
7
7
  /** Create a vector store file by attaching a file to a vector store. */
8
- export declare function createVectorStoreFile(context: Client, vectorStoreId: string, options?: CreateVectorStoreFileOptionalParams): Promise<VectorStoreFileOutput>;
8
+ export declare function createVectorStoreFile(context: Client, vectorStoreId: string, options?: CreateVectorStoreFileOptionalParams): PollerLike<OperationState<VectorStoreFileOutput>, VectorStoreFileOutput>;
9
9
  /** Retrieves a vector store file. */
10
10
  export declare function getVectorStoreFile(context: Client, vectorStoreId: string, fileId: string, options?: GetVectorStoreFileOptionalParams): Promise<VectorStoreFileOutput>;
11
11
  /**
@@ -14,5 +14,5 @@ export declare function getVectorStoreFile(context: Client, vectorStoreId: strin
14
14
  */
15
15
  export declare function deleteVectorStoreFile(context: Client, vectorStoreId: string, fileId: string, options?: DeleteVectorStoreFileOptionalParams): Promise<VectorStoreFileDeletionStatusOutput>;
16
16
  /** Create a vector store file by attaching a file to a vector store and poll. */
17
- export declare function createVectorStoreFileAndPoll(context: Client, vectorStoreId: string, options?: CreateVectorStoreFileWithPollingOptionalParams): PollerLike<PollOperationState<VectorStoreFileOutput>, VectorStoreFileOutput>;
17
+ export declare function createVectorStoreFileAndPoll(context: Client, vectorStoreId: string, options?: CreateVectorStoreFileOptionalParams): PollerLike<OperationState<VectorStoreFileOutput>, VectorStoreFileOutput>;
18
18
  //# sourceMappingURL=vectorStoresFiles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vectorStoresFiles.d.ts","sourceRoot":"","sources":["../../../src/agents/vectorStoresFiles.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAMtD,OAAO,KAAK,EACV,yCAAyC,EACzC,mCAAmC,EACnC,qBAAqB,EACtB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EACV,mCAAmC,EACnC,8CAA8C,EAC9C,mCAAmC,EACnC,gCAAgC,EAChC,kCAAkC,EACnC,MAAM,mBAAmB,CAAC;AAa3B,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAItE,4CAA4C;AAC5C,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,kCAAuC,GAC/C,OAAO,CAAC,yCAAyC,CAAC,CAgBpD;AAED,wEAAwE;AACxE,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,mCAAwC,GAChD,OAAO,CAAC,qBAAqB,CAAC,CAehC;AAED,qCAAqC;AACrC,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,gCAAqC,GAC7C,OAAO,CAAC,qBAAqB,CAAC,CAchC;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,mCAAwC,GAChD,OAAO,CAAC,mCAAmC,CAAC,CAa9C;AAED,iFAAiF;AACjF,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,8CAAmD,GAC3D,UAAU,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC,CAoB9E"}
1
+ {"version":3,"file":"vectorStoresFiles.d.ts","sourceRoot":"","sources":["../../../src/agents/vectorStoresFiles.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAMtD,OAAO,KAAK,EACV,yCAAyC,EACzC,mCAAmC,EACnC,qBAAqB,EACtB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EACV,mCAAmC,EACnC,mCAAmC,EACnC,gCAAgC,EAChC,kCAAkC,EACnC,MAAM,mBAAmB,CAAC;AAa3B,OAAO,KAAK,EAAE,cAAc,EAAmB,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAInF,4CAA4C;AAC5C,wBAAsB,oBAAoB,CACxC,OAAO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