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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/README.md +799 -20
  2. package/dist/browser/aiProjectClient.d.ts +4 -0
  3. package/dist/browser/aiProjectClient.d.ts.map +1 -1
  4. package/dist/browser/aiProjectClient.js +12 -1
  5. package/dist/browser/aiProjectClient.js.map +1 -1
  6. package/dist/browser/api/aiProjectContext.js +1 -1
  7. package/dist/browser/api/aiProjectContext.js.map +1 -1
  8. package/dist/browser/api/memoryStores/index.d.ts +1 -0
  9. package/dist/browser/api/memoryStores/index.d.ts.map +1 -1
  10. package/dist/browser/api/memoryStores/index.js.map +1 -1
  11. package/dist/browser/api/memoryStores/memoryStoreUpdateMemoriesPoller.d.ts +43 -0
  12. package/dist/browser/api/memoryStores/memoryStoreUpdateMemoriesPoller.d.ts.map +1 -0
  13. package/dist/browser/api/memoryStores/memoryStoreUpdateMemoriesPoller.js +160 -0
  14. package/dist/browser/api/memoryStores/memoryStoreUpdateMemoriesPoller.js.map +1 -0
  15. package/dist/browser/api/memoryStores/operations.d.ts +3 -4
  16. package/dist/browser/api/memoryStores/operations.d.ts.map +1 -1
  17. package/dist/browser/api/memoryStores/operations.js +3 -16
  18. package/dist/browser/api/memoryStores/operations.js.map +1 -1
  19. package/dist/browser/api/telemetry/index.d.ts +2 -0
  20. package/dist/browser/api/telemetry/index.d.ts.map +1 -0
  21. package/dist/browser/api/telemetry/index.js +4 -0
  22. package/dist/browser/api/telemetry/index.js.map +1 -0
  23. package/dist/browser/api/telemetry/operations.d.ts +22 -0
  24. package/dist/browser/api/telemetry/operations.d.ts.map +1 -0
  25. package/dist/browser/api/telemetry/operations.js +55 -0
  26. package/dist/browser/api/telemetry/operations.js.map +1 -0
  27. package/dist/browser/classic/index.d.ts +1 -0
  28. package/dist/browser/classic/index.d.ts.map +1 -1
  29. package/dist/browser/classic/index.js.map +1 -1
  30. package/dist/browser/classic/memoryStores/index.d.ts +3 -3
  31. package/dist/browser/classic/memoryStores/index.d.ts.map +1 -1
  32. package/dist/browser/classic/memoryStores/index.js.map +1 -1
  33. package/dist/browser/classic/telemetry/index.d.ts +8 -0
  34. package/dist/browser/classic/telemetry/index.d.ts.map +1 -0
  35. package/dist/browser/classic/telemetry/index.js +13 -0
  36. package/dist/browser/classic/telemetry/index.js.map +1 -0
  37. package/dist/browser/constants.d.ts +1 -1
  38. package/dist/browser/constants.js +1 -1
  39. package/dist/browser/constants.js.map +1 -1
  40. package/dist/browser/getCustomFetch-browser.d.mts.map +1 -0
  41. package/dist/browser/getCustomFetch-browser.mjs.map +1 -0
  42. package/dist/browser/getCustomFetch.d.ts +13 -0
  43. package/dist/browser/getCustomFetch.js +40 -0
  44. package/dist/browser/index.d.ts +2 -1
  45. package/dist/browser/index.d.ts.map +1 -1
  46. package/dist/browser/index.js.map +1 -1
  47. package/dist/browser/models/models.d.ts +10 -10
  48. package/dist/browser/models/models.d.ts.map +1 -1
  49. package/dist/browser/models/models.js +1 -1
  50. package/dist/browser/models/models.js.map +1 -1
  51. package/dist/browser/restorePollerHelpers.d.ts.map +1 -1
  52. package/dist/browser/restorePollerHelpers.js +12 -4
  53. package/dist/browser/restorePollerHelpers.js.map +1 -1
  54. package/dist/commonjs/aiProjectClient.d.ts +4 -0
  55. package/dist/commonjs/aiProjectClient.d.ts.map +1 -1
  56. package/dist/commonjs/aiProjectClient.js +16 -5
  57. package/dist/commonjs/aiProjectClient.js.map +1 -1
  58. package/dist/commonjs/api/aiProjectContext.js +1 -1
  59. package/dist/commonjs/api/aiProjectContext.js.map +1 -1
  60. package/dist/commonjs/api/memoryStores/index.d.ts +1 -0
  61. package/dist/commonjs/api/memoryStores/index.d.ts.map +1 -1
  62. package/dist/commonjs/api/memoryStores/index.js.map +1 -1
  63. package/dist/commonjs/api/memoryStores/memoryStoreUpdateMemoriesPoller.d.ts +43 -0
  64. package/dist/commonjs/api/memoryStores/memoryStoreUpdateMemoriesPoller.d.ts.map +1 -0
  65. package/dist/commonjs/api/memoryStores/memoryStoreUpdateMemoriesPoller.js +163 -0
  66. package/dist/commonjs/api/memoryStores/memoryStoreUpdateMemoriesPoller.js.map +1 -0
  67. package/dist/commonjs/api/memoryStores/operations.d.ts +3 -4
  68. package/dist/commonjs/api/memoryStores/operations.d.ts.map +1 -1
  69. package/dist/commonjs/api/memoryStores/operations.js +2 -16
  70. package/dist/commonjs/api/memoryStores/operations.js.map +1 -1
  71. package/dist/commonjs/api/telemetry/index.d.ts +2 -0
  72. package/dist/commonjs/api/telemetry/index.d.ts.map +1 -0
  73. package/dist/commonjs/api/telemetry/index.js +8 -0
  74. package/dist/commonjs/api/telemetry/index.js.map +1 -0
  75. package/dist/commonjs/api/telemetry/operations.d.ts +22 -0
  76. package/dist/commonjs/api/telemetry/operations.d.ts.map +1 -0
  77. package/dist/commonjs/api/telemetry/operations.js +58 -0
  78. package/dist/commonjs/api/telemetry/operations.js.map +1 -0
  79. package/dist/commonjs/classic/index.d.ts +1 -0
  80. package/dist/commonjs/classic/index.d.ts.map +1 -1
  81. package/dist/commonjs/classic/index.js.map +1 -1
  82. package/dist/commonjs/classic/memoryStores/index.d.ts +3 -3
  83. package/dist/commonjs/classic/memoryStores/index.d.ts.map +1 -1
  84. package/dist/commonjs/classic/memoryStores/index.js.map +1 -1
  85. package/dist/commonjs/classic/telemetry/index.d.ts +8 -0
  86. package/dist/commonjs/classic/telemetry/index.d.ts.map +1 -0
  87. package/dist/commonjs/classic/telemetry/index.js +16 -0
  88. package/dist/commonjs/classic/telemetry/index.js.map +1 -0
  89. package/dist/commonjs/constants.d.ts +1 -1
  90. package/dist/commonjs/constants.js +1 -1
  91. package/dist/commonjs/constants.js.map +1 -1
  92. package/dist/commonjs/getCustomFetch.d.ts +13 -0
  93. package/dist/commonjs/getCustomFetch.d.ts.map +1 -0
  94. package/dist/commonjs/getCustomFetch.js +45 -0
  95. package/dist/commonjs/getCustomFetch.js.map +1 -0
  96. package/dist/commonjs/index.d.ts +2 -1
  97. package/dist/commonjs/index.d.ts.map +1 -1
  98. package/dist/commonjs/index.js.map +1 -1
  99. package/dist/commonjs/models/models.d.ts +10 -10
  100. package/dist/commonjs/models/models.d.ts.map +1 -1
  101. package/dist/commonjs/models/models.js +1 -1
  102. package/dist/commonjs/models/models.js.map +1 -1
  103. package/dist/commonjs/restorePollerHelpers.d.ts.map +1 -1
  104. package/dist/commonjs/restorePollerHelpers.js +12 -4
  105. package/dist/commonjs/restorePollerHelpers.js.map +1 -1
  106. package/dist/commonjs/tsdoc-metadata.json +1 -1
  107. package/dist/esm/aiProjectClient.d.ts +4 -0
  108. package/dist/esm/aiProjectClient.d.ts.map +1 -1
  109. package/dist/esm/aiProjectClient.js +12 -1
  110. package/dist/esm/aiProjectClient.js.map +1 -1
  111. package/dist/esm/api/aiProjectContext.js +1 -1
  112. package/dist/esm/api/aiProjectContext.js.map +1 -1
  113. package/dist/esm/api/memoryStores/index.d.ts +1 -0
  114. package/dist/esm/api/memoryStores/index.d.ts.map +1 -1
  115. package/dist/esm/api/memoryStores/index.js.map +1 -1
  116. package/dist/esm/api/memoryStores/memoryStoreUpdateMemoriesPoller.d.ts +43 -0
  117. package/dist/esm/api/memoryStores/memoryStoreUpdateMemoriesPoller.d.ts.map +1 -0
  118. package/dist/esm/api/memoryStores/memoryStoreUpdateMemoriesPoller.js +160 -0
  119. package/dist/esm/api/memoryStores/memoryStoreUpdateMemoriesPoller.js.map +1 -0
  120. package/dist/esm/api/memoryStores/operations.d.ts +3 -4
  121. package/dist/esm/api/memoryStores/operations.d.ts.map +1 -1
  122. package/dist/esm/api/memoryStores/operations.js +3 -16
  123. package/dist/esm/api/memoryStores/operations.js.map +1 -1
  124. package/dist/esm/api/telemetry/index.d.ts +2 -0
  125. package/dist/esm/api/telemetry/index.d.ts.map +1 -0
  126. package/dist/esm/api/telemetry/index.js +4 -0
  127. package/dist/esm/api/telemetry/index.js.map +1 -0
  128. package/dist/esm/api/telemetry/operations.d.ts +22 -0
  129. package/dist/esm/api/telemetry/operations.d.ts.map +1 -0
  130. package/dist/esm/api/telemetry/operations.js +55 -0
  131. package/dist/esm/api/telemetry/operations.js.map +1 -0
  132. package/dist/esm/classic/index.d.ts +1 -0
  133. package/dist/esm/classic/index.d.ts.map +1 -1
  134. package/dist/esm/classic/index.js.map +1 -1
  135. package/dist/esm/classic/memoryStores/index.d.ts +3 -3
  136. package/dist/esm/classic/memoryStores/index.d.ts.map +1 -1
  137. package/dist/esm/classic/memoryStores/index.js.map +1 -1
  138. package/dist/esm/classic/telemetry/index.d.ts +8 -0
  139. package/dist/esm/classic/telemetry/index.d.ts.map +1 -0
  140. package/dist/esm/classic/telemetry/index.js +13 -0
  141. package/dist/esm/classic/telemetry/index.js.map +1 -0
  142. package/dist/esm/constants.d.ts +1 -1
  143. package/dist/esm/constants.js +1 -1
  144. package/dist/esm/constants.js.map +1 -1
  145. package/dist/esm/getCustomFetch.d.ts +13 -0
  146. package/dist/esm/getCustomFetch.d.ts.map +1 -0
  147. package/dist/esm/getCustomFetch.js +42 -0
  148. package/dist/esm/getCustomFetch.js.map +1 -0
  149. package/dist/esm/index.d.ts +2 -1
  150. package/dist/esm/index.d.ts.map +1 -1
  151. package/dist/esm/index.js.map +1 -1
  152. package/dist/esm/models/models.d.ts +10 -10
  153. package/dist/esm/models/models.d.ts.map +1 -1
  154. package/dist/esm/models/models.js +1 -1
  155. package/dist/esm/models/models.js.map +1 -1
  156. package/dist/esm/restorePollerHelpers.d.ts.map +1 -1
  157. package/dist/esm/restorePollerHelpers.js +12 -4
  158. package/dist/esm/restorePollerHelpers.js.map +1 -1
  159. package/dist/react-native/aiProjectClient.d.ts +4 -0
  160. package/dist/react-native/aiProjectClient.d.ts.map +1 -1
  161. package/dist/react-native/aiProjectClient.js +12 -1
  162. package/dist/react-native/aiProjectClient.js.map +1 -1
  163. package/dist/react-native/api/aiProjectContext.js +1 -1
  164. package/dist/react-native/api/aiProjectContext.js.map +1 -1
  165. package/dist/react-native/api/memoryStores/index.d.ts +1 -0
  166. package/dist/react-native/api/memoryStores/index.d.ts.map +1 -1
  167. package/dist/react-native/api/memoryStores/index.js.map +1 -1
  168. package/dist/react-native/api/memoryStores/memoryStoreUpdateMemoriesPoller.d.ts +43 -0
  169. package/dist/react-native/api/memoryStores/memoryStoreUpdateMemoriesPoller.d.ts.map +1 -0
  170. package/dist/react-native/api/memoryStores/memoryStoreUpdateMemoriesPoller.js +160 -0
  171. package/dist/react-native/api/memoryStores/memoryStoreUpdateMemoriesPoller.js.map +1 -0
  172. package/dist/react-native/api/memoryStores/operations.d.ts +3 -4
  173. package/dist/react-native/api/memoryStores/operations.d.ts.map +1 -1
  174. package/dist/react-native/api/memoryStores/operations.js +3 -16
  175. package/dist/react-native/api/memoryStores/operations.js.map +1 -1
  176. package/dist/react-native/api/telemetry/index.d.ts +2 -0
  177. package/dist/react-native/api/telemetry/index.d.ts.map +1 -0
  178. package/dist/react-native/api/telemetry/index.js +4 -0
  179. package/dist/react-native/api/telemetry/index.js.map +1 -0
  180. package/dist/react-native/api/telemetry/operations.d.ts +22 -0
  181. package/dist/react-native/api/telemetry/operations.d.ts.map +1 -0
  182. package/dist/react-native/api/telemetry/operations.js +55 -0
  183. package/dist/react-native/api/telemetry/operations.js.map +1 -0
  184. package/dist/react-native/classic/index.d.ts +1 -0
  185. package/dist/react-native/classic/index.d.ts.map +1 -1
  186. package/dist/react-native/classic/index.js.map +1 -1
  187. package/dist/react-native/classic/memoryStores/index.d.ts +3 -3
  188. package/dist/react-native/classic/memoryStores/index.d.ts.map +1 -1
  189. package/dist/react-native/classic/memoryStores/index.js.map +1 -1
  190. package/dist/react-native/classic/telemetry/index.d.ts +8 -0
  191. package/dist/react-native/classic/telemetry/index.d.ts.map +1 -0
  192. package/dist/react-native/classic/telemetry/index.js +13 -0
  193. package/dist/react-native/classic/telemetry/index.js.map +1 -0
  194. package/dist/react-native/constants.d.ts +1 -1
  195. package/dist/react-native/constants.js +1 -1
  196. package/dist/react-native/constants.js.map +1 -1
  197. package/dist/react-native/getCustomFetch.d.ts +13 -0
  198. package/dist/react-native/getCustomFetch.d.ts.map +1 -0
  199. package/dist/react-native/getCustomFetch.js +42 -0
  200. package/dist/react-native/getCustomFetch.js.map +1 -0
  201. package/dist/react-native/index.d.ts +2 -1
  202. package/dist/react-native/index.d.ts.map +1 -1
  203. package/dist/react-native/index.js.map +1 -1
  204. package/dist/react-native/models/models.d.ts +10 -10
  205. package/dist/react-native/models/models.d.ts.map +1 -1
  206. package/dist/react-native/models/models.js +1 -1
  207. package/dist/react-native/models/models.js.map +1 -1
  208. package/dist/react-native/restorePollerHelpers.d.ts.map +1 -1
  209. package/dist/react-native/restorePollerHelpers.js +12 -4
  210. package/dist/react-native/restorePollerHelpers.js.map +1 -1
  211. package/package.json +17 -10
