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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (356) hide show
  1. package/LICENSE +4 -4
  2. package/README.md +244 -183
  3. package/dist/browser/agents/assistants.d.ts.map +1 -1
  4. package/dist/browser/agents/assistants.js +3 -1
  5. package/dist/browser/agents/assistants.js.map +1 -1
  6. package/dist/browser/agents/customModels.d.ts +4 -29
  7. package/dist/browser/agents/customModels.d.ts.map +1 -1
  8. package/dist/browser/agents/customModels.js.map +1 -1
  9. package/dist/browser/agents/files.d.ts +5 -4
  10. package/dist/browser/agents/files.d.ts.map +1 -1
  11. package/dist/browser/agents/files.js +55 -27
  12. package/dist/browser/agents/files.js.map +1 -1
  13. package/dist/browser/agents/index.d.ts +10 -10
  14. package/dist/browser/agents/index.d.ts.map +1 -1
  15. package/dist/browser/agents/index.js.map +1 -1
  16. package/dist/browser/agents/inputOutputs.d.ts +3 -3
  17. package/dist/browser/agents/inputOutputs.d.ts.map +1 -1
  18. package/dist/browser/agents/inputOutputs.js.map +1 -1
  19. package/dist/browser/agents/inputValidations.d.ts.map +1 -1
  20. package/dist/browser/agents/inputValidations.js +2 -1
  21. package/dist/browser/agents/inputValidations.js.map +1 -1
  22. package/dist/browser/agents/messages.js +2 -2
  23. package/dist/browser/agents/messages.js.map +1 -1
  24. package/dist/browser/agents/openAIError.d.ts.map +1 -1
  25. package/dist/browser/agents/openAIError.js +7 -1
  26. package/dist/browser/agents/openAIError.js.map +1 -1
  27. package/dist/browser/agents/poller.d.ts +8 -33
  28. package/dist/browser/agents/poller.d.ts.map +1 -1
  29. package/dist/browser/agents/poller.js +130 -53
  30. package/dist/browser/agents/poller.js.map +1 -1
  31. package/dist/browser/agents/streamingModels.d.ts +17 -15
  32. package/dist/browser/agents/streamingModels.d.ts.map +1 -1
  33. package/dist/browser/agents/streamingModels.js.map +1 -1
  34. package/dist/browser/agents/traceUtility.d.ts +3 -3
  35. package/dist/browser/agents/traceUtility.d.ts.map +1 -1
  36. package/dist/browser/agents/traceUtility.js.map +1 -1
  37. package/dist/browser/agents/utils.d.ts +53 -3
  38. package/dist/browser/agents/utils.d.ts.map +1 -1
  39. package/dist/browser/agents/utils.js +77 -2
  40. package/dist/browser/agents/utils.js.map +1 -1
  41. package/dist/browser/agents/vectorStores.d.ts +3 -4
  42. package/dist/browser/agents/vectorStores.d.ts.map +1 -1
  43. package/dist/browser/agents/vectorStores.js +44 -26
  44. package/dist/browser/agents/vectorStores.js.map +1 -1
  45. package/dist/browser/agents/vectorStoresFileBatches.d.ts +5 -4
  46. package/dist/browser/agents/vectorStoresFileBatches.d.ts.map +1 -1
  47. package/dist/browser/agents/vectorStoresFileBatches.js +46 -32
  48. package/dist/browser/agents/vectorStoresFileBatches.js.map +1 -1
  49. package/dist/browser/agents/vectorStoresFiles.d.ts +4 -4
  50. package/dist/browser/agents/vectorStoresFiles.d.ts.map +1 -1
  51. package/dist/browser/agents/vectorStoresFiles.js +57 -28
  52. package/dist/browser/agents/vectorStoresFiles.js.map +1 -1
  53. package/dist/browser/constants.d.ts +1 -1
  54. package/dist/browser/constants.js +1 -1
  55. package/dist/browser/constants.js.map +1 -1
  56. package/dist/browser/customization/convertModelsToWrite.d.ts.map +1 -1
  57. package/dist/browser/customization/convertModelsToWrite.js +42 -93
  58. package/dist/browser/customization/convertModelsToWrite.js.map +1 -1
  59. package/dist/browser/customization/convertOutputModelsFromWire.d.ts.map +1 -1
  60. package/dist/browser/customization/convertOutputModelsFromWire.js +51 -9
  61. package/dist/browser/customization/convertOutputModelsFromWire.js.map +1 -1
  62. package/dist/browser/customization/convertParametersToWire.d.ts +1 -1
  63. package/dist/browser/customization/convertParametersToWire.d.ts.map +1 -1
  64. package/dist/browser/customization/convertParametersToWire.js.map +1 -1
  65. package/dist/browser/customization/models.d.ts +146 -151
  66. package/dist/browser/customization/models.d.ts.map +1 -1
  67. package/dist/browser/customization/models.js.map +1 -1
  68. package/dist/browser/customization/outputModels.d.ts +188 -37
  69. package/dist/browser/customization/outputModels.d.ts.map +1 -1
  70. package/dist/browser/customization/outputModels.js.map +1 -1
  71. package/dist/browser/customization/streamingModels.d.ts +2 -1
  72. package/dist/browser/customization/streamingModels.d.ts.map +1 -1
  73. package/dist/browser/customization/streamingModels.js.map +1 -1
  74. package/dist/browser/customization/streamingWireModels.d.ts +2 -1
  75. package/dist/browser/customization/streamingWireModels.d.ts.map +1 -1
  76. package/dist/browser/customization/streamingWireModels.js.map +1 -1
  77. package/dist/browser/generated/src/models.d.ts +131 -150
  78. package/dist/browser/generated/src/models.d.ts.map +1 -1
  79. package/dist/browser/generated/src/models.js.map +1 -1
  80. package/dist/browser/generated/src/outputModels.d.ts +187 -36
  81. package/dist/browser/generated/src/outputModels.d.ts.map +1 -1
  82. package/dist/browser/generated/src/outputModels.js.map +1 -1
  83. package/dist/browser/generated/src/paginateHelper.d.ts +27 -2
  84. package/dist/browser/generated/src/paginateHelper.d.ts.map +1 -1
  85. package/dist/browser/generated/src/paginateHelper.js +98 -1
  86. package/dist/browser/generated/src/paginateHelper.js.map +1 -1
  87. package/dist/browser/generated/src/projectsClient.d.ts +2 -2
  88. package/dist/browser/generated/src/projectsClient.d.ts.map +1 -1
  89. package/dist/browser/generated/src/projectsClient.js +3 -3
  90. package/dist/browser/generated/src/projectsClient.js.map +1 -1
  91. package/dist/commonjs/agents/assistants.d.ts.map +1 -1
  92. package/dist/commonjs/agents/assistants.js +3 -1
  93. package/dist/commonjs/agents/assistants.js.map +1 -1
  94. package/dist/commonjs/agents/customModels.d.ts +4 -29
  95. package/dist/commonjs/agents/customModels.d.ts.map +1 -1
  96. package/dist/commonjs/agents/customModels.js.map +1 -1
  97. package/dist/commonjs/agents/files.d.ts +5 -4
  98. package/dist/commonjs/agents/files.d.ts.map +1 -1
  99. package/dist/commonjs/agents/files.js +55 -26
  100. package/dist/commonjs/agents/files.js.map +1 -1
  101. package/dist/commonjs/agents/index.d.ts +10 -10
  102. package/dist/commonjs/agents/index.d.ts.map +1 -1
  103. package/dist/commonjs/agents/index.js.map +1 -1
  104. package/dist/commonjs/agents/inputOutputs.d.ts +3 -3
  105. package/dist/commonjs/agents/inputOutputs.d.ts.map +1 -1
  106. package/dist/commonjs/agents/inputOutputs.js.map +1 -1
  107. package/dist/commonjs/agents/inputValidations.d.ts.map +1 -1
  108. package/dist/commonjs/agents/inputValidations.js +2 -1
  109. package/dist/commonjs/agents/inputValidations.js.map +1 -1
  110. package/dist/commonjs/agents/messages.js +2 -2
  111. package/dist/commonjs/agents/messages.js.map +1 -1
  112. package/dist/commonjs/agents/openAIError.d.ts.map +1 -1
  113. package/dist/commonjs/agents/openAIError.js +7 -1
  114. package/dist/commonjs/agents/openAIError.js.map +1 -1
  115. package/dist/commonjs/agents/poller.d.ts +8 -33
  116. package/dist/commonjs/agents/poller.d.ts.map +1 -1
  117. package/dist/commonjs/agents/poller.js +131 -55
  118. package/dist/commonjs/agents/poller.js.map +1 -1
  119. package/dist/commonjs/agents/streamingModels.d.ts +17 -15
  120. package/dist/commonjs/agents/streamingModels.d.ts.map +1 -1
  121. package/dist/commonjs/agents/streamingModels.js.map +1 -1
  122. package/dist/commonjs/agents/traceUtility.d.ts +3 -3
  123. package/dist/commonjs/agents/traceUtility.d.ts.map +1 -1
  124. package/dist/commonjs/agents/traceUtility.js.map +1 -1
  125. package/dist/commonjs/agents/utils.d.ts +53 -3
  126. package/dist/commonjs/agents/utils.d.ts.map +1 -1
  127. package/dist/commonjs/agents/utils.js +77 -2
  128. package/dist/commonjs/agents/utils.js.map +1 -1
  129. package/dist/commonjs/agents/vectorStores.d.ts +3 -4
  130. package/dist/commonjs/agents/vectorStores.d.ts.map +1 -1
  131. package/dist/commonjs/agents/vectorStores.js +43 -25
  132. package/dist/commonjs/agents/vectorStores.js.map +1 -1
  133. package/dist/commonjs/agents/vectorStoresFileBatches.d.ts +5 -4
  134. package/dist/commonjs/agents/vectorStoresFileBatches.d.ts.map +1 -1
  135. package/dist/commonjs/agents/vectorStoresFileBatches.js +46 -31
  136. package/dist/commonjs/agents/vectorStoresFileBatches.js.map +1 -1
  137. package/dist/commonjs/agents/vectorStoresFiles.d.ts +4 -4
  138. package/dist/commonjs/agents/vectorStoresFiles.d.ts.map +1 -1
  139. package/dist/commonjs/agents/vectorStoresFiles.js +56 -27
  140. package/dist/commonjs/agents/vectorStoresFiles.js.map +1 -1
  141. package/dist/commonjs/constants.d.ts +1 -1
  142. package/dist/commonjs/constants.js +1 -1
  143. package/dist/commonjs/constants.js.map +1 -1
  144. package/dist/commonjs/customization/convertModelsToWrite.d.ts.map +1 -1
  145. package/dist/commonjs/customization/convertModelsToWrite.js +42 -93
  146. package/dist/commonjs/customization/convertModelsToWrite.js.map +1 -1
  147. package/dist/commonjs/customization/convertOutputModelsFromWire.d.ts.map +1 -1
  148. package/dist/commonjs/customization/convertOutputModelsFromWire.js +51 -9
  149. package/dist/commonjs/customization/convertOutputModelsFromWire.js.map +1 -1
  150. package/dist/commonjs/customization/convertParametersToWire.d.ts +1 -1
  151. package/dist/commonjs/customization/convertParametersToWire.d.ts.map +1 -1
  152. package/dist/commonjs/customization/convertParametersToWire.js.map +1 -1
  153. package/dist/commonjs/customization/models.d.ts +146 -151
  154. package/dist/commonjs/customization/models.d.ts.map +1 -1
  155. package/dist/commonjs/customization/models.js.map +1 -1
  156. package/dist/commonjs/customization/outputModels.d.ts +188 -37
  157. package/dist/commonjs/customization/outputModels.d.ts.map +1 -1
  158. package/dist/commonjs/customization/outputModels.js.map +1 -1
  159. package/dist/commonjs/customization/streamingModels.d.ts +2 -1
  160. package/dist/commonjs/customization/streamingModels.d.ts.map +1 -1
  161. package/dist/commonjs/customization/streamingModels.js.map +1 -1
  162. package/dist/commonjs/customization/streamingWireModels.d.ts +2 -1
  163. package/dist/commonjs/customization/streamingWireModels.d.ts.map +1 -1
  164. package/dist/commonjs/customization/streamingWireModels.js.map +1 -1
  165. package/dist/commonjs/generated/src/models.d.ts +131 -150
  166. package/dist/commonjs/generated/src/models.d.ts.map +1 -1
  167. package/dist/commonjs/generated/src/models.js.map +1 -1
  168. package/dist/commonjs/generated/src/outputModels.d.ts +187 -36
  169. package/dist/commonjs/generated/src/outputModels.d.ts.map +1 -1
  170. package/dist/commonjs/generated/src/outputModels.js.map +1 -1
  171. package/dist/commonjs/generated/src/paginateHelper.d.ts +27 -2
  172. package/dist/commonjs/generated/src/paginateHelper.d.ts.map +1 -1
  173. package/dist/commonjs/generated/src/paginateHelper.js +99 -2
  174. package/dist/commonjs/generated/src/paginateHelper.js.map +1 -1
  175. package/dist/commonjs/generated/src/projectsClient.d.ts +2 -2
  176. package/dist/commonjs/generated/src/projectsClient.d.ts.map +1 -1
  177. package/dist/commonjs/generated/src/projectsClient.js +3 -3
  178. package/dist/commonjs/generated/src/projectsClient.js.map +1 -1
  179. package/dist/commonjs/tsdoc-metadata.json +1 -1
  180. package/dist/esm/agents/assistants.d.ts.map +1 -1
  181. package/dist/esm/agents/assistants.js +3 -1
  182. package/dist/esm/agents/assistants.js.map +1 -1
  183. package/dist/esm/agents/customModels.d.ts +4 -29
  184. package/dist/esm/agents/customModels.d.ts.map +1 -1
  185. package/dist/esm/agents/customModels.js.map +1 -1
  186. package/dist/esm/agents/files.d.ts +5 -4
  187. package/dist/esm/agents/files.d.ts.map +1 -1
  188. package/dist/esm/agents/files.js +55 -27
  189. package/dist/esm/agents/files.js.map +1 -1
  190. package/dist/esm/agents/index.d.ts +10 -10
  191. package/dist/esm/agents/index.d.ts.map +1 -1
  192. package/dist/esm/agents/index.js.map +1 -1
  193. package/dist/esm/agents/inputOutputs.d.ts +3 -3
  194. package/dist/esm/agents/inputOutputs.d.ts.map +1 -1
  195. package/dist/esm/agents/inputOutputs.js.map +1 -1
  196. package/dist/esm/agents/inputValidations.d.ts.map +1 -1
  197. package/dist/esm/agents/inputValidations.js +2 -1
  198. package/dist/esm/agents/inputValidations.js.map +1 -1
  199. package/dist/esm/agents/messages.js +2 -2
  200. package/dist/esm/agents/messages.js.map +1 -1
  201. package/dist/esm/agents/openAIError.d.ts.map +1 -1
  202. package/dist/esm/agents/openAIError.js +7 -1
  203. package/dist/esm/agents/openAIError.js.map +1 -1
  204. package/dist/esm/agents/poller.d.ts +8 -33
  205. package/dist/esm/agents/poller.d.ts.map +1 -1
  206. package/dist/esm/agents/poller.js +130 -53
  207. package/dist/esm/agents/poller.js.map +1 -1
  208. package/dist/esm/agents/streamingModels.d.ts +17 -15
  209. package/dist/esm/agents/streamingModels.d.ts.map +1 -1
  210. package/dist/esm/agents/streamingModels.js.map +1 -1
  211. package/dist/esm/agents/traceUtility.d.ts +3 -3
  212. package/dist/esm/agents/traceUtility.d.ts.map +1 -1
  213. package/dist/esm/agents/traceUtility.js.map +1 -1
  214. package/dist/esm/agents/utils.d.ts +53 -3
  215. package/dist/esm/agents/utils.d.ts.map +1 -1
  216. package/dist/esm/agents/utils.js +77 -2
  217. package/dist/esm/agents/utils.js.map +1 -1
  218. package/dist/esm/agents/vectorStores.d.ts +3 -4
  219. package/dist/esm/agents/vectorStores.d.ts.map +1 -1
  220. package/dist/esm/agents/vectorStores.js +44 -26
  221. package/dist/esm/agents/vectorStores.js.map +1 -1
  222. package/dist/esm/agents/vectorStoresFileBatches.d.ts +5 -4
  223. package/dist/esm/agents/vectorStoresFileBatches.d.ts.map +1 -1
  224. package/dist/esm/agents/vectorStoresFileBatches.js +46 -32
  225. package/dist/esm/agents/vectorStoresFileBatches.js.map +1 -1
  226. package/dist/esm/agents/vectorStoresFiles.d.ts +4 -4
  227. package/dist/esm/agents/vectorStoresFiles.d.ts.map +1 -1
  228. package/dist/esm/agents/vectorStoresFiles.js +57 -28
  229. package/dist/esm/agents/vectorStoresFiles.js.map +1 -1
  230. package/dist/esm/constants.d.ts +1 -1
  231. package/dist/esm/constants.js +1 -1
  232. package/dist/esm/constants.js.map +1 -1
  233. package/dist/esm/customization/convertModelsToWrite.d.ts.map +1 -1
  234. package/dist/esm/customization/convertModelsToWrite.js +42 -93
  235. package/dist/esm/customization/convertModelsToWrite.js.map +1 -1
  236. package/dist/esm/customization/convertOutputModelsFromWire.d.ts.map +1 -1
  237. package/dist/esm/customization/convertOutputModelsFromWire.js +51 -9
  238. package/dist/esm/customization/convertOutputModelsFromWire.js.map +1 -1
  239. package/dist/esm/customization/convertParametersToWire.d.ts +1 -1
  240. package/dist/esm/customization/convertParametersToWire.d.ts.map +1 -1
  241. package/dist/esm/customization/convertParametersToWire.js.map +1 -1
  242. package/dist/esm/customization/models.d.ts +146 -151
  243. package/dist/esm/customization/models.d.ts.map +1 -1
  244. package/dist/esm/customization/models.js.map +1 -1
  245. package/dist/esm/customization/outputModels.d.ts +188 -37
  246. package/dist/esm/customization/outputModels.d.ts.map +1 -1
  247. package/dist/esm/customization/outputModels.js.map +1 -1
  248. package/dist/esm/customization/streamingModels.d.ts +2 -1
  249. package/dist/esm/customization/streamingModels.d.ts.map +1 -1
  250. package/dist/esm/customization/streamingModels.js.map +1 -1
  251. package/dist/esm/customization/streamingWireModels.d.ts +2 -1
  252. package/dist/esm/customization/streamingWireModels.d.ts.map +1 -1
  253. package/dist/esm/customization/streamingWireModels.js.map +1 -1
  254. package/dist/esm/generated/src/models.d.ts +131 -150
  255. package/dist/esm/generated/src/models.d.ts.map +1 -1
  256. package/dist/esm/generated/src/models.js.map +1 -1
  257. package/dist/esm/generated/src/outputModels.d.ts +187 -36
  258. package/dist/esm/generated/src/outputModels.d.ts.map +1 -1
  259. package/dist/esm/generated/src/outputModels.js.map +1 -1
  260. package/dist/esm/generated/src/paginateHelper.d.ts +27 -2
  261. package/dist/esm/generated/src/paginateHelper.d.ts.map +1 -1
  262. package/dist/esm/generated/src/paginateHelper.js +98 -1
  263. package/dist/esm/generated/src/paginateHelper.js.map +1 -1
  264. package/dist/esm/generated/src/projectsClient.d.ts +2 -2
  265. package/dist/esm/generated/src/projectsClient.d.ts.map +1 -1
  266. package/dist/esm/generated/src/projectsClient.js +3 -3
  267. package/dist/esm/generated/src/projectsClient.js.map +1 -1
  268. package/dist/react-native/agents/assistants.d.ts.map +1 -1
  269. package/dist/react-native/agents/assistants.js +3 -1
  270. package/dist/react-native/agents/assistants.js.map +1 -1
  271. package/dist/react-native/agents/customModels.d.ts +4 -29
  272. package/dist/react-native/agents/customModels.d.ts.map +1 -1
  273. package/dist/react-native/agents/customModels.js.map +1 -1
  274. package/dist/react-native/agents/files.d.ts +5 -4
  275. package/dist/react-native/agents/files.d.ts.map +1 -1
  276. package/dist/react-native/agents/files.js +55 -27
  277. package/dist/react-native/agents/files.js.map +1 -1
  278. package/dist/react-native/agents/index.d.ts +10 -10
  279. package/dist/react-native/agents/index.d.ts.map +1 -1
  280. package/dist/react-native/agents/index.js.map +1 -1
  281. package/dist/react-native/agents/inputOutputs.d.ts +3 -3
  282. package/dist/react-native/agents/inputOutputs.d.ts.map +1 -1
  283. package/dist/react-native/agents/inputOutputs.js.map +1 -1
  284. package/dist/react-native/agents/inputValidations.d.ts.map +1 -1
  285. package/dist/react-native/agents/inputValidations.js +2 -1
  286. package/dist/react-native/agents/inputValidations.js.map +1 -1
  287. package/dist/react-native/agents/messages.js +2 -2
  288. package/dist/react-native/agents/messages.js.map +1 -1
  289. package/dist/react-native/agents/openAIError.d.ts.map +1 -1
  290. package/dist/react-native/agents/openAIError.js +7 -1
  291. package/dist/react-native/agents/openAIError.js.map +1 -1
  292. package/dist/react-native/agents/poller.d.ts +8 -33
  293. package/dist/react-native/agents/poller.d.ts.map +1 -1
  294. package/dist/react-native/agents/poller.js +130 -53
  295. package/dist/react-native/agents/poller.js.map +1 -1
  296. package/dist/react-native/agents/streamingModels.d.ts +17 -15
  297. package/dist/react-native/agents/streamingModels.d.ts.map +1 -1
  298. package/dist/react-native/agents/streamingModels.js.map +1 -1
  299. package/dist/react-native/agents/traceUtility.d.ts +3 -3
  300. package/dist/react-native/agents/traceUtility.d.ts.map +1 -1
  301. package/dist/react-native/agents/traceUtility.js.map +1 -1
  302. package/dist/react-native/agents/utils.d.ts +53 -3
  303. package/dist/react-native/agents/utils.d.ts.map +1 -1
  304. package/dist/react-native/agents/utils.js +77 -2
  305. package/dist/react-native/agents/utils.js.map +1 -1
  306. package/dist/react-native/agents/vectorStores.d.ts +3 -4
  307. package/dist/react-native/agents/vectorStores.d.ts.map +1 -1
  308. package/dist/react-native/agents/vectorStores.js +44 -26
  309. package/dist/react-native/agents/vectorStores.js.map +1 -1
  310. package/dist/react-native/agents/vectorStoresFileBatches.d.ts +5 -4
  311. package/dist/react-native/agents/vectorStoresFileBatches.d.ts.map +1 -1
  312. package/dist/react-native/agents/vectorStoresFileBatches.js +46 -32
  313. package/dist/react-native/agents/vectorStoresFileBatches.js.map +1 -1
  314. package/dist/react-native/agents/vectorStoresFiles.d.ts +4 -4
  315. package/dist/react-native/agents/vectorStoresFiles.d.ts.map +1 -1
  316. package/dist/react-native/agents/vectorStoresFiles.js +57 -28
  317. package/dist/react-native/agents/vectorStoresFiles.js.map +1 -1
  318. package/dist/react-native/constants.d.ts +1 -1
  319. package/dist/react-native/constants.js +1 -1
  320. package/dist/react-native/constants.js.map +1 -1
  321. package/dist/react-native/customization/convertModelsToWrite.d.ts.map +1 -1
  322. package/dist/react-native/customization/convertModelsToWrite.js +42 -93
  323. package/dist/react-native/customization/convertModelsToWrite.js.map +1 -1
  324. package/dist/react-native/customization/convertOutputModelsFromWire.d.ts.map +1 -1
  325. package/dist/react-native/customization/convertOutputModelsFromWire.js +51 -9
  326. package/dist/react-native/customization/convertOutputModelsFromWire.js.map +1 -1
  327. package/dist/react-native/customization/convertParametersToWire.d.ts +1 -1
  328. package/dist/react-native/customization/convertParametersToWire.d.ts.map +1 -1
  329. package/dist/react-native/customization/convertParametersToWire.js.map +1 -1
  330. package/dist/react-native/customization/models.d.ts +146 -151
  331. package/dist/react-native/customization/models.d.ts.map +1 -1
  332. package/dist/react-native/customization/models.js.map +1 -1
  333. package/dist/react-native/customization/outputModels.d.ts +188 -37
  334. package/dist/react-native/customization/outputModels.d.ts.map +1 -1
  335. package/dist/react-native/customization/outputModels.js.map +1 -1
  336. package/dist/react-native/customization/streamingModels.d.ts +2 -1
  337. package/dist/react-native/customization/streamingModels.d.ts.map +1 -1
  338. package/dist/react-native/customization/streamingModels.js.map +1 -1
  339. package/dist/react-native/customization/streamingWireModels.d.ts +2 -1
  340. package/dist/react-native/customization/streamingWireModels.d.ts.map +1 -1
  341. package/dist/react-native/customization/streamingWireModels.js.map +1 -1
  342. package/dist/react-native/generated/src/models.d.ts +131 -150
  343. package/dist/react-native/generated/src/models.d.ts.map +1 -1
  344. package/dist/react-native/generated/src/models.js.map +1 -1
  345. package/dist/react-native/generated/src/outputModels.d.ts +187 -36
  346. package/dist/react-native/generated/src/outputModels.d.ts.map +1 -1
  347. package/dist/react-native/generated/src/outputModels.js.map +1 -1
  348. package/dist/react-native/generated/src/paginateHelper.d.ts +27 -2
  349. package/dist/react-native/generated/src/paginateHelper.d.ts.map +1 -1
  350. package/dist/react-native/generated/src/paginateHelper.js +98 -1
  351. package/dist/react-native/generated/src/paginateHelper.js.map +1 -1
  352. package/dist/react-native/generated/src/projectsClient.d.ts +2 -2
  353. package/dist/react-native/generated/src/projectsClient.d.ts.map +1 -1
  354. package/dist/react-native/generated/src/projectsClient.js +3 -3
  355. package/dist/react-native/generated/src/projectsClient.js.map +1 -1
  356. package/package.json +33 -34
