@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.
- package/README.md +105 -26
- package/dist/browser/agentsClient.d.ts +2 -2
- package/dist/browser/agentsClient.d.ts.map +1 -1
- package/dist/browser/agentsClient.js.map +1 -1
- package/dist/browser/api/agentsContext.d.ts +2 -2
- package/dist/browser/api/agentsContext.d.ts.map +1 -1
- package/dist/browser/api/agentsContext.js +12 -24
- package/dist/browser/api/agentsContext.js.map +1 -1
- package/dist/browser/api/files/operations.d.ts +4 -4
- package/dist/browser/api/files/operations.d.ts.map +1 -1
- package/dist/browser/api/files/operations.js +25 -12
- package/dist/browser/api/files/operations.js.map +1 -1
- package/dist/browser/api/files/options.d.ts +3 -3
- package/dist/browser/api/files/options.d.ts.map +1 -1
- package/dist/browser/api/files/options.js.map +1 -1
- package/dist/browser/api/messages/operations.d.ts.map +1 -1
- package/dist/browser/api/messages/operations.js +18 -12
- package/dist/browser/api/messages/operations.js.map +1 -1
- package/dist/browser/api/operations.d.ts +7 -6
- package/dist/browser/api/operations.d.ts.map +1 -1
- package/dist/browser/api/operations.js +34 -22
- package/dist/browser/api/operations.js.map +1 -1
- package/dist/browser/api/options.d.ts +2 -2
- package/dist/browser/api/options.d.ts.map +1 -1
- package/dist/browser/api/options.js.map +1 -1
- package/dist/browser/api/runSteps/operations.d.ts.map +1 -1
- package/dist/browser/api/runSteps/operations.js +11 -7
- package/dist/browser/api/runSteps/operations.js.map +1 -1
- package/dist/browser/api/runs/operations.d.ts.map +1 -1
- package/dist/browser/api/runs/operations.js +38 -20
- package/dist/browser/api/runs/operations.js.map +1 -1
- package/dist/browser/api/runs/options.d.ts +9 -3
- package/dist/browser/api/runs/options.d.ts.map +1 -1
- package/dist/browser/api/runs/options.js.map +1 -1
- package/dist/browser/api/threads/operations.d.ts.map +1 -1
- package/dist/browser/api/threads/operations.js +26 -16
- package/dist/browser/api/threads/operations.js.map +1 -1
- package/dist/browser/api/threads/options.d.ts +2 -2
- package/dist/browser/api/threads/options.d.ts.map +1 -1
- package/dist/browser/api/threads/options.js.map +1 -1
- package/dist/browser/api/vectorStoreFileBatches/operations.d.ts +7 -7
- package/dist/browser/api/vectorStoreFileBatches/operations.d.ts.map +1 -1
- package/dist/browser/api/vectorStoreFileBatches/operations.js +29 -11
- package/dist/browser/api/vectorStoreFileBatches/operations.js.map +1 -1
- package/dist/browser/api/vectorStoreFileBatches/options.d.ts +3 -3
- package/dist/browser/api/vectorStoreFileBatches/options.d.ts.map +1 -1
- package/dist/browser/api/vectorStoreFileBatches/options.js.map +1 -1
- package/dist/browser/api/vectorStoreFiles/operations.d.ts.map +1 -1
- package/dist/browser/api/vectorStoreFiles/operations.js +13 -5
- package/dist/browser/api/vectorStoreFiles/operations.js.map +1 -1
- package/dist/browser/api/vectorStores/operations.d.ts.map +1 -1
- package/dist/browser/api/vectorStores/operations.js +16 -6
- package/dist/browser/api/vectorStores/operations.js.map +1 -1
- package/dist/browser/classic/runSteps/index.d.ts +0 -1
- package/dist/browser/classic/runSteps/index.d.ts.map +1 -1
- package/dist/browser/classic/runSteps/index.js.map +1 -1
- package/dist/browser/classic/runs/index.d.ts +1 -1
- package/dist/browser/classic/runs/index.d.ts.map +1 -1
- package/dist/browser/classic/runs/index.js.map +1 -1
- package/dist/browser/classic/vectorStoreFileBatches/index.d.ts +6 -6
- package/dist/browser/classic/vectorStoreFileBatches/index.d.ts.map +1 -1
- package/dist/browser/classic/vectorStoreFileBatches/index.js.map +1 -1
- package/dist/browser/classic/vectorStoreFiles/index.d.ts +5 -5
- package/dist/browser/classic/vectorStoreFiles/index.d.ts.map +1 -1
- package/dist/browser/classic/vectorStoreFiles/index.js +2 -0
- package/dist/browser/classic/vectorStoreFiles/index.js.map +1 -1
- package/dist/browser/classic/vectorStores/index.d.ts.map +1 -1
- package/dist/browser/classic/vectorStores/index.js.map +1 -1
- package/dist/browser/constants.d.ts +1 -1
- package/dist/browser/constants.js +1 -1
- package/dist/browser/constants.js.map +1 -1
- package/dist/browser/index.d.ts +5 -4
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +3 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/models/index.d.ts +1 -1
- package/dist/browser/models/index.d.ts.map +1 -1
- package/dist/browser/models/index.js.map +1 -1
- package/dist/browser/models/models.d.ts +212 -94
- package/dist/browser/models/models.d.ts.map +1 -1
- package/dist/browser/models/models.js +245 -108
- package/dist/browser/models/models.js.map +1 -1
- package/dist/browser/static-helpers/pagingHelpers.d.ts +1 -1
- package/dist/browser/static-helpers/pagingHelpers.d.ts.map +1 -1
- package/dist/browser/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/browser/utils/MCPTool.d.ts +78 -0
- package/dist/browser/utils/MCPTool.d.ts.map +1 -0
- package/dist/browser/utils/MCPTool.js +128 -0
- package/dist/browser/utils/MCPTool.js.map +1 -0
- package/dist/browser/{utils.d.ts → utils/utils.d.ts} +12 -1
- package/dist/browser/utils/utils.d.ts.map +1 -0
- package/dist/{esm → browser/utils}/utils.js +9 -0
- package/dist/browser/utils/utils.js.map +1 -0
- package/dist/commonjs/agentsClient.d.ts +2 -2
- package/dist/commonjs/agentsClient.d.ts.map +1 -1
- package/dist/commonjs/agentsClient.js.map +1 -1
- package/dist/commonjs/api/agentsContext.d.ts +2 -2
- package/dist/commonjs/api/agentsContext.d.ts.map +1 -1
- package/dist/commonjs/api/agentsContext.js +12 -24
- package/dist/commonjs/api/agentsContext.js.map +1 -1
- package/dist/commonjs/api/files/operations.d.ts +4 -4
- package/dist/commonjs/api/files/operations.d.ts.map +1 -1
- package/dist/commonjs/api/files/operations.js +23 -10
- package/dist/commonjs/api/files/operations.js.map +1 -1
- package/dist/commonjs/api/files/options.d.ts +3 -3
- package/dist/commonjs/api/files/options.d.ts.map +1 -1
- package/dist/commonjs/api/files/options.js.map +1 -1
- package/dist/commonjs/api/messages/operations.d.ts.map +1 -1
- package/dist/commonjs/api/messages/operations.js +17 -11
- package/dist/commonjs/api/messages/operations.js.map +1 -1
- package/dist/commonjs/api/operations.d.ts +7 -6
- package/dist/commonjs/api/operations.d.ts.map +1 -1
- package/dist/commonjs/api/operations.js +31 -19
- package/dist/commonjs/api/operations.js.map +1 -1
- package/dist/commonjs/api/options.d.ts +2 -2
- package/dist/commonjs/api/options.d.ts.map +1 -1
- package/dist/commonjs/api/options.js.map +1 -1
- package/dist/commonjs/api/runSteps/operations.d.ts.map +1 -1
- package/dist/commonjs/api/runSteps/operations.js +10 -6
- package/dist/commonjs/api/runSteps/operations.js.map +1 -1
- package/dist/commonjs/api/runs/operations.d.ts.map +1 -1
- package/dist/commonjs/api/runs/operations.js +37 -19
- package/dist/commonjs/api/runs/operations.js.map +1 -1
- package/dist/commonjs/api/runs/options.d.ts +9 -3
- package/dist/commonjs/api/runs/options.d.ts.map +1 -1
- package/dist/commonjs/api/runs/options.js.map +1 -1
- package/dist/commonjs/api/threads/operations.d.ts.map +1 -1
- package/dist/commonjs/api/threads/operations.js +25 -15
- package/dist/commonjs/api/threads/operations.js.map +1 -1
- package/dist/commonjs/api/threads/options.d.ts +2 -2
- package/dist/commonjs/api/threads/options.d.ts.map +1 -1
- package/dist/commonjs/api/threads/options.js.map +1 -1
- package/dist/commonjs/api/vectorStoreFileBatches/operations.d.ts +7 -7
- package/dist/commonjs/api/vectorStoreFileBatches/operations.d.ts.map +1 -1
- package/dist/commonjs/api/vectorStoreFileBatches/operations.js +26 -8
- package/dist/commonjs/api/vectorStoreFileBatches/operations.js.map +1 -1
- package/dist/commonjs/api/vectorStoreFileBatches/options.d.ts +3 -3
- package/dist/commonjs/api/vectorStoreFileBatches/options.d.ts.map +1 -1
- package/dist/commonjs/api/vectorStoreFileBatches/options.js.map +1 -1
- package/dist/commonjs/api/vectorStoreFiles/operations.d.ts.map +1 -1
- package/dist/commonjs/api/vectorStoreFiles/operations.js +12 -4
- package/dist/commonjs/api/vectorStoreFiles/operations.js.map +1 -1
- package/dist/commonjs/api/vectorStores/operations.d.ts.map +1 -1
- package/dist/commonjs/api/vectorStores/operations.js +15 -5
- package/dist/commonjs/api/vectorStores/operations.js.map +1 -1
- package/dist/commonjs/classic/runSteps/index.d.ts +0 -1
- package/dist/commonjs/classic/runSteps/index.d.ts.map +1 -1
- package/dist/commonjs/classic/runSteps/index.js.map +1 -1
- package/dist/commonjs/classic/runs/index.d.ts +1 -1
- package/dist/commonjs/classic/runs/index.d.ts.map +1 -1
- package/dist/commonjs/classic/runs/index.js.map +1 -1
- package/dist/commonjs/classic/vectorStoreFileBatches/index.d.ts +6 -6
- package/dist/commonjs/classic/vectorStoreFileBatches/index.d.ts.map +1 -1
- package/dist/commonjs/classic/vectorStoreFileBatches/index.js.map +1 -1
- package/dist/commonjs/classic/vectorStoreFiles/index.d.ts +5 -5
- package/dist/commonjs/classic/vectorStoreFiles/index.d.ts.map +1 -1
- package/dist/commonjs/classic/vectorStoreFiles/index.js +2 -0
- package/dist/commonjs/classic/vectorStoreFiles/index.js.map +1 -1
- package/dist/commonjs/classic/vectorStores/index.d.ts.map +1 -1
- package/dist/commonjs/classic/vectorStores/index.js.map +1 -1
- package/dist/commonjs/constants.d.ts +1 -1
- package/dist/commonjs/constants.js +1 -1
- package/dist/commonjs/constants.js.map +1 -1
- package/dist/commonjs/index.d.ts +5 -4
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +5 -3
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +1 -1
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +2 -2
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/models.d.ts +212 -94
- package/dist/commonjs/models/models.d.ts.map +1 -1
- package/dist/commonjs/models/models.js +282 -125
- package/dist/commonjs/models/models.js.map +1 -1
- package/dist/commonjs/static-helpers/pagingHelpers.d.ts +1 -1
- package/dist/commonjs/static-helpers/pagingHelpers.d.ts.map +1 -1
- package/dist/commonjs/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/commonjs/utils/MCPTool.d.ts +78 -0
- package/dist/commonjs/utils/MCPTool.d.ts.map +1 -0
- package/dist/commonjs/utils/MCPTool.js +132 -0
- package/dist/commonjs/utils/MCPTool.js.map +1 -0
- package/dist/commonjs/{utils.d.ts → utils/utils.d.ts} +12 -1
- package/dist/commonjs/utils/utils.d.ts.map +1 -0
- package/dist/commonjs/{utils.js → utils/utils.js} +9 -0
- package/dist/commonjs/utils/utils.js.map +1 -0
- package/dist/esm/agentsClient.d.ts +2 -2
- package/dist/esm/agentsClient.d.ts.map +1 -1
- package/dist/esm/agentsClient.js.map +1 -1
- package/dist/esm/api/agentsContext.d.ts +2 -2
- package/dist/esm/api/agentsContext.d.ts.map +1 -1
- package/dist/esm/api/agentsContext.js +12 -24
- package/dist/esm/api/agentsContext.js.map +1 -1
- package/dist/esm/api/files/operations.d.ts +4 -4
- package/dist/esm/api/files/operations.d.ts.map +1 -1
- package/dist/esm/api/files/operations.js +25 -12
- package/dist/esm/api/files/operations.js.map +1 -1
- package/dist/esm/api/files/options.d.ts +3 -3
- package/dist/esm/api/files/options.d.ts.map +1 -1
- package/dist/esm/api/files/options.js.map +1 -1
- package/dist/esm/api/messages/operations.d.ts.map +1 -1
- package/dist/esm/api/messages/operations.js +18 -12
- package/dist/esm/api/messages/operations.js.map +1 -1
- package/dist/esm/api/operations.d.ts +7 -6
- package/dist/esm/api/operations.d.ts.map +1 -1
- package/dist/esm/api/operations.js +34 -22
- package/dist/esm/api/operations.js.map +1 -1
- package/dist/esm/api/options.d.ts +2 -2
- package/dist/esm/api/options.d.ts.map +1 -1
- package/dist/esm/api/options.js.map +1 -1
- package/dist/esm/api/runSteps/operations.d.ts.map +1 -1
- package/dist/esm/api/runSteps/operations.js +11 -7
- package/dist/esm/api/runSteps/operations.js.map +1 -1
- package/dist/esm/api/runs/operations.d.ts.map +1 -1
- package/dist/esm/api/runs/operations.js +38 -20
- package/dist/esm/api/runs/operations.js.map +1 -1
- package/dist/esm/api/runs/options.d.ts +9 -3
- package/dist/esm/api/runs/options.d.ts.map +1 -1
- package/dist/esm/api/runs/options.js.map +1 -1
- package/dist/esm/api/threads/operations.d.ts.map +1 -1
- package/dist/esm/api/threads/operations.js +26 -16
- package/dist/esm/api/threads/operations.js.map +1 -1
- package/dist/esm/api/threads/options.d.ts +2 -2
- package/dist/esm/api/threads/options.d.ts.map +1 -1
- package/dist/esm/api/threads/options.js.map +1 -1
- package/dist/esm/api/vectorStoreFileBatches/operations.d.ts +7 -7
- package/dist/esm/api/vectorStoreFileBatches/operations.d.ts.map +1 -1
- package/dist/esm/api/vectorStoreFileBatches/operations.js +29 -11
- package/dist/esm/api/vectorStoreFileBatches/operations.js.map +1 -1
- package/dist/esm/api/vectorStoreFileBatches/options.d.ts +3 -3
- package/dist/esm/api/vectorStoreFileBatches/options.d.ts.map +1 -1
- package/dist/esm/api/vectorStoreFileBatches/options.js.map +1 -1
- package/dist/esm/api/vectorStoreFiles/operations.d.ts.map +1 -1
- package/dist/esm/api/vectorStoreFiles/operations.js +13 -5
- package/dist/esm/api/vectorStoreFiles/operations.js.map +1 -1
- package/dist/esm/api/vectorStores/operations.d.ts.map +1 -1
- package/dist/esm/api/vectorStores/operations.js +16 -6
- package/dist/esm/api/vectorStores/operations.js.map +1 -1
- package/dist/esm/classic/runSteps/index.d.ts +0 -1
- package/dist/esm/classic/runSteps/index.d.ts.map +1 -1
- package/dist/esm/classic/runSteps/index.js.map +1 -1
- package/dist/esm/classic/runs/index.d.ts +1 -1
- package/dist/esm/classic/runs/index.d.ts.map +1 -1
- package/dist/esm/classic/runs/index.js.map +1 -1
- package/dist/esm/classic/vectorStoreFileBatches/index.d.ts +6 -6
- package/dist/esm/classic/vectorStoreFileBatches/index.d.ts.map +1 -1
- package/dist/esm/classic/vectorStoreFileBatches/index.js.map +1 -1
- package/dist/esm/classic/vectorStoreFiles/index.d.ts +5 -5
- package/dist/esm/classic/vectorStoreFiles/index.d.ts.map +1 -1
- package/dist/esm/classic/vectorStoreFiles/index.js +2 -0
- package/dist/esm/classic/vectorStoreFiles/index.js.map +1 -1
- package/dist/esm/classic/vectorStores/index.d.ts.map +1 -1
- package/dist/esm/classic/vectorStores/index.js.map +1 -1
- package/dist/esm/constants.d.ts +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/index.d.ts +5 -4
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +3 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/models/index.d.ts +1 -1
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/models.d.ts +212 -94
- package/dist/esm/models/models.d.ts.map +1 -1
- package/dist/esm/models/models.js +245 -108
- package/dist/esm/models/models.js.map +1 -1
- package/dist/esm/static-helpers/pagingHelpers.d.ts +1 -1
- package/dist/esm/static-helpers/pagingHelpers.d.ts.map +1 -1
- package/dist/esm/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/esm/utils/MCPTool.d.ts +78 -0
- package/dist/esm/utils/MCPTool.d.ts.map +1 -0
- package/dist/esm/utils/MCPTool.js +128 -0
- package/dist/esm/utils/MCPTool.js.map +1 -0
- package/dist/{react-native → esm/utils}/utils.d.ts +12 -1
- package/dist/esm/utils/utils.d.ts.map +1 -0
- package/dist/{react-native → esm/utils}/utils.js +9 -0
- package/dist/esm/utils/utils.js.map +1 -0
- package/dist/react-native/agentsClient.d.ts +2 -2
- package/dist/react-native/agentsClient.d.ts.map +1 -1
- package/dist/react-native/agentsClient.js.map +1 -1
- package/dist/react-native/api/agentsContext.d.ts +2 -2
- package/dist/react-native/api/agentsContext.d.ts.map +1 -1
- package/dist/react-native/api/agentsContext.js +12 -24
- package/dist/react-native/api/agentsContext.js.map +1 -1
- package/dist/react-native/api/files/operations.d.ts +4 -4
- package/dist/react-native/api/files/operations.d.ts.map +1 -1
- package/dist/react-native/api/files/operations.js +25 -12
- package/dist/react-native/api/files/operations.js.map +1 -1
- package/dist/react-native/api/files/options.d.ts +3 -3
- package/dist/react-native/api/files/options.d.ts.map +1 -1
- package/dist/react-native/api/files/options.js.map +1 -1
- package/dist/react-native/api/messages/operations.d.ts.map +1 -1
- package/dist/react-native/api/messages/operations.js +18 -12
- package/dist/react-native/api/messages/operations.js.map +1 -1
- package/dist/react-native/api/operations.d.ts +7 -6
- package/dist/react-native/api/operations.d.ts.map +1 -1
- package/dist/react-native/api/operations.js +34 -22
- package/dist/react-native/api/operations.js.map +1 -1
- package/dist/react-native/api/options.d.ts +2 -2
- package/dist/react-native/api/options.d.ts.map +1 -1
- package/dist/react-native/api/options.js.map +1 -1
- package/dist/react-native/api/runSteps/operations.d.ts.map +1 -1
- package/dist/react-native/api/runSteps/operations.js +11 -7
- package/dist/react-native/api/runSteps/operations.js.map +1 -1
- package/dist/react-native/api/runs/operations.d.ts.map +1 -1
- package/dist/react-native/api/runs/operations.js +38 -20
- package/dist/react-native/api/runs/operations.js.map +1 -1
- package/dist/react-native/api/runs/options.d.ts +9 -3
- package/dist/react-native/api/runs/options.d.ts.map +1 -1
- package/dist/react-native/api/runs/options.js.map +1 -1
- package/dist/react-native/api/threads/operations.d.ts.map +1 -1
- package/dist/react-native/api/threads/operations.js +26 -16
- package/dist/react-native/api/threads/operations.js.map +1 -1
- package/dist/react-native/api/threads/options.d.ts +2 -2
- package/dist/react-native/api/threads/options.d.ts.map +1 -1
- package/dist/react-native/api/threads/options.js.map +1 -1
- package/dist/react-native/api/vectorStoreFileBatches/operations.d.ts +7 -7
- package/dist/react-native/api/vectorStoreFileBatches/operations.d.ts.map +1 -1
- package/dist/react-native/api/vectorStoreFileBatches/operations.js +29 -11
- package/dist/react-native/api/vectorStoreFileBatches/operations.js.map +1 -1
- package/dist/react-native/api/vectorStoreFileBatches/options.d.ts +3 -3
- package/dist/react-native/api/vectorStoreFileBatches/options.d.ts.map +1 -1
- package/dist/react-native/api/vectorStoreFileBatches/options.js.map +1 -1
- package/dist/react-native/api/vectorStoreFiles/operations.d.ts.map +1 -1
- package/dist/react-native/api/vectorStoreFiles/operations.js +13 -5
- package/dist/react-native/api/vectorStoreFiles/operations.js.map +1 -1
- package/dist/react-native/api/vectorStores/operations.d.ts.map +1 -1
- package/dist/react-native/api/vectorStores/operations.js +16 -6
- package/dist/react-native/api/vectorStores/operations.js.map +1 -1
- package/dist/react-native/classic/runSteps/index.d.ts +0 -1
- package/dist/react-native/classic/runSteps/index.d.ts.map +1 -1
- package/dist/react-native/classic/runSteps/index.js.map +1 -1
- package/dist/react-native/classic/runs/index.d.ts +1 -1
- package/dist/react-native/classic/runs/index.d.ts.map +1 -1
- package/dist/react-native/classic/runs/index.js.map +1 -1
- package/dist/react-native/classic/vectorStoreFileBatches/index.d.ts +6 -6
- package/dist/react-native/classic/vectorStoreFileBatches/index.d.ts.map +1 -1
- package/dist/react-native/classic/vectorStoreFileBatches/index.js.map +1 -1
- package/dist/react-native/classic/vectorStoreFiles/index.d.ts +5 -5
- package/dist/react-native/classic/vectorStoreFiles/index.d.ts.map +1 -1
- package/dist/react-native/classic/vectorStoreFiles/index.js +2 -0
- package/dist/react-native/classic/vectorStoreFiles/index.js.map +1 -1
- package/dist/react-native/classic/vectorStores/index.d.ts.map +1 -1
- package/dist/react-native/classic/vectorStores/index.js.map +1 -1
- package/dist/react-native/constants.d.ts +1 -1
- package/dist/react-native/constants.js +1 -1
- package/dist/react-native/constants.js.map +1 -1
- package/dist/react-native/index.d.ts +5 -4
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +3 -2
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/models/index.d.ts +1 -1
- package/dist/react-native/models/index.d.ts.map +1 -1
- package/dist/react-native/models/index.js.map +1 -1
- package/dist/react-native/models/models.d.ts +212 -94
- package/dist/react-native/models/models.d.ts.map +1 -1
- package/dist/react-native/models/models.js +245 -108
- package/dist/react-native/models/models.js.map +1 -1
- package/dist/react-native/static-helpers/pagingHelpers.d.ts +1 -1
- package/dist/react-native/static-helpers/pagingHelpers.d.ts.map +1 -1
- package/dist/react-native/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/react-native/utils/MCPTool.d.ts +78 -0
- package/dist/react-native/utils/MCPTool.d.ts.map +1 -0
- package/dist/react-native/utils/MCPTool.js +128 -0
- package/dist/react-native/utils/MCPTool.js.map +1 -0
- package/dist/{esm → react-native/utils}/utils.d.ts +12 -1
- package/dist/react-native/utils/utils.d.ts.map +1 -0
- package/dist/{browser → react-native/utils}/utils.js +9 -0
- package/dist/react-native/utils/utils.js.map +1 -0
- package/package.json +1 -1
- package/dist/browser/utils.d.ts.map +0 -1
- package/dist/browser/utils.js.map +0 -1
- package/dist/commonjs/utils.d.ts.map +0 -1
- package/dist/commonjs/utils.js.map +0 -1
- package/dist/esm/utils.d.ts.map +0 -1
- package/dist/esm/utils.js.map +0 -1
- package/dist/react-native/utils.d.ts.map +0 -1
- 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-
|
|
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
|
|
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 {
|
|
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:
|
|
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,qCAA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BAA+C,GACvD,OAAO,CAAC,KAAK,CAAC;IAIjB,0DAA0D;IAC1D,UAAU,CACR,OAAO,GAAE,wBAAiD,GACzD,0BAA0B,CAAC,KAAK,CAAC;IAIpC,2BAA2B;IAC3B,WAAW,CACT,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,yBAAkD,GAC1D,OAAO,CAAC,KAAK,CAAC;CAGlB"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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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, 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 {
|
|
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:
|
|
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,
|
|
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
|
|
10
|
-
const
|
|
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
|
|
15
|
-
scopes: (
|
|
16
|
-
} }), { apiVersion: _ } =
|
|
17
|
-
const clientContext = getClient(
|
|
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 = (
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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;
|
|
1
|
+
{"version":3,"file":"agentsContext.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AAoB,CAAC;IAC9D,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,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;
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/api/files/operations.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EACV,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,kBAAkB,EACnB,MAAM,wBAAwB,CAAC;AAQhC,OAAO,KAAK,EACV,iCAAiC,EACjC,0BAA0B,EAC1B,6BAA6B,EAC7B,6BAA6B,EAC7B,4BAA4B,EAC7B,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEvF,OAAO,KAAK,EAAE,cAAc,EAAmB,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGnF,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,iCAA0D,GAClE,gBAAgB,CAAC,MAAM,GAAG,UAAU,CAAC,CAkBvC;AAED,oDAAoD;AACpD,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,iCAA0D,GAClE,gBAAgB,CAAC,MAAM,GAAG,UAAU,CAAC,CAGvC;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAA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,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
|
|
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
|
|
9
|
+
const path = expandUrlTemplate("/files/{fileId}/content{?api-version}", {
|
|
10
10
|
fileId: fileId,
|
|
11
|
-
"api
|
|
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
|
|
24
|
+
const path = expandUrlTemplate("/files/{fileId}{?api-version}", {
|
|
25
25
|
fileId: fileId,
|
|
26
|
-
"api
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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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,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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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/api/files/options.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../src/api/files/options.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,2BAA2B;AAC3B,MAAM,WAAW,iCAAkC,SAAQ,gBAAgB;CAAG;AAE9E,2BAA2B;AAC3B,MAAM,WAAW,0BAA2B,SAAQ,gBAAgB;CAAG;AAEvE,2BAA2B;AAC3B,MAAM,WAAW,6BAA8B,SAAQ,gBAAgB;CAAG;AAE1E,2BAA2B;AAC3B,MAAM,WAAW,6BAA8B,SAAQ,gBAAgB,EAAE,oBAAoB;IAC3F,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,2BAA2B;AAC3B,MAAM,WAAW,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,
|
|
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,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,CASxB;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,CASxB;AAED,qCAAqC;AACrC,wBAAsB,UAAU,CAC9B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,E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