@azure/ai-agents 1.0.0-beta.6 → 1.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (380) hide show
  1. package/README.md +105 -26
  2. package/dist/browser/agentsClient.d.ts +2 -2
  3. package/dist/browser/agentsClient.d.ts.map +1 -1
  4. package/dist/browser/agentsClient.js.map +1 -1
  5. package/dist/browser/api/agentsContext.d.ts +2 -2
  6. package/dist/browser/api/agentsContext.d.ts.map +1 -1
  7. package/dist/browser/api/agentsContext.js +12 -24
  8. package/dist/browser/api/agentsContext.js.map +1 -1
  9. package/dist/browser/api/files/operations.d.ts +4 -4
  10. package/dist/browser/api/files/operations.d.ts.map +1 -1
  11. package/dist/browser/api/files/operations.js +25 -12
  12. package/dist/browser/api/files/operations.js.map +1 -1
  13. package/dist/browser/api/files/options.d.ts +3 -3
  14. package/dist/browser/api/files/options.d.ts.map +1 -1
  15. package/dist/browser/api/files/options.js.map +1 -1
  16. package/dist/browser/api/messages/operations.d.ts.map +1 -1
  17. package/dist/browser/api/messages/operations.js +18 -12
  18. package/dist/browser/api/messages/operations.js.map +1 -1
  19. package/dist/browser/api/operations.d.ts +7 -6
  20. package/dist/browser/api/operations.d.ts.map +1 -1
  21. package/dist/browser/api/operations.js +34 -22
  22. package/dist/browser/api/operations.js.map +1 -1
  23. package/dist/browser/api/options.d.ts +2 -2
  24. package/dist/browser/api/options.d.ts.map +1 -1
  25. package/dist/browser/api/options.js.map +1 -1
  26. package/dist/browser/api/runSteps/operations.d.ts.map +1 -1
  27. package/dist/browser/api/runSteps/operations.js +11 -7
  28. package/dist/browser/api/runSteps/operations.js.map +1 -1
  29. package/dist/browser/api/runs/operations.d.ts.map +1 -1
  30. package/dist/browser/api/runs/operations.js +38 -20
  31. package/dist/browser/api/runs/operations.js.map +1 -1
  32. package/dist/browser/api/runs/options.d.ts +9 -3
  33. package/dist/browser/api/runs/options.d.ts.map +1 -1
  34. package/dist/browser/api/runs/options.js.map +1 -1
  35. package/dist/browser/api/threads/operations.d.ts.map +1 -1
  36. package/dist/browser/api/threads/operations.js +26 -16
  37. package/dist/browser/api/threads/operations.js.map +1 -1
  38. package/dist/browser/api/threads/options.d.ts +2 -2
  39. package/dist/browser/api/threads/options.d.ts.map +1 -1
  40. package/dist/browser/api/threads/options.js.map +1 -1
  41. package/dist/browser/api/vectorStoreFileBatches/operations.d.ts +7 -7
  42. package/dist/browser/api/vectorStoreFileBatches/operations.d.ts.map +1 -1
  43. package/dist/browser/api/vectorStoreFileBatches/operations.js +29 -11
  44. package/dist/browser/api/vectorStoreFileBatches/operations.js.map +1 -1
  45. package/dist/browser/api/vectorStoreFileBatches/options.d.ts +3 -3
  46. package/dist/browser/api/vectorStoreFileBatches/options.d.ts.map +1 -1
  47. package/dist/browser/api/vectorStoreFileBatches/options.js.map +1 -1
  48. package/dist/browser/api/vectorStoreFiles/operations.d.ts.map +1 -1
  49. package/dist/browser/api/vectorStoreFiles/operations.js +13 -5
  50. package/dist/browser/api/vectorStoreFiles/operations.js.map +1 -1
  51. package/dist/browser/api/vectorStores/operations.d.ts.map +1 -1
  52. package/dist/browser/api/vectorStores/operations.js +16 -6
  53. package/dist/browser/api/vectorStores/operations.js.map +1 -1
  54. package/dist/browser/classic/runSteps/index.d.ts +0 -1
  55. package/dist/browser/classic/runSteps/index.d.ts.map +1 -1
  56. package/dist/browser/classic/runSteps/index.js.map +1 -1
  57. package/dist/browser/classic/runs/index.d.ts +1 -1
  58. package/dist/browser/classic/runs/index.d.ts.map +1 -1
  59. package/dist/browser/classic/runs/index.js.map +1 -1
  60. package/dist/browser/classic/vectorStoreFileBatches/index.d.ts +6 -6
  61. package/dist/browser/classic/vectorStoreFileBatches/index.d.ts.map +1 -1
  62. package/dist/browser/classic/vectorStoreFileBatches/index.js.map +1 -1
  63. package/dist/browser/classic/vectorStoreFiles/index.d.ts +5 -5
  64. package/dist/browser/classic/vectorStoreFiles/index.d.ts.map +1 -1
  65. package/dist/browser/classic/vectorStoreFiles/index.js +2 -0
  66. package/dist/browser/classic/vectorStoreFiles/index.js.map +1 -1
  67. package/dist/browser/classic/vectorStores/index.d.ts.map +1 -1
  68. package/dist/browser/classic/vectorStores/index.js.map +1 -1
  69. package/dist/browser/constants.d.ts +1 -1
  70. package/dist/browser/constants.js +1 -1
  71. package/dist/browser/constants.js.map +1 -1
  72. package/dist/browser/index.d.ts +5 -4
  73. package/dist/browser/index.d.ts.map +1 -1
  74. package/dist/browser/index.js +3 -2
  75. package/dist/browser/index.js.map +1 -1
  76. package/dist/browser/models/index.d.ts +1 -1
  77. package/dist/browser/models/index.d.ts.map +1 -1
  78. package/dist/browser/models/index.js.map +1 -1
  79. package/dist/browser/models/models.d.ts +212 -94
  80. package/dist/browser/models/models.d.ts.map +1 -1
  81. package/dist/browser/models/models.js +245 -108
  82. package/dist/browser/models/models.js.map +1 -1
  83. package/dist/browser/static-helpers/pagingHelpers.d.ts +1 -1
  84. package/dist/browser/static-helpers/pagingHelpers.d.ts.map +1 -1
  85. package/dist/browser/static-helpers/pagingHelpers.js.map +1 -1
  86. package/dist/browser/utils/MCPTool.d.ts +78 -0
  87. package/dist/browser/utils/MCPTool.d.ts.map +1 -0
  88. package/dist/browser/utils/MCPTool.js +128 -0
  89. package/dist/browser/utils/MCPTool.js.map +1 -0
  90. package/dist/browser/{utils.d.ts → utils/utils.d.ts} +12 -1
  91. package/dist/browser/utils/utils.d.ts.map +1 -0
  92. package/dist/{esm → browser/utils}/utils.js +9 -0
  93. package/dist/browser/utils/utils.js.map +1 -0
  94. package/dist/commonjs/agentsClient.d.ts +2 -2
  95. package/dist/commonjs/agentsClient.d.ts.map +1 -1
  96. package/dist/commonjs/agentsClient.js.map +1 -1
  97. package/dist/commonjs/api/agentsContext.d.ts +2 -2
  98. package/dist/commonjs/api/agentsContext.d.ts.map +1 -1
  99. package/dist/commonjs/api/agentsContext.js +12 -24
  100. package/dist/commonjs/api/agentsContext.js.map +1 -1
  101. package/dist/commonjs/api/files/operations.d.ts +4 -4
  102. package/dist/commonjs/api/files/operations.d.ts.map +1 -1
  103. package/dist/commonjs/api/files/operations.js +23 -10
  104. package/dist/commonjs/api/files/operations.js.map +1 -1
  105. package/dist/commonjs/api/files/options.d.ts +3 -3
  106. package/dist/commonjs/api/files/options.d.ts.map +1 -1
  107. package/dist/commonjs/api/files/options.js.map +1 -1
  108. package/dist/commonjs/api/messages/operations.d.ts.map +1 -1
  109. package/dist/commonjs/api/messages/operations.js +17 -11
  110. package/dist/commonjs/api/messages/operations.js.map +1 -1
  111. package/dist/commonjs/api/operations.d.ts +7 -6
  112. package/dist/commonjs/api/operations.d.ts.map +1 -1
  113. package/dist/commonjs/api/operations.js +31 -19
  114. package/dist/commonjs/api/operations.js.map +1 -1
  115. package/dist/commonjs/api/options.d.ts +2 -2
  116. package/dist/commonjs/api/options.d.ts.map +1 -1
  117. package/dist/commonjs/api/options.js.map +1 -1
  118. package/dist/commonjs/api/runSteps/operations.d.ts.map +1 -1
  119. package/dist/commonjs/api/runSteps/operations.js +10 -6
  120. package/dist/commonjs/api/runSteps/operations.js.map +1 -1
  121. package/dist/commonjs/api/runs/operations.d.ts.map +1 -1
  122. package/dist/commonjs/api/runs/operations.js +37 -19
  123. package/dist/commonjs/api/runs/operations.js.map +1 -1
  124. package/dist/commonjs/api/runs/options.d.ts +9 -3
  125. package/dist/commonjs/api/runs/options.d.ts.map +1 -1
  126. package/dist/commonjs/api/runs/options.js.map +1 -1
  127. package/dist/commonjs/api/threads/operations.d.ts.map +1 -1
  128. package/dist/commonjs/api/threads/operations.js +25 -15
  129. package/dist/commonjs/api/threads/operations.js.map +1 -1
  130. package/dist/commonjs/api/threads/options.d.ts +2 -2
  131. package/dist/commonjs/api/threads/options.d.ts.map +1 -1
  132. package/dist/commonjs/api/threads/options.js.map +1 -1
  133. package/dist/commonjs/api/vectorStoreFileBatches/operations.d.ts +7 -7
  134. package/dist/commonjs/api/vectorStoreFileBatches/operations.d.ts.map +1 -1
  135. package/dist/commonjs/api/vectorStoreFileBatches/operations.js +26 -8
  136. package/dist/commonjs/api/vectorStoreFileBatches/operations.js.map +1 -1
  137. package/dist/commonjs/api/vectorStoreFileBatches/options.d.ts +3 -3
  138. package/dist/commonjs/api/vectorStoreFileBatches/options.d.ts.map +1 -1
  139. package/dist/commonjs/api/vectorStoreFileBatches/options.js.map +1 -1
  140. package/dist/commonjs/api/vectorStoreFiles/operations.d.ts.map +1 -1
  141. package/dist/commonjs/api/vectorStoreFiles/operations.js +12 -4
  142. package/dist/commonjs/api/vectorStoreFiles/operations.js.map +1 -1
  143. package/dist/commonjs/api/vectorStores/operations.d.ts.map +1 -1
  144. package/dist/commonjs/api/vectorStores/operations.js +15 -5
  145. package/dist/commonjs/api/vectorStores/operations.js.map +1 -1
  146. package/dist/commonjs/classic/runSteps/index.d.ts +0 -1
  147. package/dist/commonjs/classic/runSteps/index.d.ts.map +1 -1
  148. package/dist/commonjs/classic/runSteps/index.js.map +1 -1
  149. package/dist/commonjs/classic/runs/index.d.ts +1 -1
  150. package/dist/commonjs/classic/runs/index.d.ts.map +1 -1
  151. package/dist/commonjs/classic/runs/index.js.map +1 -1
  152. package/dist/commonjs/classic/vectorStoreFileBatches/index.d.ts +6 -6
  153. package/dist/commonjs/classic/vectorStoreFileBatches/index.d.ts.map +1 -1
  154. package/dist/commonjs/classic/vectorStoreFileBatches/index.js.map +1 -1
  155. package/dist/commonjs/classic/vectorStoreFiles/index.d.ts +5 -5
  156. package/dist/commonjs/classic/vectorStoreFiles/index.d.ts.map +1 -1
  157. package/dist/commonjs/classic/vectorStoreFiles/index.js +2 -0
  158. package/dist/commonjs/classic/vectorStoreFiles/index.js.map +1 -1
  159. package/dist/commonjs/classic/vectorStores/index.d.ts.map +1 -1
  160. package/dist/commonjs/classic/vectorStores/index.js.map +1 -1
  161. package/dist/commonjs/constants.d.ts +1 -1
  162. package/dist/commonjs/constants.js +1 -1
  163. package/dist/commonjs/constants.js.map +1 -1
  164. package/dist/commonjs/index.d.ts +5 -4
  165. package/dist/commonjs/index.d.ts.map +1 -1
  166. package/dist/commonjs/index.js +5 -3
  167. package/dist/commonjs/index.js.map +1 -1
  168. package/dist/commonjs/models/index.d.ts +1 -1
  169. package/dist/commonjs/models/index.d.ts.map +1 -1
  170. package/dist/commonjs/models/index.js +2 -2
  171. package/dist/commonjs/models/index.js.map +1 -1
  172. package/dist/commonjs/models/models.d.ts +212 -94
  173. package/dist/commonjs/models/models.d.ts.map +1 -1
  174. package/dist/commonjs/models/models.js +282 -125
  175. package/dist/commonjs/models/models.js.map +1 -1
  176. package/dist/commonjs/static-helpers/pagingHelpers.d.ts +1 -1
  177. package/dist/commonjs/static-helpers/pagingHelpers.d.ts.map +1 -1
  178. package/dist/commonjs/static-helpers/pagingHelpers.js.map +1 -1
  179. package/dist/commonjs/tsdoc-metadata.json +11 -11
  180. package/dist/commonjs/utils/MCPTool.d.ts +78 -0
  181. package/dist/commonjs/utils/MCPTool.d.ts.map +1 -0
  182. package/dist/commonjs/utils/MCPTool.js +132 -0
  183. package/dist/commonjs/utils/MCPTool.js.map +1 -0
  184. package/dist/commonjs/{utils.d.ts → utils/utils.d.ts} +12 -1
  185. package/dist/commonjs/utils/utils.d.ts.map +1 -0
  186. package/dist/commonjs/{utils.js → utils/utils.js} +9 -0
  187. package/dist/commonjs/utils/utils.js.map +1 -0
  188. package/dist/esm/agentsClient.d.ts +2 -2
  189. package/dist/esm/agentsClient.d.ts.map +1 -1
  190. package/dist/esm/agentsClient.js.map +1 -1
  191. package/dist/esm/api/agentsContext.d.ts +2 -2
  192. package/dist/esm/api/agentsContext.d.ts.map +1 -1
  193. package/dist/esm/api/agentsContext.js +12 -24
  194. package/dist/esm/api/agentsContext.js.map +1 -1
  195. package/dist/esm/api/files/operations.d.ts +4 -4
  196. package/dist/esm/api/files/operations.d.ts.map +1 -1
  197. package/dist/esm/api/files/operations.js +25 -12
  198. package/dist/esm/api/files/operations.js.map +1 -1
  199. package/dist/esm/api/files/options.d.ts +3 -3
  200. package/dist/esm/api/files/options.d.ts.map +1 -1
  201. package/dist/esm/api/files/options.js.map +1 -1
  202. package/dist/esm/api/messages/operations.d.ts.map +1 -1
  203. package/dist/esm/api/messages/operations.js +18 -12
  204. package/dist/esm/api/messages/operations.js.map +1 -1
  205. package/dist/esm/api/operations.d.ts +7 -6
  206. package/dist/esm/api/operations.d.ts.map +1 -1
  207. package/dist/esm/api/operations.js +34 -22
  208. package/dist/esm/api/operations.js.map +1 -1
  209. package/dist/esm/api/options.d.ts +2 -2
  210. package/dist/esm/api/options.d.ts.map +1 -1
  211. package/dist/esm/api/options.js.map +1 -1
  212. package/dist/esm/api/runSteps/operations.d.ts.map +1 -1
  213. package/dist/esm/api/runSteps/operations.js +11 -7
  214. package/dist/esm/api/runSteps/operations.js.map +1 -1
  215. package/dist/esm/api/runs/operations.d.ts.map +1 -1
  216. package/dist/esm/api/runs/operations.js +38 -20
  217. package/dist/esm/api/runs/operations.js.map +1 -1
  218. package/dist/esm/api/runs/options.d.ts +9 -3
  219. package/dist/esm/api/runs/options.d.ts.map +1 -1
  220. package/dist/esm/api/runs/options.js.map +1 -1
  221. package/dist/esm/api/threads/operations.d.ts.map +1 -1
  222. package/dist/esm/api/threads/operations.js +26 -16
  223. package/dist/esm/api/threads/operations.js.map +1 -1
  224. package/dist/esm/api/threads/options.d.ts +2 -2
  225. package/dist/esm/api/threads/options.d.ts.map +1 -1
  226. package/dist/esm/api/threads/options.js.map +1 -1
  227. package/dist/esm/api/vectorStoreFileBatches/operations.d.ts +7 -7
  228. package/dist/esm/api/vectorStoreFileBatches/operations.d.ts.map +1 -1
  229. package/dist/esm/api/vectorStoreFileBatches/operations.js +29 -11
  230. package/dist/esm/api/vectorStoreFileBatches/operations.js.map +1 -1
  231. package/dist/esm/api/vectorStoreFileBatches/options.d.ts +3 -3
  232. package/dist/esm/api/vectorStoreFileBatches/options.d.ts.map +1 -1
  233. package/dist/esm/api/vectorStoreFileBatches/options.js.map +1 -1
  234. package/dist/esm/api/vectorStoreFiles/operations.d.ts.map +1 -1
  235. package/dist/esm/api/vectorStoreFiles/operations.js +13 -5
  236. package/dist/esm/api/vectorStoreFiles/operations.js.map +1 -1
  237. package/dist/esm/api/vectorStores/operations.d.ts.map +1 -1
  238. package/dist/esm/api/vectorStores/operations.js +16 -6
  239. package/dist/esm/api/vectorStores/operations.js.map +1 -1
  240. package/dist/esm/classic/runSteps/index.d.ts +0 -1
  241. package/dist/esm/classic/runSteps/index.d.ts.map +1 -1
  242. package/dist/esm/classic/runSteps/index.js.map +1 -1
  243. package/dist/esm/classic/runs/index.d.ts +1 -1
  244. package/dist/esm/classic/runs/index.d.ts.map +1 -1
  245. package/dist/esm/classic/runs/index.js.map +1 -1
  246. package/dist/esm/classic/vectorStoreFileBatches/index.d.ts +6 -6
  247. package/dist/esm/classic/vectorStoreFileBatches/index.d.ts.map +1 -1
  248. package/dist/esm/classic/vectorStoreFileBatches/index.js.map +1 -1
  249. package/dist/esm/classic/vectorStoreFiles/index.d.ts +5 -5
  250. package/dist/esm/classic/vectorStoreFiles/index.d.ts.map +1 -1
  251. package/dist/esm/classic/vectorStoreFiles/index.js +2 -0
  252. package/dist/esm/classic/vectorStoreFiles/index.js.map +1 -1
  253. package/dist/esm/classic/vectorStores/index.d.ts.map +1 -1
  254. package/dist/esm/classic/vectorStores/index.js.map +1 -1
  255. package/dist/esm/constants.d.ts +1 -1
  256. package/dist/esm/constants.js +1 -1
  257. package/dist/esm/constants.js.map +1 -1
  258. package/dist/esm/index.d.ts +5 -4
  259. package/dist/esm/index.d.ts.map +1 -1
  260. package/dist/esm/index.js +3 -2
  261. package/dist/esm/index.js.map +1 -1
  262. package/dist/esm/models/index.d.ts +1 -1
  263. package/dist/esm/models/index.d.ts.map +1 -1
  264. package/dist/esm/models/index.js.map +1 -1
  265. package/dist/esm/models/models.d.ts +212 -94
  266. package/dist/esm/models/models.d.ts.map +1 -1
  267. package/dist/esm/models/models.js +245 -108
  268. package/dist/esm/models/models.js.map +1 -1
  269. package/dist/esm/static-helpers/pagingHelpers.d.ts +1 -1
  270. package/dist/esm/static-helpers/pagingHelpers.d.ts.map +1 -1
  271. package/dist/esm/static-helpers/pagingHelpers.js.map +1 -1
  272. package/dist/esm/utils/MCPTool.d.ts +78 -0
  273. package/dist/esm/utils/MCPTool.d.ts.map +1 -0
  274. package/dist/esm/utils/MCPTool.js +128 -0
  275. package/dist/esm/utils/MCPTool.js.map +1 -0
  276. package/dist/{react-native → esm/utils}/utils.d.ts +12 -1
  277. package/dist/esm/utils/utils.d.ts.map +1 -0
  278. package/dist/{react-native → esm/utils}/utils.js +9 -0
  279. package/dist/esm/utils/utils.js.map +1 -0
  280. package/dist/react-native/agentsClient.d.ts +2 -2
  281. package/dist/react-native/agentsClient.d.ts.map +1 -1
  282. package/dist/react-native/agentsClient.js.map +1 -1
  283. package/dist/react-native/api/agentsContext.d.ts +2 -2
  284. package/dist/react-native/api/agentsContext.d.ts.map +1 -1
  285. package/dist/react-native/api/agentsContext.js +12 -24
  286. package/dist/react-native/api/agentsContext.js.map +1 -1
  287. package/dist/react-native/api/files/operations.d.ts +4 -4
  288. package/dist/react-native/api/files/operations.d.ts.map +1 -1
  289. package/dist/react-native/api/files/operations.js +25 -12
  290. package/dist/react-native/api/files/operations.js.map +1 -1
  291. package/dist/react-native/api/files/options.d.ts +3 -3
  292. package/dist/react-native/api/files/options.d.ts.map +1 -1
  293. package/dist/react-native/api/files/options.js.map +1 -1
  294. package/dist/react-native/api/messages/operations.d.ts.map +1 -1
  295. package/dist/react-native/api/messages/operations.js +18 -12
  296. package/dist/react-native/api/messages/operations.js.map +1 -1
  297. package/dist/react-native/api/operations.d.ts +7 -6
  298. package/dist/react-native/api/operations.d.ts.map +1 -1
  299. package/dist/react-native/api/operations.js +34 -22
  300. package/dist/react-native/api/operations.js.map +1 -1
  301. package/dist/react-native/api/options.d.ts +2 -2
  302. package/dist/react-native/api/options.d.ts.map +1 -1
  303. package/dist/react-native/api/options.js.map +1 -1
  304. package/dist/react-native/api/runSteps/operations.d.ts.map +1 -1
  305. package/dist/react-native/api/runSteps/operations.js +11 -7
  306. package/dist/react-native/api/runSteps/operations.js.map +1 -1
  307. package/dist/react-native/api/runs/operations.d.ts.map +1 -1
  308. package/dist/react-native/api/runs/operations.js +38 -20
  309. package/dist/react-native/api/runs/operations.js.map +1 -1
  310. package/dist/react-native/api/runs/options.d.ts +9 -3
  311. package/dist/react-native/api/runs/options.d.ts.map +1 -1
  312. package/dist/react-native/api/runs/options.js.map +1 -1
  313. package/dist/react-native/api/threads/operations.d.ts.map +1 -1
  314. package/dist/react-native/api/threads/operations.js +26 -16
  315. package/dist/react-native/api/threads/operations.js.map +1 -1
  316. package/dist/react-native/api/threads/options.d.ts +2 -2
  317. package/dist/react-native/api/threads/options.d.ts.map +1 -1
  318. package/dist/react-native/api/threads/options.js.map +1 -1
  319. package/dist/react-native/api/vectorStoreFileBatches/operations.d.ts +7 -7
  320. package/dist/react-native/api/vectorStoreFileBatches/operations.d.ts.map +1 -1
  321. package/dist/react-native/api/vectorStoreFileBatches/operations.js +29 -11
  322. package/dist/react-native/api/vectorStoreFileBatches/operations.js.map +1 -1
  323. package/dist/react-native/api/vectorStoreFileBatches/options.d.ts +3 -3
  324. package/dist/react-native/api/vectorStoreFileBatches/options.d.ts.map +1 -1
  325. package/dist/react-native/api/vectorStoreFileBatches/options.js.map +1 -1
  326. package/dist/react-native/api/vectorStoreFiles/operations.d.ts.map +1 -1
  327. package/dist/react-native/api/vectorStoreFiles/operations.js +13 -5
  328. package/dist/react-native/api/vectorStoreFiles/operations.js.map +1 -1
  329. package/dist/react-native/api/vectorStores/operations.d.ts.map +1 -1
  330. package/dist/react-native/api/vectorStores/operations.js +16 -6
  331. package/dist/react-native/api/vectorStores/operations.js.map +1 -1
  332. package/dist/react-native/classic/runSteps/index.d.ts +0 -1
  333. package/dist/react-native/classic/runSteps/index.d.ts.map +1 -1
  334. package/dist/react-native/classic/runSteps/index.js.map +1 -1
  335. package/dist/react-native/classic/runs/index.d.ts +1 -1
  336. package/dist/react-native/classic/runs/index.d.ts.map +1 -1
  337. package/dist/react-native/classic/runs/index.js.map +1 -1
  338. package/dist/react-native/classic/vectorStoreFileBatches/index.d.ts +6 -6
  339. package/dist/react-native/classic/vectorStoreFileBatches/index.d.ts.map +1 -1
  340. package/dist/react-native/classic/vectorStoreFileBatches/index.js.map +1 -1
  341. package/dist/react-native/classic/vectorStoreFiles/index.d.ts +5 -5
  342. package/dist/react-native/classic/vectorStoreFiles/index.d.ts.map +1 -1
  343. package/dist/react-native/classic/vectorStoreFiles/index.js +2 -0
  344. package/dist/react-native/classic/vectorStoreFiles/index.js.map +1 -1
  345. package/dist/react-native/classic/vectorStores/index.d.ts.map +1 -1
  346. package/dist/react-native/classic/vectorStores/index.js.map +1 -1
  347. package/dist/react-native/constants.d.ts +1 -1
  348. package/dist/react-native/constants.js +1 -1
  349. package/dist/react-native/constants.js.map +1 -1
  350. package/dist/react-native/index.d.ts +5 -4
  351. package/dist/react-native/index.d.ts.map +1 -1
  352. package/dist/react-native/index.js +3 -2
  353. package/dist/react-native/index.js.map +1 -1
  354. package/dist/react-native/models/index.d.ts +1 -1
  355. package/dist/react-native/models/index.d.ts.map +1 -1
  356. package/dist/react-native/models/index.js.map +1 -1
  357. package/dist/react-native/models/models.d.ts +212 -94
  358. package/dist/react-native/models/models.d.ts.map +1 -1
  359. package/dist/react-native/models/models.js +245 -108
  360. package/dist/react-native/models/models.js.map +1 -1
  361. package/dist/react-native/static-helpers/pagingHelpers.d.ts +1 -1
  362. package/dist/react-native/static-helpers/pagingHelpers.d.ts.map +1 -1
  363. package/dist/react-native/static-helpers/pagingHelpers.js.map +1 -1
  364. package/dist/react-native/utils/MCPTool.d.ts +78 -0
  365. package/dist/react-native/utils/MCPTool.d.ts.map +1 -0
  366. package/dist/react-native/utils/MCPTool.js +128 -0
  367. package/dist/react-native/utils/MCPTool.js.map +1 -0
  368. package/dist/{esm → react-native/utils}/utils.d.ts +12 -1
  369. package/dist/react-native/utils/utils.d.ts.map +1 -0
  370. package/dist/{browser → react-native/utils}/utils.js +9 -0
  371. package/dist/react-native/utils/utils.js.map +1 -0
  372. package/package.json +1 -1
  373. package/dist/browser/utils.d.ts.map +0 -1
  374. package/dist/browser/utils.js.map +0 -1
  375. package/dist/commonjs/utils.d.ts.map +0 -1
  376. package/dist/commonjs/utils.js.map +0 -1
  377. package/dist/esm/utils.d.ts.map +0 -1
  378. package/dist/esm/utils.js.map +0 -1
  379. package/dist/react-native/utils.d.ts.map +0 -1
  380. package/dist/react-native/utils.js.map +0 -1