@@ -1 +1 @@
1
- {"version":3,"file":"restorePollerHelpers.d.ts","sourceRoot":"","sources":["../../src/restorePollerHelpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACL,UAAU,EACV,cAAc,EAGf,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,MAAM,WAAW,oBAAoB,CACnC,OAAO,EACP,SAAS,SAAS,qBAAqB,GAAG,qBAAqB,CAC/D,SAAQ,gBAAgB;IACxB,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,qDAAqD;IACrD,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC/D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,SAAS,SAAS,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C,GACtC,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CA2C9C"}
@@ -3,7 +3,7 @@
3
3
  // Licensed under the MIT License.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.restorePoller = restorePoller;
6
- const operations_js_1 = require("./api/memoryStores/operations.js");
6
+ const memoryStoreUpdateMemoriesPoller_js_1 = require("./api/memoryStores/memoryStoreUpdateMemoriesPoller.js");
7
7
  const pollingHelpers_js_1 = require("./static-helpers/pollingHelpers.js");
8
8
  const core_lro_1 = require("@azure/core-lro");
9
9
  /**
@@ -18,8 +18,16 @@ function restorePoller(client, serializedState, sourceOperation, options) {
18
18
  throw new Error(`Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`);
19
19
  }
20
20
  const resourceLocationConfig = metadata?.["resourceLocationConfig"];
21
- const { deserializer, expectedStatuses = [] } = getDeserializationHelper(initialRequestUrl, requestMethod) ?? {};
22
- const deserializeHelper = options?.processResponseBody ?? deserializer;
21
+ const helper = getDeserializationHelper(initialRequestUrl, requestMethod);
22
+ if (helper?.kind === "memoryUpdate") {
23
+ return (0, memoryStoreUpdateMemoriesPoller_js_1.createMemoryStoreUpdateMemoriesPoller)(client["_client"] ?? client, helper.expectedStatuses ?? ["202", "200"], undefined, {
24
+ updateIntervalInMs: options?.updateIntervalInMs,
25
+ abortSignal: options?.abortSignal,
26
+ restoreFrom: serializedState,
27
+ });
28
+ }
29
+ const deserializeHelper = options?.processResponseBody ?? helper?.deserializer;
30
+ const expectedStatuses = helper?.expectedStatuses ?? [];
23
31
  if (!deserializeHelper) {
24
32
  throw new Error(`Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`);
25
33
  }
@@ -33,7 +41,7 @@ function restorePoller(client, serializedState, sourceOperation, options) {
33
41
  }
34
42
  const deserializeMap = {
35
43
  "POST /memory_stores/{name}:update_memories": {
36
- deserializer: operations_js_1._updateMemoriesDeserialize,
44
+ kind: "memoryUpdate",
37
45
  expectedStatuses: ["202", "200"],
38
46
  },
39
47
  };
@@ -1 +1 @@
1
- {"version":3,"file":"restorePollerHelpers.js","sourceRoot":"","sources":["../../src/restorePollerHelpers.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAoClC,sCAoCC;AArED,oEAA8E;AAC9E,0EAA0E;AAG1E,8CAKyB;AAmBzB;;;;GAIG;AACH,SAAgB,aAAa,CAC3B,MAAuB,EACvB,eAAuB,EACvB,eAAiF,EACjF,OAAuC;IAEvC,MAAM,YAAY,GAAG,IAAA,2BAAgB,EAAC,eAAe,CAAC,CAAC,MAAM,CAAC;IAC9D,MAAM,EAAE,iBAAiB,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAC;IACpE,IAAI,CAAC,iBAAiB,IAAI,CAAC,aAAa,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CACb,6BAA6B,eAAe,wBAAwB,eAAe,EAAE,IAAI,EAAE,CAC5F,CAAC;IACJ,CAAC;IACD,MAAM,sBAAsB,GAAG,QAAQ,EAAE,CAAC,wBAAwB,CAErD,CAAC;IACd,MAAM,EAAE,YAAY,EAAE,gBAAgB,GAAG,EAAE,EAAE,GAC3C,wBAAwB,CAAC,iBAAiB,EAAE,aAAa,CAAC,IAAI,EAAE,CAAC;IACnE,MAAM,iBAAiB,GAAG,OAAO,EAAE,mBAAmB,IAAI,YAAY,CAAC;IACvE,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,0FAA0F,eAAe,EAAE,IAAI,GAAG,CACnH,CAAC;IACJ,CAAC;IACD,OAAO,IAAA,wCAAoB,EACxB,MAAc,CAAC,SAAS,CAAC,IAAI,MAAM,EACpC,iBAA4D,EAC5D,gBAAgB,EAChB;QACE,kBAAkB,EAAE,OAAO,EAAE,kBAAkB;QAC/C,WAAW,EAAE,OAAO,EAAE,WAAW;QACjC,sBAAsB;QACtB,WAAW,EAAE,eAAe;QA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KAAK,CAAC,CAAC,EAAE,CAAC;gBACjF,MAAM,KAAK,GAAG,cAAc,CAAC,CAAC,CAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAC/C,GAAG,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;gBAClC,4DAA4D;gBAC5D,qDAAqD;gBACrD,eAAe;gBACf,6BAA6B;gBAC7B,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAC1E,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CACnB,CAAC;gBAEF,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;gBACR,CAAC;gBACD,SAAS;YACX,CAAC;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;YACR,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;YAC/C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AIProjectClient } from \"./aiProjectClient.js\";\nimport { _updateMemoriesDeserialize } from \"./api/memoryStores/operations.js\";\nimport { getLongRunningPoller } from \"./static-helpers/pollingHelpers.js\";\nimport { OperationOptions, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport {\n PollerLike,\n OperationState,\n deserializeState,\n ResourceLocationConfig,\n} from \"@azure/core-lro\";\n\n/**\n * Options for restoring a poller.\n */\nexport interface RestorePollerOptions<\n TResult,\n TResponse extends PathUncheckedResponse = PathUncheckedResponse,\n> extends OperationOptions {\n /** Delay to wait until next poll, in milliseconds. */\n updateIntervalInMs?: number;\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /** Deserialization function for raw response body */\n processResponseBody?: (result: TResponse) => Promise<TResult>;\n}\n\n/**\n * Creates a poller from the serialized state of another poller. This can be\n * useful when you want to create pollers on a different host or a poller\n * needs to be constructed after the original one is not in scope.\n */\nexport function restorePoller<TResponse extends PathUncheckedResponse, TResult>(\n client: AIProjectClient,\n serializedState: string,\n sourceOperation: (...args: any[]) => PollerLike<OperationState<TResult>, TResult>,\n options?: RestorePollerOptions<TResult>,\n): PollerLike<OperationState<TResult>, TResult> {\n const pollerConfig = deserializeState(serializedState).config;\n const { initialRequestUrl, requestMethod, metadata } = pollerConfig;\n if (!initialRequestUrl || !requestMethod) {\n throw new Error(\n `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`,\n );\n }\n const resourceLocationConfig = metadata?.[\"resourceLocationConfig\"] as\n | ResourceLocationConfig\n | undefined;\n const { deserializer, expectedStatuses = [] } =\n getDeserializationHelper(initialRequestUrl, requestMethod) ?? {};\n const deserializeHelper = options?.processResponseBody ?? deserializer;\n if (!deserializeHelper) {\n throw new Error(\n `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`,\n );\n }\n return getLongRunningPoller(\n (client as any)[\"_client\"] ?? client,\n deserializeHelper as (result: TResponse) => Promise<TResult>,\n expectedStatuses,\n {\n updateIntervalInMs: options?.updateIntervalInMs,\n abortSignal: options?.abortSignal,\n resourceLocationConfig,\n restoreFrom: serializedState,\n initialRequestUrl,\n },\n );\n}\n\ninterface DeserializationHelper {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n deserializer: Function;\n expectedStatuses: string[];\n}\n\nconst deserializeMap: Record<string, DeserializationHelper> = {\n \"POST /memory_stores/{name}:update_memories\": {\n deserializer: _updateMemoriesDeserialize,\n expectedStatuses: [\"202\", \"200\"],\n },\n};\n\nfunction getDeserializationHelper(\n urlStr: string,\n method: string,\n): DeserializationHelper | undefined {\n const path = new URL(urlStr).pathname;\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: DeserializationHelper | undefined;\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(deserializeMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
1
+ {"version":3,"file":"restorePollerHelpers.js","sourceRoot":"","sources":["../../src/restorePollerHelpers.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAoClC,sCAgDC;AAjFD,8GAA8G;AAC9G,0EAA0E;AAG1E,8CAKyB;AAmBzB;;;;GAIG;AACH,SAAgB,aAAa,CAC3B,MAAuB,EACvB,eAAuB,EACvB,eAAiF,EACjF,OAAuC;IAEvC,MAAM,YAAY,GAAG,IAAA,2BAAgB,EAAC,eAAe,CAAC,CAAC,MAAM,CAAC;IAC9D,MAAM,EAAE,iBAAiB,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAC;IACpE,IAAI,CAAC,iBAAiB,IAAI,CAAC,aAAa,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CACb,6BAA6B,eAAe,wBAAwB,eAAe,EAAE,IAAI,EAAE,CAC5F,CAAC;IACJ,CAAC;IACD,MAAM,sBAAsB,GAAG,QAAQ,EAAE,CAAC,wBAAwB,CAErD,CAAC;IACd,MAAM,MAAM,GAAG,wBAAwB,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;IAC1E,IAAI,MAAM,EAAE,IAAI,KAAK,cAAc,EAAE,CAAC;QACpC,OAAO,IAAA,0EAAqC,EACzC,MAAc,CAAC,SAAS,CAAC,IAAI,MAAM,EACpC,MAAM,CAAC,gBAAgB,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,EACzC,SAAS,EACT;YACE,kBAAkB,EAAE,OAAO,EAAE,kBAAkB;YAC/C,WAAW,EAAE,OAAO,EAAE,WAAW;YACjC,WAAW,EAAE,eAAe;SAC7B,CACyD,CAAC;IAC/D,CAAC;IACD,MAAM,iBAAiB,G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QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;YAC/C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AIProjectClient } from \"./aiProjectClient.js\";\nimport { createMemoryStoreUpdateMemoriesPoller } from \"./api/memoryStores/memoryStoreUpdateMemoriesPoller.js\";\nimport { getLongRunningPoller } from \"./static-helpers/pollingHelpers.js\";\nimport { OperationOptions, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport {\n PollerLike,\n OperationState,\n deserializeState,\n ResourceLocationConfig,\n} from \"@azure/core-lro\";\n\n/**\n * Options for restoring a poller.\n */\nexport interface RestorePollerOptions<\n TResult,\n TResponse extends PathUncheckedResponse = PathUncheckedResponse,\n> extends OperationOptions {\n /** Delay to wait until next poll, in milliseconds. */\n updateIntervalInMs?: number;\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /** Deserialization function for raw response body */\n processResponseBody?: (result: TResponse) => Promise<TResult>;\n}\n\n/**\n * Creates a poller from the serialized state of another poller. This can be\n * useful when you want to create pollers on a different host or a poller\n * needs to be constructed after the original one is not in scope.\n */\nexport function restorePoller<TResponse extends PathUncheckedResponse, TResult>(\n client: AIProjectClient,\n serializedState: string,\n sourceOperation: (...args: any[]) => PollerLike<OperationState<TResult>, TResult>,\n options?: RestorePollerOptions<TResult>,\n): PollerLike<OperationState<TResult>, TResult> {\n const pollerConfig = deserializeState(serializedState).config;\n const { initialRequestUrl, requestMethod, metadata } = pollerConfig;\n if (!initialRequestUrl || !requestMethod) {\n throw new Error(\n `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`,\n );\n }\n const resourceLocationConfig = metadata?.[\"resourceLocationConfig\"] as\n | ResourceLocationConfig\n | undefined;\n const helper = getDeserializationHelper(initialRequestUrl, requestMethod);\n if (helper?.kind === \"memoryUpdate\") {\n return createMemoryStoreUpdateMemoriesPoller(\n (client as any)[\"_client\"] ?? client,\n helper.expectedStatuses ?? [\"202\", \"200\"],\n undefined,\n {\n updateIntervalInMs: options?.updateIntervalInMs,\n abortSignal: options?.abortSignal,\n restoreFrom: serializedState,\n },\n ) as unknown as PollerLike<OperationState<TResult>, TResult>;\n }\n const deserializeHelper = options?.processResponseBody ?? helper?.deserializer;\n const expectedStatuses = helper?.expectedStatuses ?? [];\n if (!deserializeHelper) {\n throw new Error(\n `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`,\n );\n }\n return getLongRunningPoller(\n (client as any)[\"_client\"] ?? client,\n deserializeHelper as (result: TResponse) => Promise<TResult>,\n expectedStatuses,\n {\n updateIntervalInMs: options?.updateIntervalInMs,\n abortSignal: options?.abortSignal,\n resourceLocationConfig,\n restoreFrom: serializedState,\n initialRequestUrl,\n },\n );\n}\n\ninterface DeserializationHelper {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n deserializer?: Function;\n expectedStatuses?: string[];\n kind?: \"memoryUpdate\";\n}\n\nconst deserializeMap: Record<string, DeserializationHelper> = {\n \"POST /memory_stores/{name}:update_memories\": {\n kind: \"memoryUpdate\",\n expectedStatuses: [\"202\", \"200\"],\n },\n};\n\nfunction getDeserializationHelper(\n urlStr: string,\n method: string,\n): DeserializationHelper | undefined {\n const path = new URL(urlStr).pathname;\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: DeserializationHelper | undefined;\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(deserializeMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.53.3"
8
+ "packageVersion": "7.55.2"
9
9
  }
10
10
  ]
11
11
  }
@@ -10,6 +10,7 @@ import { EvaluatorsOperations } from "./classic/evaluators/index.js";
10
10
  import { IndexesOperations } from "./classic/indexes/index.js";
11
11
  import { InsightsOperations } from "./classic/insights/index.js";
12
12
  import { MemoryStoresOperations } from "./classic/memoryStores/index.js";
13
+ import { TelemetryOperations } from "./classic/telemetry/index.js";
13
14
  import { RedTeamsOperations } from "./classic/redTeams/index.js";
14
15
  import { SchedulesOperations } from "./classic/schedules/index.js";
15
16
  import { TokenCredential } from "@azure/core-auth";
@@ -30,6 +31,7 @@ export { AIProjectClientOptionalParams } from "./api/aiProjectContext.js";
30
31
  * @property {ConnectionsOperations} connections - The operation groups for connections
31
32
  * @property {MemoryStoresOperations} memoryStores - The operation groups for memoryStores
32
33
  * @property {AgentsOperations} agents - The operation groups for agents
34
+ * @property {TelemetryOperations} telemetry - The operation groups for telemetry
33
35
  * @property {getEndpointUrl} getEndpointUrl - gets the endpoint of the client
34
36
  * @property {getOpenAIClient} getOpenAIClient - gets the OpenAI client
35
37
  */
@@ -64,6 +66,8 @@ export declare class AIProjectClient {
64
66
  readonly memoryStores: MemoryStoresOperations;
65
67
  /** The operation groups for agents */
66
68
  readonly agents: AgentsOperations;
69
+ /** The operation groups for telemetry */
70
+ readonly telemetry: TelemetryOperations;
67
71
  /**
68
72
  * gets the OpenAI client
69
73
  * @returns the OpenAI client
@@ -1 +1 @@
1
- {"version":3,"file":"aiProjectClient.d.ts","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":"AAIA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAqC,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAwB,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAA6B,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAE,kBAAkB,EAA0B,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAA6B,MAAM,gCAAgC,CAAC;AAClG,OAAO,EACL,yBAAyB,EAE1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,8BAA8B,EAE/B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAA4B,MAAM,+BAA+B,CAAC;AA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;;;;GAmBG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,qBAAqB,CAAmB;IAChD,OAAO,CAAC,iBAAiB,CAAmB;IAC5C,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,QAAQ,CAAgC;gBAG9C,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,eAAe,EAC3B,OAAO,GAAE,6BAAkC;IAqC7C,yCAAyC;IACzC,SAAgB,SAAS,EAAE,mBAAmB,CAAC;IAC/C,wCAAwC;IACxC,SAAgB,QAAQ,EAAE,kBAAkB,CAAC;IAC7C,0CAA0C;IAC1C,SAAgB,UAAU,EAAE,oBAAoB,CAAC;IACjD,oDAAoD;IACpD,SAAgB,oBAAoB,EAAE,8BAA8B,CAAC;IACrE,+CAA+C;IAC/C,SAAgB,eAAe,EAAE,yBAAyB,CAAC;IAC3D,wCAAwC;IACxC,SAAgB,QAAQ,EAAE,kBAAkB,CAAC;IAC7C,2CAA2C;IAC3C,SAAgB,WAAW,EAAE,qBAAqB,CAAC;IACnD,uCAAuC;IACvC,SAAgB,OAAO,EAAE,iBAAiB,CAAC;IAC3C,wCAAwC;IACxC,SAAgB,QAAQ,EAAE,kBAAkB,CAAC;IAC7C,2CAA2C;IAC3C,SAAgB,WAAW,EAAE,qBAAqB,CAAC;IACnD,4CAA4C;IAC5C,SAAgB,YAAY,EAAE,sBAAsB,CAAC;IACrD,sCAAsC;IACtC,SAAgB,MAAM,EAAE,gBAAgB,CAAC;IACzC,yCAAyC;IACzC,SAAgB,SAAS,EAAE,mBAAmB,CAAC;IAC/C;;;OAGG;IACU,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC;IAsB/C;;;OAGG;IACH,IAAW,QAAQ,IAAI,MAAM,CAE5B;CACF"}
@@ -14,9 +14,11 @@ import { _getEvaluatorsOperations } from "./classic/evaluators/index.js";
14
14
  import { _getIndexesOperations } from "./classic/indexes/index.js";
15
15
  import { _getInsightsOperations } from "./classic/insights/index.js";
16
16
  import { _getMemoryStoresOperations, } from "./classic/memoryStores/index.js";
17
+ import { _getTelemetryOperations } from "./classic/telemetry/index.js";
17
18
  import { _getRedTeamsOperations } from "./classic/redTeams/index.js";
18
19
  import { _getSchedulesOperations } from "./classic/schedules/index.js";
19
20
  import { overwriteOpenAIClient } from "./overwriteOpenAIClient.js";
21
+ import { getCustomFetch } from "./getCustomFetch.js";
20
22
  /**
21
23
  * The main client for the AIProjectClient service. It provides access to the various operations available in the service.
22
24
  * @class AIProjectClient
@@ -33,6 +35,7 @@ import { overwriteOpenAIClient } from "./overwriteOpenAIClient.js";
33
35
  * @property {ConnectionsOperations} connections - The operation groups for connections
34
36
  * @property {MemoryStoresOperations} memoryStores - The operation groups for memoryStores
35
37
  * @property {AgentsOperations} agents - The operation groups for agents
38
+ * @property {TelemetryOperations} telemetry - The operation groups for telemetry
36
39
  * @property {getEndpointUrl} getEndpointUrl - gets the endpoint of the client
37
40
  * @property {getOpenAIClient} getOpenAIClient - gets the OpenAI client
38
41
  */
@@ -55,7 +58,7 @@ export class AIProjectClient {
55
58
  userAgentOptions: { userAgentPrefix },
56
59
  credentials: {
57
60
  ...options.credentials,
58
- scopes: ["https://cognitiveservices.azure.com/.default"],
61
+ scopes: ["https://ai.azure.com/.default"],
59
62
  },
60
63
  });
61
64
  this._azureScopeClient = createAIProject(endpoint, credential, {
@@ -74,6 +77,7 @@ export class AIProjectClient {
74
77
  this.connections = _getConnectionsOperations(this._azureScopeClient);
75
78
  this.memoryStores = _getMemoryStoresOperations(this._cognitiveScopeClient);
76
79
  this.agents = _getAgentsOperations(this._azureScopeClient);
80
+ this.telemetry = _getTelemetryOperations(this.connections);
77
81
  }
78
82
  /** The operation groups for schedules */
79
83
  schedules;
@@ -99,6 +103,8 @@ export class AIProjectClient {
99
103
  memoryStores;
100
104
  /** The operation groups for agents */
101
105
  agents;
106
+ /** The operation groups for telemetry */
107
+ telemetry;
102
108
  /**
103
109
  * gets the OpenAI client
104
110
  * @returns the OpenAI client
@@ -106,11 +112,16 @@ export class AIProjectClient {
106
112
  async getOpenAIClient() {
107
113
  const scope = "https://ai.azure.com/.default";
108
114
  const azureADTokenProvider = await getBearerTokenProvider(this._credential, scope);
115
+ let customFetch;
116
+ if (this._options.additionalPolicies?.find((policy) => policy.policy.name === "recording policy")) {
117
+ customFetch = getCustomFetch(this._azureScopeClient.pipeline, this._options.httpClient);
118
+ }
109
119
  const openAIOptions = {
110
120
  apiKey: azureADTokenProvider,
111
121
  baseURL: `${this._endpoint}/openai`,
112
122
  defaultQuery: { "api-version": this._options?.apiVersion || "2025-11-15-preview" },
113
123
  dangerouslyAllowBrowser: true,
124
+ fetch: customFetch,
114
125
  };
115
126
  const openaiClient = new OpenAI(openAIOptions);
116
127
  return overwriteOpenAIClient(openaiClient);
@@ -1 +1 @@
1
- {"version":3,"file":"aiProjectClient.js","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,iCAAiC;AAEjC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAmD,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAoB,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAyB,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAsB,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAyB,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAEL,6BAA6B,GAC9B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAEL,kCAAkC,GACnC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAwB,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC/F,OAAO,EAAqB,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,E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AA2C;IAC3B,WAAW,CAAwB;IACnD,4CAA4C;IAC5B,YAAY,CAAyB;IACrD,sCAAsC;IACtB,MAAM,CAAmB;IACzC;;;OAGG;IACI,KAAK,CAAC,eAAe;QAC1B,MAAM,KAAK,GAAG,+BAA+B,CAAC;QAC9C,MAAM,oBAAoB,GAAG,MAAM,sBAAsB,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QAEnF,MAAM,aAAa,GAA4C;YAC7D,MAAM,EAAE,oBAAoB;YAC5B,OAAO,EAAE,GAAG,IAAI,CAAC,SAAS,SAAS;YACnC,YAAY,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,IAAI,oBAAoB,EAAE;YAClF,uBAAuB,EAAE,IAAI;SAC9B,CAAC;QAEF,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC;QAC/C,OAAO,qBAAqB,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;IACD;;;OAGG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/* eslint-disable tsdoc/syntax */\n\nimport OpenAI from \"openai\";\nimport { getBearerTokenProvider } from \"@azure/identity\";\nimport { createAIProject, AIProjectContext, AIProjectClientOptionalParams } from \"./api/index.js\";\nimport { AgentsOperations, _getAgentsOperations } from \"./classic/agents/index.js\";\nimport { ConnectionsOperations, _getConnectionsOperations } from \"./classic/connections/index.js\";\nimport { DatasetsOperations, _getDatasetsOperations } from \"./classic/datasets/index.js\";\nimport { DeploymentsOperations, _getDeploymentsOperations } from \"./classic/deployments/index.js\";\nimport {\n EvaluationRulesOperations,\n _getEvaluationRulesOperations,\n} from \"./classic/evaluationRules/index.js\";\nimport {\n EvaluationTaxonomiesOperations,\n _getEvaluationTaxonomiesOperations,\n} from \"./classic/evaluationTaxonomies/index.js\";\nimport { EvaluatorsOperations, _getEvaluatorsOperations } from \"./classic/evaluators/index.js\";\nimport { IndexesOperations, _getIndexesOperations } from \"./classic/indexes/index.js\";\nimport { InsightsOperations, _getInsightsOperations } from \"./classic/insights/index.js\";\nimport {\n MemoryStoresOperations,\n _getMemoryStoresOperations,\n} from \"./classic/memoryStores/index.js\";\nimport { RedTeamsOperations, _getRedTeamsOperations } from \"./classic/redTeams/index.js\";\nimport { SchedulesOperations, _getSchedulesOperations } from \"./classic/schedules/index.js\";\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { overwriteOpenAIClient } from \"./overwriteOpenAIClient.js\";\n\nexport { AIProjectClientOptionalParams } from \"./api/aiProjectContext.js\";\n\n/**\n * The main client for the AIProjectClient service. It provides access to the various operations available in the service.\n * @class AIProjectClient\n * @extends {AIProjectContext}\n * @description The main client for the AIProjectClient\n * @constructor\n * @param {string} endpoint - The endpoint to use\n * @param {TokenCredential} credential - The credential to use\n * @param {AIProjectClientOptionalParams} [options] - Optional parameters for the client.\n * @property {RedTeamsOperations} redTeams - The operation groups for redTeams\n * @property {DeploymentsOperations} deployments - The operation groups for deployments\n * @property {IndexesOperations} indexes - The operation groups for indexes\n * @property {DatasetsOperations} datasets - The operation groups for datasets\n * @property {ConnectionsOperations} connections - The operation groups for connections\n * @property {MemoryStoresOperations} memoryStores - The operation groups for memoryStores\n * @property {AgentsOperations} agents - The operation groups for agents\n * @property {getEndpointUrl} getEndpointUrl - gets the endpoint of the client\n * @property {getOpenAIClient} getOpenAIClient - gets the OpenAI client\n */\nexport class AIProjectClient {\n private _cognitiveScopeClient: AIProjectContext;\n private _azureScopeClient: AIProjectContext;\n private _endpoint: string;\n private _credential: TokenCredential;\n private _options: AIProjectClientOptionalParams;\n\n constructor(\n endpoint: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n ) {\n this._endpoint = endpoint;\n this._credential = credential;\n this._options = options;\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._cognitiveScopeClient = createAIProject(endpoint, this._credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n credentials: {\n ...options.credentials,\n scopes: [\"https://cognitiveservices.azure.com/.default\"],\n },\n });\n this._azureScopeClient = createAIProject(endpoint, credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n\n this.schedules = _getSchedulesOperations(this._cognitiveScopeClient);\n this.insights = _getInsightsOperations(this._cognitiveScopeClient);\n this.evaluators = _getEvaluatorsOperations(this._cognitiveScopeClient);\n this.evaluationTaxonomies = _getEvaluationTaxonomiesOperations(this._cognitiveScopeClient);\n this.evaluationRules = _getEvaluationRulesOperations(this._cognitiveScopeClient);\n this.redTeams = _getRedTeamsOperations(this._cognitiveScopeClient);\n this.deployments = _getDeploymentsOperations(this._azureScopeClient);\n this.indexes = _getIndexesOperations(this._azureScopeClient);\n this.datasets = _getDatasetsOperations(this._azureScopeClient, this._options);\n this.connections = _getConnectionsOperations(this._azureScopeClient);\n this.memoryStores = _getMemoryStoresOperations(this._cognitiveScopeClient);\n this.agents = _getAgentsOperations(this._azureScopeClient);\n }\n\n /** The operation groups for schedules */\n public readonly schedules: SchedulesOperations;\n /** The operation groups for insights */\n public readonly insights: InsightsOperations;\n /** The operation groups for evaluators */\n public readonly evaluators: EvaluatorsOperations;\n /** The operation groups for evaluationTaxonomies */\n public readonly evaluationTaxonomies: EvaluationTaxonomiesOperations;\n /** The operation groups for evaluationRules */\n public readonly evaluationRules: EvaluationRulesOperations;\n /** The operation groups for redTeams */\n public readonly redTeams: RedTeamsOperations;\n /** The operation groups for deployments */\n public readonly deployments: DeploymentsOperations;\n /** The operation groups for indexes */\n public readonly indexes: IndexesOperations;\n /** The operation groups for datasets */\n public readonly datasets: DatasetsOperations;\n /** The operation groups for connections */\n public readonly connections: ConnectionsOperations;\n /** The operation groups for memoryStores */\n public readonly memoryStores: MemoryStoresOperations;\n /** The operation groups for agents */\n public readonly agents: AgentsOperations;\n /**\n * gets the OpenAI client\n * @returns the OpenAI client\n */\n public async getOpenAIClient(): Promise<OpenAI> {\n const scope = \"https://ai.azure.com/.default\";\n const azureADTokenProvider = await getBearerTokenProvider(this._credential, scope);\n\n const openAIOptions: ConstructorParameters<typeof OpenAI>[0] = {\n apiKey: azureADTokenProvider,\n baseURL: `${this._endpoint}/openai`,\n defaultQuery: { \"api-version\": this._options?.apiVersion || \"2025-11-15-preview\" },\n dangerouslyAllowBrowser: true,\n };\n\n const openaiClient = new OpenAI(openAIOptions);\n return overwriteOpenAIClient(openaiClient);\n }\n /**\n * gets the endpoint of the client\n * @returns the endpoint of the client\n */\n public get endpoint(): string {\n return this._endpoint;\n }\n}\n"]}
1
+ {"version":3,"file":"aiProjectClient.js","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,iCAAiC;AAEjC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAmD,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAoB,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAyB,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAsB,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAyB,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAEL,6BAA6B,GAC9B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAEL,kCAAkC,GACnC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAwB,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC/F,OAAO,EAAqB,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAsB,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAE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MIT License.\n/* eslint-disable tsdoc/syntax */\n\nimport OpenAI from \"openai\";\nimport { getBearerTokenProvider } from \"@azure/identity\";\nimport { createAIProject, AIProjectContext, AIProjectClientOptionalParams } from \"./api/index.js\";\nimport { AgentsOperations, _getAgentsOperations } from \"./classic/agents/index.js\";\nimport { ConnectionsOperations, _getConnectionsOperations } from \"./classic/connections/index.js\";\nimport { DatasetsOperations, _getDatasetsOperations } from \"./classic/datasets/index.js\";\nimport { DeploymentsOperations, _getDeploymentsOperations } from \"./classic/deployments/index.js\";\nimport {\n EvaluationRulesOperations,\n _getEvaluationRulesOperations,\n} from \"./classic/evaluationRules/index.js\";\nimport {\n EvaluationTaxonomiesOperations,\n _getEvaluationTaxonomiesOperations,\n} from \"./classic/evaluationTaxonomies/index.js\";\nimport { EvaluatorsOperations, _getEvaluatorsOperations } from \"./classic/evaluators/index.js\";\nimport { IndexesOperations, _getIndexesOperations } from \"./classic/indexes/index.js\";\nimport { InsightsOperations, _getInsightsOperations } from \"./classic/insights/index.js\";\nimport {\n MemoryStoresOperations,\n _getMemoryStoresOperations,\n} from \"./classic/memoryStores/index.js\";\nimport { TelemetryOperations, _getTelemetryOperations } from \"./classic/telemetry/index.js\";\nimport { RedTeamsOperations, _getRedTeamsOperations } from \"./classic/redTeams/index.js\";\nimport { SchedulesOperations, _getSchedulesOperations } from \"./classic/schedules/index.js\";\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { overwriteOpenAIClient } from \"./overwriteOpenAIClient.js\";\nimport { getCustomFetch } from \"./getCustomFetch.js\";\n\nexport { AIProjectClientOptionalParams } from \"./api/aiProjectContext.js\";\n\n/**\n * The main client for the AIProjectClient service. It provides access to the various operations available in the service.\n * @class AIProjectClient\n * @extends {AIProjectContext}\n * @description The main client for the AIProjectClient\n * @constructor\n * @param {string} endpoint - The endpoint to use\n * @param {TokenCredential} credential - The credential to use\n * @param {AIProjectClientOptionalParams} [options] - Optional parameters for the client.\n * @property {RedTeamsOperations} redTeams - The operation groups for redTeams\n * @property {DeploymentsOperations} deployments - The operation groups for deployments\n * @property {IndexesOperations} indexes - The operation groups for indexes\n * @property {DatasetsOperations} datasets - The operation groups for datasets\n * @property {ConnectionsOperations} connections - The operation groups for connections\n * @property {MemoryStoresOperations} memoryStores - The operation groups for memoryStores\n * @property {AgentsOperations} agents - The operation groups for agents\n * @property {TelemetryOperations} telemetry - The operation groups for telemetry\n * @property {getEndpointUrl} getEndpointUrl - gets the endpoint of the client\n * @property {getOpenAIClient} getOpenAIClient - gets the OpenAI client\n */\nexport class AIProjectClient {\n private _cognitiveScopeClient: AIProjectContext;\n private _azureScopeClient: AIProjectContext;\n private _endpoint: string;\n private _credential: TokenCredential;\n private _options: AIProjectClientOptionalParams;\n\n constructor(\n endpoint: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n ) {\n this._endpoint = endpoint;\n this._credential = credential;\n this._options = options;\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._cognitiveScopeClient = createAIProject(endpoint, this._credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n credentials: {\n ...options.credentials,\n scopes: [\"https://ai.azure.com/.default\"],\n },\n });\n this._azureScopeClient = createAIProject(endpoint, credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n\n this.schedules = _getSchedulesOperations(this._cognitiveScopeClient);\n this.insights = _getInsightsOperations(this._cognitiveScopeClient);\n this.evaluators = _getEvaluatorsOperations(this._cognitiveScopeClient);\n this.evaluationTaxonomies = _getEvaluationTaxonomiesOperations(this._cognitiveScopeClient);\n this.evaluationRules = _getEvaluationRulesOperations(this._cognitiveScopeClient);\n this.redTeams = _getRedTeamsOperations(this._cognitiveScopeClient);\n this.deployments = _getDeploymentsOperations(this._azureScopeClient);\n this.indexes = _getIndexesOperations(this._azureScopeClient);\n this.datasets = _getDatasetsOperations(this._azureScopeClient, this._options);\n this.connections = _getConnectionsOperations(this._azureScopeClient);\n this.memoryStores = _getMemoryStoresOperations(this._cognitiveScopeClient);\n this.agents = _getAgentsOperations(this._azureScopeClient);\n this.telemetry = _getTelemetryOperations(this.connections);\n }\n\n /** The operation groups for schedules */\n public readonly schedules: SchedulesOperations;\n /** The operation groups for insights */\n public readonly insights: InsightsOperations;\n /** The operation groups for evaluators */\n public readonly evaluators: EvaluatorsOperations;\n /** The operation groups for evaluationTaxonomies */\n public readonly evaluationTaxonomies: EvaluationTaxonomiesOperations;\n /** The operation groups for evaluationRules */\n public readonly evaluationRules: EvaluationRulesOperations;\n /** The operation groups for redTeams */\n public readonly redTeams: RedTeamsOperations;\n /** The operation groups for deployments */\n public readonly deployments: DeploymentsOperations;\n /** The operation groups for indexes */\n public readonly indexes: IndexesOperations;\n /** The operation groups for datasets */\n public readonly datasets: DatasetsOperations;\n /** The operation groups for connections */\n public readonly connections: ConnectionsOperations;\n /** The operation groups for memoryStores */\n public readonly memoryStores: MemoryStoresOperations;\n /** The operation groups for agents */\n public readonly agents: AgentsOperations;\n /** The operation groups for telemetry */\n public readonly telemetry: TelemetryOperations;\n /**\n * gets the OpenAI client\n * @returns the OpenAI client\n */\n public async getOpenAIClient(): Promise<OpenAI> {\n const scope = \"https://ai.azure.com/.default\";\n const azureADTokenProvider = await getBearerTokenProvider(this._credential, scope);\n let customFetch: NonNullable<ConstructorParameters<typeof OpenAI>[0]>[\"fetch\"];\n\n if (\n this._options.additionalPolicies?.find((policy) => policy.policy.name === \"recording policy\")\n ) {\n customFetch = getCustomFetch(this._azureScopeClient.pipeline, this._options.httpClient);\n }\n\n const openAIOptions: ConstructorParameters<typeof OpenAI>[0] = {\n apiKey: azureADTokenProvider,\n baseURL: `${this._endpoint}/openai`,\n defaultQuery: { \"api-version\": this._options?.apiVersion || \"2025-11-15-preview\" },\n dangerouslyAllowBrowser: true,\n fetch: customFetch,\n };\n\n const openaiClient = new OpenAI(openAIOptions);\n return overwriteOpenAIClient(openaiClient);\n }\n /**\n * gets the endpoint of the client\n * @returns the endpoint of the client\n */\n public get endpoint(): string {\n return this._endpoint;\n }\n}\n"]}
@@ -6,7 +6,7 @@ import { getClient } from "@azure-rest/core-client";
6
6
  export function createAIProject(endpoint, credential, options = {}) {
7
7
  const endpointUrl = options.endpoint ?? String(endpoint);
8
8
  const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
9
- const userAgentInfo = `azsdk-js-ai-projects/2.0.0-beta.1`;
9
+ const userAgentInfo = `azsdk-js-ai-projects/2.0.0-beta.3`;
10
10
  const userAgentPrefix = prefixFromOptions
11
11
  ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`
12
12
  : `azsdk-js-api ${userAgentInfo}`;
@@ -1 +1 @@
1
- {"version":3,"file":"aiProjectContext.js","sourceRoot":"","sources":["../../../src/api/aiProjectContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAyB,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAgB3E,MAAM,UAAU,eAAe,CAC7B,QAAgB,EAChB,UAA2B,EAC3B,UAAyC,EAAE;IAE3C,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;IACzD,MAAM,iBAAiB,GAAG,OAAO,EAAE,gBAAgB,EAAE,eAAe,CAAC;IACrE,MAAM,aAAa,GAAG,mCAAmC,CAAC;IAC1D,MAAM,eAAe,GAAG,iBAAiB;QACvC,CAAC,CAAC,GAAG,iBAAiB,iBAAiB,aAAa,EAAE;QACtD,CAAC,CAAC,gBAAgB,aAAa,EAAE,CAAC;IACpC,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,GAAG;QAC3C,GAAG,OAAO;QACV,gBAAgB,EAAE,EAAE,eAAe,EAAE;QACrC,cAAc,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE;QACzE,WAAW,EAAE;YACX,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC,+BAA+B,CAAC;SACzE;KACF,CAAC;IACF,MAAM,aAAa,GAAG,SAAS,CAAC,WAAW,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;IACzE,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAClE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,gBAAgB,CAAC,mBAAmB,CAAC;IAC9E,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC/B,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,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,EAAE,GAAG,aAAa,EAAE,UAAU,EAAsB,CAAC;AAC9D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownApiVersions } from \"../models/models.js\";\nimport { Client, ClientOptions, getClient } from \"@azure-rest/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\nexport interface AIProjectContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownApiVersions} that the service accepts. */\n apiVersion: KnownApiVersions;\n}\n\n/** Optional parameters for the client. */\nexport interface AIProjectClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownApiVersions} that the service accepts. */\n apiVersion?: KnownApiVersions;\n}\n\nexport function createAIProject(\n endpoint: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n): AIProjectContext {\n const endpointUrl = options.endpoint ?? String(endpoint);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-ai-projects/2.0.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 ?? KnownApiVersions.v2025_11_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 AIProjectContext;\n}\n"]}
1
+ {"version":3,"file":"aiProjectContext.js","sourceRoot":"","sources":["../../../src/api/aiProj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AwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,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,EAAE,GAAG,aAAa,EAAE,UAAU,EAAsB,CAAC;AAC9D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownApiVersions } from \"../models/models.js\";\nimport { Client, ClientOptions, getClient } from \"@azure-rest/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\nexport interface AIProjectContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownApiVersions} that the service accepts. */\n apiVersion: KnownApiVersions;\n}\n\n/** Optional parameters for the client. */\nexport interface AIProjectClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownApiVersions} that the service accepts. */\n apiVersion?: KnownApiVersions;\n}\n\nexport function createAIProject(\n endpoint: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n): AIProjectContext {\n const endpointUrl = options.endpoint ?? String(endpoint);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-ai-projects/2.0.0-beta.3`;\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 ?? KnownApiVersions.v2025_11_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 AIProjectContext;\n}\n"]}
@@ -1,3 +1,4 @@
1
1
  export { deleteScope, getUpdateResult, updateMemories, searchMemories, deleteMemoryStore, listMemoryStores, getMemoryStore, updateMemoryStore, createMemoryStore, } from "./operations.js";
2
2
  export { MemoryStoresDeleteScopeOptionalParams, MemoryStoresGetUpdateResultOptionalParams, MemoryStoresUpdateMemoriesOptionalParams, MemoryStoresSearchMemoriesOptionalParams, MemoryStoresDeleteMemoryStoreOptionalParams, MemoryStoresListMemoryStoresOptionalParams, MemoryStoresGetMemoryStoreOptionalParams, MemoryStoresUpdateMemoryStoreOptionalParams, MemoryStoresCreateMemoryStoreOptionalParams, } from "./options.js";
3
+ export { MemoryStoreUpdateMemoriesPoller, MemoryStoreUpdateOperationState, } from "./memoryStoreUpdateMemoriesPoller.js";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/memoryStores/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,qCAAqC,EACrC,yCAAyC,EACzC,wCAAwC,EACxC,wCAAwC,EACxC,2CAA2C,EAC3C,0CAA0C,EAC1C,wCAAwC,EACxC,2CAA2C,EAC3C,2CAA2C,GAC5C,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/memoryStores/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,qCAAqC,EACrC,yCAAyC,EACzC,wCAAwC,EACxC,wCAAwC,EACxC,2CAA2C,EAC3C,0CAA0C,EAC1C,wCAAwC,EACxC,2CAA2C,EAC3C,2CAA2C,GAC5C,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,sCAAsC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/memoryStores/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n deleteScope,\n getUpdateResult,\n updateMemories,\n searchMemories,\n deleteMemoryStore,\n listMemoryStores,\n getMemoryStore,\n updateMemoryStore,\n createMemoryStore,\n} from \"./operations.js\";\nexport {\n MemoryStoresDeleteScopeOptionalParams,\n MemoryStoresGetUpdateResultOptionalParams,\n MemoryStoresUpdateMemoriesOptionalParams,\n MemoryStoresSearchMemoriesOptionalParams,\n MemoryStoresDeleteMemoryStoreOptionalParams,\n MemoryStoresListMemoryStoresOptionalParams,\n MemoryStoresGetMemoryStoreOptionalParams,\n MemoryStoresUpdateMemoryStoreOptionalParams,\n MemoryStoresCreateMemoryStoreOptionalParams,\n} from \"./options.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/memoryStores/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n deleteScope,\n getUpdateResult,\n updateMemories,\n searchMemories,\n deleteMemoryStore,\n listMemoryStores,\n getMemoryStore,\n updateMemoryStore,\n createMemoryStore,\n} from \"./operations.js\";\nexport {\n MemoryStoresDeleteScopeOptionalParams,\n MemoryStoresGetUpdateResultOptionalParams,\n MemoryStoresUpdateMemoriesOptionalParams,\n MemoryStoresSearchMemoriesOptionalParams,\n MemoryStoresDeleteMemoryStoreOptionalParams,\n MemoryStoresListMemoryStoresOptionalParams,\n MemoryStoresGetMemoryStoreOptionalParams,\n MemoryStoresUpdateMemoryStoreOptionalParams,\n MemoryStoresCreateMemoryStoreOptionalParams,\n} from \"./options.js\";\nexport {\n MemoryStoreUpdateMemoriesPoller,\n MemoryStoreUpdateOperationState,\n} from \"./memoryStoreUpdateMemoriesPoller.js\";\n"]}
@@ -0,0 +1,43 @@
1
+ import { AIProjectContext as Client } from "../index.js";
2
+ import { MemoryStoreUpdateResult, MemoryStoreUpdateStatus } from "../../models/models.js";
3
+ import { PollerLike, OperationState } from "@azure/core-lro";
4
+ import { AbortSignalLike } from "@azure/abort-controller";
5
+ import { PathUncheckedResponse } from "@azure-rest/core-client";
6
+ /** State of the Memory Store update operation. */
7
+ export type MemoryStoreUpdateOperationState = OperationState<MemoryStoreUpdateResult> & {
8
+ /** The ID of the memory store update operation. */
9
+ updateId: string;
10
+ /** The status of the memory store update operation. */
11
+ updateStatus: MemoryStoreUpdateStatus;
12
+ /** The ID of the memory store update operation that superseded this one, if any. */
13
+ supersededBy?: string;
14
+ };
15
+ /** Custom LROPoller for Memory Store update operations. */
16
+ export type MemoryStoreUpdateMemoriesPoller = PollerLike<MemoryStoreUpdateOperationState, MemoryStoreUpdateResult> & {
17
+ /** The ID of the memory store update operation. */
18
+ readonly updateId: string;
19
+ /** The status of the memory store update operation. */
20
+ readonly updateStatus: MemoryStoreUpdateStatus;
21
+ /** The ID of the memory store update operation that superseded this one, if any. */
22
+ readonly supersededBy?: string;
23
+ };
24
+ /** Options for creating a MemoryStoreUpdateMemoriesPoller. */
25
+ export interface CreateMemoryStoreUpdateMemoriesPollerOptions {
26
+ /** Interval in milliseconds between update polls */
27
+ updateIntervalInMs?: number;
28
+ /** An abort signal to cancel the poller */
29
+ abortSignal?: AbortSignalLike;
30
+ /** Used to restore poller from a serialized state */
31
+ restoreFrom?: string;
32
+ }
33
+ /**
34
+ * Creates a poller to track the progress of updating memories in a memory store.
35
+ *
36
+ * @param client - The AIProjectClient instance.
37
+ * @param expectedStatuses - The expected HTTP statuses for the polling operation.
38
+ * @param getInitialResponse - A function that returns a promise of the initial response to start the polling operation.
39
+ * @param options - Optional parameters for creating the poller.
40
+ * @returns A MemoryStoreUpdateMemoriesPoller instance.
41
+ */
42
+ export declare function createMemoryStoreUpdateMemoriesPoller(client: Client, expectedStatuses: string[], getInitialResponse?: () => PromiseLike<PathUncheckedResponse>, options?: CreateMemoryStoreUpdateMemoriesPollerOptions): MemoryStoreUpdateMemoriesPoller;
43
+ //# sourceMappingURL=memoryStoreUpdateMemoriesPoller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoryStoreUpdateMemoriesPoller.d.ts","sourceRoot":"","sources":["../../../../src/api/memoryStores/memoryStoreUpdateMemoriesPoller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EAIxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,UAAU,EACV,cAAc,EAIf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAmB,MAAM,yBAAyB,CAAC;AAEjF,kDAAkD;AAClD,MAAM,MAAM,+BAA+B,GAAG,cAAc,CAAC,uBAAuB,CAAC,GAAG;IACtF,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,YAAY,EAAE,uBAAuB,CAAC;IACtC,oFAAoF;IACpF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,2DAA2D;AAC3D,MAAM,MAAM,+BAA+B,GAAG,UAAU,CACtD,+BAA+B,EAC/B,uBAAuB,CACxB,GAAG;IACF,mDAAmD;IACnD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,uDAAuD;IACvD,QAAQ,CAAC,YAAY,EAAE,uBAAuB,CAAC;IAC/C,oFAAoF;IACpF,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,8DAA8D;AAC9D,MAAM,WAAW,4CAA4C;IAC3D,oDAAoD;IACpD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,2CAA2C;IAC3C,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAgID;;;;;;;;GAQG;AACH,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,MAAM,EAAE,EAC1B,kBAAkB,CAAC,EAAE,MAAM,WAAW,CAAC,qBAAqB,CAAC,EAC7D,OAAO,GAAE,4CAAiD,GACzD,+BAA+B,CAoDjC"}
@@ -0,0 +1,160 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { memoryStoreUpdateResponseDeserializer, } from "../../models/models.js";
4
+ import { createHttpPoller, } from "@azure/core-lro";
5
+ import { createRestError } from "@azure-rest/core-client";
6
+ const nonFailureTerminalUpdateStatuses = ["completed", "superseded"];
7
+ function createDefaultUsage() {
8
+ return {
9
+ embedding_tokens: 0,
10
+ input_tokens: 0,
11
+ input_tokens_details: { cached_tokens: 0 },
12
+ output_tokens: 0,
13
+ output_tokens_details: { reasoning_tokens: 0 },
14
+ total_tokens: 0,
15
+ };
16
+ }
17
+ function toOperationResponse(response, expectedStatuses) {
18
+ if (!expectedStatuses.includes(response.status)) {
19
+ throw createRestError(response);
20
+ }
21
+ return {
22
+ flatResponse: response,
23
+ rawResponse: {
24
+ ...response,
25
+ statusCode: Number.parseInt(response.status),
26
+ body: response.body,
27
+ },
28
+ };
29
+ }
30
+ function deserializeUpdateResponse(response) {
31
+ try {
32
+ return memoryStoreUpdateResponseDeserializer(response.body);
33
+ }
34
+ catch {
35
+ return undefined;
36
+ }
37
+ }
38
+ function applyUpdateState(state, response) {
39
+ const parsed = deserializeUpdateResponse(response);
40
+ state.updateId = parsed?.update_id ?? "";
41
+ state.updateStatus = parsed?.status ?? "queued";
42
+ if (!parsed) {
43
+ return;
44
+ }
45
+ if (parsed.status === "failed") {
46
+ state.status = "failed";
47
+ if (!state.error) {
48
+ state.error = parsed.error
49
+ ? new Error(parsed.error.message ?? "Memory update failed")
50
+ : new Error("Memory update failed");
51
+ }
52
+ return;
53
+ }
54
+ if (nonFailureTerminalUpdateStatuses.includes(parsed.status)) {
55
+ if (parsed.status === "superseded" && !state.error) {
56
+ state.supersededBy = parsed.superseded_by;
57
+ }
58
+ state.status = "succeeded";
59
+ state.result = parsed.result ??
60
+ state.result ?? {
61
+ memory_operations: [],
62
+ usage: createDefaultUsage(),
63
+ };
64
+ return;
65
+ }
66
+ state.status = "running";
67
+ }
68
+ function buildRunningOperation(client, expectedStatuses, getInitialResponse, options) {
69
+ const pollAbortController = new AbortController();
70
+ return {
71
+ sendInitialRequest: async () => {
72
+ if (!getInitialResponse) {
73
+ throw new Error("getInitialResponse is required when starting a new poller");
74
+ }
75
+ const initialResponse = await getInitialResponse();
76
+ return toOperationResponse(initialResponse, expectedStatuses);
77
+ },
78
+ sendPollRequest: async (path, pollOptions) => {
79
+ // The poll request will both listen to the user provided abort signal and the poller's own abort signal
80
+ function abortListener() {
81
+ pollAbortController.abort();
82
+ }
83
+ const abortSignal = pollAbortController.signal;
84
+ if (options?.abortSignal?.aborted) {
85
+ pollAbortController.abort();
86
+ }
87
+ else if (pollOptions?.abortSignal?.aborted) {
88
+ pollAbortController.abort();
89
+ }
90
+ else if (!abortSignal.aborted) {
91
+ options?.abortSignal?.addEventListener("abort", abortListener, {
92
+ once: true,
93
+ });
94
+ pollOptions?.abortSignal?.addEventListener("abort", abortListener, {
95
+ once: true,
96
+ });
97
+ }
98
+ let response;
99
+ try {
100
+ response = (await client.pathUnchecked(path).get({ abortSignal }));
101
+ }
102
+ finally {
103
+ options?.abortSignal?.removeEventListener("abort", abortListener);
104
+ pollOptions?.abortSignal?.removeEventListener("abort", abortListener);
105
+ }
106
+ return toOperationResponse(response, expectedStatuses);
107
+ },
108
+ };
109
+ }
110
+ /**
111
+ * Creates a poller to track the progress of updating memories in a memory store.
112
+ *
113
+ * @param client - The AIProjectClient instance.
114
+ * @param expectedStatuses - The expected HTTP statuses for the polling operation.
115
+ * @param getInitialResponse - A function that returns a promise of the initial response to start the polling operation.
116
+ * @param options - Optional parameters for creating the poller.
117
+ * @returns A MemoryStoreUpdateMemoriesPoller instance.
118
+ */
119
+ export function createMemoryStoreUpdateMemoriesPoller(client, expectedStatuses, getInitialResponse, options = {}) {
120
+ if (!getInitialResponse && !options?.restoreFrom) {
121
+ throw new Error("getInitialResponse is required when starting a new poller");
122
+ }
123
+ let initialResponse;
124
+ const poller = createHttpPoller(buildRunningOperation(client, expectedStatuses, getInitialResponse
125
+ ? async () => {
126
+ initialResponse = await getInitialResponse();
127
+ return initialResponse;
128
+ }
129
+ : undefined, options), {
130
+ intervalInMs: options?.updateIntervalInMs,
131
+ restoreFrom: options?.restoreFrom,
132
+ updateState: (state, lastResponse) => {
133
+ const flatResponse = lastResponse.flatResponse;
134
+ applyUpdateState(state, flatResponse);
135
+ },
136
+ processResult: async (operationResponse, state) => {
137
+ applyUpdateState(state, operationResponse);
138
+ return state.result;
139
+ },
140
+ });
141
+ if (initialResponse && poller.operationState) {
142
+ applyUpdateState(poller.operationState, initialResponse);
143
+ }
144
+ Object.defineProperties(poller, {
145
+ updateId: {
146
+ enumerable: true,
147
+ get: () => poller.operationState?.updateId,
148
+ },
149
+ updateStatus: {
150
+ enumerable: true,
151
+ get: () => poller.operationState?.updateStatus,
152
+ },
153
+ supersededBy: {
154
+ enumerable: true,
155
+ get: () => poller.operationState?.supersededBy,
156
+ },
157
+ });
158
+ return poller;
159
+ }
160
+ //# sourceMappingURL=memoryStoreUpdateMemoriesPoller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoryStoreUpdateMemoriesPoller.js","sourceRoot":"","sources":["../../../../src/api/memoryStores/memoryStoreUpdateMemoriesPoller.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAIL,qCAAqC,GAEtC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,gBAAgB,GAGjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAyB,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAmCjF,MAAM,gCAAgC,GAA8B,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;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EAAE,IAAI;YAChB,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,EAAE,YAAY;SAC/C;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AIProjectContext as Client } from \"../index.js\";\nimport {\n MemoryStoreUpdateResult,\n MemoryStoreUpdateStatus,\n MemoryStoreUpdateResponse,\n memoryStoreUpdateResponseDeserializer,\n MemoryStoreOperationUsage,\n} from \"../../models/models.js\";\nimport {\n PollerLike,\n OperationState,\n createHttpPoller,\n RunningOperation,\n OperationResponse,\n} from \"@azure/core-lro\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { PathUncheckedResponse, createRestError } from \"@azure-rest/core-client\";\n\n/** State of the Memory Store update operation. */\nexport type MemoryStoreUpdateOperationState = OperationState<MemoryStoreUpdateResult> & {\n /** The ID of the memory store update operation. */\n updateId: string;\n /** The status of the memory store update operation. */\n updateStatus: MemoryStoreUpdateStatus;\n /** The ID of the memory store update operation that superseded this one, if any. */\n supersededBy?: string;\n};\n\n/** Custom LROPoller for Memory Store update operations. */\nexport type MemoryStoreUpdateMemoriesPoller = PollerLike<\n MemoryStoreUpdateOperationState,\n MemoryStoreUpdateResult\n> & {\n /** The ID of the memory store update operation. */\n readonly updateId: string;\n /** The status of the memory store update operation. */\n readonly updateStatus: MemoryStoreUpdateStatus;\n /** The ID of the memory store update operation that superseded this one, if any. */\n readonly supersededBy?: string;\n};\n\n/** Options for creating a MemoryStoreUpdateMemoriesPoller. */\nexport interface CreateMemoryStoreUpdateMemoriesPollerOptions {\n /** Interval in milliseconds between update polls */\n updateIntervalInMs?: number;\n /** An abort signal to cancel the poller */\n abortSignal?: AbortSignalLike;\n /** Used to restore poller from a serialized state */\n restoreFrom?: string;\n}\n\nconst nonFailureTerminalUpdateStatuses: MemoryStoreUpdateStatus[] = [\"completed\", \"superseded\"];\n\nfunction createDefaultUsage(): MemoryStoreOperationUsage {\n return {\n embedding_tokens: 0,\n input_tokens: 0,\n input_tokens_details: { cached_tokens: 0 },\n output_tokens: 0,\n output_tokens_details: { reasoning_tokens: 0 },\n total_tokens: 0,\n };\n}\n\nfunction toOperationResponse(\n response: PathUncheckedResponse,\n expectedStatuses: string[],\n): OperationResponse<PathUncheckedResponse> {\n if (!expectedStatuses.includes(response.status)) {\n throw createRestError(response);\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body,\n },\n };\n}\n\nfunction deserializeUpdateResponse(\n response: PathUncheckedResponse,\n): MemoryStoreUpdateResponse | undefined {\n try {\n return memoryStoreUpdateResponseDeserializer(response.body);\n } catch {\n return undefined;\n }\n}\n\nfunction applyUpdateState(\n state: MemoryStoreUpdateOperationState,\n response: PathUncheckedResponse,\n): void {\n const parsed = deserializeUpdateResponse(response);\n state.updateId = parsed?.update_id ?? \"\";\n state.updateStatus = parsed?.status ?? \"queued\";\n\n if (!parsed) {\n return;\n }\n\n if (parsed.status === \"failed\") {\n state.status = \"failed\";\n if (!state.error) {\n state.error = parsed.error\n ? new Error(parsed.error.message ?? \"Memory update failed\")\n : new Error(\"Memory update failed\");\n }\n return;\n }\n\n if (nonFailureTerminalUpdateStatuses.includes(parsed.status)) {\n if (parsed.status === \"superseded\" && !state.error) {\n state.supersededBy = parsed.superseded_by;\n }\n state.status = \"succeeded\";\n state.result = parsed.result ??\n state.result ?? {\n memory_operations: [],\n usage: createDefaultUsage(),\n };\n return;\n }\n\n state.status = \"running\";\n}\n\nfunction buildRunningOperation(\n client: Client,\n expectedStatuses: string[],\n getInitialResponse?: () => PromiseLike<PathUncheckedResponse>,\n options?: CreateMemoryStoreUpdateMemoriesPollerOptions,\n): RunningOperation<PathUncheckedResponse> {\n const pollAbortController = new AbortController();\n return {\n sendInitialRequest: async () => {\n if (!getInitialResponse) {\n throw new Error(\"getInitialResponse is required when starting a new poller\");\n }\n const initialResponse = await getInitialResponse();\n return toOperationResponse(initialResponse, expectedStatuses);\n },\n sendPollRequest: async (path: string, pollOptions?: { abortSignal?: AbortSignalLike }) => {\n // The poll request will both listen to the user provided abort signal and the poller's own abort signal\n function abortListener(): void {\n pollAbortController.abort();\n }\n const abortSignal = pollAbortController.signal;\n if (options?.abortSignal?.aborted) {\n pollAbortController.abort();\n } else if (pollOptions?.abortSignal?.aborted) {\n pollAbortController.abort();\n } else if (!abortSignal.aborted) {\n options?.abortSignal?.addEventListener(\"abort\", abortListener, {\n once: true,\n });\n pollOptions?.abortSignal?.addEventListener(\"abort\", abortListener, {\n once: true,\n });\n }\n\n let response: PathUncheckedResponse;\n try {\n response = (await client.pathUnchecked(path).get({ abortSignal })) as PathUncheckedResponse;\n } finally {\n options?.abortSignal?.removeEventListener(\"abort\", abortListener);\n pollOptions?.abortSignal?.removeEventListener(\"abort\", abortListener);\n }\n\n return toOperationResponse(response, expectedStatuses);\n },\n };\n}\n\n/**\n * Creates a poller to track the progress of updating memories in a memory store.\n *\n * @param client - The AIProjectClient instance.\n * @param expectedStatuses - The expected HTTP statuses for the polling operation.\n * @param getInitialResponse - A function that returns a promise of the initial response to start the polling operation.\n * @param options - Optional parameters for creating the poller.\n * @returns A MemoryStoreUpdateMemoriesPoller instance.\n */\nexport function createMemoryStoreUpdateMemoriesPoller(\n client: Client,\n expectedStatuses: string[],\n getInitialResponse?: () => PromiseLike<PathUncheckedResponse>,\n options: CreateMemoryStoreUpdateMemoriesPollerOptions = {},\n): MemoryStoreUpdateMemoriesPoller {\n if (!getInitialResponse && !options?.restoreFrom) {\n throw new Error(\"getInitialResponse is required when starting a new poller\");\n }\n let initialResponse: PathUncheckedResponse | undefined;\n\n const poller = createHttpPoller<MemoryStoreUpdateResult, MemoryStoreUpdateOperationState>(\n buildRunningOperation(\n client,\n expectedStatuses,\n getInitialResponse\n ? async () => {\n initialResponse = await getInitialResponse();\n return initialResponse;\n }\n : undefined,\n options,\n ),\n {\n intervalInMs: options?.updateIntervalInMs,\n restoreFrom: options?.restoreFrom,\n updateState: (state, lastResponse) => {\n const flatResponse = lastResponse.flatResponse as PathUncheckedResponse;\n applyUpdateState(state, flatResponse);\n },\n processResult: async (operationResponse, state) => {\n applyUpdateState(state, operationResponse as PathUncheckedResponse);\n return state.result as MemoryStoreUpdateResult;\n },\n },\n ) as MemoryStoreUpdateMemoriesPoller;\n\n if (initialResponse && poller.operationState) {\n applyUpdateState(poller.operationState, initialResponse);\n }\n\n Object.defineProperties(poller, {\n updateId: {\n enumerable: true,\n get: () => poller.operationState?.updateId,\n },\n updateStatus: {\n enumerable: true,\n get: () => poller.operationState?.updateStatus,\n },\n supersededBy: {\n enumerable: true,\n get: () => poller.operationState?.supersededBy,\n },\n });\n\n return poller;\n}\n"]}
@@ -1,9 +1,9 @@
1
1
  import { AIProjectContext as Client } from "../index.js";