@@ -1,7 +1,104 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { getPagedAsyncIterator, } from "@azure/core-paging";
3
+ import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
4
4
  import { createRestError, } from "@azure-rest/core-client";
5
+ /**
6
+ * returns an async iterator that iterates over results. It also has a `byPage`
7
+ * method that returns pages of items at once.
8
+ *
9
+ * @param pagedResult - an object that specifies how to get pages.
10
+ * @returns a paged async iterator that iterates over results.
11
+ */
12
+ function getPagedAsyncIterator(pagedResult) {
13
+ var _a;
14
+ const iter = getItemAsyncIterator(pagedResult);
15
+ return {
16
+ next() {
17
+ return iter.next();
18
+ },
19
+ [Symbol.asyncIterator]() {
20
+ return this;
21
+ },
22
+ byPage: (_a = pagedResult === null || pagedResult === void 0 ? void 0 : pagedResult.byPage) !== null && _a !== void 0 ? _a : ((settings) => {
23
+ const { continuationToken } = settings !== null && settings !== void 0 ? settings : {};
24
+ return getPageAsyncIterator(pagedResult, {
25
+ pageLink: continuationToken,
26
+ });
27
+ }),
28
+ };
29
+ }
30
+ function getItemAsyncIterator(pagedResult) {
31
+ return __asyncGenerator(this, arguments, function* getItemAsyncIterator_1() {
32
+ var _a, e_1, _b, _c, _d, e_2, _e, _f;
33
+ const pages = getPageAsyncIterator(pagedResult);
34
+ const firstVal = yield __await(pages.next());
35
+ // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is
36
+ if (!Array.isArray(firstVal.value)) {
37
+ // can extract elements from this page
38
+ const { toElements } = pagedResult;
39
+ if (toElements) {
40
+ yield __await(yield* __asyncDelegator(__asyncValues(toElements(firstVal.value))));
41
+ try {
42
+ for (var _g = true, pages_1 = __asyncValues(pages), pages_1_1; pages_1_1 = yield __await(pages_1.next()), _a = pages_1_1.done, !_a; _g = true) {
43
+ _c = pages_1_1.value;
44
+ _g = false;
45
+ const page = _c;
46
+ yield __await(yield* __asyncDelegator(__asyncValues(toElements(page))));
47
+ }
48
+ }
49
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
50
+ finally {
51
+ try {
52
+ if (!_g && !_a && (_b = pages_1.return)) yield __await(_b.call(pages_1));
53
+ }
54
+ finally { if (e_1) throw e_1.error; }
55
+ }
56
+ }
57
+ else {
58
+ yield yield __await(firstVal.value);
59
+ // `pages` is of type `AsyncIterableIterator<TPage>` but TPage = TElement in this case
60
+ yield __await(yield* __asyncDelegator(__asyncValues(pages)));
61
+ }
62
+ }
63
+ else {
64
+ yield __await(yield* __asyncDelegator(__asyncValues(firstVal.value)));
65
+ try {
66
+ for (var _h = true, pages_2 = __asyncValues(pages), pages_2_1; pages_2_1 = yield __await(pages_2.next()), _d = pages_2_1.done, !_d; _h = true) {
67
+ _f = pages_2_1.value;
68
+ _h = false;
69
+ const page = _f;
70
+ // pages is of type `AsyncIterableIterator<TPage>` so `page` is of type `TPage`. In this branch,
71
+ // it must be the case that `TPage = TElement[]`
72
+ yield __await(yield* __asyncDelegator(__asyncValues(page)));
73
+ }
74
+ }
75
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
76
+ finally {
77
+ try {
78
+ if (!_h && !_d && (_e = pages_2.return)) yield __await(_e.call(pages_2));
79
+ }
80
+ finally { if (e_2) throw e_2.error; }
81
+ }
82
+ }
83
+ });
84
+ }
85
+ function getPageAsyncIterator(pagedResult_1) {
86
+ return __asyncGenerator(this, arguments, function* getPageAsyncIterator_1(pagedResult, options = {}) {
87
+ const { pageLink } = options;
88
+ let response = yield __await(pagedResult.getPage(pageLink !== null && pageLink !== void 0 ? pageLink : pagedResult.firstPageLink));
89
+ if (!response) {
90
+ return yield __await(void 0);
91
+ }
92
+ yield yield __await(response.page);
93
+ while (response.nextPageLink) {
94
+ response = yield __await(pagedResult.getPage(response.nextPageLink));
95
+ if (!response) {
96
+ return yield __await(void 0);
97
+ }
98
+ yield yield __await(response.page);
99
+ }
100
+ });
101
+ }
5
102
  /**
6
103
  * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
7
104
  * @param client - Client to use for sending the next page requests
@@ -1 +1 @@
1
- {"version":3,"file":"paginateHelper.js","sourceRoot":"","sources":["../../../../src/generated/src/paginateHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,qBAAqB,GAGtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,eAAe,GAEhB,MAAM,yBAAyB,CAAC;AAyCjC;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CACtB,MAAc,EACd,eAA0B,EAC1B,UAAoC,EAAE;IAItC,IAAI,QAAQ,GAAG,IAAI,CAAC;IACpB,MAA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EAAE,QAAgB;IAC/D,MAAM,KAAK,GAAI,IAAgC,CAAC,QAAQ,CAAQ,CAAC;IAEjE,qEAAqE;IACrE,qEAAqE;IACrE,iDAAiD;IACjD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CACb,kFAAkF,QAAQ,EAAE,CAC7F,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B;IACzD,MAAM,kBAAkB,GAAG;QACzB,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;KACN,CAAC;IACF,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,MAAM,eAAe,CACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n getPagedAsyncIterator,\n PagedAsyncIterableIterator,\n PagedResult,\n} from \"@azure/core-paging\";\nimport {\n Client,\n createRestError,\n PathUncheckedResponse,\n} from \"@azure-rest/core-client\";\n\n/**\n * Helper type to extract the type of an array\n */\nexport type GetArrayType<T> = T extends Array<infer TData> ? TData : never;\n\n/**\n * The type of a custom function that defines how to get a page and a link to the next one if any.\n */\nexport type GetPage<TPage> = (\n pageLink: string,\n maxPageSize?: number,\n) => Promise<{\n page: TPage;\n nextPageLink?: string;\n}>;\n\n/**\n * Options for the paging helper\n */\nexport interface PagingOptions<TResponse> {\n /**\n * Custom function to extract pagination details for crating the PagedAsyncIterableIterator\n */\n customGetPage?: GetPage<PaginateReturn<TResponse>[]>;\n}\n\n/**\n * Helper type to infer the Type of the paged elements from the response type\n * This type is generated based on the swagger information for x-ms-pageable\n * specifically on the itemName property which indicates the property of the response\n * where the page items are found. The default value is `value`.\n * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter\n */\nexport type PaginateReturn<TResult> = TResult extends {\n body: { value?: infer TPage };\n}\n ? GetArrayType<TPage>\n : Array<unknown>;\n\n/**\n * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension\n * @param client - Client to use for sending the next page requests\n * @param initialResponse - Initial response containing the nextLink and current page of elements\n * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results\n * @returns - PagedAsyncIterableIterator to iterate the elements\n */\nexport function paginate<TResponse extends PathUncheckedResponse>(\n client: Client,\n initialResponse: TResponse,\n options: PagingOptions<TResponse> = {},\n): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {\n // Extract element type from initial response\n type TElement = PaginateReturn<TResponse>;\n let firstRun = true;\n const itemName = \"value\";\n const nextLinkName = \"nextLink\";\n const { customGetPage } = options;\n const pagedResult: PagedResult<TElement[]> = {\n firstPageLink: \"\",\n getPage:\n typeof customGetPage === \"function\"\n ? customGetPage\n : async (pageLink: string) => {\n const result = firstRun\n ? initialResponse\n : await client.pathUnchecked(pageLink).get();\n firstRun = false;\n checkPagingRequest(result);\n const nextLink = getNextLink(result.body, nextLinkName);\n const values = getElements<TElement>(result.body, itemName);\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n };\n\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\") {\n throw new Error(\n `Body Property ${nextLinkName} should be a string or undefined`,\n );\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n\n // value has to be an array according to the x-ms-pageable extension.\n // The fact that this must be an array is used above to calculate the\n // type of elements in the page in PaginateReturn\n if (!Array.isArray(value)) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`,\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse): void {\n const Http2xxStatusCodes = [\n \"200\",\n \"201\",\n \"202\",\n \"203\",\n \"204\",\n \"205\",\n \"206\",\n \"207\",\n \"208\",\n \"226\",\n ];\n if (!Http2xxStatusCodes.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response,\n );\n }\n}\n"]}
1
+ {"version":3,"file":"paginateHelper.js","sourceRoot":"","sources":["../../../../src/generated/src/paginateHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAEL,eAAe,GAEhB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;GAMG;AACH,SAAS,qBAAqB,CAM5B,WAAqD;;IAErD,MAAM,IAAI,GAAG,oBAAoB,CAC/B,WAAW,CACZ,CAAC;IACF,OAAO;QACL,IAAI;YACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;QACrB,CAAC;QACD,CAAC,MAAM,CAAC,aAAa,CAAC;YACpB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,EACJ,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,mCAClB,CAAC,CAAC,QAAuB,EAAE,EAAE;YAC5B,MAAM,EAAE,iBAAiB,EAAE,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,EAAE,CAAC;YAC7C,OAAO,oBAAoB,CAAC,WAAW,EAAE;gBACvC,QAAQ,EAAE,iBAAiD;aAC5D,CAAC,CAAC;QACL,CAAC,CAEiC;KACrC,CAAC;AACJ,CAAC;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ACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;KACN,CAAC;IACF,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,MAAM,eAAe,CACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n Client,\n createRestError,\n PathUncheckedResponse,\n} from \"@azure-rest/core-client\";\n\n/**\n * returns an async iterator that iterates over results. It also has a `byPage`\n * method that returns pages of items at once.\n *\n * @param pagedResult - an object that specifies how to get pages.\n * @returns a paged async iterator that iterates over results.\n */\nfunction getPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings = PageSettings,\n TLink = string,\n>(\n pagedResult: PagedResult<TPage, TPageSettings, TLink>,\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const iter = getItemAsyncIterator<TElement, TPage, TLink, TPageSettings>(\n pagedResult,\n );\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage:\n pagedResult?.byPage ??\n (((settings?: PageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken as unknown as TLink | undefined,\n });\n }) as unknown as (\n settings?: TPageSettings,\n ) => AsyncIterableIterator<TPage>),\n };\n}\n\nasync function* getItemAsyncIterator<TElement, TPage, TLink, TPageSettings>(\n pagedResult: PagedResult<TPage, TPageSettings, TLink>,\n): AsyncIterableIterator<TElement> {\n const pages = getPageAsyncIterator(pagedResult);\n const firstVal = await pages.next();\n // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is\n if (!Array.isArray(firstVal.value)) {\n // can extract elements from this page\n const { toElements } = pagedResult;\n if (toElements) {\n yield* toElements(firstVal.value) as TElement[];\n for await (const page of pages) {\n yield* toElements(page) as TElement[];\n }\n } else {\n yield firstVal.value;\n // `pages` is of type `AsyncIterableIterator<TPage>` but TPage = TElement in this case\n yield* pages as unknown as AsyncIterableIterator<TElement>;\n }\n } else {\n yield* firstVal.value;\n for await (const page of pages) {\n // pages is of type `AsyncIterableIterator<TPage>` so `page` is of type `TPage`. In this branch,\n // it must be the case that `TPage = TElement[]`\n yield* page as unknown as TElement[];\n }\n }\n}\n\nasync function* getPageAsyncIterator<TPage, TLink, TPageSettings>(\n pagedResult: PagedResult<TPage, TPageSettings, TLink>,\n options: {\n pageLink?: TLink;\n } = {},\n): AsyncIterableIterator<TPage> {\n const { pageLink } = options;\n let response = await pagedResult.getPage(\n pageLink ?? pagedResult.firstPageLink,\n );\n if (!response) {\n return;\n }\n yield response.page;\n while (response.nextPageLink) {\n response = await pagedResult.getPage(response.nextPageLink);\n if (!response) {\n return;\n }\n yield response.page;\n }\n}\n\n/**\n * An interface that tracks the settings for paged iteration\n */\nexport interface PageSettings {\n /**\n * The token that keeps track of where to continue the iterator\n */\n continuationToken?: string;\n}\n\n/**\n * An interface that allows async iterable iteration both to completion and by page.\n */\nexport interface PagedAsyncIterableIterator<\n TElement,\n TPage = TElement[],\n TPageSettings = PageSettings,\n> {\n /**\n * The next method, part of the iteration protocol\n */\n next(): Promise<IteratorResult<TElement>>;\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator](): PagedAsyncIterableIterator<\n TElement,\n TPage,\n TPageSettings\n >;\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;\n}\n\n/**\n * An interface that describes how to communicate with the service.\n */\ninterface PagedResult<TPage, TPageSettings = PageSettings, TLink = string> {\n /**\n * Link to the first page of results.\n */\n firstPageLink: TLink;\n /**\n * A method that returns a page of results.\n */\n getPage: (\n pageLink: TLink,\n ) => Promise<{ page: TPage; nextPageLink?: TLink } | undefined>;\n /**\n * a function to implement the `byPage` method on the paged async iterator.\n */\n byPage?: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;\n\n /**\n * A function to extract elements from a page.\n */\n toElements?: (page: TPage) => unknown[];\n}\n\n/**\n * Helper type to extract the type of an array\n */\nexport type GetArrayType<T> = T extends Array<infer TData> ? TData : never;\n\n/**\n * The type of a custom function that defines how to get a page and a link to the next one if any.\n */\nexport type GetPage<TPage> = (pageLink: string) => Promise<{\n page: TPage;\n nextPageLink?: string;\n}>;\n\n/**\n * Options for the paging helper\n */\nexport interface PagingOptions<TResponse> {\n /**\n * Custom function to extract pagination details for crating the PagedAsyncIterableIterator\n */\n customGetPage?: GetPage<PaginateReturn<TResponse>[]>;\n}\n\n/**\n * Helper type to infer the Type of the paged elements from the response type\n * This type is generated based on the swagger information for x-ms-pageable\n * specifically on the itemName property which indicates the property of the response\n * where the page items are found. The default value is `value`.\n * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter\n */\nexport type PaginateReturn<TResult> = TResult extends {\n body: { value?: infer TPage };\n}\n ? GetArrayType<TPage>\n : Array<unknown>;\n\n/**\n * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension\n * @param client - Client to use for sending the next page requests\n * @param initialResponse - Initial response containing the nextLink and current page of elements\n * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results\n * @returns - PagedAsyncIterableIterator to iterate the elements\n */\nexport function paginate<TResponse extends PathUncheckedResponse>(\n client: Client,\n initialResponse: TResponse,\n options: PagingOptions<TResponse> = {},\n): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {\n // Extract element type from initial response\n type TElement = PaginateReturn<TResponse>;\n let firstRun = true;\n const itemName = \"value\";\n const nextLinkName = \"nextLink\";\n const { customGetPage } = options;\n const pagedResult: PagedResult<TElement[]> = {\n firstPageLink: \"\",\n getPage:\n typeof customGetPage === \"function\"\n ? customGetPage\n : async (pageLink: string) => {\n const result = firstRun\n ? initialResponse\n : await client.pathUnchecked(pageLink).get();\n firstRun = false;\n checkPagingRequest(result);\n const nextLink = getNextLink(result.body, nextLinkName);\n const values = getElements<TElement>(result.body, itemName);\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n };\n\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\") {\n throw new Error(\n `Body Property ${nextLinkName} should be a string or undefined`,\n );\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n\n // value has to be an array according to the x-ms-pageable extension.\n // The fact that this must be an array is used above to calculate the\n // type of elements in the page in PaginateReturn\n if (!Array.isArray(value)) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`,\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse): void {\n const Http2xxStatusCodes = [\n \"200\",\n \"201\",\n \"202\",\n \"203\",\n \"204\",\n \"205\",\n \"206\",\n \"207\",\n \"208\",\n \"226\",\n ];\n if (!Http2xxStatusCodes.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response,\n );\n }\n}\n"]}
@@ -8,10 +8,10 @@ export interface ProjectsClientOptions extends ClientOptions {
8
8
  }
9
9
  /**
10
10
  * Initialize a new instance of `ProjectsClient`
11
- * @param endpointParam - The Azure AI Studio project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link.
11
+ * @param endpointParam - The Azure AI Foundry project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link.
12
12
  * @param subscriptionId - The Azure subscription ID.
13
13
  * @param resourceGroupName - The name of the Azure Resource Group.
14
- * @param projectName - The Azure AI Studio project name.
14
+ * @param projectName - The Azure AI Foundry project name.
15
15
  * @param credentials - uniquely identify client credential
16
16
  * @param options - the parameter for all optional parameters
17
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"projectsClient.d.ts","sourceRoot":"","sources":["../../../../src/generated/src/projectsClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAAa,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,6CAA6C;AAC7C,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAC1D,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,iBAAiB,EAAE,MAAM,EACzB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,eAAe,EAC5B,EAAE,UAAiC,EAAE,GAAG,OAAO,EAAE,GAAE,qBAA0B,GAC5E,cAAc,CA4ChB"}
1
+ {"version":3,"file":"projectsClient.d.ts","sourceRoot":"","sources":["../../../../src/generated/src/projectsClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAAa,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,6CAA6C;AAC7C,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAC1D,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,iBAAiB,EAAE,MAAM,EACzB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,eAAe,EAC5B,EAAE,UAAiC,EAAE,GAAG,OAAO,EAAE,GAAE,qBAA0B,GAC5E,cAAc,CA2ChB"}
@@ -5,10 +5,10 @@ import { getClient } from "@azure-rest/core-client";
5
5
  import { logger } from "./logger.js";
6
6
  /**
7
7
  * Initialize a new instance of `ProjectsClient`
8
- * @param endpointParam - The Azure AI Studio project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link.
8
+ * @param endpointParam - The Azure AI Foundry project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link.
9
9
  * @param subscriptionId - The Azure subscription ID.
10
10
  * @param resourceGroupName - The name of the Azure Resource Group.
11
- * @param projectName - The Azure AI Studio project name.
11
+ * @param projectName - The Azure AI Foundry project name.
12
12
  * @param credentials - uniquely identify client credential
13
13
  * @param options - the parameter for all optional parameters
14
14
  */
@@ -16,7 +16,7 @@ export default function createClient(endpointParam, subscriptionId, resourceGrou
16
16
  var _b, _c, _d, _e, _f, _g;
17
17
  var { apiVersion = "2024-07-01-preview" } = _a, options = __rest(_a, ["apiVersion"]);
18
18
  const endpointUrl = (_c = (_b = options.endpoint) !== null && _b !== void 0 ? _b : options.baseUrl) !== null && _c !== void 0 ? _c : `${endpointParam}/agents/v1.0/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/${projectName}`;
19
- const userAgentInfo = `azsdk-js-ai-projects-rest/1.0.0-beta.1`;
19
+ const userAgentInfo = `azsdk-js-ai-projects-rest/1.0.0-beta.3`;
20
20
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
21
21
  ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
22
22
  : `${userAgentInfo}`;
@@ -1 +1 @@
1
- {"version":3,"file":"projectsClient.js","sourceRoot":"","sources":["../../../../src/generated/src/projectsClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,SAAS,EAAiB,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAqB,EACrB,cAAsB,EACtB,iBAAyB,EACzB,WAAmB,EACnB,WAA4B,EAC5B,KAA2E,EAAE;;QAA7E,EAAE,UAAU,GAAG,oBAAoB,OAA0C,EAArC,OAAO,cAA/C,cAAiD,CAAF;IAE/C,MAAM,WAAW,GACf,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAChB,OAAO,CAAC,OAAO,mCACf,GAAG,aAAa,8BAA8B,cAAc,mBAAmB,iBAAiB,2DAA2D,WAAW,EAAE,CAAC;IAC3K,MAAM,aAAa,GAAG,wCAAwC,CAAC;IAC/D,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,EACD,cAAc,EAAE;YACd,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,cAAc,0CAAE,MAAM,mCAAI,MAAM,CAAC,IAAI;SACtD,EACD,WAAW,EAAE;YACX,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,WAAW,0CAAE,MAAM,mCAAI;gBACrC,uCAAuC;aACxC;SACF,GACF,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAmB,CAAC;IAE9E,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;QACxB,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { ProjectsClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface ProjectsClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `ProjectsClient`\n * @param endpointParam - The Azure AI Studio project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link.\n * @param subscriptionId - The Azure subscription ID.\n * @param resourceGroupName - The name of the Azure Resource Group.\n * @param projectName - The Azure AI Studio project name.\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n subscriptionId: string,\n resourceGroupName: string,\n projectName: string,\n credentials: TokenCredential,\n { apiVersion = \"2024-07-01-preview\", ...options }: ProjectsClientOptions = {},\n): ProjectsClient {\n const endpointUrl =\n options.endpoint ??\n options.baseUrl ??\n `${endpointParam}/agents/v1.0/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/${projectName}`;\n const userAgentInfo = `azsdk-js-ai-projects-rest/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\n \"https://management.azure.com/.default\",\n ],\n },\n };\n const client = getClient(endpointUrl, credentials, options) as ProjectsClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
1
+ {"version":3,"file":"projectsClient.js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,kBAAkB,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;QACxB,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAC5E,eAAe,UAAU,EAAE,CAAC;YAChC,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { ProjectsClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface ProjectsClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `ProjectsClient`\n * @param endpointParam - The Azure AI Foundry project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link.\n * @param subscriptionId - The Azure subscription ID.\n * @param resourceGroupName - The name of the Azure Resource Group.\n * @param projectName - The Azure AI Foundry project name.\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n subscriptionId: string,\n resourceGroupName: string,\n projectName: string,\n credentials: TokenCredential,\n { apiVersion = \"2024-07-01-preview\", ...options }: ProjectsClientOptions = {},\n): ProjectsClient {\n const endpointUrl =\n options.endpoint ??\n options.baseUrl ??\n `${endpointParam}/agents/v1.0/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/${projectName}`;\n const userAgentInfo = `azsdk-js-ai-projects-rest/1.0.0-beta.3`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\n \"https://management.azure.com/.default\",\n ],\n },\n };\n const client = getClient(endpointUrl, credentials, options) as ProjectsClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"assistants.d.ts","sourceRoot":"","sources":["../../../src/agents/assistants.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EACV,yBAAyB,EACzB,WAAW,EACX,+BAA+B,EAChC,MAAM,kCAAkC,CAAC;AAU1C,OAAO,KAAK,EACV,yBA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M,EACb,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,WAAW,CAAC,CAuBtB;AAED,0DAA0D;AAC1D,wBAAsB,UAAU,CAC9B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,+BAA+B,CAAC,CAoB1C;AAED,mCAAmC;AACnC,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,WAAW,CAAC,CA0BtB;AAED,kCAAkC;AAClC,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,WAAW,CAAC,CAyBtB;AAED,wBAAwB;AACxB,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,yBAAyB,CAAC,CAsBpC"}
@@ -27,6 +27,8 @@ var Tools;
27
27
  Tools["MicrosoftFabric"] = "microsoft_fabric";
28
28
  Tools["SharepointGrounding"] = "sharepoint_grounding";
29
29
  Tools["AzureAISearch"] = "azure_ai_search";
30
+ Tools["OpenApi"] = "openapi";
31
+ Tools["AzureFunction"] = "azure_function";
30
32
  })(Tools || (Tools = {}));
31
33
  /** Creates a new agent. */
32
34
  async function createAgent(context, model, options = {}) {
@@ -103,7 +105,7 @@ function validateCreateAgentParameters(options) {
103
105
  var _a;
104
106
  if (options.body.tools) {
105
107
  if (options.body.tools.some((value) => !Object.values(Tools).includes(value.type))) {
106
- throw new Error("Tool type must be one of 'code_interpreter', 'file_search', 'function', 'bing_grounding', 'microsoft_fabric', 'sharepoint_grounding', 'azure_ai_search'");
108
+ throw new Error("Tool type must be one of 'code_interpreter', 'file_search', 'function', 'bing_grounding', 'microsoft_fabric', 'sharepoint_grounding', 'azure_ai_search', 'azure_function'");
107
109
  }
108
110
  }
109
111
  if (options.body.tool_resources) {
@@ -1 +1 @@
1
- {"version":3,"file":"assistants.js","sourceRoot":"","sources":["../../../src/agents/assistants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA4ClC,kCA2BC;AAGD,gCAuBC;AAGD,4BA8BC;AAGD,kCA6BC;AAGD,kCA0BC;;AA5LD,yDAA8E;AAM9E,+DAK+B;AAC/B,8CAA+C;AAC/C,6DAAkG;AAClG,uDAAiF;AASjF,yGAAmF;AACnF,kGAA4E;AAC5E,4FAA2F;AAC3F,qDAAqD;AAErD,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;AAEjC,IAAK,KAQJ;AARD,WAAK,KAAK;IACR,6CAAoC,CAAA;IACpC,mCAA0B,CAAA;IAC1B,8BAAqB,CAAA;IACrB,yCAAgC,CAAA;IAChC,6CAAoC,CAAA;IACpC,qDAA4C,CAAA;IAC5C,0CAAiC,CAAA;AACnC,CAAC,EARI,KAAK,KAAL,KAAK,QAQT;AAED,2BAA2B;AACpB,KAAK,UAAU,WAAW,CAC/B,OAAe,EACf,KAAa,EACb,UAAqC,EAAE;IAEvC,MAAM,aAAa,mCACd,IAAA,iDAAmC,EAAC,OAAO,CAAC,KAC/C,IAAI,oBACC,eAAe,CAAC,yBAAyB,iCAAM,OAAO,KAAE,KAAK,IAAG,IAEtE,CAAC;IAEF,6BAA6B,CAAC,aAAa,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,MAAM,2BAAc,CAAC,QAAQ,CAC5C,aAAa,EACb,aAAa,EACb,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACtE,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9C,MAAM,IAAA,kCAAiB,EAAC,MAAM,CA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,KAAK,EAAE,CAAC;QACpC,IAAA,mCAAa,EAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,WAAmB;IAC9C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC;AAED,SAAS,6BAA6B,CACpC,WAAmB,EACnB,OAAmD;IAEnD,mBAAmB,CAAC,WAAW,CAAC,CAAC;IACjC,IAAI,OAAO,EAAE,CAAC;QACZ,6BAA6B,CAAC,OAAO,CAAC,CAAC;IACzC,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 AgentDeletionStatusOutput,\n AgentOutput,\n OpenAIPageableListOfAgentOutput,\n} from \"../customization/outputModels.js\";\nimport {\n validateLimit,\n validateMetadata,\n validateOrder,\n validateVectorStoreDataType,\n} from \"./inputValidations.js\";\nimport { TracingUtility } from \"../tracing.js\";\nimport { traceEndCreateOrUpdateAgent, traceStartCreateOrUpdateAgent } from \"./assistantsTrace.js\";\nimport { traceEndAgentGeneric, traceStartAgentGeneric } from \"./traceUtility.js\";\nimport type {\n CreateAgentOptionalParams,\n DeleteAgentOptionalParams,\n GetAgentOptionalParams,\n ListAgentsOptionalParams,\n UpdateAgentOptionalParams,\n} from \"./customModels.js\";\nimport type * as GeneratedParameters from \"../generated/src/parameters.js\";\nimport * as ConvertFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport * as ConverterToWire from \"../customization/convertModelsToWrite.js\";\nimport { convertToListQueryParameters } from \"../customization/convertParametersToWire.js\";\nimport { createOpenAIError } from \"./openAIError.js\";\n\nconst expectedStatuses = [\"200\"];\n\nenum Tools {\n CodeInterpreter = \"code_interpreter\",\n FileSearch = \"file_search\",\n Function = \"function\",\n BingGrounding = \"bing_grounding\",\n MicrosoftFabric = \"microsoft_fabric\",\n SharepointGrounding = \"sharepoint_grounding\",\n AzureAISearch = \"azure_ai_search\",\n}\n\n/** Creates a new agent. */\nexport async function createAgent(\n context: Client,\n model: string,\n options: CreateAgentOptionalParams = {},\n): Promise<AgentOutput> {\n const createOptions: GeneratedParameters.CreateAgentParameters = {\n ...operationOptionsToRequestParameters(options),\n body: {\n ...ConverterToWire.convertCreateAgentOptions({ ...options, model }),\n },\n };\n\n validateCreateAgentParameters(createOptions);\n const response = await TracingUtility.withSpan(\n \"CreateAgent\",\n createOptions,\n async (updatedOptions) => {\n const result = await context.path(\"/assistants\").post(updatedOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n traceStartCreateOrUpdateAgent,\n traceEndCreateOrUpdateAgent,\n );\n return ConvertFromWire.convertAgentOutput(response);\n}\n\n/** Gets a list of agents that were previously created. */\nexport async function listAgents(\n context: Client,\n options: ListAgentsOptionalParams = {},\n): Promise<OpenAIPageableListOfAgentOutput> {\n const listAgentsOptions: GeneratedParameters.ListAgentsParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: convertToListQueryParameters(options),\n };\n\n validateListAgentsParameters(listAgentsOptions);\n const response = await TracingUtility.withSpan(\n \"ListAgents\",\n listAgentsOptions || {},\n async (updateOptions) => {\n const result = await context.path(\"/assistants\").get(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n );\n\n return ConvertFromWire.convertOpenAIPageableListOfAgentOutput(response);\n}\n\n/** Retrieves an existing agent. */\nexport async function getAgent(\n context: Client,\n assistantId: string,\n options: GetAgentOptionalParams = {},\n): Promise<AgentOutput> {\n const getAgentOptions: GeneratedParameters.GetAgentParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateAssistantId(assistantId);\n const response = await TracingUtility.withSpan(\n \"GetAgent\",\n getAgentOptions,\n async (updateOptions) => {\n const result = await context\n .path(\"/assistants/{assistantId}\", assistantId)\n .get(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) =>\n traceStartAgentGeneric(span, {\n ...updatedOptions,\n tracingAttributeOptions: { agentId: assistantId },\n }),\n );\n\n return ConvertFromWire.convertAgentOutput(response);\n}\n\n/** Modifies an existing agent. */\nexport async function updateAgent(\n context: Client,\n assistantId: string,\n options: UpdateAgentOptionalParams = {},\n): Promise<AgentOutput> {\n const updateAgentOptions: GeneratedParameters.UpdateAgentParameters = {\n ...operationOptionsToRequestParameters(options),\n body: {\n ...ConverterToWire.convertUpdateAgentOptions(options),\n },\n };\n\n validateUpdateAgentParameters(assistantId, updateAgentOptions);\n const response = await TracingUtility.withSpan(\n \"UpdateAgent\",\n updateAgentOptions,\n async (updateOptions) => {\n const result = await context\n .path(\"/assistants/{assistantId}\", assistantId)\n .post(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) => traceStartCreateOrUpdateAgent(span, updatedOptions, assistantId),\n traceEndCreateOrUpdateAgent,\n );\n return ConvertFromWire.convertAgentOutput(response);\n}\n\n/** Deletes an agent. */\nexport async function deleteAgent(\n context: Client,\n assistantId: string,\n options: DeleteAgentOptionalParams = {},\n): Promise<AgentDeletionStatusOutput> {\n const deleteAgentOptions: GeneratedParameters.DeleteAgentParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateAssistantId(assistantId);\n const response = await TracingUtility.withSpan(\n \"DeleteAgent\",\n deleteAgentOptions,\n async (updateOptions) => {\n const result = await context\n .path(\"/assistants/{assistantId}\", assistantId)\n .delete(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n traceStartAgentGeneric,\n traceEndAgentGeneric,\n );\n return ConvertFromWire.convertAgentDeletionStatusOutput(response);\n}\n\nfunction validateCreateAgentParameters(\n options: GeneratedParameters.CreateAgentParameters | GeneratedParameters.UpdateAgentParameters,\n): void {\n if (options.body.tools) {\n if (options.body.tools.some((value) => !Object.values(Tools).includes(value.type as Tools))) {\n throw new Error(\n \"Tool type must be one of 'code_interpreter', 'file_search', 'function', 'bing_grounding', 'microsoft_fabric', 'sharepoint_grounding', 'azure_ai_search'\",\n );\n }\n }\n if (options.body.tool_resources) {\n if (options.body.tool_resources.code_interpreter) {\n if (\n options.body.tool_resources.code_interpreter.file_ids &&\n options.body.tool_resources.code_interpreter.data_sources\n ) {\n throw new Error(\"Only file_ids or data_sources can be provided, not both\");\n }\n if (\n options.body.tool_resources.code_interpreter.file_ids &&\n options.body.tool_resources.code_interpreter.file_ids.length > 20\n ) {\n throw new Error(\"A maximum of 20 file IDs are allowed\");\n }\n if (options.body.tool_resources.code_interpreter.data_sources) {\n validateVectorStoreDataType(options.body.tool_resources.code_interpreter.data_sources);\n }\n }\n if (options.body.tool_resources.file_search) {\n if (\n options.body.tool_resources.file_search.vector_store_ids &&\n options.body.tool_resources.file_search.vector_store_ids.length > 1\n ) {\n throw new Error(\"Only one vector store ID is allowed\");\n }\n if (options.body.tool_resources.file_search.vector_stores) {\n if (options.body.tool_resources.file_search.vector_stores.length > 1) {\n throw new Error(\"Only one vector store is allowed\");\n }\n validateVectorStoreDataType(\n options.body.tool_resources.file_search.vector_stores[0]?.configuration.data_sources,\n );\n }\n }\n if (options.body.tool_resources.azure_ai_search) {\n if (\n options.body.tool_resources.azure_ai_search.indexes &&\n options.body.tool_resources.azure_ai_search.indexes.length > 1\n ) {\n throw new Error(\"Only one index is allowed\");\n }\n }\n }\n if (options.body.temperature && (options.body.temperature < 0 || options.body.temperature > 2)) {\n throw new Error(\"Temperature must be between 0 and 2\");\n }\n if (options.body.metadata) {\n validateMetadata(options.body.metadata);\n }\n}\n\nfunction validateListAgentsParameters(options?: GeneratedParameters.ListAgentsParameters): 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 validateAssistantId(assistantId: string): void {\n if (!assistantId) {\n throw new Error(\"Assistant ID is required\");\n }\n}\n\nfunction validateUpdateAgentParameters(\n assistantId: string,\n options?: GeneratedParameters.UpdateAgentParameters,\n): void {\n validateAssistantId(assistantId);\n if (options) {\n validateCreateAgentParameters(options);\n }\n}\n"]}
1
+ {"version":3,"file":"assistants.js","sourceRoot":"","sources":["../../../src/agents/assistants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA8ClC,kCA2BC;AAGD,gCAuBC;AAGD,4BA8BC;AAGD,kCA6BC;AAGD,kCA0BC;;AA9LD,yDAA8E;AAM9E,+DAK+B;AAC/B,8CAA+C;AAC/C,6DAAkG;AAClG,uDAAiF;AASjF,yGAAmF;AACnF,kGAA4E;AAC5E,4FAA2F;AAC3F,qDAAqD;AAErD,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;AAEjC,IAAK,KAUJ;AAVD,WAAK,KAAK;IACR,6CAAoC,CAAA;IACpC,mCAA0B,CAAA;IAC1B,8BAAqB,CAAA;IACrB,yCAAgC,CAAA;IAChC,6CAAoC,CAAA;IACpC,qDAA4C,CAAA;IAC5C,0CAAiC,CAAA;IACjC,4BAAmB,CAAA;IACnB,yCAAgC,CAAA;AAClC,CAAC,EAVI,KAAK,KAAL,KAAK,QAUT;AAED,2BAA2B;AACpB,KAAK,UAAU,WAAW,CAC/B,OAAe,EACf,KAAa,EACb,UAAqC,EAAE;IAEvC,MAAM,aAAa,mCACd,IAAA,iDAAmC,EAAC,OAAO,CAAC,KAC/C,IAAI,oBACC,eAAe,CAAC,yBAAyB,iCAAM,OAAO,KAAE,KAAK,IAAG,IAEtE,CAAC;IAEF,6BAA6B,CAAC,aAAa,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,MAAM,2BAAc,CAAC,QAAQ,CAC5C,aAAa,EAC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;AAED,SAAS,4BAA4B,CAAC,OAAkD;;IACtF,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,IAAA,mCAAa,EAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,IAAA,mCAAa,EAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,WAAmB;IAC9C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC;AAED,SAAS,6BAA6B,CACpC,WAAmB,EACnB,OAAmD;IAEnD,mBAAmB,CAAC,WAAW,CAAC,CAAC;IACjC,IAAI,OAAO,EAAE,CAAC;QACZ,6BAA6B,CAAC,OAAO,CAAC,CAAC;IACzC,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 AgentDeletionStatusOutput,\n AgentOutput,\n OpenAIPageableListOfAgentOutput,\n} from \"../customization/outputModels.js\";\nimport {\n validateLimit,\n validateMetadata,\n validateOrder,\n validateVectorStoreDataType,\n} from \"./inputValidations.js\";\nimport { TracingUtility } from \"../tracing.js\";\nimport { traceEndCreateOrUpdateAgent, traceStartCreateOrUpdateAgent } from \"./assistantsTrace.js\";\nimport { traceEndAgentGeneric, traceStartAgentGeneric } from \"./traceUtility.js\";\nimport type {\n CreateAgentOptionalParams,\n DeleteAgentOptionalParams,\n GetAgentOptionalParams,\n ListAgentsOptionalParams,\n UpdateAgentOptionalParams,\n} from \"./customModels.js\";\nimport type * as GeneratedParameters from \"../generated/src/parameters.js\";\nimport * as ConvertFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport * as ConverterToWire from \"../customization/convertModelsToWrite.js\";\nimport { convertToListQueryParameters } from \"../customization/convertParametersToWire.js\";\nimport { createOpenAIError } from \"./openAIError.js\";\n\nconst expectedStatuses = [\"200\"];\n\nenum Tools {\n CodeInterpreter = \"code_interpreter\",\n FileSearch = \"file_search\",\n Function = \"function\",\n BingGrounding = \"bing_grounding\",\n MicrosoftFabric = \"microsoft_fabric\",\n SharepointGrounding = \"sharepoint_grounding\",\n AzureAISearch = \"azure_ai_search\",\n OpenApi = \"openapi\",\n AzureFunction = \"azure_function\",\n}\n\n/** Creates a new agent. */\nexport async function createAgent(\n context: Client,\n model: string,\n options: CreateAgentOptionalParams = {},\n): Promise<AgentOutput> {\n const createOptions: GeneratedParameters.CreateAgentParameters = {\n ...operationOptionsToRequestParameters(options),\n body: {\n ...ConverterToWire.convertCreateAgentOptions({ ...options, model }),\n },\n };\n\n validateCreateAgentParameters(createOptions);\n const response = await TracingUtility.withSpan(\n \"CreateAgent\",\n createOptions,\n async (updatedOptions) => {\n const result = await context.path(\"/assistants\").post(updatedOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n traceStartCreateOrUpdateAgent,\n traceEndCreateOrUpdateAgent,\n );\n return ConvertFromWire.convertAgentOutput(response);\n}\n\n/** Gets a list of agents that were previously created. */\nexport async function listAgents(\n context: Client,\n options: ListAgentsOptionalParams = {},\n): Promise<OpenAIPageableListOfAgentOutput> {\n const listAgentsOptions: GeneratedParameters.ListAgentsParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: convertToListQueryParameters(options),\n };\n\n validateListAgentsParameters(listAgentsOptions);\n const response = await TracingUtility.withSpan(\n \"ListAgents\",\n listAgentsOptions || {},\n async (updateOptions) => {\n const result = await context.path(\"/assistants\").get(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n );\n\n return ConvertFromWire.convertOpenAIPageableListOfAgentOutput(response);\n}\n\n/** Retrieves an existing agent. */\nexport async function getAgent(\n context: Client,\n assistantId: string,\n options: GetAgentOptionalParams = {},\n): Promise<AgentOutput> {\n const getAgentOptions: GeneratedParameters.GetAgentParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateAssistantId(assistantId);\n const response = await TracingUtility.withSpan(\n \"GetAgent\",\n getAgentOptions,\n async (updateOptions) => {\n const result = await context\n .path(\"/assistants/{assistantId}\", assistantId)\n .get(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) =>\n traceStartAgentGeneric(span, {\n ...updatedOptions,\n tracingAttributeOptions: { agentId: assistantId },\n }),\n );\n\n return ConvertFromWire.convertAgentOutput(response);\n}\n\n/** Modifies an existing agent. */\nexport async function updateAgent(\n context: Client,\n assistantId: string,\n options: UpdateAgentOptionalParams = {},\n): Promise<AgentOutput> {\n const updateAgentOptions: GeneratedParameters.UpdateAgentParameters = {\n ...operationOptionsToRequestParameters(options),\n body: {\n ...ConverterToWire.convertUpdateAgentOptions(options),\n },\n };\n\n validateUpdateAgentParameters(assistantId, updateAgentOptions);\n const response = await TracingUtility.withSpan(\n \"UpdateAgent\",\n updateAgentOptions,\n async (updateOptions) => {\n const result = await context\n .path(\"/assistants/{assistantId}\", assistantId)\n .post(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) => traceStartCreateOrUpdateAgent(span, updatedOptions, assistantId),\n traceEndCreateOrUpdateAgent,\n );\n return ConvertFromWire.convertAgentOutput(response);\n}\n\n/** Deletes an agent. */\nexport async function deleteAgent(\n context: Client,\n assistantId: string,\n options: DeleteAgentOptionalParams = {},\n): Promise<AgentDeletionStatusOutput> {\n const deleteAgentOptions: GeneratedParameters.DeleteAgentParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateAssistantId(assistantId);\n const response = await TracingUtility.withSpan(\n \"DeleteAgent\",\n deleteAgentOptions,\n async (updateOptions) => {\n const result = await context\n .path(\"/assistants/{assistantId}\", assistantId)\n .delete(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n traceStartAgentGeneric,\n traceEndAgentGeneric,\n );\n return ConvertFromWire.convertAgentDeletionStatusOutput(response);\n}\n\nfunction validateCreateAgentParameters(\n options: GeneratedParameters.CreateAgentParameters | GeneratedParameters.UpdateAgentParameters,\n): void {\n if (options.body.tools) {\n if (options.body.tools.some((value) => !Object.values(Tools).includes(value.type as Tools))) {\n throw new Error(\n \"Tool type must be one of 'code_interpreter', 'file_search', 'function', 'bing_grounding', 'microsoft_fabric', 'sharepoint_grounding', 'azure_ai_search', 'azure_function'\",\n );\n }\n }\n if (options.body.tool_resources) {\n if (options.body.tool_resources.code_interpreter) {\n if (\n options.body.tool_resources.code_interpreter.file_ids &&\n options.body.tool_resources.code_interpreter.data_sources\n ) {\n throw new Error(\"Only file_ids or data_sources can be provided, not both\");\n }\n if (\n options.body.tool_resources.code_interpreter.file_ids &&\n options.body.tool_resources.code_interpreter.file_ids.length > 20\n ) {\n throw new Error(\"A maximum of 20 file IDs are allowed\");\n }\n if (options.body.tool_resources.code_interpreter.data_sources) {\n validateVectorStoreDataType(options.body.tool_resources.code_interpreter.data_sources);\n }\n }\n if (options.body.tool_resources.file_search) {\n if (\n options.body.tool_resources.file_search.vector_store_ids &&\n options.body.tool_resources.file_search.vector_store_ids.length > 1\n ) {\n throw new Error(\"Only one vector store ID is allowed\");\n }\n if (options.body.tool_resources.file_search.vector_stores) {\n if (options.body.tool_resources.file_search.vector_stores.length > 1) {\n throw new Error(\"Only one vector store is allowed\");\n }\n validateVectorStoreDataType(\n options.body.tool_resources.file_search.vector_stores[0]?.configuration.data_sources,\n );\n }\n }\n if (options.body.tool_resources.azure_ai_search) {\n if (\n options.body.tool_resources.azure_ai_search.indexes &&\n options.body.tool_resources.azure_ai_search.indexes.length > 1\n ) {\n throw new Error(\"Only one index is allowed\");\n }\n }\n }\n if (options.body.temperature && (options.body.temperature < 0 || options.body.temperature > 2)) {\n throw new Error(\"Temperature must be between 0 and 2\");\n }\n if (options.body.metadata) {\n validateMetadata(options.body.metadata);\n }\n}\n\nfunction validateListAgentsParameters(options?: GeneratedParameters.ListAgentsParameters): 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 validateAssistantId(assistantId: string): void {\n if (!assistantId) {\n throw new Error(\"Assistant ID is required\");\n }\n}\n\nfunction validateUpdateAgentParameters(\n assistantId: string,\n options?: GeneratedParameters.UpdateAgentParameters,\n): void {\n validateAssistantId(assistantId);\n if (options) {\n validateCreateAgentParameters(options);\n }\n}\n"]}
@@ -1,5 +1,4 @@
1
1
  import type { OperationOptions, RequestParameters } from "@azure-rest/core-client";
2
- import type { AbortSignalLike } from "@azure/abort-controller";
3
2
  import type { ThreadRunOutput } from "../customization/outputModels.js";
4
3
  import type { AgentEventMessageStream } from "./streamingModels.js";
5
4
  import type { AgentThreadCreationOptions, CreateAgentOptions, CreateAndRunThreadOptions, CreateRunOptions, UpdateAgentOptions, UpdateAgentThreadOptions, VectorStoreFileStatusFilter, VectorStoreOptions, VectorStoreUpdateOptions } from "../customization/models.js";
@@ -38,10 +37,6 @@ export interface PollingOptions {
38
37
  * The interval, in milliseconds, to wait between polling attempts. If not specified, a default interval of 1000ms will be used.
39
38
  */
40
39
  sleepIntervalInMs?: number;
41
- /**
42
- * An AbortSignalLike object (as defined by @azure/abort-controller) that can be used to cancel the polling operation.
43
- */
44
- abortSignal?: AbortSignalLike;
45
40
  }
46
41
  /**
47
42
  * Optional parameters configuring polling behavior.
@@ -149,12 +144,7 @@ export interface ListMessagesOptionalParams extends ListMessagesQueryParamProper
149
144
  /**
150
145
  * Optional parameters creating vector store.
151
146
  */
152
- export interface CreateVectorStoreOptionalParams extends VectorStoreOptions, OperationOptions {
153
- }
154
- /**
155
- * Optional parameters for creating vector store with polling.
156
- */
157
- export interface CreateVectorStoreWithPollingOptionalParams extends CreateVectorStoreOptionalParams, PollingOptionsParams {
147
+ export interface CreateVectorStoreOptionalParams extends VectorStoreOptions, OperationOptions, PollingOptionsParams {
158
148
  }
159
149
  /**
160
150
  * Optional parameters for listing vector stores.
@@ -184,7 +174,7 @@ export interface ListVectorStoreFilesOptionalParams extends ListQueryParameters,
184
174
  /**
185
175
  * Optional parameters for creating a vector store file.
186
176
  */
187
- export interface CreateVectorStoreFileOptionalParams extends CreateVectorStoreFileOptions, OperationOptions {
177
+ export interface CreateVectorStoreFileOptionalParams extends CreateVectorStoreFileOptions, OperationOptions, PollingOptionsParams {
188
178
  }
189
179
  /**
190
180
  * Optional parameters for getting a vector store file.
@@ -196,11 +186,6 @@ export interface GetVectorStoreFileOptionalParams extends OperationOptions {
196
186
  */
197
187
  export interface DeleteVectorStoreFileOptionalParams extends OperationOptions {
198
188
  }
199
- /**
200
- * Optional parameters for creating a vector store file with polling.
201
- */
202
- export interface CreateVectorStoreFileWithPollingOptionalParams extends CreateVectorStoreFileOptions, PollingOptionsParams, OperationOptions {
203
- }
204
189
  /**
205
190
  * Optional parameters for listing vector store file batches.
206
191
  */
@@ -221,12 +206,7 @@ export interface CancelVectorStoreFileBatchOptionalParams extends OperationOptio
221
206
  /**
222
207
  * Optional parameters for creating a vector store file batch.
223
208
  */
224
- export interface CreateVectorStoreFileBatchOptionalParams extends CreateVectorStoreFileBatchOptions, OperationOptions {
225
- }
226
- /**
227
- * Optional parameters for creating a vector store file batch with polling.
228
- */
229
- export interface CreateVectorStoreFileBatchWithPollingOptionalParams extends CreateVectorStoreFileBatchOptionalParams, PollingOptionsParams {
209
+ export interface CreateVectorStoreFileBatchOptionalParams extends CreateVectorStoreFileBatchOptions, OperationOptions, PollingOptionsParams {
230
210
  }
231
211
  /**
232
212
  * Optional parameters for creating agent.
@@ -276,13 +256,8 @@ export interface GetFileContentOptionalParams extends OperationOptions {
276
256
  /**
277
257
  * Optional parameters for uploading a file.
278
258
  */
279
- export interface UploadFileOptionalParams extends OperationOptions {
259
+ export interface UploadFileOptionalParams extends OperationOptions, PollingOptionsParams {
280
260
  /** The name of the file. */
281
261
  fileName?: string;
282
262
  }
283
- /**
284
- * Optional parameters for uploading a file with polling.
285
- */
286
- export interface UploadFileWithPollingOptionalParams extends UploadFileOptionalParams, PollingOptionsParams {
287
- }
288
263
  //# sourceMappingURL=customModels.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"customModels.d.ts","sourceRoot":"","sources":["../../../src/agents/customModels.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,KAAK,EACV,0BAA0B,EAC1B,kBAAkB,EAClB,yBAAyB,EACzB,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,EACxB,2BAA2B,EAC3B,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,gCAAgC,EAChC,6BAA6B,EAC9B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EACV,iCAAiC,EACjC,4BAA4B,EAC7B,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,iBAAiB,EACjB,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,gBAAgB,CACzD,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IAC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IAC7B,MAAM,CAAC,EAAE,2BAA2B,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,qCAAsC,SAAQ,gBAAgB;CAAG;AAElF;;GAEG;AACH,MAAM,WAAW,wCAAyC,SAAQ,gBAAgB;CAAG;AAErF;;GAEG;AACH,MAAM,WAAW,wCACf,SAAQ,iCAAiC,EACvC,gBAAgB,EAChB,oBAAoB;CAAG;AAE3B;;GAEG;AACH,MAAM,WAAW,yBACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC,EACvC,gBAAgB;CAAG;AAEvB;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,kBAAkB,EAAE,gBAAgB;CAAG;AAE1F;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,gBAAgB;CAAG;AAEtE;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;CAAG;AAEnE;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB,EAAE,gBAAgB;CAAG;AAE1F;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,6BAA6B,EAAE,gBAAgB;CAAG;AAEnG;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;CAAG;AAErE;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;CAAG;AAElE;;GAEG;AACH,MAAM,WAAW,4BAA6B,SAAQ,gBAAgB;CAAG;AAEzE;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB,EAAE,oBAAoB;IACtF,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"customModels.js","sourceRoot":"","sources":["../../../src/agents/customModels.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions, RequestParameters } from \"@azure-rest/core-client\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { ThreadRunOutput } from \"../customization/outputModels.js\";\nimport type { AgentEventMessageStream } from \"./streamingModels.js\";\nimport type {\n AgentThreadCreationOptions,\n CreateAgentOptions,\n CreateAndRunThreadOptions,\n CreateRunOptions,\n UpdateAgentOptions,\n UpdateAgentThreadOptions,\n VectorStoreFileStatusFilter,\n VectorStoreOptions,\n VectorStoreUpdateOptions,\n} from \"../customization/models.js\";\nimport type {\n ListMessagesQueryParamProperties,\n ListFilesQueryParamProperties,\n} from \"../customization/parameters.js\";\nimport type {\n CreateVectorStoreFileBatchOptions,\n CreateVectorStoreFileOptions,\n} from \"./vectorStoresModels.js\";\n\n/**\n * Optional request parameters support passing headers, abort signal, etc.\n */\nexport type OptionalRequestParameters = Pick<\n RequestParameters,\n \"headers\" | \"timeout\" | \"abortSignal\" | \"tracingOptions\"\n>;\n\n/**\n * Request options for list requests.\n */\nexport interface ListQueryParameters {\n /**\n * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n */\n limit?: number;\n\n /**\n * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.\n */\n order?: \"asc\" | \"desc\";\n\n /**\n * A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.\n */\n after?: string;\n\n /**\n * A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.\n */\n before?: string;\n}\n\n/**\n * Options for configuring polling behavior.\n */\nexport interface PollingOptions {\n /**\n * The interval, in milliseconds, to wait between polling attempts. If not specified, a default interval of 1000ms will be used.\n */\n sleepIntervalInMs?: number;\n\n /**\n * An AbortSignalLike object (as defined by @azure/abort-controller) that can be used to cancel the polling operation.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Optional parameters configuring polling behavior.\n */\nexport interface PollingOptionsParams {\n /** Options for configuring polling behavior. */\n pollingOptions?: PollingOptions;\n}\n\n/**\n * Agent run response with support to stream.\n */\nexport type AgentRunResponse = PromiseLike<ThreadRunOutput> & {\n /**\n * Function to start streaming the agent event messages.\n * @returns A promise that resolves to an AgentEventMessageStream.\n */\n stream: () => Promise<AgentEventMessageStream>;\n};\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateRunOptionalParams = Omit<CreateRunOptions & OperationOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateAndRunThreadOptionalParams = Omit<CreateAndRunThreadOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for listing run queries.\n */\nexport interface ListRunQueryOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for getting a run.\n */\nexport interface GetRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a run.\n */\nexport interface CancelRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for submitting tool outputs to a run.\n */\nexport interface SubmitToolOutputsToRunOptionalParams extends OperationOptions {\n /**\n * Whether to stream the tool outputs.\n */\n stream?: boolean;\n}\n\n/**\n * Optional parameters for updating a run.\n */\nexport interface UpdateRunOptionalParams extends OperationOptions {\n /** Metadata to update in the run. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for creating an agent thread.\n */\nexport interface CreateAgentThreadOptionalParams\n extends AgentThreadCreationOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting an agent thread.\n */\nexport interface GetAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating an agent thread.\n */\nexport interface UpdateAgentThreadOptionalParams\n extends UpdateAgentThreadOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting an agent thread.\n */\nexport interface DeleteAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting an run step.\n */\nexport interface GetRunStepOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing run steps.\n */\nexport interface ListRunStepsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a message.\n */\nexport interface CreateMessageOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating a message.\n */\nexport interface UpdateMessageOptionalParams extends OperationOptions {\n /** Metadata to update in the message. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for listing messages.\n */\nexport interface ListMessagesOptionalParams\n extends ListMessagesQueryParamProperties,\n OperationOptions {}\n\n/**\n * Optional parameters creating vector store.\n */\nexport interface CreateVectorStoreOptionalParams extends VectorStoreOptions, OperationOptions {}\n\n/**\n * Optional parameters for creating vector store with polling.\n */\nexport interface CreateVectorStoreWithPollingOptionalParams\n extends CreateVectorStoreOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for listing vector stores.\n */\nexport interface ListVectorStoresOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for updating a vector store.\n */\nexport interface UpdateVectorStoreOptionalParams\n extends VectorStoreUpdateOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store.\n */\nexport interface DeleteVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store.\n */\nexport interface GetVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing vector store files.\n */\nexport interface ListVectorStoreFilesOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file.\n */\nexport interface CreateVectorStoreFileOptionalParams\n extends CreateVectorStoreFileOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store file.\n */\nexport interface GetVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store file.\n */\nexport interface DeleteVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file with polling.\n */\nexport interface CreateVectorStoreFileWithPollingOptionalParams\n extends CreateVectorStoreFileOptions,\n PollingOptionsParams,\n OperationOptions {}\n\n/**\n * Optional parameters for listing vector store file batches.\n */\nexport interface ListVectorStoreFileBatchFilesOptionalParams\n extends ListQueryParameters,\n OperationOptions {\n /** Filter by file status. */\n filter?: VectorStoreFileStatusFilter;\n}\n\n/**\n * Optional parameters for getting a vector store file batch.\n */\nexport interface GetVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a vector store file batch.\n */\nexport interface CancelVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch.\n */\nexport interface CreateVectorStoreFileBatchOptionalParams\n extends CreateVectorStoreFileBatchOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch with polling.\n */\nexport interface CreateVectorStoreFileBatchWithPollingOptionalParams\n extends CreateVectorStoreFileBatchOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for creating agent.\n */\nexport interface CreateAgentOptionalParams\n extends Omit<CreateAgentOptions, \"model\">,\n OperationOptions {}\n\n/**\n * Optional parameters for updating agent.\n */\nexport interface UpdateAgentOptionalParams extends UpdateAgentOptions, OperationOptions {}\n\n/**\n * Optional parameters for deleting agent.\n */\nexport interface DeleteAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting agent.\n */\nexport interface GetAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing agents.\n */\nexport interface ListAgentsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for listing files.\n */\nexport interface ListFilesOptionalParams extends ListFilesQueryParamProperties, OperationOptions {}\n\n/**\n * Optional parameters for deleting a file.\n */\nexport interface DeleteFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a file.\n */\nexport interface GetFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting file content.\n */\nexport interface GetFileContentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for uploading a file.\n */\nexport interface UploadFileOptionalParams extends OperationOptions {\n /** The name of the file. */\n fileName?: string;\n}\n\n/**\n * Optional parameters for uploading a file with polling.\n */\nexport interface UploadFileWithPollingOptionalParams\n extends UploadFileOptionalParams,\n PollingOptionsParams {}\n"]}
1
+ {"version":3,"file":"customModels.js","sourceRoot":"","sources":["../../../src/agents/customModels.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions, RequestParameters } from \"@azure-rest/core-client\";\nimport type { ThreadRunOutput } from \"../customization/outputModels.js\";\nimport type { AgentEventMessageStream } from \"./streamingModels.js\";\nimport type {\n AgentThreadCreationOptions,\n CreateAgentOptions,\n CreateAndRunThreadOptions,\n CreateRunOptions,\n UpdateAgentOptions,\n UpdateAgentThreadOptions,\n VectorStoreFileStatusFilter,\n VectorStoreOptions,\n VectorStoreUpdateOptions,\n} from \"../customization/models.js\";\nimport type {\n ListMessagesQueryParamProperties,\n ListFilesQueryParamProperties,\n} from \"../customization/parameters.js\";\nimport type {\n CreateVectorStoreFileBatchOptions,\n CreateVectorStoreFileOptions,\n} from \"./vectorStoresModels.js\";\n\n/**\n * Optional request parameters support passing headers, abort signal, etc.\n */\nexport type OptionalRequestParameters = Pick<\n RequestParameters,\n \"headers\" | \"timeout\" | \"abortSignal\" | \"tracingOptions\"\n>;\n\n/**\n * Request options for list requests.\n */\nexport interface ListQueryParameters {\n /**\n * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n */\n limit?: number;\n\n /**\n * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.\n */\n order?: \"asc\" | \"desc\";\n\n /**\n * A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.\n */\n after?: string;\n\n /**\n * A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.\n */\n before?: string;\n}\n\n/**\n * Options for configuring polling behavior.\n */\nexport interface PollingOptions {\n /**\n * The interval, in milliseconds, to wait between polling attempts. If not specified, a default interval of 1000ms will be used.\n */\n sleepIntervalInMs?: number;\n}\n\n/**\n * Optional parameters configuring polling behavior.\n */\nexport interface PollingOptionsParams {\n /** Options for configuring polling behavior. */\n pollingOptions?: PollingOptions;\n}\n\n/**\n * Agent run response with support to stream.\n */\nexport type AgentRunResponse = PromiseLike<ThreadRunOutput> & {\n /**\n * Function to start streaming the agent event messages.\n * @returns A promise that resolves to an AgentEventMessageStream.\n */\n stream: () => Promise<AgentEventMessageStream>;\n};\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateRunOptionalParams = Omit<CreateRunOptions & OperationOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateAndRunThreadOptionalParams = Omit<CreateAndRunThreadOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for listing run queries.\n */\nexport interface ListRunQueryOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for getting a run.\n */\nexport interface GetRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a run.\n */\nexport interface CancelRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for submitting tool outputs to a run.\n */\nexport interface SubmitToolOutputsToRunOptionalParams extends OperationOptions {\n /**\n * Whether to stream the tool outputs.\n */\n stream?: boolean;\n}\n\n/**\n * Optional parameters for updating a run.\n */\nexport interface UpdateRunOptionalParams extends OperationOptions {\n /** Metadata to update in the run. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for creating an agent thread.\n */\nexport interface CreateAgentThreadOptionalParams\n extends AgentThreadCreationOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting an agent thread.\n */\nexport interface GetAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating an agent thread.\n */\nexport interface UpdateAgentThreadOptionalParams\n extends UpdateAgentThreadOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting an agent thread.\n */\nexport interface DeleteAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting an run step.\n */\nexport interface GetRunStepOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing run steps.\n */\nexport interface ListRunStepsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a message.\n */\nexport interface CreateMessageOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating a message.\n */\nexport interface UpdateMessageOptionalParams extends OperationOptions {\n /** Metadata to update in the message. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for listing messages.\n */\nexport interface ListMessagesOptionalParams\n extends ListMessagesQueryParamProperties,\n OperationOptions {}\n\n/**\n * Optional parameters creating vector store.\n */\nexport interface CreateVectorStoreOptionalParams\n extends VectorStoreOptions,\n OperationOptions,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for listing vector stores.\n */\nexport interface ListVectorStoresOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for updating a vector store.\n */\nexport interface UpdateVectorStoreOptionalParams\n extends VectorStoreUpdateOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store.\n */\nexport interface DeleteVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store.\n */\nexport interface GetVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing vector store files.\n */\nexport interface ListVectorStoreFilesOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file.\n */\nexport interface CreateVectorStoreFileOptionalParams\n extends CreateVectorStoreFileOptions,\n OperationOptions,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for getting a vector store file.\n */\nexport interface GetVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store file.\n */\nexport interface DeleteVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing vector store file batches.\n */\nexport interface ListVectorStoreFileBatchFilesOptionalParams\n extends ListQueryParameters,\n OperationOptions {\n /** Filter by file status. */\n filter?: VectorStoreFileStatusFilter;\n}\n\n/**\n * Optional parameters for getting a vector store file batch.\n */\nexport interface GetVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a vector store file batch.\n */\nexport interface CancelVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch.\n */\nexport interface CreateVectorStoreFileBatchOptionalParams\n extends CreateVectorStoreFileBatchOptions,\n OperationOptions,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for creating agent.\n */\nexport interface CreateAgentOptionalParams\n extends Omit<CreateAgentOptions, \"model\">,\n OperationOptions {}\n\n/**\n * Optional parameters for updating agent.\n */\nexport interface UpdateAgentOptionalParams extends UpdateAgentOptions, OperationOptions {}\n\n/**\n * Optional parameters for deleting agent.\n */\nexport interface DeleteAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting agent.\n */\nexport interface GetAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing agents.\n */\nexport interface ListAgentsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for listing files.\n */\nexport interface ListFilesOptionalParams extends ListFilesQueryParamProperties, OperationOptions {}\n\n/**\n * Optional parameters for deleting a file.\n */\nexport interface DeleteFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a file.\n */\nexport interface GetFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting file content.\n */\nexport interface GetFileContentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for uploading a file.\n */\nexport interface UploadFileOptionalParams extends OperationOptions, PollingOptionsParams {\n /** The name of the file. */\n fileName?: string;\n}\n"]}
@@ -1,17 +1,18 @@
1
1
  import type { Client, StreamableMethod } from "@azure-rest/core-client";
2
2
  import type { FileDeletionStatusOutput, FileListResponseOutput, OpenAIFileOutput } from "../customization/outputModels.js";
3
3
  import type { FilePurpose as CustomizedFilePurpose } from "../customization/models.js";
4
- import type { DeleteFileOptionalParams, GetFileContentOptionalParams, GetFileOptionalParams, ListFilesOptionalParams, UploadFileWithPollingOptionalParams } from "./customModels.js";
5
- import type { PollerLike, PollOperationState } from "@azure/core-lro";
4
+ import type { DeleteFileOptionalParams, GetFileContentOptionalParams, GetFileOptionalParams, ListFilesOptionalParams, UploadFileOptionalParams } from "./customModels.js";
5
+ import type { OperationState, PollerLike } from "@azure/core-lro";
6
6
  /** Gets a list of previously uploaded files. */
7
7
  export declare function listFiles(context: Client, options?: ListFilesOptionalParams): Promise<FileListResponseOutput>;
8
8
  /** Uploads a file for use by other operations. */
9
- export declare function uploadFile(context: Client, content: ReadableStream | NodeJS.ReadableStream, purpose: CustomizedFilePurpose, options?: UploadFileWithPollingOptionalParams): Promise<OpenAIFileOutput>;
10
- export declare function uploadFileAndPoll(context: Client, content: ReadableStream | NodeJS.ReadableStream, purpose: CustomizedFilePurpose, options?: UploadFileWithPollingOptionalParams): PollerLike<PollOperationState<OpenAIFileOutput>, OpenAIFileOutput>;
9
+ export declare function uploadFile(context: Client, content: ReadableStream | NodeJS.ReadableStream, purpose: CustomizedFilePurpose, options?: UploadFileOptionalParams): PollerLike<OperationState<OpenAIFileOutput>, OpenAIFileOutput>;
10
+ export declare function uploadFileAndPoll(context: Client, content: ReadableStream | NodeJS.ReadableStream, purpose: CustomizedFilePurpose, options?: UploadFileOptionalParams): PollerLike<OperationState<OpenAIFileOutput>, OpenAIFileOutput>;
11
11
  /** Delete a previously uploaded file. */
12
12
  export declare function deleteFile(context: Client, fileId: string, options?: DeleteFileOptionalParams): Promise<FileDeletionStatusOutput>;
13
13
  /** Returns information about a specific file. Does not retrieve file content. */
14
14
  export declare function getFile(context: Client, fileId: string, options?: GetFileOptionalParams): Promise<OpenAIFileOutput>;
15
15
  /** Returns file content. */
16
16
  export declare function getFileContent(context: Client, fileId: string, options?: GetFileContentOptionalParams): StreamableMethod<string | Uint8Array>;
17
+ export declare function uploadFileInternal(context: Client, content: ReadableStream | NodeJS.ReadableStream, purpose: CustomizedFilePurpose, options?: UploadFileOptionalParams): Promise<OpenAIFileOutput>;
17
18
  //# sourceMappingURL=files.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/agents/files.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,OAAO,KAAK,EACV,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,KAAK,EACV,wBAAwB,EACxB,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,EACvB,mCAAmC,EACpC,MAAM,mBAAmB,CAAC;AAO3B,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAatE,gDAAgD;AAChD,wBAAsB,SAAS,CAC7B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,sBAAsB,CAAC,CAWjC;AAED,kDAAkD;AAClD,wBAAsB,UAAU,CAC9B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,cAAc,GAAG,MAAM,CAAC,cAAc,EAC/C,OAAO,EAAE,qBAAqB,EAC9B,OAAO,GAAE,mCAAwC,GAChD,OAAO,CAAC,gBAAgB,CAAC,CAc3B;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,cAAc,GAAG,MAAM,CAAC,cAAc,EAC/C,OAAO,EAAE,qBAAqB,EA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