@azure/ai-agents 1.0.0-beta.5 → 1.0.0
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 +2 -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 +21 -8
- 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 +10 -4
- 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 +22 -10
- 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 +7 -3
- 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 +21 -9
- package/dist/browser/api/runs/operations.js.map +1 -1
- package/dist/browser/api/runs/options.d.ts +3 -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 +16 -6
- 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 +6 -6
- 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 +5 -5
- 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.d.ts.map +1 -1
- package/dist/browser/constants.js +1 -1
- package/dist/browser/constants.js.map +1 -1
- package/dist/browser/index.d.ts +3 -3
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +1 -1
- 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 +41 -161
- package/dist/browser/models/models.d.ts.map +1 -1
- package/dist/browser/models/models.js +34 -217
- 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.d.ts +1 -50
- package/dist/browser/utils.d.ts.map +1 -1
- package/dist/browser/utils.js +0 -81
- package/dist/browser/utils.js.map +1 -1
- 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 +19 -6
- 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 +9 -3
- 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 +19 -7
- 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 +6 -2
- 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 +20 -8
- package/dist/commonjs/api/runs/operations.js.map +1 -1
- package/dist/commonjs/api/runs/options.d.ts +3 -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 +15 -5
- 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 +6 -6
- 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 +5 -5
- 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.d.ts.map +1 -1
- package/dist/commonjs/constants.js +1 -1
- package/dist/commonjs/constants.js.map +1 -1
- package/dist/commonjs/index.d.ts +3 -3
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +2 -2
- 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 +41 -161
- package/dist/commonjs/models/models.d.ts.map +1 -1
- package/dist/commonjs/models/models.js +42 -248
- 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/utils.d.ts +1 -50
- package/dist/commonjs/utils.d.ts.map +1 -1
- package/dist/commonjs/utils.js +0 -81
- package/dist/commonjs/utils.js.map +1 -1
- 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 +21 -8
- 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 +10 -4
- 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 +22 -10
- 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 +7 -3
- 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 +21 -9
- package/dist/esm/api/runs/operations.js.map +1 -1
- package/dist/esm/api/runs/options.d.ts +3 -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 +16 -6
- 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 +6 -6
- 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 +5 -5
- 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.d.ts.map +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- 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 +41 -161
- package/dist/esm/models/models.d.ts.map +1 -1
- package/dist/esm/models/models.js +34 -217
- 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.d.ts +1 -50
- package/dist/esm/utils.d.ts.map +1 -1
- package/dist/esm/utils.js +0 -81
- package/dist/esm/utils.js.map +1 -1
- 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 +21 -8
- 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 +10 -4
- 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 +22 -10
- 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 +7 -3
- 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 +21 -9
- package/dist/react-native/api/runs/operations.js.map +1 -1
- package/dist/react-native/api/runs/options.d.ts +3 -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 +16 -6
- 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 +6 -6
- 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 +5 -5
- 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.d.ts.map +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 +3 -3
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +1 -1
- 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 +41 -161
- package/dist/react-native/models/models.d.ts.map +1 -1
- package/dist/react-native/models/models.js +34 -217
- 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.d.ts +1 -50
- package/dist/react-native/utils.d.ts.map +1 -1
- package/dist/react-native/utils.js +0 -81
- package/dist/react-native/utils.js.map +1 -1
- package/package.json +1 -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
|
|
|
@@ -29,7 +29,6 @@ Use the AI Agents client library to:
|
|
|
29
29
|
- [Bing grounding](#create-agent-with-bing-grounding)
|
|
30
30
|
- [Azure AI Search](#create-agent-with-azure-ai-search)
|
|
31
31
|
- [Function call](#create-agent-with-function-call)
|
|
32
|
-
- [Fabric Data](#create-an-agent-with-fabric)
|
|
33
32
|
- [Create thread](#create-thread) with
|
|
34
33
|
- [Tool resource](#create-thread-with-tool-resource)
|
|
35
34
|
- [Create message](#create-message) with:
|
|
@@ -74,7 +73,7 @@ npm install @azure/ai-agents @azure/identity
|
|
|
74
73
|
|
|
75
74
|
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
75
|
|
|
77
|
-
To get your project endpoint you can refer
|
|
76
|
+
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
77
|
|
|
79
78
|
```ts snippet:setup
|
|
80
79
|
import { AgentsClient } from "@azure/ai-agents";
|
|
@@ -413,29 +412,6 @@ const agent = await client.createAgent("gpt-4o", {
|
|
|
413
412
|
console.log(`Created agent, agent ID: ${agent.id}`);
|
|
414
413
|
```
|
|
415
414
|
|
|
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
415
|
#### Create Thread
|
|
440
416
|
|
|
441
417
|
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,qCAAqC,CAAC;AAEtF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAE9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,
|
|
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,yBAAy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OAAO,CAAC,CAAC;IACtD,CAAC;IAED,0DAA0D;IAC1D,UAAU,CACR,UAAoC,EAAE,cAAc,EAAE,EAAE,EAAE;QAE1D,OAAO,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED,2BAA2B;IAC3B,WAAW,CACT,KAAa,EACb,UAAqC,EAAE,cAAc,EAAE,EAAE,EAAE;QAE3D,OAAO,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AgentsContext, AgentsClientOptionalParams } from \"./api/index.js\";\nimport { createAgents } from \"./api/index.js\";\nimport type { Agent, AgentDeletionStatus } from \"./models/models.js\";\nimport type {\n DeleteAgentOptionalParams,\n UpdateAgentOptionalParams,\n GetAgentOptionalParams,\n ListAgentsOptionalParams,\n CreateAgentOptionalParams,\n} from \"./api/options.js\";\nimport { deleteAgent, updateAgent, getAgent, listAgents, createAgent } from \"./api/operations.js\";\nimport type { VectorStoreFileBatchesOperations } from \"./classic/vectorStoreFileBatches/index.js\";\nimport { _getVectorStoreFileBatchesOperations } from \"./classic/vectorStoreFileBatches/index.js\";\nimport type { VectorStoreFilesOperations } from \"./classic/vectorStoreFiles/index.js\";\nimport { _getVectorStoreFilesOperations } from \"./classic/vectorStoreFiles/index.js\";\nimport type { VectorStoresOperations } from \"./classic/vectorStores/index.js\";\nimport { _getVectorStoresOperations } from \"./classic/vectorStores/index.js\";\nimport type { FilesOperations } from \"./classic/files/index.js\";\nimport { _getFilesOperations } from \"./classic/files/index.js\";\nimport type { RunStepsOperations } from \"./classic/runSteps/index.js\";\nimport { _getRunStepsOperations } from \"./classic/runSteps/index.js\";\nimport type { RunsOperations } from \"./classic/runs/index.js\";\nimport { _getRunsOperations } from \"./classic/runs/index.js\";\nimport type { MessagesOperations } from \"./classic/messages/index.js\";\nimport { _getMessagesOperations } from \"./classic/messages/index.js\";\nimport type { ThreadsOperations } from \"./classic/threads/index.js\";\nimport { _getThreadsOperations } from \"./classic/threads/index.js\";\nimport type { PagedAsyncIterableIterator } from \"./static-helpers/pagingHelpers.js\";\nimport type { Pipeline } from \"@azure/core-rest-pipeline\";\nimport type { TokenCredential } from \"@azure/core-auth\";\n\nexport { AgentsClientOptionalParams } from \"./api/agentsContext.js\";\n\nexport class AgentsClient {\n private _client: AgentsContext;\n /** The pipeline used by this client to make requests */\n public readonly pipeline: Pipeline;\n\n constructor(\n endpointParam: string,\n credential: TokenCredential,\n options: AgentsClientOptionalParams = {},\n ) {\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._client = createAgents(endpointParam, credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n this.pipeline = this._client.pipeline;\n this.vectorStoreFileBatches = _getVectorStoreFileBatchesOperations(this._client);\n this.vectorStoreFiles = _getVectorStoreFilesOperations(this._client);\n this.vectorStores = _getVectorStoresOperations(this._client);\n this.files = _getFilesOperations(this._client);\n this.runSteps = _getRunStepsOperations(this._client);\n this.runs = _getRunsOperations(this._client);\n this.messages = _getMessagesOperations(this._client);\n this.threads = _getThreadsOperations(this._client);\n }\n\n /** The operation groups for vectorStoreFileBatches */\n public readonly vectorStoreFileBatches: VectorStoreFileBatchesOperations;\n /** The operation groups for vectorStoreFiles */\n public readonly vectorStoreFiles: VectorStoreFilesOperations;\n /** The operation groups for vectorStores */\n public readonly vectorStores: VectorStoresOperations;\n /** The operation groups for files */\n public readonly files: FilesOperations;\n /** The operation groups for runSteps */\n public readonly runSteps: RunStepsOperations;\n /** The operation groups for runs */\n public readonly runs: RunsOperations;\n /** The operation groups for messages */\n public readonly messages: MessagesOperations;\n /** The operation groups for threads */\n public readonly threads: ThreadsOperations;\n\n /** Deletes an agent. */\n deleteAgent(\n assistantId: string,\n options: DeleteAgentOptionalParams = { requestOptions: {} },\n ): Promise<AgentDeletionStatus> {\n return deleteAgent(this._client, assistantId, options);\n }\n\n /** Modifies an existing agent. */\n updateAgent(\n assistantId: string,\n options: UpdateAgentOptionalParams = { requestOptions: {} },\n ): Promise<Agent> {\n return updateAgent(this._client, assistantId, options);\n }\n\n /** Retrieves an existing agent. */\n getAgent(\n assistantId: string,\n options: GetAgentOptionalParams = { requestOptions: {} },\n ): Promise<Agent> {\n return getAgent(this._client, assistantId, options);\n }\n\n /** Gets a list of agents that were previously created. */\n listAgents(\n options: ListAgentsOptionalParams = { requestOptions: {} },\n ): PagedAsyncIterableIterator<Agent> {\n return listAgents(this._client, options);\n }\n\n /** Creates a new agent. */\n createAgent(\n model: string,\n options: CreateAgentOptionalParams = { requestOptions: {} },\n ): Promise<Agent> {\n return createAgent(this._client, model, options);\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Client, ClientOptions } from "@azure-rest/core-client";
|
|
2
|
-
import {
|
|
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.0.0`;
|
|
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 : "v1";
|
|
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.js","sourceRoot":"","sources":["../../../src/api/agentsContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAyB,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAgB3E,MAAM,UAAU,YAAY,CAC1B,aAAqB,EACrB,UAA2B,EAC3B,UAAsC,EAAE;;IAExC,MAAM,WAAW,GAAG,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,MAAM,CAAC,aAAa,CAAC,CAAC;IACjF,MAAM,iBAAiB,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,0CAAE,eAAe,CAAC;IACrE,MAAM,aAAa,GAAG,0BAA0B,CAAC;IACjD,MAAM,eAAe,GAAG,iBAAiB;QACvC,CAAC,CAAC,GAAG,iBAAiB,iBAAiB,aAAa,EAAE;QACtD,CAAC,CAAC,gBAAgB,aAAa,EAAE,CAAC;IACpC,MAAM,qCACD,OAAO,KACV,gBAAgB,EAAE,EAAE,eAAe,EAAE,EACrC,cAAc,EAAE,EAAE,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,cAAc,0CAAE,MAAM,mCAAI,MAAM,CAAC,IAAI,EAAE,EACzE,WAAW,EAAE;YACX,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,WAAW,0CAAE,MAAM,mCAAI,CAAC,+BAA+B,CAAC;SACzE,GACF,EAPK,EAAE,UAAU,EAAE,CAAC,OAOpB,EAPyB,cAAc,cAAlC,cAAoC,CAOzC,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,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI,CAAC;IAC9C,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.0.0`;\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 ?? \"v1\";\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,E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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,8 +1,8 @@
|
|
|
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;
|
|
@@ -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%2Dversion}", {
|
|
73
|
+
"api%2Dversion": 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,0CAAE,OAAO,KAEpC,CAAC;AACL,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,cAAc,CAC5B,OAAe,EACf,MAAc,EACd,UAA6C,EAAE,cAAc,EAAE,EAAE,EAAE;IAEnE,MAAM,MAAM,GAAG,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7D,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,OAAe,EACf,MAAc,EAC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C,CAAC,OAAO,CAAC,KAC/C,OAAO,kBACL,MAAM,EAAE,kBAAkB,IACvB,MAAA,OAAO,CAAC,cAAc,0CAAE,OAAO,KAEpC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,MAA6B;IAE7B,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,4BAA4B,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACnD,CAAC;AAED,gDAAgD;AAChD,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,OAAe,EACf,UAAwC,EAAE,cAAc,EAAE,EAAE,EAAE;IAE9D,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACtD,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC;AACD,SAAS,qBAAqB,CAAC,MAAgB;IAC7C,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;QACtB,KAAK,SAAS,CAAC;QACf,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,UAAU,CAAC;QAChB,KAAK,WAAW;YACd,OAAO,WAAW,CAAC;QACrB;YACE,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AgentsContext as Client } from \"../index.js\";\nimport {\n FileListResponse,\n fileListResponseDeserializer,\n FileInfo,\n fileInfoDeserializer,\n FilePurpose,\n _uploadFileRequestSerializer,\n FileDeletionStatus,\n fileDeletionStatusDeserializer,\n} from \"../../models/models.js\";\nimport {\n FilesGetFileContentOptionalParams,\n FilesGetFileOptionalParams,\n FilesDeleteFileOptionalParams,\n FilesUploadFileOptionalParams,\n FilesListFilesOptionalParams,\n} from \"./options.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\nimport type { OperationState, OperationStatus, PollerLike } from \"@azure/core-lro\";\nimport { createPoller } from \"../poller.js\";\n\nexport function _getFileContentSend(\n context: Client,\n fileId: string,\n options: FilesGetFileContentOptionalParams = { requestOptions: {} },\n): StreamableMethod<string | Uint8Array> {\n const path = expandUrlTemplate(\n \"/files/{fileId}/content{?api%2Dversion}\",\n {\n fileId: fileId,\n \"api%2Dversion\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/octet-stream\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\n/** Retrieves the raw content of a specific file. */\nexport function getFileContent(\n context: Client,\n fileId: string,\n options: FilesGetFileContentOptionalParams = { requestOptions: {} },\n): StreamableMethod<string | Uint8Array> {\n const result = _getFileContentSend(context, fileId, options);\n return result;\n}\n\nexport function _getFileSend(\n context: Client,\n fileId: string,\n options: FilesGetFileOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/files/{fileId}{?api%2Dversion}\",\n {\n fileId: fileId,\n \"api%2Dversion\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getFileDeserialize(result: PathUncheckedResponse): Promise<FileInfo> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return fileInfoDeserializer(result.body);\n}\n\n/** Returns information about a specific file. Does not retrieve file content. */\nexport async function getFile(\n context: Client,\n fileId: string,\n options: FilesGetFileOptionalParams = { requestOptions: {} },\n): Promise<FileInfo> {\n const result = await _getFileSend(context, fileId, options);\n return _getFileDeserialize(result);\n}\n\nexport function _deleteFileSend(\n context: Client,\n fileId: string,\n options: FilesDeleteFileOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/files/{fileId}{?api%2Dversion}\",\n {\n fileId: fileId,\n \"api%2Dversion\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).delete({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _deleteFileDeserialize(\n result: PathUncheckedResponse,\n): Promise<FileDeletionStatus> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return fileDeletionStatusDeserializer(result.body);\n}\n\n/** Delete a previously uploaded file. */\nexport async function deleteFile(\n context: Client,\n fileId: string,\n options: FilesDeleteFileOptionalParams = { requestOptions: {} },\n): Promise<FileDeletionStatus> {\n const result = await _deleteFileSend(context, fileId, options);\n return _deleteFileDeserialize(result);\n}\n\nexport function _uploadFileSend(\n context: Client,\n body: {\n file: ReadableStream<Uint8Array> | NodeJS.ReadableStream;\n purpose: FilePurpose;\n filename?: string;\n },\n options: FilesUploadFileOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n return context.path(\"/files\").post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"multipart/form-data\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: _uploadFileRequestSerializer(body),\n });\n}\n\nexport async function _uploadFileDeserialize(result: PathUncheckedResponse): Promise<FileInfo> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return fileInfoDeserializer(result.body);\n}\n\n/** Uploads a file for use by other operations. */\nexport async function uploadFileInternal(\n context: Client,\n body: {\n file: ReadableStream<Uint8Array> | NodeJS.ReadableStream;\n purpose: FilePurpose;\n filename?: string;\n },\n options: FilesUploadFileOptionalParams = { requestOptions: {} },\n): Promise<FileInfo> {\n const result = await _uploadFileSend(context, body, options);\n return _uploadFileDeserialize(result);\n}\n\n/** Uploads a file for use by other operations. */\nexport function uploadFile(\n context: Client,\n body: {\n file: ReadableStream<Uint8Array> | NodeJS.ReadableStream;\n purpose: FilePurpose;\n filename?: string;\n },\n options: FilesUploadFileOptionalParams = { requestOptions: {} },\n): PollerLike<OperationState<FileInfo>, FileInfo> {\n return createPoller<FileInfo>({\n initOperation: async () => {\n return uploadFileInternal(context, body, options);\n },\n pollOperation: async (currentResult: FileInfo) => {\n return getFile(context, currentResult.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n getOperationError: (result: FileInfo) => {\n return getLroOperationStatus(result) === \"failed\" && result.statusDetails\n ? new Error(`Operation failed: ${result.statusDetails}`)\n : undefined;\n },\n intervalInMs: options.pollingOptions?.intervalInMs,\n });\n}\n\n/** Uploads a file for use by other operations with polling */\nexport function uploadFileAndPoll(\n context: Client,\n body: {\n file: ReadableStream<Uint8Array> | NodeJS.ReadableStream;\n purpose: FilePurpose;\n filename?: string;\n },\n options: FilesUploadFileOptionalParams = { requestOptions: {} },\n): PollerLike<OperationState<FileInfo>, FileInfo> {\n return createPoller<FileInfo>({\n initOperation: async () => {\n return uploadFileInternal(context, body, options);\n },\n pollOperation: async (currentResult: FileInfo) => {\n return getFile(context, currentResult.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n getOperationError: (result: FileInfo) => {\n return getLroOperationStatus(result) === \"failed\" && result.statusDetails\n ? new Error(`Operation failed: ${result.statusDetails}`)\n : undefined;\n },\n intervalInMs: options.pollingOptions?.intervalInMs,\n });\n}\n\nexport function _listFilesSend(\n context: Client,\n options: FilesListFilesOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/files{?api%2Dversion,purpose}\",\n {\n \"api%2Dversion\": context.apiVersion,\n purpose: options?.purpose,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listFilesDeserialize(\n result: PathUncheckedResponse,\n): Promise<FileListResponse> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return fileListResponseDeserializer(result.body);\n}\n\n/** Gets a list of previously uploaded files. */\nexport async function listFiles(\n context: Client,\n options: FilesListFilesOptionalParams = { requestOptions: {} },\n): Promise<FileListResponse> {\n const result = await _listFilesSend(context, options);\n return _listFilesDeserialize(result);\n}\nfunction getLroOperationStatus(result: FileInfo): OperationStatus {\n switch (result.status) {\n case \"running\":\n case \"pending\":\n return \"running\";\n case \"uploaded\":\n case \"processed\":\n return \"succeeded\";\n default:\n return \"failed\";\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/files/operations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC;AAQhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAE,eAAe,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAC;AAE/F,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,UAAU,mBAAmB,CACjC,OAAe,EACf,MAAc,EACd,UAA6C,EAAE,cAAc,EAAE,EAAE,EAAE;;IAEnE,MAAM,IAAI,GAAG,iBAAiB,CAC5B,yCAAyC,EACzC;QACE,MAAM,EAAE,MAAM;QACd,eAAe,EAAE,OAAO,CAAC,UAAU;KACpC,EACD;QACE,aAAa,EAAE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BAAqB,CACzC,MAA6B;IAE7B,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACtC,KAAK,CAAC,OAAO,GAAG,wBAAwB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACtD,MAAM,KAAK,CAAC;IACd,CAAC;IAED,OAAO,4BAA4B,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACnD,CAAC;AAED,gDAAgD;AAChD,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,OAAe,EACf,UAAwC,EAAE,cAAc,EAAE,EAAE,EAAE;IAE9D,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACtD,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAgB;IAC7C,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;QACtB,KAAK,SAAS,CAAC;QACf,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,UAAU,CAAC;QAChB,KAAK,WAAW;YACd,OAAO,WAAW,CAAC;QACrB;YACE,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AgentsContext as Client } from \"../index.js\";\nimport type {\n FileListResponse,\n FileInfo,\n FilePurpose,\n FileDeletionStatus,\n} from \"../../models/models.js\";\nimport {\n agentV1ErrorDeserializer,\n fileListResponseDeserializer,\n fileInfoDeserializer,\n _uploadFileRequestSerializer,\n fileDeletionStatusDeserializer,\n} from \"../../models/models.js\";\nimport type {\n FilesGetFileContentOptionalParams,\n FilesGetFileOptionalParams,\n FilesDeleteFileOptionalParams,\n FilesUploadFileOptionalParams,\n FilesListFilesOptionalParams,\n} from \"./options.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport type { StreamableMethod, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError, operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nimport type { OperationState, OperationStatus, PollerLike } from \"@azure/core-lro\";\nimport { createPoller } from \"../poller.js\";\n\nexport function _getFileContentSend(\n context: Client,\n fileId: string,\n options: FilesGetFileContentOptionalParams = { requestOptions: {} },\n): StreamableMethod<string | Uint8Array> {\n const path = expandUrlTemplate(\n \"/files/{fileId}/content{?api%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 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%2Dversion}\",\n {\n \"api%2Dversion\": 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,M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,CAAC,CAO1C;AAED,sDAAsD;AACtD,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,kCAA2D,GACnE,0BAA0B,CAAC,aAAa,CAAC,CAQ3C;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,GAAE,mCAA4D,GACpE,gBAAgB,CA2BlB;AAED,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,aAAa,CAAC,CASxB;AAED,mDAAmD;AACnD,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,GAAE,mCAA4D,GACpE,OAAO,CAAC,aAAa,CAAC,CAGxB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import { messageInputContentSerializer, messageAttachmentArraySerializer, threadMessageDeserializer, _agentsPagedResultThreadMessageDeserializer, } from "../../models/models.js";
|
|
3
|
+
import { agentV1ErrorDeserializer, messageInputContentSerializer, messageAttachmentArraySerializer, threadMessageDeserializer, _agentsPagedResultThreadMessageDeserializer, } from "../../models/models.js";
|
|
4
4
|
import { buildPagedAsyncIterator, } from "../../static-helpers/pagingHelpers.js";
|
|
5
5
|
import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js";
|
|
6
6
|
import { createRestError, operationOptionsToRequestParameters, } from "@azure-rest/core-client";
|
|
@@ -18,7 +18,9 @@ export function _updateMessageSend(context, threadId, messageId, options = { req
|
|
|
18
18
|
export async function _updateMessageDeserialize(result) {
|
|
19
19
|
const expectedStatuses = ["200"];
|
|
20
20
|
if (!expectedStatuses.includes(result.status)) {
|
|
21
|
-
|
|
21
|
+
const error = createRestError(result);
|
|
22
|
+
error.details = agentV1ErrorDeserializer(result.body);
|
|
23
|
+
throw error;
|
|
22
24
|
}
|
|
23
25
|
return threadMessageDeserializer(result.body);
|
|
24
26
|
}
|
|
@@ -41,7 +43,9 @@ export function _getMessageSend(context, threadId, messageId, options = { reques
|
|
|
41
43
|
export async function _getMessageDeserialize(result) {
|
|
42
44
|
const expectedStatuses = ["200"];
|
|
43
45
|
if (!expectedStatuses.includes(result.status)) {
|
|
44
|
-
|
|
46
|
+
const error = createRestError(result);
|
|
47
|
+
error.details = agentV1ErrorDeserializer(result.body);
|
|
48
|
+
throw error;
|
|
45
49
|
}
|
|
46
50
|
return threadMessageDeserializer(result.body);
|
|
47
51
|
}
|
|
@@ -96,7 +100,9 @@ export function _createMessageSend(context, threadId, role, content, options = {
|
|
|
96
100
|
export async function _createMessageDeserialize(result) {
|
|
97
101
|
const expectedStatuses = ["200"];
|
|
98
102
|
if (!expectedStatuses.includes(result.status)) {
|
|
99
|
-
|
|
103
|
+
const error = createRestError(result);
|
|
104
|
+
error.details = agentV1ErrorDeserializer(result.body);
|
|
105
|
+
throw error;
|
|
100
106
|
}
|
|
101
107
|
return threadMessageDeserializer(result.body);
|
|
102
108
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/messages/operations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAGL,6BAA6B,EAC7B,gCAAgC,EAEhC,yBAAyB,EAEzB,2CAA2C,GAC5C,MAAM,wBAAwB,CAAC;AAOhC,OAAO,EAEL,uBAAuB,GACxB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAGL,eAAe,EACf,mCAAmC,GACpC,MAAM,yBAAyB,CAAC;AAEjC,MAAM,UAAU,kBAAkB,C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,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,yBAAyB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAChD,CAAC;AAED,mDAAmD;AACnD,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAAe,EACf,QAAgB,EAChB,IAAiB,EACjB,OAA4B,EAC5B,UAA+C,EAAE,cAAc,EAAE,EAAE,EAAE;IAErE,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACnF,OAAO,yBAAyB,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AgentsContext as Client } from \"../index.js\";\nimport {\n MessageRole,\n MessageInputContent,\n messageInputContentSerializer,\n messageAttachmentArraySerializer,\n ThreadMessage,\n threadMessageDeserializer,\n _AgentsPagedResultThreadMessage,\n _agentsPagedResultThreadMessageDeserializer,\n} from \"../../models/models.js\";\nimport {\n MessagesUpdateMessageOptionalParams,\n MessagesGetMessageOptionalParams,\n MessagesListMessagesOptionalParams,\n MessagesCreateMessageOptionalParams,\n} from \"./options.js\";\nimport {\n PagedAsyncIterableIterator,\n buildPagedAsyncIterator,\n} from \"../../static-helpers/pagingHelpers.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\n\nexport function _updateMessageSend(\n context: Client,\n threadId: string,\n messageId: string,\n options: MessagesUpdateMessageOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/messages/{messageId}{?api%2Dversion}\",\n {\n threadId: threadId,\n messageId: messageId,\n \"api%2Dversion\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: { metadata: options?.metadata },\n });\n}\n\nexport async function _updateMessageDeserialize(\n result: PathUncheckedResponse,\n): Promise<ThreadMessage> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return threadMessageDeserializer(result.body);\n}\n\n/** Modifies an existing message on an existing thread. */\nexport async function updateMessage(\n context: Client,\n threadId: string,\n messageId: string,\n options: MessagesUpdateMessageOptionalParams = { requestOptions: {} },\n): Promise<ThreadMessage> {\n const result = await _updateMessageSend(context, threadId, messageId, options);\n return _updateMessageDeserialize(result);\n}\n\nexport function _getMessageSend(\n context: Client,\n threadId: string,\n messageId: string,\n options: MessagesGetMessageOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/messages/{messageId}{?api%2Dversion}\",\n {\n threadId: threadId,\n messageId: messageId,\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 _getMessageDeserialize(\n result: PathUncheckedResponse,\n): Promise<ThreadMessage> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return threadMessageDeserializer(result.body);\n}\n\n/** Retrieves an existing message. */\nexport async function getMessage(\n context: Client,\n threadId: string,\n messageId: string,\n options: MessagesGetMessageOptionalParams = { requestOptions: {} },\n): Promise<ThreadMessage> {\n const result = await _getMessageSend(context, threadId, messageId, options);\n return _getMessageDeserialize(result);\n}\n\nexport function _listMessagesSend(\n context: Client,\n threadId: string,\n options: MessagesListMessagesOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/messages{?run_id,api%2Dversion,limit,order,after,before}\",\n {\n threadId: threadId,\n run_id: options?.runId,\n \"api%2Dversion\": context.apiVersion,\n limit: options?.limit,\n order: options?.order,\n after: options?.after,\n before: options?.before,\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 _listMessagesDeserialize(\n result: PathUncheckedResponse,\n): Promise<_AgentsPagedResultThreadMessage> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _agentsPagedResultThreadMessageDeserializer(result.body);\n}\n\n/** Gets a list of messages that exist on a thread. */\nexport function listMessages(\n context: Client,\n threadId: string,\n options: MessagesListMessagesOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<ThreadMessage> {\n return buildPagedAsyncIterator(\n context,\n () => _listMessagesSend(context, threadId, options),\n _listMessagesDeserialize,\n [\"200\"],\n { itemName: \"data\" },\n );\n}\n\nexport function _createMessageSend(\n context: Client,\n threadId: string,\n role: MessageRole,\n content: MessageInputContent,\n options: MessagesCreateMessageOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/messages{?api%2Dversion}\",\n {\n threadId: threadId,\n \"api%2Dversion\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: {\n role: role,\n content: messageInputContentSerializer(content),\n attachments: !options?.attachments\n ? options?.attachments\n : messageAttachmentArraySerializer(options?.attachments),\n metadata: options?.metadata,\n },\n });\n}\n\nexport async function _createMessageDeserialize(\n result: PathUncheckedResponse,\n): Promise<ThreadMessage> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return threadMessageDeserializer(result.body);\n}\n\n/** Creates a new message on a specified thread. */\nexport async function createMessage(\n context: Client,\n threadId: string,\n role: MessageRole,\n content: MessageInputContent,\n options: MessagesCreateMessageOptionalParams = { requestOptions: {} },\n): Promise<ThreadMessage> {\n const result = await _createMessageSend(context, threadId, role, content, options);\n return _createMessageDeserialize(result);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/messages/operations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EACL,wBAAwB,EAGxB,6BAA6B,EAC7B,gCAAgC,EAEhC,yBAAyB,EAEzB,2CAA2C,GAC5C,MAAM,wBAAwB,CAAC;AAOhC,OAAO,EAEL,uBAAuB,GACxB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAGL,eAAe,EACf,mCAAmC,GACpC,MAAM,yBAAyB,CAAC;AAEjC,MAAM,UAAU,kBAAkB,CAChC,OAAe,EACf,QAAgB,EAChB,SAAiB,EACjB,UAA+C,EAAE,cAAc,EAAE,EAAE,EAAE;;IAErE,MAAM,IAAI,GAAG,iBAAiB,CAC5B,0DAA0D,EAC1D;QACE,QAAQ,EAAE,QAAQ;QAClB,SAAS,EAAE,SAAS;QACpB,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,IAAI,iCACzB,mCAAmC,CAAC,OAAO,CAAC,KAC/C,WAAW,EAAE,kBAAkB,EAC/B,OAAO,k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M,CAAC,IAAI,CAAC,CAAC;AAChD,CAAC;AAED,mDAAmD;AACnD,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAAe,EACf,QAAgB,EAChB,IAAiB,EACjB,OAA4B,EAC5B,UAA+C,EAAE,cAAc,EAAE,EAAE,EAAE;IAErE,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACnF,OAAO,yBAAyB,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AgentsContext as Client } from \"../index.js\";\nimport {\n agentV1ErrorDeserializer,\n MessageRole,\n MessageInputContent,\n messageInputContentSerializer,\n messageAttachmentArraySerializer,\n ThreadMessage,\n threadMessageDeserializer,\n _AgentsPagedResultThreadMessage,\n _agentsPagedResultThreadMessageDeserializer,\n} from \"../../models/models.js\";\nimport {\n MessagesUpdateMessageOptionalParams,\n MessagesGetMessageOptionalParams,\n MessagesListMessagesOptionalParams,\n MessagesCreateMessageOptionalParams,\n} from \"./options.js\";\nimport {\n PagedAsyncIterableIterator,\n buildPagedAsyncIterator,\n} from \"../../static-helpers/pagingHelpers.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\n\nexport function _updateMessageSend(\n context: Client,\n threadId: string,\n messageId: string,\n options: MessagesUpdateMessageOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/messages/{messageId}{?api%2Dversion}\",\n {\n threadId: threadId,\n messageId: messageId,\n \"api%2Dversion\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: { metadata: options?.metadata },\n });\n}\n\nexport async function _updateMessageDeserialize(\n result: PathUncheckedResponse,\n): Promise<ThreadMessage> {\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 threadMessageDeserializer(result.body);\n}\n\n/** Modifies an existing message on an existing thread. */\nexport async function updateMessage(\n context: Client,\n threadId: string,\n messageId: string,\n options: MessagesUpdateMessageOptionalParams = { requestOptions: {} },\n): Promise<ThreadMessage> {\n const result = await _updateMessageSend(context, threadId, messageId, options);\n return _updateMessageDeserialize(result);\n}\n\nexport function _getMessageSend(\n context: Client,\n threadId: string,\n messageId: string,\n options: MessagesGetMessageOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/messages/{messageId}{?api%2Dversion}\",\n {\n threadId: threadId,\n messageId: messageId,\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 _getMessageDeserialize(\n result: PathUncheckedResponse,\n): Promise<ThreadMessage> {\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 threadMessageDeserializer(result.body);\n}\n\n/** Retrieves an existing message. */\nexport async function getMessage(\n context: Client,\n threadId: string,\n messageId: string,\n options: MessagesGetMessageOptionalParams = { requestOptions: {} },\n): Promise<ThreadMessage> {\n const result = await _getMessageSend(context, threadId, messageId, options);\n return _getMessageDeserialize(result);\n}\n\nexport function _listMessagesSend(\n context: Client,\n threadId: string,\n options: MessagesListMessagesOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/messages{?run_id,api%2Dversion,limit,order,after,before}\",\n {\n threadId: threadId,\n run_id: options?.runId,\n \"api%2Dversion\": context.apiVersion,\n limit: options?.limit,\n order: options?.order,\n after: options?.after,\n before: options?.before,\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 _listMessagesDeserialize(\n result: PathUncheckedResponse,\n): Promise<_AgentsPagedResultThreadMessage> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _agentsPagedResultThreadMessageDeserializer(result.body);\n}\n\n/** Gets a list of messages that exist on a thread. */\nexport function listMessages(\n context: Client,\n threadId: string,\n options: MessagesListMessagesOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<ThreadMessage> {\n return buildPagedAsyncIterator(\n context,\n () => _listMessagesSend(context, threadId, options),\n _listMessagesDeserialize,\n [\"200\"],\n { itemName: \"data\" },\n );\n}\n\nexport function _createMessageSend(\n context: Client,\n threadId: string,\n role: MessageRole,\n content: MessageInputContent,\n options: MessagesCreateMessageOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/threads/{threadId}/messages{?api%2Dversion}\",\n {\n threadId: threadId,\n \"api%2Dversion\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: {\n role: role,\n content: messageInputContentSerializer(content),\n attachments: !options?.attachments\n ? options?.attachments\n : messageAttachmentArraySerializer(options?.attachments),\n metadata: options?.metadata,\n },\n });\n}\n\nexport async function _createMessageDeserialize(\n result: PathUncheckedResponse,\n): Promise<ThreadMessage> {\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 threadMessageDeserializer(result.body);\n}\n\n/** Creates a new message on a specified thread. */\nexport async function createMessage(\n context: Client,\n threadId: string,\n role: MessageRole,\n content: MessageInputContent,\n options: MessagesCreateMessageOptionalParams = { requestOptions: {} },\n): Promise<ThreadMessage> {\n const result = await _createMessageSend(context, threadId, role, content, options);\n return _createMessageDeserialize(result);\n}\n"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { AgentsContext as Client } from "./index.js";
|
|
2
|
-
import { Agent, _AgentsPagedResultAgent, AgentDeletionStatus, ThreadRun
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import type { AgentsContext as Client } from "./index.js";
|
|
2
|
+
import type { Agent, _AgentsPagedResultAgent, AgentDeletionStatus, ThreadRun } from "../models/models.js";
|
|
3
|
+
import { ToolOutput } from "../models/models.js";
|
|
4
|
+
import type { CreateThreadAndRunOptionalParams, DeleteAgentOptionalParams, UpdateAgentOptionalParams, GetAgentOptionalParams, ListAgentsOptionalParams, CreateAgentOptionalParams } from "./options.js";
|
|
5
|
+
import type { PagedAsyncIterableIterator } from "../static-helpers/pagingHelpers.js";
|
|
6
|
+
import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
7
|
+
import type { AgentEventMessageStream, AgentRunResponse } from "../models/streamingModels.js";
|
|
7
8
|
import type { RunsCreateRunOptionalParams, RunsSubmitToolOutputsToRunOptionalParams } from "./runs/options.js";
|
|
8
9
|
export declare function _createThreadAndRunSend(context: Client, assistantId: string, options?: CreateThreadAndRunOptionalParams): StreamableMethod;
|
|
9
10
|
export declare function _createThreadAndRunDeserialize(result: PathUncheckedResponse): Promise<ThreadRun>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../src/api/operations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../src/api/operations.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EACV,KAAK,EACL,uBAAuB,EACvB,mBAAmB,EACnB,SAAS,EACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAgBL,UAAU,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,gCAAgC,EAChC,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAGrF,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEvF,OAAO,KAAK,EAEV,uBAAuB,EAEvB,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EACV,2BAA2B,EAC3B,wCAAwC,EACzC,MAAM,mBAAmB,CAAC;AAQ3B,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,gCAAyD,GACjE,gBAAgB,CA8ClB;AAED,wBAAsB,8BAA8B,CAClD,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,SAAS,CAAC,CASpB;AAED,qFAAqF;AACrF,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,gCAAyD,GACjE,gBAAgB,CAclB;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,OAAO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