2
- import { MemoryStoreDefinitionUnion, MemoryStore, _AgentsPagedResultMemoryStore, DeleteMemoryStoreResponse, MemoryStoreSearchResponse, MemoryStoreUpdateResponse, MemoryStoreUpdateResult, MemoryStoreDeleteScopeResponse } from "../../models/models.js";
2
+ import { MemoryStoreDefinitionUnion, MemoryStore, _AgentsPagedResultMemoryStore, DeleteMemoryStoreResponse, MemoryStoreSearchResponse, MemoryStoreUpdateResponse, MemoryStoreDeleteScopeResponse } from "../../models/models.js";
3
3
  import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js";
4
+ import { MemoryStoreUpdateMemoriesPoller } from "./memoryStoreUpdateMemoriesPoller.js";
4
5
  import { MemoryStoresDeleteScopeOptionalParams, MemoryStoresGetUpdateResultOptionalParams, MemoryStoresUpdateMemoriesOptionalParams, MemoryStoresSearchMemoriesOptionalParams, MemoryStoresDeleteMemoryStoreOptionalParams, MemoryStoresListMemoryStoresOptionalParams, MemoryStoresGetMemoryStoreOptionalParams, MemoryStoresUpdateMemoryStoreOptionalParams, MemoryStoresCreateMemoryStoreOptionalParams } from "./options.js";