package/README.md CHANGED
@@ -11,7 +11,7 @@ Use the AI Agents client library to:
11
11
  [Product documentation](https://aka.ms/azsdk/azure-ai-projects/product-doc)
12
12
  | [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/ai/ai-agents/samples/)
13
13
  | [Package (npm)](https://www.npmjs.com/package/@azure/ai-agents)
14
- | [API reference documentation](https://learn.microsoft.com/javascript/api/overview/azure/ai-agents-readme?view=azure-node-preview)
14
+ | [API reference documentation](https://learn.microsoft.com/javascript/api/overview/azure/ai-agents-readme?view=azure-node-latest)
15
15
 
16
16
  ## Table of contents
17
17
 
@@ -27,9 +27,9 @@ Use the AI Agents client library to:
27
27
  - [File Search](#create-agent-with-file-search)
28
28
  - [Code interpreter](#create-agent-with-code-interpreter)
29
29
  - [Bing grounding](#create-agent-with-bing-grounding)
30
+ - [Deep research](#create-agent-with-deep-research)
30
31
  - [Azure AI Search](#create-agent-with-azure-ai-search)
31
32
  - [Function call](#create-agent-with-function-call)
32
- - [Fabric Data](#create-an-agent-with-fabric)
33
33
  - [Create thread](#create-thread) with
34
34
  - [Tool resource](#create-thread-with-tool-resource)
35
35
  - [Create message](#create-message) with:
@@ -74,7 +74,7 @@ npm install @azure/ai-agents @azure/identity
74
74
 
75
75
  The `AgentsClient` is used to construct the client. Currently, we recommend that you use the AgentsClient through the [Azure AI Projects Client Library](https://www.npmjs.com/package/@azure/ai-projects) using `client.agents`.
76
76
 
77
- To get your project endpoint you can refer this doc: [azure_foundry_service_endpoint]. Below we will assume the environment variable `PROJECT_ENDPOINT` was defined to hold this value:
77
+ To get your project endpoint you can refer to the [documentation][azure_foundry_service_endpoint]. Below we will assume the environment variable `PROJECT_ENDPOINT` holds this value.
78
78
 
79
79
  ```ts snippet:setup
80
80
  import { AgentsClient } from "@azure/ai-agents";
@@ -144,6 +144,34 @@ const agent = await client.createAgent("gpt-4o", {
144
144
  console.log(`Created agent, agent ID: ${agent.id}`);
145
145
  ```
146
146
 
147
+ #### Multiple Agents
148
+ You can create multiple Agents with different tools and then connect them together.
149
+
150
+ ```ts snippet:MultiAgents
151
+ import { ToolUtility } from "@azure/ai-agents";
152
+
153
+ const connectedAgentName = "stock_price_bot";
154
+ const modelDeploymentName = process.env["MODEL_DEPLOYMENT_NAME"] || "gpt-4o";
155
+ const stockAgent = await client.createAgent(modelDeploymentName, {
156
+ name: "stock-price-agent",
157
+ instructions:
158
+ "Your job is to get the stock price of a company. If you don't know the realtime stock price, return the last known stock price.",
159
+ });
160
+ // Initialize Connected Agent tool with the agent id, name, and description
161
+ const connectedAgentTool = ToolUtility.createConnectedAgentTool(
162
+ stockAgent.id,
163
+ connectedAgentName,
164
+ "Gets the stock price of a company",
165
+ );
166
+ // Create agent with the Connected Agent tool and process assistant run
167
+ const agent = await client.createAgent(modelDeploymentName, {
168
+ name: "my-agent",
169
+ instructions: "You are a helpful assistant, and use the connected agent to get stock prices.",
170
+ tools: [connectedAgentTool.definition],
171
+ });
172
+ console.log(`Created agent, agent ID: ${agent.id}`);
173
+ ```
174
+
147
175
  #### Create Agent with File Search
148
176
 
149
177
  To perform file search by an Agent, we first need to upload a file, create a vector store, and associate the file to the vector store. Here is an example:
@@ -224,6 +252,80 @@ const agent = await client.createAgent("gpt-4o", {
224
252
  });
225
253
  console.log(`Created agent, agent ID : ${agent.id}`);
226
254
  ```
255
+ #### Create Agent with Deep Research
256
+
257
+ To enable your Agent to do a detailed research of a topic, use the `DeepResearchTool` along with a connection to a Bing Grounding resource.
258
+ This scenario requires you to specify two model deployments. One is the generic chat model that does arbitration, and is
259
+ specified as usual when you call the `createAgent` method. The other is the Deep Research model, which is specified
260
+ when you define the `DeepResearchTool`.
261
+
262
+ Here is an example to integrate Deep ReSearch:
263
+
264
+ ```ts snippet:DeepResearch
265
+ import { DeepResearchToolDefinition } from "@azure/ai-agents";
266
+
267
+ const bingConnectionId = process.env["AZURE_BING_CONNECTION_ID"] || "<connection-name>";
268
+ const deepResearchModelDeploymentName =
269
+ process.env["DEEP_RESEARCH_MODEL_DEPLOYMENT_NAME"] || "gpt-4o";
270
+ const modelDeploymentName = process.env["MODEL_DEPLOYMENT_NAME"] || "gpt-4o";
271
+ // Create Deep Research tool definition
272
+ const deepResearchTool: DeepResearchToolDefinition = {
273
+ type: "deep_research",
274
+ deepResearch: {
275
+ deepResearchModel: deepResearchModelDeploymentName,
276
+ deepResearchBingGroundingConnections: [
277
+ {
278
+ connectionId: bingConnectionId,
279
+ },
280
+ ],
281
+ },
282
+ };
283
+ // Create agent with the Deep Research tool
284
+ const agent = await client.createAgent(modelDeploymentName, {
285
+ name: "my-agent",
286
+ instructions: "You are a helpful Agent that assists in researching scientific topics.",
287
+ tools: [deepResearchTool],
288
+ });
289
+ console.log(`Created agent, ID: ${agent.id}`);
290
+ ```
291
+
292
+ #### Create Agent with MCP tool
293
+
294
+ To enable your Agent to use the MCP tool, you can create an instance of the MCP tool and pass it to the agent during creation.
295
+ Here is an example to integrate MCP tool:
296
+
297
+ ```ts snippet:MCPTool
298
+ import { AgentsClient, ToolUtility } from "@azure/ai-agents";
299
+ import { DefaultAzureCredential } from "@azure/identity";
300
+
301
+ // Get MCP server configuration from environment variables
302
+ const mcpServerUrl =
303
+ process.env["MCP_SERVER_URL"] || "https://gitmcp.io/Azure/azure-rest-api-specs";
304
+ const mcpServerLabel = process.env["MCP_SERVER_LABEL"] || "github";
305
+ // Create an Azure AI Client
306
+ const client = new AgentsClient(projectEndpoint, new DefaultAzureCredential());
307
+ // Initialize agent MCP tool
308
+ const mcpTool = ToolUtility.createMCPTool({
309
+ serverLabel: mcpServerLabel,
310
+ serverUrl: mcpServerUrl,
311
+ allowedTools: [], // Optional: specify allowed tools
312
+ });
313
+ // You can also add or remove allowed tools dynamically
314
+ const searchApiCode = "search_azure_rest_api_code";
315
+ mcpTool.allowTool(searchApiCode);
316
+ console.log(`Allowed tools: ${mcpTool.allowedTools}`);
317
+ // Create agent with MCP tool
318
+ const agent = await client.createAgent(modelDeploymentName, {
319
+ name: "my-mcp-agent",
320
+ instructions:
321
+ "You are a helpful agent that can use MCP tools to assist users. Use the available MCP tools to answer questions and perform tasks.",
322
+ tools: mcpTool.definitions,
323
+ });
324
+ console.log(`Created agent, agent ID : ${agent.id}`);
325
+ ```
326
+
327
+
328
+
227
329
 
228
330
  #### Create Agent with Azure AI Search
229
331
 
@@ -413,29 +515,6 @@ const agent = await client.createAgent("gpt-4o", {
413
515
  console.log(`Created agent, agent ID: ${agent.id}`);
414
516
  ```
415
517
 
416
- #### Create an Agent with Fabric
417
-
418
- To enable your Agent to answer queries using Fabric data, use `FabricTool` along with a connection to the Fabric resource.
419
-
420
- Here is an example:
421
-
422
- ```ts snippet:createAgentWithFabric
423
- import { ToolUtility } from "@azure/ai-agents";
424
-
425
- const connectionId = process.env["FABRIC_CONNECTION_ID"] || "<connection-name>";
426
-
427
- // Initialize agent Microsoft Fabric tool with the connection id
428
- const fabricTool = ToolUtility.createFabricTool(connectionId);
429
-
430
- // Create agent with the Microsoft Fabric tool and process assistant run
431
- const agent = await client.createAgent("gpt-4o", {
432
- name: "my-agent",
433
- instructions: "You are a helpful agent",
434
- tools: [fabricTool.definition],
435
- });
436
- console.log(`Created agent, agent ID : ${agent.id}`);
437
- ```
438
-
439
518
  #### Create Thread
440
519
 
441
520
  For each session or conversation, a thread is required. Here is an example:
@@ -11,13 +11,13 @@ import type { MessagesOperations } from "./classic/messages/index.js";
11
11
  import type { ThreadsOperations } from "./classic/threads/index.js";
12
12
  import type { PagedAsyncIterableIterator } from "./static-helpers/pagingHelpers.js";
13
13
  import type { Pipeline } from "@azure/core-rest-pipeline";
14
- import type { KeyCredential, TokenCredential } from "@azure/core-auth";
14
+ import type { TokenCredential } from "@azure/core-auth";
15
15
  export { AgentsClientOptionalParams } from "./api/agentsContext.js";
16
16
  export declare class AgentsClient {
17
17
  private _client;
18
18
  /** The pipeline used by this client to make requests */
19
19
  readonly pipeline: Pipeline;
20
- constructor(endpointParam: string, credential: KeyCredential | TokenCredential, options?: AgentsClientOptionalParams);
20
+ constructor(endpointParam: string, credential: TokenCredential, options?: AgentsClientOptionalParams);
21
21
  /** The operation groups for vectorStoreFileBatches */
22
22
  readonly vectorStoreFileBatches: VectorStoreFileBatchesOperations;
23
23
  /** The operation groups for vectorStoreFiles */
@@ -1 +1 @@
1
- {"version":3,"file":"agentsClient.d.ts","sourceRoot":"","sources":["../../src/agentsClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAiB,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAEhF,OAAO,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAElG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAEtF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAE9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,KAAK,E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AED,2BAA2B;IAC3B,WAAW,CACT,KAAa,EACb,UAAqC,EAAE,cAAc,EAAE,EAAE,EAAE;QAE3D,OAAO,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AgentsContext, AgentsClientOptionalParams } from \"./api/index.js\";\nimport { createAgents } from \"./api/index.js\";\nimport type { Agent, AgentDeletionStatus } from \"./models/models.js\";\nimport type {\n DeleteAgentOptionalParams,\n UpdateAgentOptionalParams,\n GetAgentOptionalParams,\n ListAgentsOptionalParams,\n CreateAgentOptionalParams,\n} from \"./api/options.js\";\nimport { deleteAgent, updateAgent, getAgent, listAgents, createAgent } from \"./api/operations.js\";\nimport type { VectorStoreFileBatchesOperations } from \"./classic/vectorStoreFileBatches/index.js\";\nimport { _getVectorStoreFileBatchesOperations } from \"./classic/vectorStoreFileBatches/index.js\";\nimport type { VectorStoreFilesOperations } from \"./classic/vectorStoreFiles/index.js\";\nimport { _getVectorStoreFilesOperations } from \"./classic/vectorStoreFiles/index.js\";\nimport type { VectorStoresOperations } from \"./classic/vectorStores/index.js\";\nimport { _getVectorStoresOperations } from \"./classic/vectorStores/index.js\";\nimport type { FilesOperations } from \"./classic/files/index.js\";\nimport { _getFilesOperations } from \"./classic/files/index.js\";\nimport type { RunStepsOperations } from \"./classic/runSteps/index.js\";\nimport { _getRunStepsOperations } from \"./classic/runSteps/index.js\";\nimport type { RunsOperations } from \"./classic/runs/index.js\";\nimport { _getRunsOperations } from \"./classic/runs/index.js\";\nimport type { MessagesOperations } from \"./classic/messages/index.js\";\nimport { _getMessagesOperations } from \"./classic/messages/index.js\";\nimport type { ThreadsOperations } from \"./classic/threads/index.js\";\nimport { _getThreadsOperations } from \"./classic/threads/index.js\";\nimport type { PagedAsyncIterableIterator } from \"./static-helpers/pagingHelpers.js\";\nimport type { Pipeline } from \"@azure/core-rest-pipeline\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\n\nexport { AgentsClientOptionalParams } from \"./api/agentsContext.js\";\n\nexport class AgentsClient {\n private _client: AgentsContext;\n /** The pipeline used by this client to make requests */\n public readonly pipeline: Pipeline;\n\n constructor(\n endpointParam: string,\n credential: KeyCredential | TokenCredential,\n options: AgentsClientOptionalParams = {},\n ) {\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._client = createAgents(endpointParam, credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n this.pipeline = this._client.pipeline;\n this.vectorStoreFileBatches = _getVectorStoreFileBatchesOperations(this._client);\n this.vectorStoreFiles = _getVectorStoreFilesOperations(this._client);\n this.vectorStores = _getVectorStoresOperations(this._client);\n this.files = _getFilesOperations(this._client);\n this.runSteps = _getRunStepsOperations(this._client);\n this.runs = _getRunsOperations(this._client);\n this.messages = _getMessagesOperations(this._client);\n this.threads = _getThreadsOperations(this._client);\n }\n\n /** The operation groups for vectorStoreFileBatches */\n public readonly vectorStoreFileBatches: VectorStoreFileBatchesOperations;\n /** The operation groups for vectorStoreFiles */\n public readonly vectorStoreFiles: VectorStoreFilesOperations;\n /** The operation groups for vectorStores */\n public readonly vectorStores: VectorStoresOperations;\n /** The operation groups for files */\n public readonly files: FilesOperations;\n /** The operation groups for runSteps */\n public readonly runSteps: RunStepsOperations;\n /** The operation groups for runs */\n public readonly runs: RunsOperations;\n /** The operation groups for messages */\n public readonly messages: MessagesOperations;\n /** The operation groups for threads */\n public readonly threads: ThreadsOperations;\n\n /** Deletes an agent. */\n deleteAgent(\n assistantId: string,\n options: DeleteAgentOptionalParams = { requestOptions: {} },\n ): Promise<AgentDeletionStatus> {\n return deleteAgent(this._client, assistantId, options);\n }\n\n /** Modifies an existing agent. */\n updateAgent(\n assistantId: string,\n options: UpdateAgentOptionalParams = { requestOptions: {} },\n ): Promise<Agent> {\n return updateAgent(this._client, assistantId, options);\n }\n\n /** Retrieves an existing agent. */\n getAgent(\n assistantId: string,\n options: GetAgentOptionalParams = { requestOptions: {} },\n ): Promise<Agent> {\n return getAgent(this._client, assistantId, options);\n }\n\n /** Gets a list of agents that were previously created. */\n listAgents(\n options: ListAgentsOptionalParams = { requestOptions: {} },\n ): PagedAsyncIterableIterator<Agent> {\n return listAgents(this._client, options);\n }\n\n /** Creates a new agent. */\n createAgent(\n model: string,\n options: CreateAgentOptionalParams = { requestOptions: {} },\n ): Promise<Agent> {\n return createAgent(this._client, model, options);\n }\n}\n"]}
1
+ {"version":3,"file":"agentsClient.js","sourceRoot":"","sources":["../../src/agentsClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAS9C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElG,OAAO,EAAE,oCAAoC,EAAE,MAAM,2CAA2C,CAAC;AAEjG,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAErF,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAOnE,MAAM,OAAO,YAAY;IAKvB,YACE,aAAqB,EACrB,UAA2B,EAC3B,UAAsC,EAAE;;QAExC,MAAM,iBAAiB,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,0CA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AE,WAAW,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,mCAAmC;IACnC,QAAQ,CACN,WAAmB,EACnB,UAAkC,EAAE,cAAc,EAAE,EAAE,EAAE;QAExD,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED,0DAA0D;IAC1D,UAAU,CACR,UAAoC,EAAE,cAAc,EAAE,EAAE,EAAE;QAE1D,OAAO,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED,2BAA2B;IAC3B,WAAW,CACT,KAAa,EACb,UAAqC,EAAE,cAAc,EAAE,EAAE,EAAE;QAE3D,OAAO,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AgentsContext, AgentsClientOptionalParams } from \"./api/index.js\";\nimport { createAgents } from \"./api/index.js\";\nimport type { Agent, AgentDeletionStatus } from \"./models/models.js\";\nimport type {\n DeleteAgentOptionalParams,\n UpdateAgentOptionalParams,\n GetAgentOptionalParams,\n ListAgentsOptionalParams,\n CreateAgentOptionalParams,\n} from \"./api/options.js\";\nimport { deleteAgent, updateAgent, getAgent, listAgents, createAgent } from \"./api/operations.js\";\nimport type { VectorStoreFileBatchesOperations } from \"./classic/vectorStoreFileBatches/index.js\";\nimport { _getVectorStoreFileBatchesOperations } from \"./classic/vectorStoreFileBatches/index.js\";\nimport type { VectorStoreFilesOperations } from \"./classic/vectorStoreFiles/index.js\";\nimport { _getVectorStoreFilesOperations } from \"./classic/vectorStoreFiles/index.js\";\nimport type { VectorStoresOperations } from \"./classic/vectorStores/index.js\";\nimport { _getVectorStoresOperations } from \"./classic/vectorStores/index.js\";\nimport type { FilesOperations } from \"./classic/files/index.js\";\nimport { _getFilesOperations } from \"./classic/files/index.js\";\nimport type { RunStepsOperations } from \"./classic/runSteps/index.js\";\nimport { _getRunStepsOperations } from \"./classic/runSteps/index.js\";\nimport type { RunsOperations } from \"./classic/runs/index.js\";\nimport { _getRunsOperations } from \"./classic/runs/index.js\";\nimport type { MessagesOperations } from \"./classic/messages/index.js\";\nimport { _getMessagesOperations } from \"./classic/messages/index.js\";\nimport type { ThreadsOperations } from \"./classic/threads/index.js\";\nimport { _getThreadsOperations } from \"./classic/threads/index.js\";\nimport type { PagedAsyncIterableIterator } from \"./static-helpers/pagingHelpers.js\";\nimport type { Pipeline } from \"@azure/core-rest-pipeline\";\nimport type { TokenCredential } from \"@azure/core-auth\";\n\nexport { AgentsClientOptionalParams } from \"./api/agentsContext.js\";\n\nexport class AgentsClient {\n private _client: AgentsContext;\n /** The pipeline used by this client to make requests */\n public readonly pipeline: Pipeline;\n\n constructor(\n endpointParam: string,\n credential: TokenCredential,\n options: AgentsClientOptionalParams = {},\n ) {\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._client = createAgents(endpointParam, credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n this.pipeline = this._client.pipeline;\n this.vectorStoreFileBatches = _getVectorStoreFileBatchesOperations(this._client);\n this.vectorStoreFiles = _getVectorStoreFilesOperations(this._client);\n this.vectorStores = _getVectorStoresOperations(this._client);\n this.files = _getFilesOperations(this._client);\n this.runSteps = _getRunStepsOperations(this._client);\n this.runs = _getRunsOperations(this._client);\n this.messages = _getMessagesOperations(this._client);\n this.threads = _getThreadsOperations(this._client);\n }\n\n /** The operation groups for vectorStoreFileBatches */\n public readonly vectorStoreFileBatches: VectorStoreFileBatchesOperations;\n /** The operation groups for vectorStoreFiles */\n public readonly vectorStoreFiles: VectorStoreFilesOperations;\n /** The operation groups for vectorStores */\n public readonly vectorStores: VectorStoresOperations;\n /** The operation groups for files */\n public readonly files: FilesOperations;\n /** The operation groups for runSteps */\n public readonly runSteps: RunStepsOperations;\n /** The operation groups for runs */\n public readonly runs: RunsOperations;\n /** The operation groups for messages */\n public readonly messages: MessagesOperations;\n /** The operation groups for threads */\n public readonly threads: ThreadsOperations;\n\n /** Deletes an agent. */\n deleteAgent(\n assistantId: string,\n options: DeleteAgentOptionalParams = { requestOptions: {} },\n ): Promise<AgentDeletionStatus> {\n return deleteAgent(this._client, assistantId, options);\n }\n\n /** Modifies an existing agent. */\n updateAgent(\n assistantId: string,\n options: UpdateAgentOptionalParams = { requestOptions: {} },\n ): Promise<Agent> {\n return updateAgent(this._client, assistantId, options);\n }\n\n /** Retrieves an existing agent. */\n getAgent(\n assistantId: string,\n options: GetAgentOptionalParams = { requestOptions: {} },\n ): Promise<Agent> {\n return getAgent(this._client, assistantId, options);\n }\n\n /** Gets a list of agents that were previously created. */\n listAgents(\n options: ListAgentsOptionalParams = { requestOptions: {} },\n ): PagedAsyncIterableIterator<Agent> {\n return listAgents(this._client, options);\n }\n\n /** Creates a new agent. */\n createAgent(\n model: string,\n options: CreateAgentOptionalParams = { requestOptions: {} },\n ): Promise<Agent> {\n return createAgent(this._client, model, options);\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { Client, ClientOptions } from "@azure-rest/core-client";
2
- import { KeyCredential, TokenCredential } from "@azure/core-auth";
2
+ import { TokenCredential } from "@azure/core-auth";
3
3
  export interface AgentsContext extends Client {
4
4
  /** The API version to use for this operation. */
5
5
  /** Known values of {@link KnownVersions} that the service accepts. */
@@ -11,5 +11,5 @@ export interface AgentsClientOptionalParams extends ClientOptions {
11
11
  /** Known values of {@link KnownVersions} that the service accepts. */
12
12
  apiVersion?: string;
13
13
  }
14
- export declare function createAgents(endpointParam: string, credential: KeyCredential | TokenCredential, options?: AgentsClientOptionalParams): AgentsContext;
14
+ export declare function createAgents(endpointParam: string, credential: TokenCredential, options?: AgentsClientOptionalParams): AgentsContext;
15
15
  //# sourceMappingURL=agentsContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agentsContext.d.ts","sourceRoot":"","sources":["../../../src/api/agentsContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAa,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAmB,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnF,MAAM,WAAW,aAAc,SAAQ,MAAM;IAC3C,iDAAiD;IACjD,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,0CAA0C;AAC1C,MAAM,WAAW,0BAA2B,SAAQ,aAAa;IAC/D,iDAAiD;IACjD,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,YAAY,CAC1B,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,aAAa,GAAG,eAAe,EAC3C,OAAO,GAAE,0BAA+B,GACvC,aAAa,CA4Cf"}
1
+ {"version":3,"file":"agentsContext.d.ts","sourceRoot":"","sources":["../../../src/api/agentsContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAa,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,WAAW,aAAc,SAAQ,MAAM;IAC3C,iDAAiD;IACjD,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,0CAA0C;AAC1C,MAAM,WAAW,0BAA2B,SAAQ,aAAa;IAC/D,iDAAiD;IACjD,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,YAAY,CAC1B,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,eAAe,EAC3B,OAAO,GAAE,0BAA+B,GACvC,aAAa,CAkCf"}
@@ -3,41 +3,29 @@
3
3
  import { __rest } from "tslib";
4
4
  import { logger } from "../logger.js";
5
5
  import { getClient } from "@azure-rest/core-client";
6
- import { isKeyCredential } from "@azure/core-auth";
7
6
  export function createAgents(endpointParam, credential, options = {}) {
8
- var _a, _b, _c, _d, _e, _f;
9
- const prefixFromOptions = (_a = options === null || options === void 0 ? void 0 : options.userAgentOptions) === null || _a === void 0 ? void 0 : _a.userAgentPrefix;
10
- const userAgentInfo = `azsdk-js-ai-agents/1.0.0-beta.5`;
7
+ var _a, _b, _c, _d, _e, _f, _g, _h;
8
+ const endpointUrl = (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUrl) !== null && _b !== void 0 ? _b : String(endpointParam);
9
+ const prefixFromOptions = (_c = options === null || options === void 0 ? void 0 : options.userAgentOptions) === null || _c === void 0 ? void 0 : _c.userAgentPrefix;
10
+ const userAgentInfo = `azsdk-js-ai-agents/1.1.0-beta.1`;
11
11
  const userAgentPrefix = prefixFromOptions
12
12
  ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`
13
13
  : `azsdk-js-api ${userAgentInfo}`;
14
- const _g = Object.assign(Object.assign({}, options), { userAgentOptions: { userAgentPrefix }, loggingOptions: { logger: (_c = (_b = options.loggingOptions) === null || _b === void 0 ? void 0 : _b.logger) !== null && _c !== void 0 ? _c : logger.info }, credentials: {
15
- scopes: (_e = (_d = options.credentials) === null || _d === void 0 ? void 0 : _d.scopes) !== null && _e !== void 0 ? _e : ["https://ai.azure.com/.default"],
16
- } }), { apiVersion: _ } = _g, updatedOptions = __rest(_g, ["apiVersion"]);
17
- const clientContext = getClient(endpointParam, credential, updatedOptions);
18
- if (isKeyCredential(credential)) {
19
- clientContext.pipeline.addPolicy({
20
- name: "customKeyCredentialPolicy",
21
- sendRequest(request, next) {
22
- request.headers.set("Authorization", "Bearer " + credential.key);
23
- return next(request);
24
- },
25
- });
26
- }
14
+ const _j = Object.assign(Object.assign({}, options), { userAgentOptions: { userAgentPrefix }, loggingOptions: { logger: (_e = (_d = options.loggingOptions) === null || _d === void 0 ? void 0 : _d.logger) !== null && _e !== void 0 ? _e : logger.info }, credentials: {
15
+ scopes: (_g = (_f = options.credentials) === null || _f === void 0 ? void 0 : _f.scopes) !== null && _g !== void 0 ? _g : ["https://ai.azure.com/.default"],
16
+ } }), { apiVersion: _ } = _j, updatedOptions = __rest(_j, ["apiVersion"]);
17
+ const clientContext = getClient(endpointUrl, credential, updatedOptions);
27
18
  clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" });
28
- const apiVersion = (_f = options.apiVersion) !== null && _f !== void 0 ? _f : "2025-05-15-preview";
19
+ const apiVersion = (_h = options.apiVersion) !== null && _h !== void 0 ? _h : "2025-05-15-preview";
29
20
  clientContext.pipeline.addPolicy({
30
21
  name: "ClientApiVersionPolicy",
31
22
  sendRequest: (req, next) => {
32
- var _a;
33
23
  // Use the apiVersion defined in request url directly
34
24
  // Append one if there is no apiVersion and we have one at client options
35
25
  const url = new URL(req.url);
36
- const defaultApiVersion = (_a = url.searchParams.get("api-version")) !== null && _a !== void 0 ? _a : apiVersion;
37
- // remove api-version from url
38
- url.searchParams.delete("api-version");
39
- // add api-version to url
40
- req.url = `${url.toString()}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${defaultApiVersion}`;
26
+ if (!url.searchParams.get("api-version")) {
27
+ req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${apiVersion}`;
28
+ }
41
29
  return next(req);
42
30
  },
43
31
  });
@@ -1 +1 @@
1
- {"version":3,"file":"agentsContext.js","sourceRoot":"","sources":["../../../src/api/agentsContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAyB,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAiB,eAAe,EAAmB,MAAM,kBAAkB,CAAC;AAenF,MAAM,UAAU,YAAY,CAC1B,aAAqB,EACrB,UAA2C,EAC3C,UAAsC,EAAE;;IAExC,MAAM,iBAAiB,GAAG,MAAA,OAA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BAAwB;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,MAAM,iBAAiB,GAAG,MAAA,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,mCAAI,UAAU,CAAC;YAC5E,8BAA8B;YAC9B,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YACvC,yBAAyB;YACzB,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,GACzB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,iBAAiB,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,gCAAK,aAAa,KAAE,UAAU,GAAmB,CAAC;AAC3D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownVersions } from \"../models/models.js\";\nimport { Client, ClientOptions, getClient } from \"@azure-rest/core-client\";\nimport { KeyCredential, isKeyCredential, TokenCredential } from \"@azure/core-auth\";\n\nexport interface AgentsContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion: string;\n}\n\n/** Optional parameters for the client. */\nexport interface AgentsClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion?: string;\n}\n\nexport function createAgents(\n endpointParam: string,\n credential: KeyCredential | TokenCredential,\n options: AgentsClientOptionalParams = {},\n): AgentsContext {\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-ai-agents/1.0.0-beta.5`;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`\n : `azsdk-js-api ${userAgentInfo}`;\n const { apiVersion: _, ...updatedOptions } = {\n ...options,\n userAgentOptions: { userAgentPrefix },\n loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://ai.azure.com/.default\"],\n },\n };\n const clientContext = getClient(endpointParam, credential, updatedOptions);\n\n if (isKeyCredential(credential)) {\n clientContext.pipeline.addPolicy({\n name: \"customKeyCredentialPolicy\",\n sendRequest(request, next) {\n request.headers.set(\"Authorization\", \"Bearer \" + credential.key);\n return next(request);\n },\n });\n }\n clientContext.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n const apiVersion = options.apiVersion ?? \"2025-05-15-preview\";\n clientContext.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 const defaultApiVersion = url.searchParams.get(\"api-version\") ?? apiVersion;\n // remove api-version from url\n url.searchParams.delete(\"api-version\");\n // add api-version to url\n req.url = `${url.toString()}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${defaultApiVersion}`;\n return next(req);\n },\n });\n return { ...clientContext, apiVersion } as AgentsContext;\n}\n"]}
1
+ {"version":3,"file":"agentsContext.js","sourceRoot":"","sources":["../../../src/api/agentsContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAyB,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAgB3E,MAAM,UAAU,YAAY,CAC1B,aAAqB,EACrB,UAA2B,EAC3B,UAAsC,EAAE;;IAExC,MAAM,WAAW,GAAG,MA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AAG,CAAC,aAAa,CAAC,EAAE,CAAC;gBACzC,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;IACH,OAAO,gCAAK,aAAa,KAAE,UAAU,GAAmB,CAAC;AAC3D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownVersions } from \"../models/models.js\";\nimport { Client, ClientOptions, getClient } from \"@azure-rest/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\nexport interface AgentsContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion: string;\n}\n\n/** Optional parameters for the client. */\nexport interface AgentsClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion?: string;\n}\n\nexport function createAgents(\n endpointParam: string,\n credential: TokenCredential,\n options: AgentsClientOptionalParams = {},\n): AgentsContext {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? String(endpointParam);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-ai-agents/1.1.0-beta.1`;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`\n : `azsdk-js-api ${userAgentInfo}`;\n const { apiVersion: _, ...updatedOptions } = {\n ...options,\n userAgentOptions: { userAgentPrefix },\n loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://ai.azure.com/.default\"],\n },\n };\n const clientContext = getClient(endpointUrl, credential, updatedOptions);\n clientContext.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n const apiVersion = options.apiVersion ?? \"2025-05-15-preview\";\n clientContext.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\")) {\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 return { ...clientContext, apiVersion } as AgentsContext;\n}\n"]}
@@ -1,7 +1,7 @@
1
- import { AgentsContext as Client } from "../index.js";
2
- import { FileListResponse, FileInfo, FilePurpose, FileDeletionStatus } from "../../models/models.js";
3
- import { FilesGetFileContentOptionalParams, FilesGetFileOptionalParams, FilesDeleteFileOptionalParams, FilesUploadFileOptionalParams, FilesListFilesOptionalParams } from "./options.js";
4
- import { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client";
1
+ import type { AgentsContext as Client } from "../index.js";
2
+ import type { FileListResponse, FileInfo, FilePurpose, FileDeletionStatus } from "../../models/models.js";
3
+ import type { FilesGetFileContentOptionalParams, FilesGetFileOptionalParams, FilesDeleteFileOptionalParams, FilesUploadFileOptionalParams, FilesListFilesOptionalParams } from "./options.js";
4
+ import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client";
5
5
  import type { OperationState, PollerLike } from "@azure/core-lro";
6
6
  export declare function _getFileContentSend(context: Client, fileId: string, options?: FilesGetFileContentOptionalParams): StreamableMethod<string | Uint8Array>;
7
7
  /** Retrieves the raw content of a specific file. */
@@ -1 +1 @@
1
- {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/api/files/operations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,g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zD,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,EACD,OAAO,GAAE,6BAAsD,GAC9D,OAAO,CAAC,QAAQ,CAAC,CAGnB;AAED,kDAAkD;AAClD,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE;IACJ,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,cAAc,CAAC;IACzD,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,EACD,OAAO,GAAE,6BAAsD,GAC9D,UAAU,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAgBhD;AAED,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE;IACJ,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,cAAc,CAAC;IACzD,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,EACD,OAAO,GAAE,6BAAsD,GAC9D,UAAU,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAgBhD;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,4BAAqD,GAC7D,gBAAgB,CAkBlB;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAS3B;AAED,gDAAgD;AAChD,wBAAsB,SAAS,CAC7B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,4BAAqD,GAC7D,OAAO,CAAC,gBAAgB,CAAC,CAG3B"}
@@ -1,14 +1,14 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { fileListResponseDeserializer, fileInfoDeserializer, _uploadFileRequestSerializer, fileDeletionStatusDeserializer, } from "../../models/models.js";
3
+ import { agentV1ErrorDeserializer, fileListResponseDeserializer, fileInfoDeserializer, _uploadFileRequestSerializer, fileDeletionStatusDeserializer, } from "../../models/models.js";
4
4
  import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js";
5
- import { createRestError, operationOptionsToRequestParameters, } from "@azure-rest/core-client";
5
+ import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client";
6
6
  import { createPoller } from "../poller.js";
7
7
  export function _getFileContentSend(context, fileId, options = { requestOptions: {} }) {
8
8
  var _a, _b;
9
- const path = expandUrlTemplate("/files/{fileId}/content{?api%2Dversion}", {
9
+ const path = expandUrlTemplate("/files/{fileId}/content{?api-version}", {
10
10
  fileId: fileId,
11
- "api%2Dversion": context.apiVersion,
11
+ "api-version": context.apiVersion,
12
12
  }, {
13
13
  allowReserved: (_a = options === null || options === void 0 ? void 0 : options.requestOptions) === null || _a === void 0 ? void 0 : _a.skipUrlEncoding,
14
14
  });
@@ -21,9 +21,9 @@ export function getFileContent(context, fileId, options = { requestOptions: {} }
21
21
  }
22
22
  export function _getFileSend(context, fileId, options = { requestOptions: {} }) {
23
23
  var _a, _b;
24
- const path = expandUrlTemplate("/files/{fileId}{?api%2Dversion}", {
24
+ const path = expandUrlTemplate("/files/{fileId}{?api-version}", {
25
25
  fileId: fileId,
26
- "api%2Dversion": context.apiVersion,
26
+ "api-version": context.apiVersion,
27
27
  }, {
28
28
  allowReserved: (_a = options === null || options === void 0 ? void 0 : options.requestOptions) === null || _a === void 0 ? void 0 : _a.skipUrlEncoding,
29
29
  });
@@ -32,7 +32,9 @@ export function _getFileSend(context, fileId, options = { requestOptions: {} })
32
32
  export async function _getFileDeserialize(result) {
33
33
  const expectedStatuses = ["200"];
34
34
  if (!expectedStatuses.includes(result.status)) {
35
- throw createRestError(result);
35
+ const error = createRestError(result);
36
+ error.details = agentV1ErrorDeserializer(result.body);
37
+ throw error;
36
38
  }
37
39
  return fileInfoDeserializer(result.body);
38
40
  }
@@ -54,7 +56,9 @@ export function _deleteFileSend(context, fileId, options = { requestOptions: {}
54
56
  export async function _deleteFileDeserialize(result) {
55
57
  const expectedStatuses = ["200"];
56
58
  if (!expectedStatuses.includes(result.status)) {
57
- throw createRestError(result);
59
+ const error = createRestError(result);
60
+ error.details = agentV1ErrorDeserializer(result.body);
61
+ throw error;
58
62
  }
59
63
  return fileDeletionStatusDeserializer(result.body);
60
64
  }
@@ -64,13 +68,20 @@ export async function deleteFile(context, fileId, options = { requestOptions: {}
64
68
  return _deleteFileDeserialize(result);
65
69
  }
66
70
  export function _uploadFileSend(context, body, options = { requestOptions: {} }) {
67
- var _a;
68
- return context.path("/files").post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { contentType: "multipart/form-data", headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), body: _uploadFileRequestSerializer(body) }));
71
+ var _a, _b;
72
+ const path = expandUrlTemplate("/files{?api-version}", {
73
+ "api-version": context.apiVersion,
74
+ }, {
75
+ allowReserved: (_a = options === null || options === void 0 ? void 0 : options.requestOptions) === null || _a === void 0 ? void 0 : _a.skipUrlEncoding,
76
+ });
77
+ return context.path(path).post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { contentType: "multipart/form-data", headers: Object.assign({ accept: "application/json" }, (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.headers), body: _uploadFileRequestSerializer(body) }));
69
78
  }
70
79
  export async function _uploadFileDeserialize(result) {
71
80
  const expectedStatuses = ["200"];
72
81
  if (!expectedStatuses.includes(result.status)) {
73
- throw createRestError(result);
82
+ const error = createRestError(result);
83
+ error.details = agentV1ErrorDeserializer(result.body);
84
+ throw error;
74
85
  }
75
86
  return fileInfoDeserializer(result.body);
76
87
  }
@@ -130,7 +141,9 @@ export function _listFilesSend(context, options = { requestOptions: {} }) {
130
141
  export async function _listFilesDeserialize(result) {
131
142
  const expectedStatuses = ["200"];
132
143
  if (!expectedStatuses.includes(result.status)) {
133
- throw createRestError(result);
144
+ const error = createRestError(result);
145
+ error.details = agentV1ErrorDeserializer(result.body);
146
+ throw error;
134
147
  }
135
148
  return fileListResponseDeserializer(result.body);
136
149
  }
@@ -1 +1 @@
1
- {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/files/operations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAEL,4BAA4B,EAE5B,oBAAoB,EAEpB,4BAA4B,EAE5B,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC;AAQhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAGL,eAAe,EACf,mCAAmC,GACpC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,UAAU,mBAAmB,CACjC,OAAe,EACf,MAAc,EACd,UAA6C,EAAE,cAAc,EAAE,EAAE,EAAE;;IAEnE,MAAM,IAAI,GAAG,iBAAiB,CAC5B,yCAAyC,EACzC;QACE,MAAM,EAAE,MAAM;QACd,eAAe,EAAE,OAAO,CAAC,UAAU;KACpC,EACD;QACE,aAAa,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,0CAAE,eAAe;KACxD,CACF,CAAC;IACF,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,iCACxB,mCAAmC,CAAC,OAAO,CAAC,KAC/C,OAAO,kBACL,MAAM,EAAE,0BAA0B,IAC/B,MAAA,OAAO,CAAC,cAAc,0CAAE,OAAO,KAEpC,CAAC;AACL,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,cAAc,CAC5B,OAAe,EACf,MAAc,EACd,UAA6C,EAAE,cAAc,EAAE,EAAE,EAAE;IAEnE,MAAM,MAAM,GAAG,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7D,OAAO,MAAM,CAAC;AAChB,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CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,iCACxB,mCAAmC,CAAC,OAAO,CAAC,KAC/C,OAAO,kBACL,MAAM,EAAE,kBAAkB,IACvB,MAAA,OAAO,CAAC,cAAc,0CAAE,OAAO,KAEpC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,MAA6B;IAE7B,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,4BAA4B,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACnD,CAAC;AAED,gDAAgD;AAChD,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,OAAe,EACf,UAAwC,EAAE,cAAc,EAAE,EAAE,EAAE;IAE9D,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACtD,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC;AACD,SAAS,qBAAqB,CAAC,MAAgB;IAC7C,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;QACtB,KAAK,SAAS,CAAC;QACf,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,UAAU,CAAC;QAChB,KAAK,WAAW;YACd,OAAO,WAAW,CAAC;QACrB;YACE,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AgentsContext as Client } from \"../index.js\";\nimport {\n FileListResponse,\n fileListResponseDeserializer,\n FileInfo,\n fileInfoDeserializer,\n FilePurpose,\n _uploadFileRequestSerializer,\n FileDeletionStatus,\n fileDeletionStatusDeserializer,\n} from \"../../models/models.js\";\nimport {\n FilesGetFileContentOptionalParams,\n FilesGetFileOptionalParams,\n FilesDeleteFileOptionalParams,\n FilesUploadFileOptionalParams,\n FilesListFilesOptionalParams,\n} from \"./options.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\nimport type { OperationState, OperationStatus, PollerLike } from \"@azure/core-lro\";\nimport { createPoller } from \"../poller.js\";\n\nexport function _getFileContentSend(\n context: Client,\n fileId: string,\n options: FilesGetFileContentOptionalParams = { requestOptions: {} },\n): StreamableMethod<string | Uint8Array> {\n const path = expandUrlTemplate(\n \"/files/{fileId}/content{?api%2Dversion}\",\n {\n fileId: fileId,\n \"api%2Dversion\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/octet-stream\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\n/** Retrieves the raw content of a specific file. */\nexport function getFileContent(\n context: Client,\n fileId: string,\n options: FilesGetFileContentOptionalParams = { requestOptions: {} },\n): StreamableMethod<string | Uint8Array> {\n const result = _getFileContentSend(context, fileId, options);\n return result;\n}\n\nexport function _getFileSend(\n context: Client,\n fileId: string,\n options: FilesGetFileOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/files/{fileId}{?api%2Dversion}\",\n {\n fileId: fileId,\n \"api%2Dversion\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getFileDeserialize(result: PathUncheckedResponse): Promise<FileInfo> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return fileInfoDeserializer(result.body);\n}\n\n/** Returns information about a specific file. Does not retrieve file content. */\nexport async function getFile(\n context: Client,\n fileId: string,\n options: FilesGetFileOptionalParams = { requestOptions: {} },\n): Promise<FileInfo> {\n const result = await _getFileSend(context, fileId, options);\n return _getFileDeserialize(result);\n}\n\nexport function _deleteFileSend(\n context: Client,\n fileId: string,\n options: FilesDeleteFileOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/files/{fileId}{?api%2Dversion}\",\n {\n fileId: fileId,\n \"api%2Dversion\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).delete({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _deleteFileDeserialize(\n result: PathUncheckedResponse,\n): Promise<FileDeletionStatus> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return fileDeletionStatusDeserializer(result.body);\n}\n\n/** Delete a previously uploaded file. */\nexport async function deleteFile(\n context: Client,\n fileId: string,\n options: FilesDeleteFileOptionalParams = { requestOptions: {} },\n): Promise<FileDeletionStatus> {\n const result = await _deleteFileSend(context, fileId, options);\n return _deleteFileDeserialize(result);\n}\n\nexport function _uploadFileSend(\n context: Client,\n body: {\n file: ReadableStream<Uint8Array> | NodeJS.ReadableStream;\n purpose: FilePurpose;\n filename?: string;\n },\n options: FilesUploadFileOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n return context.path(\"/files\").post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"multipart/form-data\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: _uploadFileRequestSerializer(body),\n });\n}\n\nexport async function _uploadFileDeserialize(result: PathUncheckedResponse): Promise<FileInfo> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return fileInfoDeserializer(result.body);\n}\n\n/** Uploads a file for use by other operations. */\nexport async function uploadFileInternal(\n context: Client,\n body: {\n file: ReadableStream<Uint8Array> | NodeJS.ReadableStream;\n purpose: FilePurpose;\n filename?: string;\n },\n options: FilesUploadFileOptionalParams = { requestOptions: {} },\n): Promise<FileInfo> {\n const result = await _uploadFileSend(context, body, options);\n return _uploadFileDeserialize(result);\n}\n\n/** Uploads a file for use by other operations. */\nexport function uploadFile(\n context: Client,\n body: {\n file: ReadableStream<Uint8Array> | NodeJS.ReadableStream;\n purpose: FilePurpose;\n filename?: string;\n },\n options: FilesUploadFileOptionalParams = { requestOptions: {} },\n): PollerLike<OperationState<FileInfo>, FileInfo> {\n return createPoller<FileInfo>({\n initOperation: async () => {\n return uploadFileInternal(context, body, options);\n },\n pollOperation: async (currentResult: FileInfo) => {\n return getFile(context, currentResult.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n getOperationError: (result: FileInfo) => {\n return getLroOperationStatus(result) === \"failed\" && result.statusDetails\n ? new Error(`Operation failed: ${result.statusDetails}`)\n : undefined;\n },\n intervalInMs: options.pollingOptions?.intervalInMs,\n });\n}\n\n/** Uploads a file for use by other operations with polling */\nexport function uploadFileAndPoll(\n context: Client,\n body: {\n file: ReadableStream<Uint8Array> | NodeJS.ReadableStream;\n purpose: FilePurpose;\n filename?: string;\n },\n options: FilesUploadFileOptionalParams = { requestOptions: {} },\n): PollerLike<OperationState<FileInfo>, FileInfo> {\n return createPoller<FileInfo>({\n initOperation: async () => {\n return uploadFileInternal(context, body, options);\n },\n pollOperation: async (currentResult: FileInfo) => {\n return getFile(context, currentResult.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n getOperationError: (result: FileInfo) => {\n return getLroOperationStatus(result) === \"failed\" && result.statusDetails\n ? new Error(`Operation failed: ${result.statusDetails}`)\n : undefined;\n },\n intervalInMs: options.pollingOptions?.intervalInMs,\n });\n}\n\nexport function _listFilesSend(\n context: Client,\n options: FilesListFilesOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/files{?api%2Dversion,purpose}\",\n {\n \"api%2Dversion\": context.apiVersion,\n purpose: options?.purpose,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listFilesDeserialize(\n result: PathUncheckedResponse,\n): Promise<FileListResponse> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return fileListResponseDeserializer(result.body);\n}\n\n/** Gets a list of previously uploaded files. */\nexport async function listFiles(\n context: Client,\n options: FilesListFilesOptionalParams = { requestOptions: {} },\n): Promise<FileListResponse> {\n const result = await _listFilesSend(context, options);\n return _listFilesDeserialize(result);\n}\nfunction getLroOperationStatus(result: FileInfo): OperationStatus {\n switch (result.status) {\n case \"running\":\n case \"pending\":\n return \"running\";\n case \"uploaded\":\n case \"processed\":\n return \"succeeded\";\n default:\n return \"failed\";\n }\n}\n"]}
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/files/operations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC;AAQhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAE,eAAe,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAC;AAE/F,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,UAAU,mBAAmB,CACjC,OAAe,EACf,MAAc,EACd,UAA6C,EAAE,cAAc,EAAE,EAAE,EAAE;;IAEnE,MAAM,IAAI,GAAG,iBAAiB,CAC5B,uCAAuC,EACvC;QACE,MAAM,EAAE,MAAM;QACd,aAAa,EA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C,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,MAA6B;IAE7B,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACtC,KAAK,CAAC,OAAO,GAAG,wBAAwB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACtD,MAAM,KAAK,CAAC;IACd,CAAC;IAED,OAAO,4BAA4B,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACnD,CAAC;AAED,gDAAgD;AAChD,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,OAAe,EACf,UAAwC,EAAE,cAAc,EAAE,EAAE,EAAE;IAE9D,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACtD,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAgB;IAC7C,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;QACtB,KAAK,SAAS,CAAC;QACf,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,UAAU,CAAC;QAChB,KAAK,WAAW;YACd,OAAO,WAAW,CAAC;QACrB;YACE,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AgentsContext as Client } from \"../index.js\";\nimport type {\n FileListResponse,\n FileInfo,\n FilePurpose,\n FileDeletionStatus,\n} from \"../../models/models.js\";\nimport {\n agentV1ErrorDeserializer,\n fileListResponseDeserializer,\n fileInfoDeserializer,\n _uploadFileRequestSerializer,\n fileDeletionStatusDeserializer,\n} from \"../../models/models.js\";\nimport type {\n FilesGetFileContentOptionalParams,\n FilesGetFileOptionalParams,\n FilesDeleteFileOptionalParams,\n FilesUploadFileOptionalParams,\n FilesListFilesOptionalParams,\n} from \"./options.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport type { StreamableMethod, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError, operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nimport type { OperationState, OperationStatus, PollerLike } from \"@azure/core-lro\";\nimport { createPoller } from \"../poller.js\";\n\nexport function _getFileContentSend(\n context: Client,\n fileId: string,\n options: FilesGetFileContentOptionalParams = { requestOptions: {} },\n): StreamableMethod<string | Uint8Array> {\n const path = expandUrlTemplate(\n \"/files/{fileId}/content{?api-version}\",\n {\n fileId: fileId,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/octet-stream\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\n/** Retrieves the raw content of a specific file. */\nexport function getFileContent(\n context: Client,\n fileId: string,\n options: FilesGetFileContentOptionalParams = { requestOptions: {} },\n): StreamableMethod<string | Uint8Array> {\n const result = _getFileContentSend(context, fileId, options);\n return result;\n}\n\nexport function _getFileSend(\n context: Client,\n fileId: string,\n options: FilesGetFileOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/files/{fileId}{?api-version}\",\n {\n fileId: fileId,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getFileDeserialize(result: PathUncheckedResponse): Promise<FileInfo> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n const error = createRestError(result);\n error.details = agentV1ErrorDeserializer(result.body);\n throw error;\n }\n\n return fileInfoDeserializer(result.body);\n}\n\n/** Returns information about a specific file. Does not retrieve file content. */\nexport async function getFile(\n context: Client,\n fileId: string,\n options: FilesGetFileOptionalParams = { requestOptions: {} },\n): Promise<FileInfo> {\n const result = await _getFileSend(context, fileId, options);\n return _getFileDeserialize(result);\n}\n\nexport function _deleteFileSend(\n context: Client,\n fileId: string,\n options: FilesDeleteFileOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/files/{fileId}{?api%2Dversion}\",\n {\n fileId: fileId,\n \"api%2Dversion\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).delete({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _deleteFileDeserialize(\n result: PathUncheckedResponse,\n): Promise<FileDeletionStatus> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n const error = createRestError(result);\n error.details = agentV1ErrorDeserializer(result.body);\n throw error;\n }\n\n return fileDeletionStatusDeserializer(result.body);\n}\n\n/** Delete a previously uploaded file. */\nexport async function deleteFile(\n context: Client,\n fileId: string,\n options: FilesDeleteFileOptionalParams = { requestOptions: {} },\n): Promise<FileDeletionStatus> {\n const result = await _deleteFileSend(context, fileId, options);\n return _deleteFileDeserialize(result);\n}\n\nexport function _uploadFileSend(\n context: Client,\n body: {\n file: ReadableStream<Uint8Array> | NodeJS.ReadableStream;\n purpose: FilePurpose;\n filename?: string;\n },\n options: FilesUploadFileOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/files{?api-version}\",\n {\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"multipart/form-data\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: _uploadFileRequestSerializer(body),\n });\n}\n\nexport async function _uploadFileDeserialize(result: PathUncheckedResponse): Promise<FileInfo> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n const error = createRestError(result);\n error.details = agentV1ErrorDeserializer(result.body);\n throw error;\n }\n\n return fileInfoDeserializer(result.body);\n}\n\n/** Uploads a file for use by other operations. */\nexport async function uploadFileInternal(\n context: Client,\n body: {\n file: ReadableStream<Uint8Array> | NodeJS.ReadableStream;\n purpose: FilePurpose;\n filename?: string;\n },\n options: FilesUploadFileOptionalParams = { requestOptions: {} },\n): Promise<FileInfo> {\n const result = await _uploadFileSend(context, body, options);\n return _uploadFileDeserialize(result);\n}\n\n/** Uploads a file for use by other operations. */\nexport function uploadFile(\n context: Client,\n body: {\n file: ReadableStream<Uint8Array> | NodeJS.ReadableStream;\n purpose: FilePurpose;\n filename?: string;\n },\n options: FilesUploadFileOptionalParams = { requestOptions: {} },\n): PollerLike<OperationState<FileInfo>, FileInfo> {\n return createPoller<FileInfo>({\n initOperation: async () => {\n return uploadFileInternal(context, body, options);\n },\n pollOperation: async (currentResult: FileInfo) => {\n return getFile(context, currentResult.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n getOperationError: (result: FileInfo) => {\n return getLroOperationStatus(result) === \"failed\" && result.statusDetails\n ? new Error(`Operation failed: ${result.statusDetails}`)\n : undefined;\n },\n intervalInMs: options.pollingOptions?.intervalInMs,\n });\n}\n\n/** Uploads a file for use by other operations with polling */\nexport function uploadFileAndPoll(\n context: Client,\n body: {\n file: ReadableStream<Uint8Array> | NodeJS.ReadableStream;\n purpose: FilePurpose;\n filename?: string;\n },\n options: FilesUploadFileOptionalParams = { requestOptions: {} },\n): PollerLike<OperationState<FileInfo>, FileInfo> {\n return createPoller<FileInfo>({\n initOperation: async () => {\n return uploadFileInternal(context, body, options);\n },\n pollOperation: async (currentResult: FileInfo) => {\n return getFile(context, currentResult.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n getOperationError: (result: FileInfo) => {\n return getLroOperationStatus(result) === \"failed\" && result.statusDetails\n ? new Error(`Operation failed: ${result.statusDetails}`)\n : undefined;\n },\n intervalInMs: options.pollingOptions?.intervalInMs,\n });\n}\n\nexport function _listFilesSend(\n context: Client,\n options: FilesListFilesOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/files{?api%2Dversion,purpose}\",\n {\n \"api%2Dversion\": context.apiVersion,\n purpose: options?.purpose,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listFilesDeserialize(\n result: PathUncheckedResponse,\n): Promise<FileListResponse> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n const error = createRestError(result);\n error.details = agentV1ErrorDeserializer(result.body);\n throw error;\n }\n\n return fileListResponseDeserializer(result.body);\n}\n\n/** Gets a list of previously uploaded files. */\nexport async function listFiles(\n context: Client,\n options: FilesListFilesOptionalParams = { requestOptions: {} },\n): Promise<FileListResponse> {\n const result = await _listFilesSend(context, options);\n return _listFilesDeserialize(result);\n}\n\nfunction getLroOperationStatus(result: FileInfo): OperationStatus {\n switch (result.status) {\n case \"running\":\n case \"pending\":\n return \"running\";\n case \"uploaded\":\n case \"processed\":\n return \"succeeded\";\n default:\n return \"failed\";\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { FilePurpose } from "../../models/models.js";
2
- import { OperationOptions } from "@azure-rest/core-client";
3
- import { PollingOptionsParams } from "../options.js";
1
+ import type { FilePurpose } from "../../models/models.js";
2
+ import type { OperationOptions } from "@azure-rest/core-client";
3
+ import type { PollingOptionsParams } from "../options.js";
4
4
  /** Optional parameters. */
5
5
  export interface FilesGetFileContentOptionalParams extends OperationOptions {
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../src/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4BAA6B,SAAQ,gBAAgB;IACpE,+BAA+B;IAC/B,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../src/api/files/options.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { FilePurpose } from \"../../models/models.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { PollingOptionsParams } from \"../options.js\";\n\n/** Optional parameters. */\nexport interface FilesGetFileContentOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface FilesGetFileOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface FilesDeleteFileOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface FilesUploadFileOptionalParams extends OperationOptions, PollingOptionsParams {\n /** The name of the file to be uploaded. */\n fileName?: string;\n}\n\n/** Optional parameters. */\nexport interface FilesListFilesOptionalParams extends OperationOptions {\n /** The purpose of the file. */\n purpose?: FilePurpose;\n}\n"]}
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../src/api/files/options.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { FilePurpose } from \"../../models/models.js\";\nimport type { OperationOptions } from \"@azure-rest/core-client\";\nimport type { PollingOptionsParams } from \"../options.js\";\n\n/** Optional parameters. */\nexport interface FilesGetFileContentOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface FilesGetFileOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface FilesDeleteFileOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface FilesUploadFileOptionalParams extends OperationOptions, PollingOptionsParams {\n /** The name of the file to be uploaded. */\n fileName?: string;\n}\n\n/** Optional parameters. */\nexport interface FilesListFilesOptionalParams extends OperationOptions {\n /** The purpose of the file. */\n purpose?: FilePurpose;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/api/messages/operations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,WAAW,EACX,mBAAmB,EAGnB,aAAa,EAEb,+BAA+B,EAEhC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,mCAAmC,EACnC,gCAAgC,EAChC,kCAAkC,EAClC,mCAAmC,EACpC,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,0BAA0B,EAE3B,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EAGtB,MAAM,yBAAyB,CAAC;AAEjC,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,mCAA4D,GACpE,gBAAgB,CAqBlB;AAED,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,aAAa,CAAC,CAOxB;AAED,0DAA0D;AAC1D,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,mCAA4D,GACpE,OAAO,CAAC,aAAa,CAAC,CAGxB;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,gCAAyD,GACjE,gBAAgB,CAmBlB;AAED,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,aAAa,CAAC,CAOxB;AAED,qCAAqC;AACrC,wBAAsB,UAAU,CAC9B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,gCAAyD,GACjE,OAAO,CAAC,aAAa,CAAC,CAGxB;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,kCAA2D,GACnE,gBAAgB,CAuBlB;AAED,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,+BAA+B,CAAC,CAO1C;AAED,sDAAsD;AACtD,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,kCAA2D,GACnE,0BAA0B,CAAC,aAAa,CAAC,CAQ3C;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,GAAE,mCAA4D,GACpE,gBAAgB,CA2BlB;AAED,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,aAAa,CAAC,CAOxB;AAED,mDAAmD;AACnD,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,GAAE,mCAA4D,GACpE,OAAO,CAAC,aAAa,CAAC,CAGxB"}
1
+ {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/api/messages/operations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAEL,WAAW,EACX,mBAAmB,EAGnB,aAAa,EAEb,+BAA+B,EAEhC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,mCAAmC,EACnC,gCAAgC,EAChC,kCAAkC,EAClC,mCAAmC,EACpC,MAAM,cAAc,CAAC;AACtB,OA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