@azure/ai-projects 1.0.0-beta.2 → 1.0.0-beta.4
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/LICENSE +4 -4
- package/README.md +270 -186
- package/dist/browser/agents/assistants.d.ts.map +1 -1
- package/dist/browser/agents/assistants.js +4 -2
- package/dist/browser/agents/assistants.js.map +1 -1
- package/dist/browser/agents/customModels.d.ts +4 -29
- package/dist/browser/agents/customModels.d.ts.map +1 -1
- package/dist/browser/agents/customModels.js.map +1 -1
- package/dist/browser/agents/files.d.ts +5 -4
- package/dist/browser/agents/files.d.ts.map +1 -1
- package/dist/browser/agents/files.js +55 -27
- package/dist/browser/agents/files.js.map +1 -1
- package/dist/browser/agents/index.d.ts +10 -10
- package/dist/browser/agents/index.d.ts.map +1 -1
- package/dist/browser/agents/index.js.map +1 -1
- package/dist/browser/agents/inputOutputs.d.ts +3 -3
- package/dist/browser/agents/inputOutputs.d.ts.map +1 -1
- package/dist/browser/agents/inputOutputs.js.map +1 -1
- package/dist/browser/agents/inputValidations.d.ts.map +1 -1
- package/dist/browser/agents/inputValidations.js +3 -2
- package/dist/browser/agents/inputValidations.js.map +1 -1
- package/dist/browser/agents/messages.js +2 -2
- package/dist/browser/agents/messages.js.map +1 -1
- package/dist/browser/agents/poller.d.ts +8 -33
- package/dist/browser/agents/poller.d.ts.map +1 -1
- package/dist/browser/agents/poller.js +130 -53
- package/dist/browser/agents/poller.js.map +1 -1
- package/dist/browser/agents/streamingModels.d.ts +17 -15
- package/dist/browser/agents/streamingModels.d.ts.map +1 -1
- package/dist/browser/agents/streamingModels.js.map +1 -1
- package/dist/browser/agents/traceUtility.d.ts +3 -3
- package/dist/browser/agents/traceUtility.d.ts.map +1 -1
- package/dist/browser/agents/traceUtility.js.map +1 -1
- package/dist/browser/agents/utils.d.ts +72 -4
- package/dist/browser/agents/utils.d.ts.map +1 -1
- package/dist/browser/agents/utils.js +100 -3
- package/dist/browser/agents/utils.js.map +1 -1
- package/dist/browser/agents/vectorStores.d.ts +3 -4
- package/dist/browser/agents/vectorStores.d.ts.map +1 -1
- package/dist/browser/agents/vectorStores.js +44 -26
- package/dist/browser/agents/vectorStores.js.map +1 -1
- package/dist/browser/agents/vectorStoresFileBatches.d.ts +5 -4
- package/dist/browser/agents/vectorStoresFileBatches.d.ts.map +1 -1
- package/dist/browser/agents/vectorStoresFileBatches.js +46 -32
- package/dist/browser/agents/vectorStoresFileBatches.js.map +1 -1
- package/dist/browser/agents/vectorStoresFiles.d.ts +4 -4
- package/dist/browser/agents/vectorStoresFiles.d.ts.map +1 -1
- package/dist/browser/agents/vectorStoresFiles.js +57 -28
- package/dist/browser/agents/vectorStoresFiles.js.map +1 -1
- package/dist/browser/constants.d.ts +1 -1
- package/dist/browser/constants.js +1 -1
- package/dist/browser/constants.js.map +1 -1
- package/dist/browser/customization/convertModelsToWrite.d.ts.map +1 -1
- package/dist/browser/customization/convertModelsToWrite.js +43 -94
- package/dist/browser/customization/convertModelsToWrite.js.map +1 -1
- package/dist/browser/customization/convertOutputModelsFromWire.d.ts.map +1 -1
- package/dist/browser/customization/convertOutputModelsFromWire.js +53 -11
- package/dist/browser/customization/convertOutputModelsFromWire.js.map +1 -1
- package/dist/browser/customization/convertParametersToWire.d.ts +1 -1
- package/dist/browser/customization/convertParametersToWire.d.ts.map +1 -1
- package/dist/browser/customization/convertParametersToWire.js.map +1 -1
- package/dist/browser/customization/models.d.ts +146 -151
- package/dist/browser/customization/models.d.ts.map +1 -1
- package/dist/browser/customization/models.js.map +1 -1
- package/dist/browser/customization/outputModels.d.ts +188 -37
- package/dist/browser/customization/outputModels.d.ts.map +1 -1
- package/dist/browser/customization/outputModels.js.map +1 -1
- package/dist/browser/customization/streamingModels.d.ts +2 -1
- package/dist/browser/customization/streamingModels.d.ts.map +1 -1
- package/dist/browser/customization/streamingModels.js.map +1 -1
- package/dist/browser/customization/streamingWireModels.d.ts +2 -1
- package/dist/browser/customization/streamingWireModels.d.ts.map +1 -1
- package/dist/browser/customization/streamingWireModels.js.map +1 -1
- package/dist/browser/generated/src/clientDefinitions.d.ts +3 -3
- package/dist/browser/generated/src/clientDefinitions.d.ts.map +1 -1
- package/dist/browser/generated/src/clientDefinitions.js.map +1 -1
- package/dist/browser/generated/src/isUnexpected.d.ts +1 -1
- package/dist/browser/generated/src/isUnexpected.d.ts.map +1 -1
- package/dist/browser/generated/src/isUnexpected.js.map +1 -1
- package/dist/browser/generated/src/models.d.ts +191 -157
- package/dist/browser/generated/src/models.d.ts.map +1 -1
- package/dist/browser/generated/src/models.js.map +1 -1
- package/dist/browser/generated/src/outputModels.d.ts +277 -47
- package/dist/browser/generated/src/outputModels.d.ts.map +1 -1
- package/dist/browser/generated/src/outputModels.js.map +1 -1
- package/dist/browser/generated/src/paginateHelper.d.ts +28 -3
- package/dist/browser/generated/src/paginateHelper.d.ts.map +1 -1
- package/dist/browser/generated/src/paginateHelper.js +99 -2
- package/dist/browser/generated/src/paginateHelper.js.map +1 -1
- package/dist/browser/generated/src/parameters.d.ts +67 -10
- package/dist/browser/generated/src/parameters.d.ts.map +1 -1
- package/dist/browser/generated/src/parameters.js.map +1 -1
- package/dist/browser/generated/src/projectsClient.d.ts +5 -5
- package/dist/browser/generated/src/projectsClient.d.ts.map +1 -1
- package/dist/browser/generated/src/projectsClient.js +3 -3
- package/dist/browser/generated/src/projectsClient.js.map +1 -1
- package/dist/browser/generated/src/responses.d.ts +5 -4
- package/dist/browser/generated/src/responses.d.ts.map +1 -1
- package/dist/browser/generated/src/responses.js.map +1 -1
- package/dist/commonjs/agents/assistants.d.ts.map +1 -1
- package/dist/commonjs/agents/assistants.js +4 -2
- package/dist/commonjs/agents/assistants.js.map +1 -1
- package/dist/commonjs/agents/customModels.d.ts +4 -29
- package/dist/commonjs/agents/customModels.d.ts.map +1 -1
- package/dist/commonjs/agents/customModels.js.map +1 -1
- package/dist/commonjs/agents/files.d.ts +5 -4
- package/dist/commonjs/agents/files.d.ts.map +1 -1
- package/dist/commonjs/agents/files.js +55 -26
- package/dist/commonjs/agents/files.js.map +1 -1
- package/dist/commonjs/agents/index.d.ts +10 -10
- package/dist/commonjs/agents/index.d.ts.map +1 -1
- package/dist/commonjs/agents/index.js.map +1 -1
- package/dist/commonjs/agents/inputOutputs.d.ts +3 -3
- package/dist/commonjs/agents/inputOutputs.d.ts.map +1 -1
- package/dist/commonjs/agents/inputOutputs.js.map +1 -1
- package/dist/commonjs/agents/inputValidations.d.ts.map +1 -1
- package/dist/commonjs/agents/inputValidations.js +3 -2
- package/dist/commonjs/agents/inputValidations.js.map +1 -1
- package/dist/commonjs/agents/messages.js +2 -2
- package/dist/commonjs/agents/messages.js.map +1 -1
- package/dist/commonjs/agents/poller.d.ts +8 -33
- package/dist/commonjs/agents/poller.d.ts.map +1 -1
- package/dist/commonjs/agents/poller.js +131 -55
- package/dist/commonjs/agents/poller.js.map +1 -1
- package/dist/commonjs/agents/streamingModels.d.ts +17 -15
- package/dist/commonjs/agents/streamingModels.d.ts.map +1 -1
- package/dist/commonjs/agents/streamingModels.js.map +1 -1
- package/dist/commonjs/agents/traceUtility.d.ts +3 -3
- package/dist/commonjs/agents/traceUtility.d.ts.map +1 -1
- package/dist/commonjs/agents/traceUtility.js.map +1 -1
- package/dist/commonjs/agents/utils.d.ts +72 -4
- package/dist/commonjs/agents/utils.d.ts.map +1 -1
- package/dist/commonjs/agents/utils.js +100 -3
- package/dist/commonjs/agents/utils.js.map +1 -1
- package/dist/commonjs/agents/vectorStores.d.ts +3 -4
- package/dist/commonjs/agents/vectorStores.d.ts.map +1 -1
- package/dist/commonjs/agents/vectorStores.js +43 -25
- package/dist/commonjs/agents/vectorStores.js.map +1 -1
- package/dist/commonjs/agents/vectorStoresFileBatches.d.ts +5 -4
- package/dist/commonjs/agents/vectorStoresFileBatches.d.ts.map +1 -1
- package/dist/commonjs/agents/vectorStoresFileBatches.js +46 -31
- package/dist/commonjs/agents/vectorStoresFileBatches.js.map +1 -1
- package/dist/commonjs/agents/vectorStoresFiles.d.ts +4 -4
- package/dist/commonjs/agents/vectorStoresFiles.d.ts.map +1 -1
- package/dist/commonjs/agents/vectorStoresFiles.js +56 -27
- package/dist/commonjs/agents/vectorStoresFiles.js.map +1 -1
- package/dist/commonjs/constants.d.ts +1 -1
- package/dist/commonjs/constants.js +1 -1
- package/dist/commonjs/constants.js.map +1 -1
- package/dist/commonjs/customization/convertModelsToWrite.d.ts.map +1 -1
- package/dist/commonjs/customization/convertModelsToWrite.js +43 -94
- package/dist/commonjs/customization/convertModelsToWrite.js.map +1 -1
- package/dist/commonjs/customization/convertOutputModelsFromWire.d.ts.map +1 -1
- package/dist/commonjs/customization/convertOutputModelsFromWire.js +53 -11
- package/dist/commonjs/customization/convertOutputModelsFromWire.js.map +1 -1
- package/dist/commonjs/customization/convertParametersToWire.d.ts +1 -1
- package/dist/commonjs/customization/convertParametersToWire.d.ts.map +1 -1
- package/dist/commonjs/customization/convertParametersToWire.js.map +1 -1
- package/dist/commonjs/customization/models.d.ts +146 -151
- package/dist/commonjs/customization/models.d.ts.map +1 -1
- package/dist/commonjs/customization/models.js.map +1 -1
- package/dist/commonjs/customization/outputModels.d.ts +188 -37
- package/dist/commonjs/customization/outputModels.d.ts.map +1 -1
- package/dist/commonjs/customization/outputModels.js.map +1 -1
- package/dist/commonjs/customization/streamingModels.d.ts +2 -1
- package/dist/commonjs/customization/streamingModels.d.ts.map +1 -1
- package/dist/commonjs/customization/streamingModels.js.map +1 -1
- package/dist/commonjs/customization/streamingWireModels.d.ts +2 -1
- package/dist/commonjs/customization/streamingWireModels.d.ts.map +1 -1
- package/dist/commonjs/customization/streamingWireModels.js.map +1 -1
- package/dist/commonjs/generated/src/clientDefinitions.d.ts +3 -3
- package/dist/commonjs/generated/src/clientDefinitions.d.ts.map +1 -1
- package/dist/commonjs/generated/src/clientDefinitions.js.map +1 -1
- package/dist/commonjs/generated/src/isUnexpected.d.ts +1 -1
- package/dist/commonjs/generated/src/isUnexpected.d.ts.map +1 -1
- package/dist/commonjs/generated/src/isUnexpected.js.map +1 -1
- package/dist/commonjs/generated/src/models.d.ts +191 -157
- package/dist/commonjs/generated/src/models.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models.js.map +1 -1
- package/dist/commonjs/generated/src/outputModels.d.ts +277 -47
- package/dist/commonjs/generated/src/outputModels.d.ts.map +1 -1
- package/dist/commonjs/generated/src/outputModels.js.map +1 -1
- package/dist/commonjs/generated/src/paginateHelper.d.ts +28 -3
- package/dist/commonjs/generated/src/paginateHelper.d.ts.map +1 -1
- package/dist/commonjs/generated/src/paginateHelper.js +99 -2
- package/dist/commonjs/generated/src/paginateHelper.js.map +1 -1
- package/dist/commonjs/generated/src/parameters.d.ts +67 -10
- package/dist/commonjs/generated/src/parameters.d.ts.map +1 -1
- package/dist/commonjs/generated/src/parameters.js.map +1 -1
- package/dist/commonjs/generated/src/projectsClient.d.ts +5 -5
- package/dist/commonjs/generated/src/projectsClient.d.ts.map +1 -1
- package/dist/commonjs/generated/src/projectsClient.js +3 -3
- package/dist/commonjs/generated/src/projectsClient.js.map +1 -1
- package/dist/commonjs/generated/src/responses.d.ts +5 -4
- package/dist/commonjs/generated/src/responses.d.ts.map +1 -1
- package/dist/commonjs/generated/src/responses.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/esm/agents/assistants.d.ts.map +1 -1
- package/dist/esm/agents/assistants.js +4 -2
- package/dist/esm/agents/assistants.js.map +1 -1
- package/dist/esm/agents/customModels.d.ts +4 -29
- package/dist/esm/agents/customModels.d.ts.map +1 -1
- package/dist/esm/agents/customModels.js.map +1 -1
- package/dist/esm/agents/files.d.ts +5 -4
- package/dist/esm/agents/files.d.ts.map +1 -1
- package/dist/esm/agents/files.js +55 -27
- package/dist/esm/agents/files.js.map +1 -1
- package/dist/esm/agents/index.d.ts +10 -10
- package/dist/esm/agents/index.d.ts.map +1 -1
- package/dist/esm/agents/index.js.map +1 -1
- package/dist/esm/agents/inputOutputs.d.ts +3 -3
- package/dist/esm/agents/inputOutputs.d.ts.map +1 -1
- package/dist/esm/agents/inputOutputs.js.map +1 -1
- package/dist/esm/agents/inputValidations.d.ts.map +1 -1
- package/dist/esm/agents/inputValidations.js +3 -2
- package/dist/esm/agents/inputValidations.js.map +1 -1
- package/dist/esm/agents/messages.js +2 -2
- package/dist/esm/agents/messages.js.map +1 -1
- package/dist/esm/agents/poller.d.ts +8 -33
- package/dist/esm/agents/poller.d.ts.map +1 -1
- package/dist/esm/agents/poller.js +130 -53
- package/dist/esm/agents/poller.js.map +1 -1
- package/dist/esm/agents/streamingModels.d.ts +17 -15
- package/dist/esm/agents/streamingModels.d.ts.map +1 -1
- package/dist/esm/agents/streamingModels.js.map +1 -1
- package/dist/esm/agents/traceUtility.d.ts +3 -3
- package/dist/esm/agents/traceUtility.d.ts.map +1 -1
- package/dist/esm/agents/traceUtility.js.map +1 -1
- package/dist/esm/agents/utils.d.ts +72 -4
- package/dist/esm/agents/utils.d.ts.map +1 -1
- package/dist/esm/agents/utils.js +100 -3
- package/dist/esm/agents/utils.js.map +1 -1
- package/dist/esm/agents/vectorStores.d.ts +3 -4
- package/dist/esm/agents/vectorStores.d.ts.map +1 -1
- package/dist/esm/agents/vectorStores.js +44 -26
- package/dist/esm/agents/vectorStores.js.map +1 -1
- package/dist/esm/agents/vectorStoresFileBatches.d.ts +5 -4
- package/dist/esm/agents/vectorStoresFileBatches.d.ts.map +1 -1
- package/dist/esm/agents/vectorStoresFileBatches.js +46 -32
- package/dist/esm/agents/vectorStoresFileBatches.js.map +1 -1
- package/dist/esm/agents/vectorStoresFiles.d.ts +4 -4
- package/dist/esm/agents/vectorStoresFiles.d.ts.map +1 -1
- package/dist/esm/agents/vectorStoresFiles.js +57 -28
- package/dist/esm/agents/vectorStoresFiles.js.map +1 -1
- package/dist/esm/constants.d.ts +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/customization/convertModelsToWrite.d.ts.map +1 -1
- package/dist/esm/customization/convertModelsToWrite.js +43 -94
- package/dist/esm/customization/convertModelsToWrite.js.map +1 -1
- package/dist/esm/customization/convertOutputModelsFromWire.d.ts.map +1 -1
- package/dist/esm/customization/convertOutputModelsFromWire.js +53 -11
- package/dist/esm/customization/convertOutputModelsFromWire.js.map +1 -1
- package/dist/esm/customization/convertParametersToWire.d.ts +1 -1
- package/dist/esm/customization/convertParametersToWire.d.ts.map +1 -1
- package/dist/esm/customization/convertParametersToWire.js.map +1 -1
- package/dist/esm/customization/models.d.ts +146 -151
- package/dist/esm/customization/models.d.ts.map +1 -1
- package/dist/esm/customization/models.js.map +1 -1
- package/dist/esm/customization/outputModels.d.ts +188 -37
- package/dist/esm/customization/outputModels.d.ts.map +1 -1
- package/dist/esm/customization/outputModels.js.map +1 -1
- package/dist/esm/customization/streamingModels.d.ts +2 -1
- package/dist/esm/customization/streamingModels.d.ts.map +1 -1
- package/dist/esm/customization/streamingModels.js.map +1 -1
- package/dist/esm/customization/streamingWireModels.d.ts +2 -1
- package/dist/esm/customization/streamingWireModels.d.ts.map +1 -1
- package/dist/esm/customization/streamingWireModels.js.map +1 -1
- package/dist/esm/generated/src/clientDefinitions.d.ts +3 -3
- package/dist/esm/generated/src/clientDefinitions.d.ts.map +1 -1
- package/dist/esm/generated/src/clientDefinitions.js.map +1 -1
- package/dist/esm/generated/src/isUnexpected.d.ts +1 -1
- package/dist/esm/generated/src/isUnexpected.d.ts.map +1 -1
- package/dist/esm/generated/src/isUnexpected.js.map +1 -1
- package/dist/esm/generated/src/models.d.ts +191 -157
- package/dist/esm/generated/src/models.d.ts.map +1 -1
- package/dist/esm/generated/src/models.js.map +1 -1
- package/dist/esm/generated/src/outputModels.d.ts +277 -47
- package/dist/esm/generated/src/outputModels.d.ts.map +1 -1
- package/dist/esm/generated/src/outputModels.js.map +1 -1
- package/dist/esm/generated/src/paginateHelper.d.ts +28 -3
- package/dist/esm/generated/src/paginateHelper.d.ts.map +1 -1
- package/dist/esm/generated/src/paginateHelper.js +99 -2
- package/dist/esm/generated/src/paginateHelper.js.map +1 -1
- package/dist/esm/generated/src/parameters.d.ts +67 -10
- package/dist/esm/generated/src/parameters.d.ts.map +1 -1
- package/dist/esm/generated/src/parameters.js.map +1 -1
- package/dist/esm/generated/src/projectsClient.d.ts +5 -5
- package/dist/esm/generated/src/projectsClient.d.ts.map +1 -1
- package/dist/esm/generated/src/projectsClient.js +3 -3
- package/dist/esm/generated/src/projectsClient.js.map +1 -1
- package/dist/esm/generated/src/responses.d.ts +5 -4
- package/dist/esm/generated/src/responses.d.ts.map +1 -1
- package/dist/esm/generated/src/responses.js.map +1 -1
- package/dist/react-native/agents/assistants.d.ts.map +1 -1
- package/dist/react-native/agents/assistants.js +4 -2
- package/dist/react-native/agents/assistants.js.map +1 -1
- package/dist/react-native/agents/customModels.d.ts +4 -29
- package/dist/react-native/agents/customModels.d.ts.map +1 -1
- package/dist/react-native/agents/customModels.js.map +1 -1
- package/dist/react-native/agents/files.d.ts +5 -4
- package/dist/react-native/agents/files.d.ts.map +1 -1
- package/dist/react-native/agents/files.js +55 -27
- package/dist/react-native/agents/files.js.map +1 -1
- package/dist/react-native/agents/index.d.ts +10 -10
- package/dist/react-native/agents/index.d.ts.map +1 -1
- package/dist/react-native/agents/index.js.map +1 -1
- package/dist/react-native/agents/inputOutputs.d.ts +3 -3
- package/dist/react-native/agents/inputOutputs.d.ts.map +1 -1
- package/dist/react-native/agents/inputOutputs.js.map +1 -1
- package/dist/react-native/agents/inputValidations.d.ts.map +1 -1
- package/dist/react-native/agents/inputValidations.js +3 -2
- package/dist/react-native/agents/inputValidations.js.map +1 -1
- package/dist/react-native/agents/messages.js +2 -2
- package/dist/react-native/agents/messages.js.map +1 -1
- package/dist/react-native/agents/poller.d.ts +8 -33
- package/dist/react-native/agents/poller.d.ts.map +1 -1
- package/dist/react-native/agents/poller.js +130 -53
- package/dist/react-native/agents/poller.js.map +1 -1
- package/dist/react-native/agents/streamingModels.d.ts +17 -15
- package/dist/react-native/agents/streamingModels.d.ts.map +1 -1
- package/dist/react-native/agents/streamingModels.js.map +1 -1
- package/dist/react-native/agents/traceUtility.d.ts +3 -3
- package/dist/react-native/agents/traceUtility.d.ts.map +1 -1
- package/dist/react-native/agents/traceUtility.js.map +1 -1
- package/dist/react-native/agents/utils.d.ts +72 -4
- package/dist/react-native/agents/utils.d.ts.map +1 -1
- package/dist/react-native/agents/utils.js +100 -3
- package/dist/react-native/agents/utils.js.map +1 -1
- package/dist/react-native/agents/vectorStores.d.ts +3 -4
- package/dist/react-native/agents/vectorStores.d.ts.map +1 -1
- package/dist/react-native/agents/vectorStores.js +44 -26
- package/dist/react-native/agents/vectorStores.js.map +1 -1
- package/dist/react-native/agents/vectorStoresFileBatches.d.ts +5 -4
- package/dist/react-native/agents/vectorStoresFileBatches.d.ts.map +1 -1
- package/dist/react-native/agents/vectorStoresFileBatches.js +46 -32
- package/dist/react-native/agents/vectorStoresFileBatches.js.map +1 -1
- package/dist/react-native/agents/vectorStoresFiles.d.ts +4 -4
- package/dist/react-native/agents/vectorStoresFiles.d.ts.map +1 -1
- package/dist/react-native/agents/vectorStoresFiles.js +57 -28
- package/dist/react-native/agents/vectorStoresFiles.js.map +1 -1
- package/dist/react-native/constants.d.ts +1 -1
- package/dist/react-native/constants.js +1 -1
- package/dist/react-native/constants.js.map +1 -1
- package/dist/react-native/customization/convertModelsToWrite.d.ts.map +1 -1
- package/dist/react-native/customization/convertModelsToWrite.js +43 -94
- package/dist/react-native/customization/convertModelsToWrite.js.map +1 -1
- package/dist/react-native/customization/convertOutputModelsFromWire.d.ts.map +1 -1
- package/dist/react-native/customization/convertOutputModelsFromWire.js +53 -11
- package/dist/react-native/customization/convertOutputModelsFromWire.js.map +1 -1
- package/dist/react-native/customization/convertParametersToWire.d.ts +1 -1
- package/dist/react-native/customization/convertParametersToWire.d.ts.map +1 -1
- package/dist/react-native/customization/convertParametersToWire.js.map +1 -1
- package/dist/react-native/customization/models.d.ts +146 -151
- package/dist/react-native/customization/models.d.ts.map +1 -1
- package/dist/react-native/customization/models.js.map +1 -1
- package/dist/react-native/customization/outputModels.d.ts +188 -37
- package/dist/react-native/customization/outputModels.d.ts.map +1 -1
- package/dist/react-native/customization/outputModels.js.map +1 -1
- package/dist/react-native/customization/streamingModels.d.ts +2 -1
- package/dist/react-native/customization/streamingModels.d.ts.map +1 -1
- package/dist/react-native/customization/streamingModels.js.map +1 -1
- package/dist/react-native/customization/streamingWireModels.d.ts +2 -1
- package/dist/react-native/customization/streamingWireModels.d.ts.map +1 -1
- package/dist/react-native/customization/streamingWireModels.js.map +1 -1
- package/dist/react-native/generated/src/clientDefinitions.d.ts +3 -3
- package/dist/react-native/generated/src/clientDefinitions.d.ts.map +1 -1
- package/dist/react-native/generated/src/clientDefinitions.js.map +1 -1
- package/dist/react-native/generated/src/isUnexpected.d.ts +1 -1
- package/dist/react-native/generated/src/isUnexpected.d.ts.map +1 -1
- package/dist/react-native/generated/src/isUnexpected.js.map +1 -1
- package/dist/react-native/generated/src/models.d.ts +191 -157
- package/dist/react-native/generated/src/models.d.ts.map +1 -1
- package/dist/react-native/generated/src/models.js.map +1 -1
- package/dist/react-native/generated/src/outputModels.d.ts +277 -47
- package/dist/react-native/generated/src/outputModels.d.ts.map +1 -1
- package/dist/react-native/generated/src/outputModels.js.map +1 -1
- package/dist/react-native/generated/src/paginateHelper.d.ts +28 -3
- package/dist/react-native/generated/src/paginateHelper.d.ts.map +1 -1
- package/dist/react-native/generated/src/paginateHelper.js +99 -2
- package/dist/react-native/generated/src/paginateHelper.js.map +1 -1
- package/dist/react-native/generated/src/parameters.d.ts +67 -10
- package/dist/react-native/generated/src/parameters.d.ts.map +1 -1
- package/dist/react-native/generated/src/parameters.js.map +1 -1
- package/dist/react-native/generated/src/projectsClient.d.ts +5 -5
- package/dist/react-native/generated/src/projectsClient.d.ts.map +1 -1
- package/dist/react-native/generated/src/projectsClient.js +3 -3
- package/dist/react-native/generated/src/projectsClient.js.map +1 -1
- package/dist/react-native/generated/src/responses.d.ts +5 -4
- package/dist/react-native/generated/src/responses.d.ts.map +1 -1
- package/dist/react-native/generated/src/responses.js.map +1 -1
- package/package.json +33 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assistants.d.ts","sourceRoot":"","sources":["../../../src/agents/assistants.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EACV,yBAAyB,EACzB,WAAW,EACX,+BAA+B,EAChC,MAAM,kCAAkC,CAAC;AAU1C,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"assistants.d.ts","sourceRoot":"","sources":["../../../src/agents/assistants.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EACV,yBAAyB,EACzB,WAAW,EACX,+BAA+B,EAChC,MAAM,kCAAkC,CAAC;AAU1C,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,mBAAmB,CAAC;AAqB3B,2BAA2B;AAC3B,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,WAAW,CAAC,CAuBtB;AAED,0DAA0D;AAC1D,wBAAsB,UAAU,CAC9B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,+BAA+B,CAAC,CAoB1C;AAED,mCAAmC;AACnC,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,WAAW,CAAC,CA0BtB;AAED,kCAAkC;AAClC,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,WAAW,CAAC,CAyBtB;AAED,wBAAwB;AACxB,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,yBAAyB,CAAC,CAsBpC"}
|
|
@@ -16,9 +16,11 @@ var Tools;
|
|
|
16
16
|
Tools["FileSearch"] = "file_search";
|
|
17
17
|
Tools["Function"] = "function";
|
|
18
18
|
Tools["BingGrounding"] = "bing_grounding";
|
|
19
|
-
Tools["MicrosoftFabric"] = "
|
|
19
|
+
Tools["MicrosoftFabric"] = "fabric_dataagent";
|
|
20
20
|
Tools["SharepointGrounding"] = "sharepoint_grounding";
|
|
21
21
|
Tools["AzureAISearch"] = "azure_ai_search";
|
|
22
|
+
Tools["OpenApi"] = "openapi";
|
|
23
|
+
Tools["AzureFunction"] = "azure_function";
|
|
22
24
|
})(Tools || (Tools = {}));
|
|
23
25
|
/** Creates a new agent. */
|
|
24
26
|
export async function createAgent(context, model, options = {}) {
|
|
@@ -95,7 +97,7 @@ function validateCreateAgentParameters(options) {
|
|
|
95
97
|
var _a;
|
|
96
98
|
if (options.body.tools) {
|
|
97
99
|
if (options.body.tools.some((value) => !Object.values(Tools).includes(value.type))) {
|
|
98
|
-
throw new Error("Tool type must be one of 'code_interpreter', 'file_search', 'function', 'bing_grounding', '
|
|
100
|
+
throw new Error("Tool type must be one of 'code_interpreter', 'file_search', 'function', 'bing_grounding', 'fabric_dataagent', 'sharepoint_grounding', 'azure_ai_search', 'azure_function'");
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
103
|
if (options.body.tool_resources) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assistants.js","sourceRoot":"","sources":["../../../src/agents/assistants.ts"],"names":[],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,EAAE,CAAC;QACpC,aAAa,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,aAAa,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,WAAmB;IAC9C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC;AAED,SAAS,6BAA6B,CACpC,WAAmB,EACnB,OAAmD;IAEnD,mBAAmB,CAAC,WAAW,CAAC,CAAC;IACjC,IAAI,OAAO,EAAE,CAAC;QACZ,6BAA6B,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client } from \"@azure-rest/core-client\";\nimport { operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nimport type {\n AgentDeletionStatusOutput,\n AgentOutput,\n OpenAIPageableListOfAgentOutput,\n} from \"../customization/outputModels.js\";\nimport {\n validateLimit,\n validateMetadata,\n validateOrder,\n validateVectorStoreDataType,\n} from \"./inputValidations.js\";\nimport { TracingUtility } from \"../tracing.js\";\nimport { traceEndCreateOrUpdateAgent, traceStartCreateOrUpdateAgent } from \"./assistantsTrace.js\";\nimport { traceEndAgentGeneric, traceStartAgentGeneric } from \"./traceUtility.js\";\nimport type {\n CreateAgentOptionalParams,\n DeleteAgentOptionalParams,\n GetAgentOptionalParams,\n ListAgentsOptionalParams,\n UpdateAgentOptionalParams,\n} from \"./customModels.js\";\nimport type * as GeneratedParameters from \"../generated/src/parameters.js\";\nimport * as ConvertFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport * as ConverterToWire from \"../customization/convertModelsToWrite.js\";\nimport { convertToListQueryParameters } from \"../customization/convertParametersToWire.js\";\nimport { createOpenAIError } from \"./openAIError.js\";\n\nconst expectedStatuses = [\"200\"];\n\nenum Tools {\n CodeInterpreter = \"code_interpreter\",\n FileSearch = \"file_search\",\n Function = \"function\",\n BingGrounding = \"bing_grounding\",\n MicrosoftFabric = \"microsoft_fabric\",\n SharepointGrounding = \"sharepoint_grounding\",\n AzureAISearch = \"azure_ai_search\",\n}\n\n/** Creates a new agent. */\nexport async function createAgent(\n context: Client,\n model: string,\n options: CreateAgentOptionalParams = {},\n): Promise<AgentOutput> {\n const createOptions: GeneratedParameters.CreateAgentParameters = {\n ...operationOptionsToRequestParameters(options),\n body: {\n ...ConverterToWire.convertCreateAgentOptions({ ...options, model }),\n },\n };\n\n validateCreateAgentParameters(createOptions);\n const response = await TracingUtility.withSpan(\n \"CreateAgent\",\n createOptions,\n async (updatedOptions) => {\n const result = await context.path(\"/assistants\").post(updatedOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n traceStartCreateOrUpdateAgent,\n traceEndCreateOrUpdateAgent,\n );\n return ConvertFromWire.convertAgentOutput(response);\n}\n\n/** Gets a list of agents that were previously created. */\nexport async function listAgents(\n context: Client,\n options: ListAgentsOptionalParams = {},\n): Promise<OpenAIPageableListOfAgentOutput> {\n const listAgentsOptions: GeneratedParameters.ListAgentsParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: convertToListQueryParameters(options),\n };\n\n validateListAgentsParameters(listAgentsOptions);\n const response = await TracingUtility.withSpan(\n \"ListAgents\",\n listAgentsOptions || {},\n async (updateOptions) => {\n const result = await context.path(\"/assistants\").get(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n );\n\n return ConvertFromWire.convertOpenAIPageableListOfAgentOutput(response);\n}\n\n/** Retrieves an existing agent. */\nexport async function getAgent(\n context: Client,\n assistantId: string,\n options: GetAgentOptionalParams = {},\n): Promise<AgentOutput> {\n const getAgentOptions: GeneratedParameters.GetAgentParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateAssistantId(assistantId);\n const response = await TracingUtility.withSpan(\n \"GetAgent\",\n getAgentOptions,\n async (updateOptions) => {\n const result = await context\n .path(\"/assistants/{assistantId}\", assistantId)\n .get(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) =>\n traceStartAgentGeneric(span, {\n ...updatedOptions,\n tracingAttributeOptions: { agentId: assistantId },\n }),\n );\n\n return ConvertFromWire.convertAgentOutput(response);\n}\n\n/** Modifies an existing agent. */\nexport async function updateAgent(\n context: Client,\n assistantId: string,\n options: UpdateAgentOptionalParams = {},\n): Promise<AgentOutput> {\n const updateAgentOptions: GeneratedParameters.UpdateAgentParameters = {\n ...operationOptionsToRequestParameters(options),\n body: {\n ...ConverterToWire.convertUpdateAgentOptions(options),\n },\n };\n\n validateUpdateAgentParameters(assistantId, updateAgentOptions);\n const response = await TracingUtility.withSpan(\n \"UpdateAgent\",\n updateAgentOptions,\n async (updateOptions) => {\n const result = await context\n .path(\"/assistants/{assistantId}\", assistantId)\n .post(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) => traceStartCreateOrUpdateAgent(span, updatedOptions, assistantId),\n traceEndCreateOrUpdateAgent,\n );\n return ConvertFromWire.convertAgentOutput(response);\n}\n\n/** Deletes an agent. */\nexport async function deleteAgent(\n context: Client,\n assistantId: string,\n options: DeleteAgentOptionalParams = {},\n): Promise<AgentDeletionStatusOutput> {\n const deleteAgentOptions: GeneratedParameters.DeleteAgentParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateAssistantId(assistantId);\n const response = await TracingUtility.withSpan(\n \"DeleteAgent\",\n deleteAgentOptions,\n async (updateOptions) => {\n const result = await context\n .path(\"/assistants/{assistantId}\", assistantId)\n .delete(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n traceStartAgentGeneric,\n traceEndAgentGeneric,\n );\n return ConvertFromWire.convertAgentDeletionStatusOutput(response);\n}\n\nfunction validateCreateAgentParameters(\n options: GeneratedParameters.CreateAgentParameters | GeneratedParameters.UpdateAgentParameters,\n): void {\n if (options.body.tools) {\n if (options.body.tools.some((value) => !Object.values(Tools).includes(value.type as Tools))) {\n throw new Error(\n \"Tool type must be one of 'code_interpreter', 'file_search', 'function', 'bing_grounding', 'microsoft_fabric', 'sharepoint_grounding', 'azure_ai_search'\",\n );\n }\n }\n if (options.body.tool_resources) {\n if (options.body.tool_resources.code_interpreter) {\n if (\n options.body.tool_resources.code_interpreter.file_ids &&\n options.body.tool_resources.code_interpreter.data_sources\n ) {\n throw new Error(\"Only file_ids or data_sources can be provided, not both\");\n }\n if (\n options.body.tool_resources.code_interpreter.file_ids &&\n options.body.tool_resources.code_interpreter.file_ids.length > 20\n ) {\n throw new Error(\"A maximum of 20 file IDs are allowed\");\n }\n if (options.body.tool_resources.code_interpreter.data_sources) {\n validateVectorStoreDataType(options.body.tool_resources.code_interpreter.data_sources);\n }\n }\n if (options.body.tool_resources.file_search) {\n if (\n options.body.tool_resources.file_search.vector_store_ids &&\n options.body.tool_resources.file_search.vector_store_ids.length > 1\n ) {\n throw new Error(\"Only one vector store ID is allowed\");\n }\n if (options.body.tool_resources.file_search.vector_stores) {\n if (options.body.tool_resources.file_search.vector_stores.length > 1) {\n throw new Error(\"Only one vector store is allowed\");\n }\n validateVectorStoreDataType(\n options.body.tool_resources.file_search.vector_stores[0]?.configuration.data_sources,\n );\n }\n }\n if (options.body.tool_resources.azure_ai_search) {\n if (\n options.body.tool_resources.azure_ai_search.indexes &&\n options.body.tool_resources.azure_ai_search.indexes.length > 1\n ) {\n throw new Error(\"Only one index is allowed\");\n }\n }\n }\n if (options.body.temperature && (options.body.temperature < 0 || options.body.temperature > 2)) {\n throw new Error(\"Temperature must be between 0 and 2\");\n }\n if (options.body.metadata) {\n validateMetadata(options.body.metadata);\n }\n}\n\nfunction validateListAgentsParameters(options?: GeneratedParameters.ListAgentsParameters): void {\n if (options?.queryParameters?.limit) {\n validateLimit(options.queryParameters.limit);\n }\n if (options?.queryParameters?.order) {\n validateOrder(options.queryParameters.order);\n }\n}\n\nfunction validateAssistantId(assistantId: string): void {\n if (!assistantId) {\n throw new Error(\"Assistant ID is required\");\n }\n}\n\nfunction validateUpdateAgentParameters(\n assistantId: string,\n options?: GeneratedParameters.UpdateAgentParameters,\n): void {\n validateAssistantId(assistantId);\n if (options) {\n validateCreateAgentParameters(options);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"assistants.js","sourceRoot":"","sources":["../../../src/agents/assistants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAC;AAM9E,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAClG,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AASjF,OAAO,KAAK,eAAe,MAAM,iDAAiD,CAAC;AACnF,OAAO,KAAK,eAAe,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;AAEjC,IAAK,KAUJ;AAVD,WAAK,KAAK;IACR,6CAAoC,CAAA;IACpC,mCAA0B,CAAA;IAC1B,8BAAqB,CAAA;IACrB,yCAAgC,CAAA;IAChC,6C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,2BAA2B,CAAC,CAAC;YAC/C,CAAC;QACH,CAAC;IACH,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC;QAC/F,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC1B,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC;AAED,SAAS,4BAA4B,CAAC,OAAkD;;IACtF,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,aAAa,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,aAAa,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,WAAmB;IAC9C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC;AAED,SAAS,6BAA6B,CACpC,WAAmB,EACnB,OAAmD;IAEnD,mBAAmB,CAAC,WAAW,CAAC,CAAC;IACjC,IAAI,OAAO,EAAE,CAAC;QACZ,6BAA6B,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client } from \"@azure-rest/core-client\";\nimport { operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nimport type {\n AgentDeletionStatusOutput,\n AgentOutput,\n OpenAIPageableListOfAgentOutput,\n} from \"../customization/outputModels.js\";\nimport {\n validateLimit,\n validateMetadata,\n validateOrder,\n validateVectorStoreDataType,\n} from \"./inputValidations.js\";\nimport { TracingUtility } from \"../tracing.js\";\nimport { traceEndCreateOrUpdateAgent, traceStartCreateOrUpdateAgent } from \"./assistantsTrace.js\";\nimport { traceEndAgentGeneric, traceStartAgentGeneric } from \"./traceUtility.js\";\nimport type {\n CreateAgentOptionalParams,\n DeleteAgentOptionalParams,\n GetAgentOptionalParams,\n ListAgentsOptionalParams,\n UpdateAgentOptionalParams,\n} from \"./customModels.js\";\nimport type * as GeneratedParameters from \"../generated/src/parameters.js\";\nimport * as ConvertFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport * as ConverterToWire from \"../customization/convertModelsToWrite.js\";\nimport { convertToListQueryParameters } from \"../customization/convertParametersToWire.js\";\nimport { createOpenAIError } from \"./openAIError.js\";\n\nconst expectedStatuses = [\"200\"];\n\nenum Tools {\n CodeInterpreter = \"code_interpreter\",\n FileSearch = \"file_search\",\n Function = \"function\",\n BingGrounding = \"bing_grounding\",\n MicrosoftFabric = \"fabric_dataagent\",\n SharepointGrounding = \"sharepoint_grounding\",\n AzureAISearch = \"azure_ai_search\",\n OpenApi = \"openapi\",\n AzureFunction = \"azure_function\",\n}\n\n/** Creates a new agent. */\nexport async function createAgent(\n context: Client,\n model: string,\n options: CreateAgentOptionalParams = {},\n): Promise<AgentOutput> {\n const createOptions: GeneratedParameters.CreateAgentParameters = {\n ...operationOptionsToRequestParameters(options),\n body: {\n ...ConverterToWire.convertCreateAgentOptions({ ...options, model }),\n },\n };\n\n validateCreateAgentParameters(createOptions);\n const response = await TracingUtility.withSpan(\n \"CreateAgent\",\n createOptions,\n async (updatedOptions) => {\n const result = await context.path(\"/assistants\").post(updatedOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n traceStartCreateOrUpdateAgent,\n traceEndCreateOrUpdateAgent,\n );\n return ConvertFromWire.convertAgentOutput(response);\n}\n\n/** Gets a list of agents that were previously created. */\nexport async function listAgents(\n context: Client,\n options: ListAgentsOptionalParams = {},\n): Promise<OpenAIPageableListOfAgentOutput> {\n const listAgentsOptions: GeneratedParameters.ListAgentsParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: convertToListQueryParameters(options),\n };\n\n validateListAgentsParameters(listAgentsOptions);\n const response = await TracingUtility.withSpan(\n \"ListAgents\",\n listAgentsOptions || {},\n async (updateOptions) => {\n const result = await context.path(\"/assistants\").get(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n );\n\n return ConvertFromWire.convertOpenAIPageableListOfAgentOutput(response);\n}\n\n/** Retrieves an existing agent. */\nexport async function getAgent(\n context: Client,\n assistantId: string,\n options: GetAgentOptionalParams = {},\n): Promise<AgentOutput> {\n const getAgentOptions: GeneratedParameters.GetAgentParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateAssistantId(assistantId);\n const response = await TracingUtility.withSpan(\n \"GetAgent\",\n getAgentOptions,\n async (updateOptions) => {\n const result = await context\n .path(\"/assistants/{assistantId}\", assistantId)\n .get(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) =>\n traceStartAgentGeneric(span, {\n ...updatedOptions,\n tracingAttributeOptions: { agentId: assistantId },\n }),\n );\n\n return ConvertFromWire.convertAgentOutput(response);\n}\n\n/** Modifies an existing agent. */\nexport async function updateAgent(\n context: Client,\n assistantId: string,\n options: UpdateAgentOptionalParams = {},\n): Promise<AgentOutput> {\n const updateAgentOptions: GeneratedParameters.UpdateAgentParameters = {\n ...operationOptionsToRequestParameters(options),\n body: {\n ...ConverterToWire.convertUpdateAgentOptions(options),\n },\n };\n\n validateUpdateAgentParameters(assistantId, updateAgentOptions);\n const response = await TracingUtility.withSpan(\n \"UpdateAgent\",\n updateAgentOptions,\n async (updateOptions) => {\n const result = await context\n .path(\"/assistants/{assistantId}\", assistantId)\n .post(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n (span, updatedOptions) => traceStartCreateOrUpdateAgent(span, updatedOptions, assistantId),\n traceEndCreateOrUpdateAgent,\n );\n return ConvertFromWire.convertAgentOutput(response);\n}\n\n/** Deletes an agent. */\nexport async function deleteAgent(\n context: Client,\n assistantId: string,\n options: DeleteAgentOptionalParams = {},\n): Promise<AgentDeletionStatusOutput> {\n const deleteAgentOptions: GeneratedParameters.DeleteAgentParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateAssistantId(assistantId);\n const response = await TracingUtility.withSpan(\n \"DeleteAgent\",\n deleteAgentOptions,\n async (updateOptions) => {\n const result = await context\n .path(\"/assistants/{assistantId}\", assistantId)\n .delete(updateOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return result.body;\n },\n traceStartAgentGeneric,\n traceEndAgentGeneric,\n );\n return ConvertFromWire.convertAgentDeletionStatusOutput(response);\n}\n\nfunction validateCreateAgentParameters(\n options: GeneratedParameters.CreateAgentParameters | GeneratedParameters.UpdateAgentParameters,\n): void {\n if (options.body.tools) {\n if (options.body.tools.some((value) => !Object.values(Tools).includes(value.type as Tools))) {\n throw new Error(\n \"Tool type must be one of 'code_interpreter', 'file_search', 'function', 'bing_grounding', 'fabric_dataagent', 'sharepoint_grounding', 'azure_ai_search', 'azure_function'\",\n );\n }\n }\n if (options.body.tool_resources) {\n if (options.body.tool_resources.code_interpreter) {\n if (\n options.body.tool_resources.code_interpreter.file_ids &&\n options.body.tool_resources.code_interpreter.data_sources\n ) {\n throw new Error(\"Only file_ids or data_sources can be provided, not both\");\n }\n if (\n options.body.tool_resources.code_interpreter.file_ids &&\n options.body.tool_resources.code_interpreter.file_ids.length > 20\n ) {\n throw new Error(\"A maximum of 20 file IDs are allowed\");\n }\n if (options.body.tool_resources.code_interpreter.data_sources) {\n validateVectorStoreDataType(options.body.tool_resources.code_interpreter.data_sources);\n }\n }\n if (options.body.tool_resources.file_search) {\n if (\n options.body.tool_resources.file_search.vector_store_ids &&\n options.body.tool_resources.file_search.vector_store_ids.length > 1\n ) {\n throw new Error(\"Only one vector store ID is allowed\");\n }\n if (options.body.tool_resources.file_search.vector_stores) {\n if (options.body.tool_resources.file_search.vector_stores.length > 1) {\n throw new Error(\"Only one vector store is allowed\");\n }\n validateVectorStoreDataType(\n options.body.tool_resources.file_search.vector_stores[0]?.configuration.data_sources,\n );\n }\n }\n if (options.body.tool_resources.azure_ai_search) {\n if (\n options.body.tool_resources.azure_ai_search.indexes &&\n options.body.tool_resources.azure_ai_search.indexes.length > 1\n ) {\n throw new Error(\"Only one index is allowed\");\n }\n }\n }\n if (options.body.temperature && (options.body.temperature < 0 || options.body.temperature > 2)) {\n throw new Error(\"Temperature must be between 0 and 2\");\n }\n if (options.body.metadata) {\n validateMetadata(options.body.metadata);\n }\n}\n\nfunction validateListAgentsParameters(options?: GeneratedParameters.ListAgentsParameters): void {\n if (options?.queryParameters?.limit) {\n validateLimit(options.queryParameters.limit);\n }\n if (options?.queryParameters?.order) {\n validateOrder(options.queryParameters.order);\n }\n}\n\nfunction validateAssistantId(assistantId: string): void {\n if (!assistantId) {\n throw new Error(\"Assistant ID is required\");\n }\n}\n\nfunction validateUpdateAgentParameters(\n assistantId: string,\n options?: GeneratedParameters.UpdateAgentParameters,\n): void {\n validateAssistantId(assistantId);\n if (options) {\n validateCreateAgentParameters(options);\n }\n}\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { OperationOptions, RequestParameters } from "@azure-rest/core-client";
|
|
2
|
-
import type { AbortSignalLike } from "@azure/abort-controller";
|
|
3
2
|
import type { ThreadRunOutput } from "../customization/outputModels.js";
|
|
4
3
|
import type { AgentEventMessageStream } from "./streamingModels.js";
|
|
5
4
|
import type { AgentThreadCreationOptions, CreateAgentOptions, CreateAndRunThreadOptions, CreateRunOptions, UpdateAgentOptions, UpdateAgentThreadOptions, VectorStoreFileStatusFilter, VectorStoreOptions, VectorStoreUpdateOptions } from "../customization/models.js";
|
|
@@ -38,10 +37,6 @@ export interface PollingOptions {
|
|
|
38
37
|
* The interval, in milliseconds, to wait between polling attempts. If not specified, a default interval of 1000ms will be used.
|
|
39
38
|
*/
|
|
40
39
|
sleepIntervalInMs?: number;
|
|
41
|
-
/**
|
|
42
|
-
* An AbortSignalLike object (as defined by @azure/abort-controller) that can be used to cancel the polling operation.
|
|
43
|
-
*/
|
|
44
|
-
abortSignal?: AbortSignalLike;
|
|
45
40
|
}
|
|
46
41
|
/**
|
|
47
42
|
* Optional parameters configuring polling behavior.
|
|
@@ -149,12 +144,7 @@ export interface ListMessagesOptionalParams extends ListMessagesQueryParamProper
|
|
|
149
144
|
/**
|
|
150
145
|
* Optional parameters creating vector store.
|
|
151
146
|
*/
|
|
152
|
-
export interface CreateVectorStoreOptionalParams extends VectorStoreOptions, OperationOptions {
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Optional parameters for creating vector store with polling.
|
|
156
|
-
*/
|
|
157
|
-
export interface CreateVectorStoreWithPollingOptionalParams extends CreateVectorStoreOptionalParams, PollingOptionsParams {
|
|
147
|
+
export interface CreateVectorStoreOptionalParams extends VectorStoreOptions, OperationOptions, PollingOptionsParams {
|
|
158
148
|
}
|
|
159
149
|
/**
|
|
160
150
|
* Optional parameters for listing vector stores.
|
|
@@ -184,7 +174,7 @@ export interface ListVectorStoreFilesOptionalParams extends ListQueryParameters,
|
|
|
184
174
|
/**
|
|
185
175
|
* Optional parameters for creating a vector store file.
|
|
186
176
|
*/
|
|
187
|
-
export interface CreateVectorStoreFileOptionalParams extends CreateVectorStoreFileOptions, OperationOptions {
|
|
177
|
+
export interface CreateVectorStoreFileOptionalParams extends CreateVectorStoreFileOptions, OperationOptions, PollingOptionsParams {
|
|
188
178
|
}
|
|
189
179
|
/**
|
|
190
180
|
* Optional parameters for getting a vector store file.
|
|
@@ -196,11 +186,6 @@ export interface GetVectorStoreFileOptionalParams extends OperationOptions {
|
|
|
196
186
|
*/
|
|
197
187
|
export interface DeleteVectorStoreFileOptionalParams extends OperationOptions {
|
|
198
188
|
}
|
|
199
|
-
/**
|
|
200
|
-
* Optional parameters for creating a vector store file with polling.
|
|
201
|
-
*/
|
|
202
|
-
export interface CreateVectorStoreFileWithPollingOptionalParams extends CreateVectorStoreFileOptions, PollingOptionsParams, OperationOptions {
|
|
203
|
-
}
|
|
204
189
|
/**
|
|
205
190
|
* Optional parameters for listing vector store file batches.
|
|
206
191
|
*/
|
|
@@ -221,12 +206,7 @@ export interface CancelVectorStoreFileBatchOptionalParams extends OperationOptio
|
|
|
221
206
|
/**
|
|
222
207
|
* Optional parameters for creating a vector store file batch.
|
|
223
208
|
*/
|
|
224
|
-
export interface CreateVectorStoreFileBatchOptionalParams extends CreateVectorStoreFileBatchOptions, OperationOptions {
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Optional parameters for creating a vector store file batch with polling.
|
|
228
|
-
*/
|
|
229
|
-
export interface CreateVectorStoreFileBatchWithPollingOptionalParams extends CreateVectorStoreFileBatchOptionalParams, PollingOptionsParams {
|
|
209
|
+
export interface CreateVectorStoreFileBatchOptionalParams extends CreateVectorStoreFileBatchOptions, OperationOptions, PollingOptionsParams {
|
|
230
210
|
}
|
|
231
211
|
/**
|
|
232
212
|
* Optional parameters for creating agent.
|
|
@@ -276,13 +256,8 @@ export interface GetFileContentOptionalParams extends OperationOptions {
|
|
|
276
256
|
/**
|
|
277
257
|
* Optional parameters for uploading a file.
|
|
278
258
|
*/
|
|
279
|
-
export interface UploadFileOptionalParams extends OperationOptions {
|
|
259
|
+
export interface UploadFileOptionalParams extends OperationOptions, PollingOptionsParams {
|
|
280
260
|
/** The name of the file. */
|
|
281
261
|
fileName?: string;
|
|
282
262
|
}
|
|
283
|
-
/**
|
|
284
|
-
* Optional parameters for uploading a file with polling.
|
|
285
|
-
*/
|
|
286
|
-
export interface UploadFileWithPollingOptionalParams extends UploadFileOptionalParams, PollingOptionsParams {
|
|
287
|
-
}
|
|
288
263
|
//# sourceMappingURL=customModels.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customModels.d.ts","sourceRoot":"","sources":["../../../src/agents/customModels.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"customModels.d.ts","sourceRoot":"","sources":["../../../src/agents/customModels.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,KAAK,EACV,0BAA0B,EAC1B,kBAAkB,EAClB,yBAAyB,EACzB,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,EACxB,2BAA2B,EAC3B,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,gCAAgC,EAChC,6BAA6B,EAC9B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EACV,iCAAiC,EACjC,4BAA4B,EAC7B,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,iBAAiB,EACjB,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,gBAAgB,CACzD,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,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CAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions, RequestParameters } from \"@azure-rest/core-client\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { ThreadRunOutput } from \"../customization/outputModels.js\";\nimport type { AgentEventMessageStream } from \"./streamingModels.js\";\nimport type {\n AgentThreadCreationOptions,\n CreateAgentOptions,\n CreateAndRunThreadOptions,\n CreateRunOptions,\n UpdateAgentOptions,\n UpdateAgentThreadOptions,\n VectorStoreFileStatusFilter,\n VectorStoreOptions,\n VectorStoreUpdateOptions,\n} from \"../customization/models.js\";\nimport type {\n ListMessagesQueryParamProperties,\n ListFilesQueryParamProperties,\n} from \"../customization/parameters.js\";\nimport type {\n CreateVectorStoreFileBatchOptions,\n CreateVectorStoreFileOptions,\n} from \"./vectorStoresModels.js\";\n\n/**\n * Optional request parameters support passing headers, abort signal, etc.\n */\nexport type OptionalRequestParameters = Pick<\n RequestParameters,\n \"headers\" | \"timeout\" | \"abortSignal\" | \"tracingOptions\"\n>;\n\n/**\n * Request options for list requests.\n */\nexport interface ListQueryParameters {\n /**\n * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n */\n limit?: number;\n\n /**\n * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.\n */\n order?: \"asc\" | \"desc\";\n\n /**\n * A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.\n */\n after?: string;\n\n /**\n * A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.\n */\n before?: string;\n}\n\n/**\n * Options for configuring polling behavior.\n */\nexport interface PollingOptions {\n /**\n * The interval, in milliseconds, to wait between polling attempts. If not specified, a default interval of 1000ms will be used.\n */\n sleepIntervalInMs?: number;\n\n /**\n * An AbortSignalLike object (as defined by @azure/abort-controller) that can be used to cancel the polling operation.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Optional parameters configuring polling behavior.\n */\nexport interface PollingOptionsParams {\n /** Options for configuring polling behavior. */\n pollingOptions?: PollingOptions;\n}\n\n/**\n * Agent run response with support to stream.\n */\nexport type AgentRunResponse = PromiseLike<ThreadRunOutput> & {\n /**\n * Function to start streaming the agent event messages.\n * @returns A promise that resolves to an AgentEventMessageStream.\n */\n stream: () => Promise<AgentEventMessageStream>;\n};\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateRunOptionalParams = Omit<CreateRunOptions & OperationOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateAndRunThreadOptionalParams = Omit<CreateAndRunThreadOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for listing run queries.\n */\nexport interface ListRunQueryOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for getting a run.\n */\nexport interface GetRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a run.\n */\nexport interface CancelRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for submitting tool outputs to a run.\n */\nexport interface SubmitToolOutputsToRunOptionalParams extends OperationOptions {\n /**\n * Whether to stream the tool outputs.\n */\n stream?: boolean;\n}\n\n/**\n * Optional parameters for updating a run.\n */\nexport interface UpdateRunOptionalParams extends OperationOptions {\n /** Metadata to update in the run. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for creating an agent thread.\n */\nexport interface CreateAgentThreadOptionalParams\n extends AgentThreadCreationOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting an agent thread.\n */\nexport interface GetAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating an agent thread.\n */\nexport interface UpdateAgentThreadOptionalParams\n extends UpdateAgentThreadOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting an agent thread.\n */\nexport interface DeleteAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting an run step.\n */\nexport interface GetRunStepOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing run steps.\n */\nexport interface ListRunStepsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a message.\n */\nexport interface CreateMessageOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating a message.\n */\nexport interface UpdateMessageOptionalParams extends OperationOptions {\n /** Metadata to update in the message. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for listing messages.\n */\nexport interface ListMessagesOptionalParams\n extends ListMessagesQueryParamProperties,\n OperationOptions {}\n\n/**\n * Optional parameters creating vector store.\n */\nexport interface CreateVectorStoreOptionalParams extends VectorStoreOptions, OperationOptions {}\n\n/**\n * Optional parameters for creating vector store with polling.\n */\nexport interface CreateVectorStoreWithPollingOptionalParams\n extends CreateVectorStoreOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for listing vector stores.\n */\nexport interface ListVectorStoresOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for updating a vector store.\n */\nexport interface UpdateVectorStoreOptionalParams\n extends VectorStoreUpdateOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store.\n */\nexport interface DeleteVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store.\n */\nexport interface GetVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing vector store files.\n */\nexport interface ListVectorStoreFilesOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file.\n */\nexport interface CreateVectorStoreFileOptionalParams\n extends CreateVectorStoreFileOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store file.\n */\nexport interface GetVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store file.\n */\nexport interface DeleteVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file with polling.\n */\nexport interface CreateVectorStoreFileWithPollingOptionalParams\n extends CreateVectorStoreFileOptions,\n PollingOptionsParams,\n OperationOptions {}\n\n/**\n * Optional parameters for listing vector store file batches.\n */\nexport interface ListVectorStoreFileBatchFilesOptionalParams\n extends ListQueryParameters,\n OperationOptions {\n /** Filter by file status. */\n filter?: VectorStoreFileStatusFilter;\n}\n\n/**\n * Optional parameters for getting a vector store file batch.\n */\nexport interface GetVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a vector store file batch.\n */\nexport interface CancelVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch.\n */\nexport interface CreateVectorStoreFileBatchOptionalParams\n extends CreateVectorStoreFileBatchOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch with polling.\n */\nexport interface CreateVectorStoreFileBatchWithPollingOptionalParams\n extends CreateVectorStoreFileBatchOptionalParams,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for creating agent.\n */\nexport interface CreateAgentOptionalParams\n extends Omit<CreateAgentOptions, \"model\">,\n OperationOptions {}\n\n/**\n * Optional parameters for updating agent.\n */\nexport interface UpdateAgentOptionalParams extends UpdateAgentOptions, OperationOptions {}\n\n/**\n * Optional parameters for deleting agent.\n */\nexport interface DeleteAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting agent.\n */\nexport interface GetAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing agents.\n */\nexport interface ListAgentsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for listing files.\n */\nexport interface ListFilesOptionalParams extends ListFilesQueryParamProperties, OperationOptions {}\n\n/**\n * Optional parameters for deleting a file.\n */\nexport interface DeleteFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a file.\n */\nexport interface GetFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting file content.\n */\nexport interface GetFileContentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for uploading a file.\n */\nexport interface UploadFileOptionalParams extends OperationOptions {\n /** The name of the file. */\n fileName?: string;\n}\n\n/**\n * Optional parameters for uploading a file with polling.\n */\nexport interface UploadFileWithPollingOptionalParams\n extends UploadFileOptionalParams,\n PollingOptionsParams {}\n"]}
|
|
1
|
+
{"version":3,"file":"customModels.js","sourceRoot":"","sources":["../../../src/agents/customModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions, RequestParameters } from \"@azure-rest/core-client\";\nimport type { ThreadRunOutput } from \"../customization/outputModels.js\";\nimport type { AgentEventMessageStream } from \"./streamingModels.js\";\nimport type {\n AgentThreadCreationOptions,\n CreateAgentOptions,\n CreateAndRunThreadOptions,\n CreateRunOptions,\n UpdateAgentOptions,\n UpdateAgentThreadOptions,\n VectorStoreFileStatusFilter,\n VectorStoreOptions,\n VectorStoreUpdateOptions,\n} from \"../customization/models.js\";\nimport type {\n ListMessagesQueryParamProperties,\n ListFilesQueryParamProperties,\n} from \"../customization/parameters.js\";\nimport type {\n CreateVectorStoreFileBatchOptions,\n CreateVectorStoreFileOptions,\n} from \"./vectorStoresModels.js\";\n\n/**\n * Optional request parameters support passing headers, abort signal, etc.\n */\nexport type OptionalRequestParameters = Pick<\n RequestParameters,\n \"headers\" | \"timeout\" | \"abortSignal\" | \"tracingOptions\"\n>;\n\n/**\n * Request options for list requests.\n */\nexport interface ListQueryParameters {\n /**\n * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.\n */\n limit?: number;\n\n /**\n * Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.\n */\n order?: \"asc\" | \"desc\";\n\n /**\n * A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.\n */\n after?: string;\n\n /**\n * A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.\n */\n before?: string;\n}\n\n/**\n * Options for configuring polling behavior.\n */\nexport interface PollingOptions {\n /**\n * The interval, in milliseconds, to wait between polling attempts. If not specified, a default interval of 1000ms will be used.\n */\n sleepIntervalInMs?: number;\n}\n\n/**\n * Optional parameters configuring polling behavior.\n */\nexport interface PollingOptionsParams {\n /** Options for configuring polling behavior. */\n pollingOptions?: PollingOptions;\n}\n\n/**\n * Agent run response with support to stream.\n */\nexport type AgentRunResponse = PromiseLike<ThreadRunOutput> & {\n /**\n * Function to start streaming the agent event messages.\n * @returns A promise that resolves to an AgentEventMessageStream.\n */\n stream: () => Promise<AgentEventMessageStream>;\n};\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateRunOptionalParams = Omit<CreateRunOptions & OperationOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for creating and running a thread, excluding the assistantId.\n */\nexport type CreateAndRunThreadOptionalParams = Omit<CreateAndRunThreadOptions, \"assistantId\"> &\n OperationOptions;\n\n/**\n * Optional parameters for listing run queries.\n */\nexport interface ListRunQueryOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for getting a run.\n */\nexport interface GetRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a run.\n */\nexport interface CancelRunOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for submitting tool outputs to a run.\n */\nexport interface SubmitToolOutputsToRunOptionalParams extends OperationOptions {\n /**\n * Whether to stream the tool outputs.\n */\n stream?: boolean;\n}\n\n/**\n * Optional parameters for updating a run.\n */\nexport interface UpdateRunOptionalParams extends OperationOptions {\n /** Metadata to update in the run. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for creating an agent thread.\n */\nexport interface CreateAgentThreadOptionalParams\n extends AgentThreadCreationOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for getting an agent thread.\n */\nexport interface GetAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating an agent thread.\n */\nexport interface UpdateAgentThreadOptionalParams\n extends UpdateAgentThreadOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting an agent thread.\n */\nexport interface DeleteAgentThreadOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting an run step.\n */\nexport interface GetRunStepOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing run steps.\n */\nexport interface ListRunStepsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a message.\n */\nexport interface CreateMessageOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for updating a message.\n */\nexport interface UpdateMessageOptionalParams extends OperationOptions {\n /** Metadata to update in the message. */\n metadata?: Record<string, string> | null;\n}\n\n/**\n * Optional parameters for listing messages.\n */\nexport interface ListMessagesOptionalParams\n extends ListMessagesQueryParamProperties,\n OperationOptions {}\n\n/**\n * Optional parameters creating vector store.\n */\nexport interface CreateVectorStoreOptionalParams\n extends VectorStoreOptions,\n OperationOptions,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for listing vector stores.\n */\nexport interface ListVectorStoresOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for updating a vector store.\n */\nexport interface UpdateVectorStoreOptionalParams\n extends VectorStoreUpdateOptions,\n OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store.\n */\nexport interface DeleteVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a vector store.\n */\nexport interface GetVectorStoreOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing vector store files.\n */\nexport interface ListVectorStoreFilesOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file.\n */\nexport interface CreateVectorStoreFileOptionalParams\n extends CreateVectorStoreFileOptions,\n OperationOptions,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for getting a vector store file.\n */\nexport interface GetVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for deleting a vector store file.\n */\nexport interface DeleteVectorStoreFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing vector store file batches.\n */\nexport interface ListVectorStoreFileBatchFilesOptionalParams\n extends ListQueryParameters,\n OperationOptions {\n /** Filter by file status. */\n filter?: VectorStoreFileStatusFilter;\n}\n\n/**\n * Optional parameters for getting a vector store file batch.\n */\nexport interface GetVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for canceling a vector store file batch.\n */\nexport interface CancelVectorStoreFileBatchOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for creating a vector store file batch.\n */\nexport interface CreateVectorStoreFileBatchOptionalParams\n extends CreateVectorStoreFileBatchOptions,\n OperationOptions,\n PollingOptionsParams {}\n\n/**\n * Optional parameters for creating agent.\n */\nexport interface CreateAgentOptionalParams\n extends Omit<CreateAgentOptions, \"model\">,\n OperationOptions {}\n\n/**\n * Optional parameters for updating agent.\n */\nexport interface UpdateAgentOptionalParams extends UpdateAgentOptions, OperationOptions {}\n\n/**\n * Optional parameters for deleting agent.\n */\nexport interface DeleteAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting agent.\n */\nexport interface GetAgentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for listing agents.\n */\nexport interface ListAgentsOptionalParams extends ListQueryParameters, OperationOptions {}\n\n/**\n * Optional parameters for listing files.\n */\nexport interface ListFilesOptionalParams extends ListFilesQueryParamProperties, OperationOptions {}\n\n/**\n * Optional parameters for deleting a file.\n */\nexport interface DeleteFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting a file.\n */\nexport interface GetFileOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for getting file content.\n */\nexport interface GetFileContentOptionalParams extends OperationOptions {}\n\n/**\n * Optional parameters for uploading a file.\n */\nexport interface UploadFileOptionalParams extends OperationOptions, PollingOptionsParams {\n /** The name of the file. */\n fileName?: string;\n}\n"]}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import type { Client, StreamableMethod } from "@azure-rest/core-client";
|
|
2
2
|
import type { FileDeletionStatusOutput, FileListResponseOutput, OpenAIFileOutput } from "../customization/outputModels.js";
|
|
3
3
|
import type { FilePurpose as CustomizedFilePurpose } from "../customization/models.js";
|
|
4
|
-
import type { DeleteFileOptionalParams, GetFileContentOptionalParams, GetFileOptionalParams, ListFilesOptionalParams,
|
|
5
|
-
import type {
|
|
4
|
+
import type { DeleteFileOptionalParams, GetFileContentOptionalParams, GetFileOptionalParams, ListFilesOptionalParams, UploadFileOptionalParams } from "./customModels.js";
|
|
5
|
+
import type { OperationState, PollerLike } from "@azure/core-lro";
|
|
6
6
|
/** Gets a list of previously uploaded files. */
|
|
7
7
|
export declare function listFiles(context: Client, options?: ListFilesOptionalParams): Promise<FileListResponseOutput>;
|
|
8
8
|
/** Uploads a file for use by other operations. */
|
|
9
|
-
export declare function uploadFile(context: Client, content: ReadableStream | NodeJS.ReadableStream, purpose: CustomizedFilePurpose, options?:
|
|
10
|
-
export declare function uploadFileAndPoll(context: Client, content: ReadableStream | NodeJS.ReadableStream, purpose: CustomizedFilePurpose, options?:
|
|
9
|
+
export declare function uploadFile(context: Client, content: ReadableStream | NodeJS.ReadableStream, purpose: CustomizedFilePurpose, options?: UploadFileOptionalParams): PollerLike<OperationState<OpenAIFileOutput>, OpenAIFileOutput>;
|
|
10
|
+
export declare function uploadFileAndPoll(context: Client, content: ReadableStream | NodeJS.ReadableStream, purpose: CustomizedFilePurpose, options?: UploadFileOptionalParams): PollerLike<OperationState<OpenAIFileOutput>, OpenAIFileOutput>;
|
|
11
11
|
/** Delete a previously uploaded file. */
|
|
12
12
|
export declare function deleteFile(context: Client, fileId: string, options?: DeleteFileOptionalParams): Promise<FileDeletionStatusOutput>;
|
|
13
13
|
/** Returns information about a specific file. Does not retrieve file content. */
|
|
14
14
|
export declare function getFile(context: Client, fileId: string, options?: GetFileOptionalParams): Promise<OpenAIFileOutput>;
|
|
15
15
|
/** Returns file content. */
|
|
16
16
|
export declare function getFileContent(context: Client, fileId: string, options?: GetFileContentOptionalParams): StreamableMethod<string | Uint8Array>;
|
|
17
|
+
export declare function uploadFileInternal(context: Client, content: ReadableStream | NodeJS.ReadableStream, purpose: CustomizedFilePurpose, options?: UploadFileOptionalParams): Promise<OpenAIFileOutput>;
|
|
17
18
|
//# sourceMappingURL=files.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/agents/files.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,OAAO,KAAK,EACV,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,KAAK,EACV,wBAAwB,EACxB,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/agents/files.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,OAAO,KAAK,EACV,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,KAAK,EACV,wBAAwB,EACxB,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,mBAAmB,CA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C9B,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,gBAAgB,CAAC,CAc3B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { operationOptionsToRequestParameters } from "@azure-rest/core-client";
|
|
4
|
-
import {
|
|
4
|
+
import { createPoller } from "./poller.js";
|
|
5
5
|
import * as ConvertFromWire from "../customization/convertOutputModelsFromWire.js";
|
|
6
6
|
import * as ConvertParameters from "../customization/convertParametersToWire.js";
|
|
7
7
|
import { randomUUID } from "@azure/core-util";
|
|
@@ -28,36 +28,40 @@ export async function listFiles(context, options = {}) {
|
|
|
28
28
|
return ConvertFromWire.convertFileListResponseOutput(result.body);
|
|
29
29
|
}
|
|
30
30
|
/** Uploads a file for use by other operations. */
|
|
31
|
-
export
|
|
31
|
+
export function uploadFile(context, content, purpose, options = {}) {
|
|
32
32
|
var _a;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
return createPoller({
|
|
34
|
+
initOperation: async () => {
|
|
35
|
+
return uploadFileInternal(context, content, purpose, options);
|
|
36
|
+
},
|
|
37
|
+
pollOperation: async (currentResult) => {
|
|
38
|
+
return getFile(context, currentResult.id, options);
|
|
39
|
+
},
|
|
40
|
+
getOperationStatus: getLroOperationStatus,
|
|
41
|
+
getOperationError: (result) => {
|
|
42
|
+
return result.status === "failed" && result.statusDetails
|
|
43
|
+
? new Error(`Operation failed: ${result.statusDetails}`)
|
|
44
|
+
: undefined;
|
|
45
|
+
},
|
|
46
|
+
intervalInMs: (_a = options.pollingOptions) === null || _a === void 0 ? void 0 : _a.sleepIntervalInMs,
|
|
47
|
+
});
|
|
42
48
|
}
|
|
43
49
|
export function uploadFileAndPoll(context, content, purpose, options = {}) {
|
|
44
50
|
var _a;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
result
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
update: updateUploadFileAndPoll,
|
|
60
|
-
pollingOptions: (_a = options.pollingOptions) !== null && _a !== void 0 ? _a : {},
|
|
51
|
+
return createPoller({
|
|
52
|
+
initOperation: async () => {
|
|
53
|
+
return uploadFileInternal(context, content, purpose, options);
|
|
54
|
+
},
|
|
55
|
+
pollOperation: async (currentResult) => {
|
|
56
|
+
return getFile(context, currentResult.id, options);
|
|
57
|
+
},
|
|
58
|
+
getOperationStatus: getLroOperationStatus,
|
|
59
|
+
getOperationError: (result) => {
|
|
60
|
+
return result.status === "failed" && result.statusDetails
|
|
61
|
+
? new Error(`Operation failed: ${result.statusDetails}`)
|
|
62
|
+
: undefined;
|
|
63
|
+
},
|
|
64
|
+
intervalInMs: (_a = options.pollingOptions) === null || _a === void 0 ? void 0 : _a.sleepIntervalInMs,
|
|
61
65
|
});
|
|
62
66
|
}
|
|
63
67
|
/** Delete a previously uploaded file. */
|
|
@@ -86,6 +90,30 @@ export function getFileContent(context, fileId, options = {}) {
|
|
|
86
90
|
const getFileContentOptions = Object.assign({}, operationOptionsToRequestParameters(options));
|
|
87
91
|
return context.path("/files/{fileId}/content", fileId).get(getFileContentOptions);
|
|
88
92
|
}
|
|
93
|
+
export async function uploadFileInternal(context, content, purpose, options = {}) {
|
|
94
|
+
var _a;
|
|
95
|
+
const uploadFileOptions = Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: [
|
|
96
|
+
{ name: "file", body: content, filename: (_a = options.fileName) !== null && _a !== void 0 ? _a : randomUUID() },
|
|
97
|
+
{ name: "purpose", body: purpose },
|
|
98
|
+
], contentType: "multipart/form-data" });
|
|
99
|
+
const result = await context.path("/files").post(uploadFileOptions);
|
|
100
|
+
if (!expectedStatuses.includes(result.status)) {
|
|
101
|
+
throw createOpenAIError(result);
|
|
102
|
+
}
|
|
103
|
+
return ConvertFromWire.convertOpenAIFileOutput(result.body);
|
|
104
|
+
}
|
|
105
|
+
function getLroOperationStatus(result) {
|
|
106
|
+
switch (result.status) {
|
|
107
|
+
case "running":
|
|
108
|
+
case "pending":
|
|
109
|
+
return "running";
|
|
110
|
+
case "uploaded":
|
|
111
|
+
case "processed":
|
|
112
|
+
return "succeeded";
|
|
113
|
+
default:
|
|
114
|
+
return "failed";
|
|
115
|
+
}
|
|
116
|
+
}
|
|
89
117
|
function validateListFilesParameters(options) {
|
|
90
118
|
var _a, _b;
|
|
91
119
|
if ((_a = options === null || options === void 0 ? void 0 : options.queryParameters) === null || _a === void 0 ? void 0 : _a.purpose) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/agents/files.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAC;AAc9E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,KAAK,eAAe,MAAM,iDAAiD,CAAC;AACnF,OAAO,KAAK,iBAAiB,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;AAEjC,IAAK,WAQJ;AARD,WAAK,WAAW;IACd,qCAAsB,CAAA;IACtB,oDAAqC,CAAA;IACrC,wCAAyB,CAAA;IACzB,qDAAsC,CAAA;IACtC,8BAAe,CAAA;IACf,2CAA4B,CAAA;IAC5B,gCAAiB,CAAA;AACnB,CAAC,EARI,WAAW,KAAX,WAAW,QAQf;AAED,gDAAgD;AAChD,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,OAAe,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AM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACzC,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client, StreamableMethod } from \"@azure-rest/core-client\";\nimport { operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nimport type {\n FileDeletionStatusOutput,\n FileListResponseOutput,\n OpenAIFileOutput,\n} from \"../customization/outputModels.js\";\nimport type { FilePurpose as CustomizedFilePurpose } from \"../customization/models.js\";\nimport type {\n DeleteFileOptionalParams,\n GetFileContentOptionalParams,\n GetFileOptionalParams,\n ListFilesOptionalParams,\n UploadFileWithPollingOptionalParams,\n} from \"./customModels.js\";\nimport { AgentsPoller } from \"./poller.js\";\nimport type * as GeneratedParameters from \"../generated/src/parameters.js\";\nimport * as ConvertFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport * as ConvertParameters from \"../customization/convertParametersToWire.js\";\nimport { randomUUID } from \"@azure/core-util\";\nimport { createOpenAIError } from \"./openAIError.js\";\nimport type { PollerLike, PollOperationState } from \"@azure/core-lro\";\nconst expectedStatuses = [\"200\"];\n\nenum FilePurpose {\n FineTune = \"fine-tune\",\n FineTuneResults = \"fine-tune-results\",\n Assistants = \"assistants\",\n AssistantsOutput = \"assistants_output\",\n Batch = \"batch\",\n BatchOutput = \"batch_output\",\n Vision = \"vision\",\n}\n\n/** Gets a list of previously uploaded files. */\nexport async function listFiles(\n context: Client,\n options: ListFilesOptionalParams = {},\n): Promise<FileListResponseOutput> {\n const listOptions: GeneratedParameters.ListFilesParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: ConvertParameters.convertListFilesQueryParamProperties(options),\n };\n validateListFilesParameters(listOptions);\n const result = await context.path(\"/files\").get(options);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertFileListResponseOutput(result.body);\n}\n\n/** Uploads a file for use by other operations. */\nexport async function uploadFile(\n context: Client,\n content: ReadableStream | NodeJS.ReadableStream,\n purpose: CustomizedFilePurpose,\n options: UploadFileWithPollingOptionalParams = {},\n): Promise<OpenAIFileOutput> {\n const uploadFileOptions: GeneratedParameters.UploadFileParameters = {\n ...operationOptionsToRequestParameters(options),\n body: [\n { name: \"file\" as const, body: content, filename: options.fileName ?? randomUUID() },\n { name: \"purpose\" as const, body: purpose },\n ],\n contentType: \"multipart/form-data\",\n };\n const result = await context.path(\"/files\").post(uploadFileOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertOpenAIFileOutput(result.body);\n}\n\nexport function uploadFileAndPoll(\n context: Client,\n content: ReadableStream | NodeJS.ReadableStream,\n purpose: CustomizedFilePurpose,\n options: UploadFileWithPollingOptionalParams = {},\n): PollerLike<PollOperationState<OpenAIFileOutput>, OpenAIFileOutput> {\n async function updateUploadFileAndPoll(\n currentResult?: OpenAIFileOutput,\n ): Promise<{ result: OpenAIFileOutput; completed: boolean }> {\n let file: OpenAIFileOutput;\n if (!currentResult) {\n file = await uploadFile(context, content, purpose, options);\n } else {\n file = await getFile(context, currentResult.id, options);\n }\n return {\n result: file,\n completed:\n file.status === \"uploaded\" || file.status === \"processed\" || file.status === \"deleted\",\n };\n }\n return new AgentsPoller<OpenAIFileOutput>({\n update: updateUploadFileAndPoll,\n pollingOptions: options.pollingOptions ?? {},\n });\n}\n\n/** Delete a previously uploaded file. */\nexport async function deleteFile(\n context: Client,\n fileId: string,\n options: DeleteFileOptionalParams = {},\n): Promise<FileDeletionStatusOutput> {\n const deleteOptions: GeneratedParameters.ListFilesParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n validateFileId(fileId);\n const result = await context.path(\"/files/{fileId}\", fileId).delete(deleteOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return 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: GetFileOptionalParams = {},\n): Promise<OpenAIFileOutput> {\n validateFileId(fileId);\n const getFileOptions: GeneratedParameters.ListFilesParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n const result = await context.path(\"/files/{fileId}\", fileId).get(getFileOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertOpenAIFileOutput(result.body);\n}\n\n/** Returns file content. */\nexport function getFileContent(\n context: Client,\n fileId: string,\n options: GetFileContentOptionalParams = {},\n): StreamableMethod<string | Uint8Array> {\n validateFileId(fileId);\n const getFileContentOptions: GeneratedParameters.ListFilesParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n return context.path(\"/files/{fileId}/content\", fileId).get(getFileContentOptions);\n}\n\nfunction validateListFilesParameters(options?: GeneratedParameters.ListFilesParameters): void {\n if (options?.queryParameters?.purpose) {\n if (!Object.values(FilePurpose).includes(options?.queryParameters?.purpose as FilePurpose)) {\n throw new Error(\n \"Purpose must be one of 'fine-tune', 'fine-tune-results', 'assistants', 'assistants_output', 'batch', 'batch_output', 'vision'\",\n );\n }\n }\n}\n\nfunction validateFileId(fileId: string): void {\n if (!fileId) {\n throw new Error(\"File ID is required\");\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/agents/files.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAC;AAc9E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,KAAK,eAAe,MAAM,iDAAiD,CAAC;AACnF,OAAO,KAAK,iBAAiB,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;AAEjC,IAAK,WAQJ;AARD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AC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACzC,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client, StreamableMethod } from \"@azure-rest/core-client\";\nimport { operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nimport type {\n FileDeletionStatusOutput,\n FileListResponseOutput,\n OpenAIFileOutput,\n} from \"../customization/outputModels.js\";\nimport type { FilePurpose as CustomizedFilePurpose } from \"../customization/models.js\";\nimport type {\n DeleteFileOptionalParams,\n GetFileContentOptionalParams,\n GetFileOptionalParams,\n ListFilesOptionalParams,\n UploadFileOptionalParams,\n} from \"./customModels.js\";\nimport { createPoller } from \"./poller.js\";\nimport type * as GeneratedParameters from \"../generated/src/parameters.js\";\nimport * as ConvertFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport * as ConvertParameters from \"../customization/convertParametersToWire.js\";\nimport { randomUUID } from \"@azure/core-util\";\nimport { createOpenAIError } from \"./openAIError.js\";\nimport type { OperationState, OperationStatus, PollerLike } from \"@azure/core-lro\";\nconst expectedStatuses = [\"200\"];\n\nenum FilePurpose {\n FineTune = \"fine-tune\",\n FineTuneResults = \"fine-tune-results\",\n Assistants = \"assistants\",\n AssistantsOutput = \"assistants_output\",\n Batch = \"batch\",\n BatchOutput = \"batch_output\",\n Vision = \"vision\",\n}\n\n/** Gets a list of previously uploaded files. */\nexport async function listFiles(\n context: Client,\n options: ListFilesOptionalParams = {},\n): Promise<FileListResponseOutput> {\n const listOptions: GeneratedParameters.ListFilesParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: ConvertParameters.convertListFilesQueryParamProperties(options),\n };\n validateListFilesParameters(listOptions);\n const result = await context.path(\"/files\").get(options);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertFileListResponseOutput(result.body);\n}\n\n/** Uploads a file for use by other operations. */\nexport function uploadFile(\n context: Client,\n content: ReadableStream | NodeJS.ReadableStream,\n purpose: CustomizedFilePurpose,\n options: UploadFileOptionalParams = {},\n): PollerLike<OperationState<OpenAIFileOutput>, OpenAIFileOutput> {\n return createPoller<OpenAIFileOutput>({\n initOperation: async () => {\n return uploadFileInternal(context, content, purpose, options);\n },\n pollOperation: async (currentResult: OpenAIFileOutput) => {\n return getFile(context, currentResult.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n getOperationError: (result: OpenAIFileOutput) => {\n return result.status === \"failed\" && result.statusDetails\n ? new Error(`Operation failed: ${result.statusDetails}`)\n : undefined;\n },\n intervalInMs: options.pollingOptions?.sleepIntervalInMs,\n });\n}\n\nexport function uploadFileAndPoll(\n context: Client,\n content: ReadableStream | NodeJS.ReadableStream,\n purpose: CustomizedFilePurpose,\n options: UploadFileOptionalParams = {},\n): PollerLike<OperationState<OpenAIFileOutput>, OpenAIFileOutput> {\n return createPoller<OpenAIFileOutput>({\n initOperation: async () => {\n return uploadFileInternal(context, content, purpose, options);\n },\n pollOperation: async (currentResult: OpenAIFileOutput) => {\n return getFile(context, currentResult.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n getOperationError: (result: OpenAIFileOutput) => {\n return result.status === \"failed\" && result.statusDetails\n ? new Error(`Operation failed: ${result.statusDetails}`)\n : undefined;\n },\n intervalInMs: options.pollingOptions?.sleepIntervalInMs,\n });\n}\n\n/** Delete a previously uploaded file. */\nexport async function deleteFile(\n context: Client,\n fileId: string,\n options: DeleteFileOptionalParams = {},\n): Promise<FileDeletionStatusOutput> {\n const deleteOptions: GeneratedParameters.ListFilesParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n validateFileId(fileId);\n const result = await context.path(\"/files/{fileId}\", fileId).delete(deleteOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return 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: GetFileOptionalParams = {},\n): Promise<OpenAIFileOutput> {\n validateFileId(fileId);\n const getFileOptions: GeneratedParameters.ListFilesParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n const result = await context.path(\"/files/{fileId}\", fileId).get(getFileOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertOpenAIFileOutput(result.body);\n}\n\n/** Returns file content. */\nexport function getFileContent(\n context: Client,\n fileId: string,\n options: GetFileContentOptionalParams = {},\n): StreamableMethod<string | Uint8Array> {\n validateFileId(fileId);\n const getFileContentOptions: GeneratedParameters.ListFilesParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n return context.path(\"/files/{fileId}/content\", fileId).get(getFileContentOptions);\n}\n\nexport async function uploadFileInternal(\n context: Client,\n content: ReadableStream | NodeJS.ReadableStream,\n purpose: CustomizedFilePurpose,\n options: UploadFileOptionalParams = {},\n): Promise<OpenAIFileOutput> {\n const uploadFileOptions: GeneratedParameters.UploadFileParameters = {\n ...operationOptionsToRequestParameters(options),\n body: [\n { name: \"file\" as const, body: content, filename: options.fileName ?? randomUUID() },\n { name: \"purpose\" as const, body: purpose },\n ],\n contentType: \"multipart/form-data\",\n };\n const result = await context.path(\"/files\").post(uploadFileOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertOpenAIFileOutput(result.body);\n}\n\nfunction getLroOperationStatus(result: OpenAIFileOutput): 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\nfunction validateListFilesParameters(options?: GeneratedParameters.ListFilesParameters): void {\n if (options?.queryParameters?.purpose) {\n if (!Object.values(FilePurpose).includes(options?.queryParameters?.purpose as FilePurpose)) {\n throw new Error(\n \"Purpose must be one of 'fine-tune', 'fine-tune-results', 'assistants', 'assistants_output', 'batch', 'batch_output', 'vision'\",\n );\n }\n }\n}\n\nfunction validateFileId(fileId: string): void {\n if (!fileId) {\n throw new Error(\"File ID is required\");\n }\n}\n"]}
|
|
@@ -2,9 +2,9 @@ import { type Client, type StreamableMethod } from "@azure-rest/core-client";
|
|
|
2
2
|
import type { FileDeletionStatusOutput, FileListResponseOutput, OpenAIFileOutput } from "../customization/outputModels.js";
|
|
3
3
|
import type { OpenAIPageableListOfThreadRunOutput, ThreadRunOutput, AgentThreadOutput, RunStepOutput, OpenAIPageableListOfRunStepOutput, ThreadMessageOutput, ThreadDeletionStatusOutput, OpenAIPageableListOfThreadMessageOutput, OpenAIPageableListOfVectorStoreOutput, VectorStoreOutput, VectorStoreFileOutput, VectorStoreDeletionStatusOutput, VectorStoreFileDeletionStatusOutput, VectorStoreFileBatchOutput, OpenAIPageableListOfVectorStoreFileOutput, AgentDeletionStatusOutput, AgentOutput, OpenAIPageableListOfAgentOutput } from "../customization/outputModels.js";
|
|
4
4
|
import type { FilePurpose } from "../customization/models.js";
|
|
5
|
-
import type { AgentRunResponse, CreateRunOptionalParams, GetRunOptionalParams, CancelRunOptionalParams, SubmitToolOutputsToRunOptionalParams, UpdateRunOptionalParams, ListRunQueryOptionalParams, CreateAndRunThreadOptionalParams, CreateAgentThreadOptionalParams, GetAgentThreadOptionalParams, UpdateAgentThreadOptionalParams, DeleteAgentThreadOptionalParams, GetRunStepOptionalParams, CreateMessageOptionalParams, ListMessagesOptionalParams, UpdateMessageOptionalParams, UpdateVectorStoreOptionalParams, DeleteVectorStoreOptionalParams, CreateVectorStoreOptionalParams,
|
|
5
|
+
import type { AgentRunResponse, CreateRunOptionalParams, GetRunOptionalParams, CancelRunOptionalParams, SubmitToolOutputsToRunOptionalParams, UpdateRunOptionalParams, ListRunQueryOptionalParams, CreateAndRunThreadOptionalParams, CreateAgentThreadOptionalParams, GetAgentThreadOptionalParams, UpdateAgentThreadOptionalParams, DeleteAgentThreadOptionalParams, GetRunStepOptionalParams, CreateMessageOptionalParams, ListMessagesOptionalParams, UpdateMessageOptionalParams, UpdateVectorStoreOptionalParams, DeleteVectorStoreOptionalParams, CreateVectorStoreOptionalParams, CreateVectorStoreFileOptionalParams, ListVectorStoreFilesOptionalParams, GetVectorStoreFileOptionalParams, DeleteVectorStoreFileOptionalParams, CreateVectorStoreFileBatchOptionalParams, GetVectorStoreFileBatchOptionalParams, ListVectorStoreFileBatchFilesOptionalParams, CreateAgentOptionalParams, ListAgentsOptionalParams, GetAgentOptionalParams, UpdateAgentOptionalParams, DeleteFileOptionalParams, GetFileOptionalParams, GetFileContentOptionalParams, ListFilesOptionalParams, UploadFileOptionalParams, CancelVectorStoreFileBatchOptionalParams, DeleteAgentOptionalParams } from "./customModels.js";
|
|
6
6
|
import type { ThreadMessageOptions, ToolOutput } from "../customization/models.js";
|
|
7
|
-
import type { PollerLike,
|
|
7
|
+
import type { PollerLike, OperationState } from "@azure/core-lro";
|
|
8
8
|
/**
|
|
9
9
|
* Agents Interface Contains operations for creating, listing, updating, and deleting agents, threads, runs, messages, and files.
|
|
10
10
|
*/
|
|
@@ -50,9 +50,9 @@ export interface AgentsOperations {
|
|
|
50
50
|
/** Gets a list of previously uploaded files. */
|
|
51
51
|
listFiles: (options?: ListFilesOptionalParams) => Promise<FileListResponseOutput>;
|
|
52
52
|
/** Uploads a file for use by other operations. */
|
|
53
|
-
uploadFile: (data: ReadableStream | NodeJS.ReadableStream, purpose: FilePurpose, options?: UploadFileOptionalParams) =>
|
|
53
|
+
uploadFile: (data: ReadableStream | NodeJS.ReadableStream, purpose: FilePurpose, options?: UploadFileOptionalParams) => PollerLike<OperationState<OpenAIFileOutput>, OpenAIFileOutput>;
|
|
54
54
|
/** Uploads a file for use by other operations. */
|
|
55
|
-
uploadFileAndPoll: (data: ReadableStream | NodeJS.ReadableStream, purpose: FilePurpose, options?:
|
|
55
|
+
uploadFileAndPoll: (data: ReadableStream | NodeJS.ReadableStream, purpose: FilePurpose, options?: UploadFileOptionalParams) => PollerLike<OperationState<OpenAIFileOutput>, OpenAIFileOutput>;
|
|
56
56
|
/** Delete a previously uploaded file. */
|
|
57
57
|
deleteFile: (fileId: string, options?: DeleteFileOptionalParams) => Promise<FileDeletionStatusOutput>;
|
|
58
58
|
/** Returns information about a specific file. Does not retrieve file content. */
|
|
@@ -62,7 +62,7 @@ export interface AgentsOperations {
|
|
|
62
62
|
/** Returns a list of vector stores. */
|
|
63
63
|
listVectorStores: (options?: DeleteVectorStoreOptionalParams) => Promise<OpenAIPageableListOfVectorStoreOutput>;
|
|
64
64
|
/** Creates a vector store. */
|
|
65
|
-
createVectorStore: (options?: CreateVectorStoreOptionalParams) =>
|
|
65
|
+
createVectorStore: (options?: CreateVectorStoreOptionalParams) => PollerLike<OperationState<VectorStoreOutput>, VectorStoreOutput>;
|
|
66
66
|
/** Returns the vector store object object matching the specific ID. */
|
|
67
67
|
getVectorStore: (vectorStoreId: string, options?: DeleteVectorStoreOptionalParams) => Promise<VectorStoreOutput>;
|
|
68
68
|
/** The ID of the vector store to modify. */
|
|
@@ -70,9 +70,9 @@ export interface AgentsOperations {
|
|
|
70
70
|
/** Deletes the vector store object matching the specified ID. */
|
|
71
71
|
deleteVectorStore: (vectorStoreId: string, options?: DeleteVectorStoreOptionalParams) => Promise<VectorStoreDeletionStatusOutput>;
|
|
72
72
|
/** Create vector store and poll. */
|
|
73
|
-
createVectorStoreAndPoll: (options?:
|
|
73
|
+
createVectorStoreAndPoll: (options?: CreateVectorStoreOptionalParams) => PollerLike<OperationState<VectorStoreOutput>, VectorStoreOutput>;
|
|
74
74
|
/** Create a vector store file by attching a file to a vector store. */
|
|
75
|
-
createVectorStoreFile: (vectorStoreId: string, options?: CreateVectorStoreFileOptionalParams) =>
|
|
75
|
+
createVectorStoreFile: (vectorStoreId: string, options?: CreateVectorStoreFileOptionalParams) => PollerLike<OperationState<VectorStoreFileOutput>, VectorStoreFileOutput>;
|
|
76
76
|
/** Retrieves a vector store file. */
|
|
77
77
|
getVectorStoreFile: (vectorStoreId: string, fileId: string, options?: GetVectorStoreFileOptionalParams) => Promise<VectorStoreFileOutput>;
|
|
78
78
|
/** Returns a list of vector store files. */
|
|
@@ -83,9 +83,9 @@ export interface AgentsOperations {
|
|
|
83
83
|
*/
|
|
84
84
|
deleteVectorStoreFile: (vectorStoreId: string, fileId: string, options?: DeleteVectorStoreFileOptionalParams) => Promise<VectorStoreFileDeletionStatusOutput>;
|
|
85
85
|
/** Create a vector store file by attaching a file to a vector store and poll. */
|
|
86
|
-
createVectorStoreFileAndPoll: (vectorStoreId: string, options?:
|
|
86
|
+
createVectorStoreFileAndPoll: (vectorStoreId: string, options?: CreateVectorStoreFileOptionalParams) => PollerLike<OperationState<VectorStoreFileOutput>, VectorStoreFileOutput>;
|
|
87
87
|
/** Create a vector store file batch. */
|
|
88
|
-
createVectorStoreFileBatch: (vectorStoreId: string, options?: CreateVectorStoreFileBatchOptionalParams) =>
|
|
88
|
+
createVectorStoreFileBatch: (vectorStoreId: string, options?: CreateVectorStoreFileBatchOptionalParams) => PollerLike<OperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput>;
|
|
89
89
|
/** Retrieve a vector store file batch. */
|
|
90
90
|
getVectorStoreFileBatch: (vectorStoreId: string, batchId: string, options?: GetVectorStoreFileBatchOptionalParams) => Promise<VectorStoreFileBatchOutput>;
|
|
91
91
|
/** Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. */
|
|
@@ -93,7 +93,7 @@ export interface AgentsOperations {
|
|
|
93
93
|
/** Returns a list of vector store files in a batch. */
|
|
94
94
|
listVectorStoreFileBatchFiles: (vectorStoreId: string, batchId: string, options?: ListVectorStoreFileBatchFilesOptionalParams) => Promise<OpenAIPageableListOfVectorStoreFileOutput>;
|
|
95
95
|
/** Create a vector store file batch and poll. */
|
|
96
|
-
createVectorStoreFileBatchAndPoll: (vectorStoreId: string, options?:
|
|
96
|
+
createVectorStoreFileBatchAndPoll: (vectorStoreId: string, options?: CreateVectorStoreFileBatchOptionalParams) => PollerLike<OperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput>;
|
|
97
97
|
/** Gets a single run step from a thread run. */
|
|
98
98
|
getRunStep: (threadId: string, runId: string, stepId: string, options?: GetRunStepOptionalParams) => Promise<RunStepOutput>;
|
|
99
99
|
/** Gets a list of run steps from a thread run. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,KAAK,EACV,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EACV,mCAAmC,EACnC,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,iCAAiC,EACjC,mBAAmB,EACnB,0BAA0B,EAC1B,uCAAuC,EACvC,qCAAqC,EACrC,iBAAiB,EACjB,qBAAqB,EACrB,+BAA+B,EAC/B,mCAAmC,EACnC,0BAA0B,EAC1B,yCAAyC,EACzC,yBAAyB,EACzB,WAAW,EACX,+BAA+B,EAChC,MAAM,kCAAkC,CAAC;AAqB1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAwB9D,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,oCAAoC,EACpC,uBAAuB,EACvB,0BAA0B,EAC1B,gCAAgC,EAChC,+BAA+B,EAC/B,4BAA4B,EAC5B,+BAA+B,EAC/B,+BAA+B,EAC/B,wBAAwB,EAExB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAG3B,+BAA+B,EAC/B,+BAA+B,EAC/B,+BAA+B,EAC/B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,gBAAgB,EAAE,MAA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