5
6
  import { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client";
6
- import { PollerLike, OperationState } from "@azure/core-lro";
7
7
  export declare function _deleteScopeSend(context: Client, name: string, scope: string, options?: MemoryStoresDeleteScopeOptionalParams): StreamableMethod;
8
8
  export declare function _deleteScopeDeserialize(result: PathUncheckedResponse): Promise<MemoryStoreDeleteScopeResponse>;
9
9
  /** Delete all memories associated with a specific scope from a memory store. */
@@ -13,9 +13,8 @@ export declare function _getUpdateResultDeserialize(result: PathUncheckedRespons
13
13
  /** Get memory store update result. */
14
14
  export declare function getUpdateResult(context: Client, name: string, updateId: string, options?: MemoryStoresGetUpdateResultOptionalParams): Promise<MemoryStoreUpdateResponse>;
15
15
  export declare function _updateMemoriesSend(context: Client, name: string, scope: string, options?: MemoryStoresUpdateMemoriesOptionalParams): StreamableMethod;
16
- export declare function _updateMemoriesDeserialize(result: PathUncheckedResponse): Promise<MemoryStoreUpdateResult>;
17
16
  /** Update memory store with conversation memories. */
18
- export declare function updateMemories(context: Client, name: string, scope: string, options?: MemoryStoresUpdateMemoriesOptionalParams): PollerLike<OperationState<MemoryStoreUpdateResult>, MemoryStoreUpdateResult>;
17
+ export declare function updateMemories(context: Client, name: string, scope: string, options?: MemoryStoresUpdateMemoriesOptionalParams): MemoryStoreUpdateMemoriesPoller;
19
18
  export declare function _searchMemoriesSend(context: Client, name: string, scope: string, options?: MemoryStoresSearchMemoriesOptionalParams): StreamableMethod;
20
19
  export declare function _searchMemoriesDeserialize(result: PathUncheckedResponse): Promise<MemoryStoreSearchResponse>;
21
20
  /** Search for relevant memories from a memory store based on conversation context. */
@@ -1 +1 @@
1
- {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/api/memoryStores/operations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAIL,0BAA0B,EAC1B,WAAW,EAEX,6BAA6B,EAE7B,yBAAyB,EAGzB,yBAAyB,EAEzB,yBAAyB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AAiB,CACrC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,0BAA0B,EACtC,OAAO,GAAE,2CAAoE,GAC5E,OAAO,CAAC,WAAW,CAAC,CAGtB"}
1
+ {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/api/memoryStores/operations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAIL,0BAA0B,EAC1B,WAAW,EAEX,6BAA6B,EAE7B,yBAAyB,EAGzB,yBAAyB,EAEzB,yBAAyB,EAEzB,8BAA8B,EAE/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,0BAA0B,EAE3B,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAEL,+BAA+B,EAChC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,qCAAqC,EACrC,yCAAyC,EACzC,wCAAwC,EACxC,wCAAwC,EACxC,2CAA2C,EAC3C,0CAA0C,EAC1C,wCAAwC,EACxC,2CAA2C,EAC3C,2CAA2C,EAC5C,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EAGtB,MAAM,yBAAyB,CAAC;AAEjC,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,qCAA8D,GACtE,gBAAgB,CAoBlB;AAED,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,8BAA8B,CAAC,CASzC;AAED,gFAAgF;AAChF,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,qCAA8D,GACtE,OAAO,CAAC,8BAA8B,CAAC,CAGzC;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EAC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