@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,8 +1,8 @@
|
|
|
1
|
-
import type { AzureAISearchToolDefinition, CodeInterpreterToolDefinition, FileSearchToolDefinition, FileSearchToolDefinitionDetails, FunctionDefinition, FunctionToolDefinition, RequiredActionOutput, RequiredToolCallOutput, ToolDefinition, ToolDefinitionOutputParent, ToolResources, VectorStoreConfigurations, VectorStoreDataSource } from "./inputOutputs.js";
|
|
1
|
+
import type { AzureAISearchToolDefinition, AzureFunctionToolDefinition, CodeInterpreterToolDefinition, FileSearchToolDefinition, FileSearchToolDefinitionDetails, FunctionDefinition, FunctionToolDefinition, OpenApiFunctionDefinition, OpenApiToolDefinition, RequiredActionOutput, RequiredToolCallOutput, ToolDefinition, ToolDefinitionOutputParent, ToolResources, VectorStoreConfigurations, VectorStoreDataSource, AzureFunctionStorageQueue, AzureFunctionDefinition } from "./inputOutputs.js";
|
|
2
2
|
/**
|
|
3
3
|
* Determines if the given output is of the specified type.
|
|
4
4
|
*
|
|
5
|
-
* @
|
|
5
|
+
* @typeParam T - The type to check against, which extends one of the possible output parent types.
|
|
6
6
|
* @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.
|
|
7
7
|
* @param type - The type to check the action against.
|
|
8
8
|
* @returns A boolean indicating whether the action is of the specified type.
|
|
@@ -15,9 +15,11 @@ export declare enum connectionToolType {
|
|
|
15
15
|
/** Bing grounding search tool */
|
|
16
16
|
BingGrounding = "bing_grounding",
|
|
17
17
|
/** Microsoft Fabric tool */
|
|
18
|
-
MicrosoftFabric = "
|
|
18
|
+
MicrosoftFabric = "fabric_dataagent",
|
|
19
19
|
/** Sharepoint tool */
|
|
20
|
-
SharepointGrounding = "sharepoint_grounding"
|
|
20
|
+
SharepointGrounding = "sharepoint_grounding",
|
|
21
|
+
/** Azure Function tool */
|
|
22
|
+
AzureFunction = "azure_function"
|
|
21
23
|
}
|
|
22
24
|
/**
|
|
23
25
|
* Utility class for creating various tools.
|
|
@@ -58,6 +60,19 @@ export declare class ToolUtility {
|
|
|
58
60
|
definition: CodeInterpreterToolDefinition;
|
|
59
61
|
resources: ToolResources;
|
|
60
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* Creates an Azure Function tool
|
|
65
|
+
* @param name - The name of the Azure Function.
|
|
66
|
+
* @param description - The description of the Azure Function.
|
|
67
|
+
* @param parameters - The parameters of the Azure Function.
|
|
68
|
+
* @param inputQueue - The input queue configuration.
|
|
69
|
+
* @param outputQueue - The output queue configuration.
|
|
70
|
+
* @returns An object containing the definition and resources for the Azure Function tool.
|
|
71
|
+
*/
|
|
72
|
+
static createAzureFunctionTool(name: string, description: string, parameters: unknown, inputQueue: AzureFunctionStorageQueue, outputQueue: AzureFunctionStorageQueue, definitionDetails: AzureFunctionDefinition): {
|
|
73
|
+
definition: AzureFunctionToolDefinition;
|
|
74
|
+
resources: ToolResources;
|
|
75
|
+
};
|
|
61
76
|
/**
|
|
62
77
|
* Creates an Azure AI search tool
|
|
63
78
|
*
|
|
@@ -70,6 +85,15 @@ export declare class ToolUtility {
|
|
|
70
85
|
definition: AzureAISearchToolDefinition;
|
|
71
86
|
resources: ToolResources;
|
|
72
87
|
};
|
|
88
|
+
/**
|
|
89
|
+
* Creates a Microsoft Fabric tool
|
|
90
|
+
*
|
|
91
|
+
* @param connectionIds - A list of the IDs of the Fabric connections to use.
|
|
92
|
+
* @returns An object containing the definition for the Microsoft Fabric tool
|
|
93
|
+
*/
|
|
94
|
+
static createFabricTool(connectionId: string): {
|
|
95
|
+
definition: ToolDefinition;
|
|
96
|
+
};
|
|
73
97
|
/**
|
|
74
98
|
* Creates a function tool
|
|
75
99
|
*
|
|
@@ -80,6 +104,16 @@ export declare class ToolUtility {
|
|
|
80
104
|
static createFunctionTool(functionDefinition: FunctionDefinition): {
|
|
81
105
|
definition: FunctionToolDefinition;
|
|
82
106
|
};
|
|
107
|
+
/**
|
|
108
|
+
* Creates an OpenApi tool
|
|
109
|
+
*
|
|
110
|
+
* @param openApiFunctionDefinition - The OpenApi function definition to use.
|
|
111
|
+
*
|
|
112
|
+
* @returns An object containing the definition for the OpenApi tool.
|
|
113
|
+
*/
|
|
114
|
+
static createOpenApiTool(openApiFunctionDefinition: OpenApiFunctionDefinition): {
|
|
115
|
+
definition: OpenApiToolDefinition;
|
|
116
|
+
};
|
|
83
117
|
}
|
|
84
118
|
/**
|
|
85
119
|
* Represents a set of tools with their definitions and resources.
|
|
@@ -137,5 +171,39 @@ export declare class ToolSet {
|
|
|
137
171
|
definition: AzureAISearchToolDefinition;
|
|
138
172
|
resources: ToolResources;
|
|
139
173
|
};
|
|
174
|
+
/**
|
|
175
|
+
* Adds an OpenApi tool to the tool set.
|
|
176
|
+
*
|
|
177
|
+
* @param openApiFunctionDefinition - The OpenApi function definition to use.
|
|
178
|
+
*
|
|
179
|
+
* @returns An object containing the definition for the OpenApi tool
|
|
180
|
+
*/
|
|
181
|
+
addOpenApiTool(openApiFunctionDefinition: OpenApiFunctionDefinition): {
|
|
182
|
+
definition: OpenApiToolDefinition;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Adds an Azure Function tool to the tool set.
|
|
186
|
+
*
|
|
187
|
+
* @param name - The name of the Azure Function.
|
|
188
|
+
* @param description - The description of the Azure Function.
|
|
189
|
+
* @param parameters - The parameters of the Azure Function.
|
|
190
|
+
* @param inputQueue - The input queue configuration.
|
|
191
|
+
* @param outputQueue - The output queue configuration.
|
|
192
|
+
*
|
|
193
|
+
* @returns An object containing the definition and resources for the Azure Function tool.
|
|
194
|
+
*/
|
|
195
|
+
addAzureFunctionTool(name: string, description: string, parameters: unknown, inputQueue: AzureFunctionStorageQueue, outputQueue: AzureFunctionStorageQueue, definitionDetails: AzureFunctionDefinition): {
|
|
196
|
+
definition: AzureFunctionToolDefinition;
|
|
197
|
+
resources: ToolResources;
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Adds a Microsoft Fabric tool to the tool set.
|
|
201
|
+
*
|
|
202
|
+
* @param connectionId - The ID of the Fabric connection to use.
|
|
203
|
+
* @returns An object containing the definition for the Microsoft Fabric tool
|
|
204
|
+
*/
|
|
205
|
+
addFabricTool(connectionId: string): {
|
|
206
|
+
definition: ToolDefinition;
|
|
207
|
+
};
|
|
140
208
|
}
|
|
141
209
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,EAC/B,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,cAAc,EACd,0BAA0B,EAC1B,aAAa,EACb,yBAAyB,EACzB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,2BAA2B,EAC3B,2BAA2B,EAC3B,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,EAC/B,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,cAAc,EACd,0BAA0B,EAC1B,aAAa,EACb,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EACvD,MAAM,EAAE,oBAAoB,GAAG,sBAAsB,GAAG,0BAA0B,EAClF,IAAI,EAAE,MAAM,GACX,MAAM,IAAI,CAAC,CAEb;AAED,2DAA2D;AAC3D,oBAAY,kBAAkB;IA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,EAAE,yBAAyB,GAAG;QACpE,UAAU,EAAE,qBAAqB,CAAC;KACnC;IAMD;;;;;;;;;;OAUG;IACH,oBAAoB,CAClB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,OAAO,EACnB,UAAU,EAAE,yBAAyB,EACrC,WAAW,EAAE,yBAAyB,EACtC,iBAAiB,EAAE,uBAAuB,GACzC;QAAE,UAAU,EAAE,2BAA2B,CAAC;QAAC,SAAS,EAAE,aAAa,CAAA;KAAE;IAaxE;;;;;OAKG;IACH,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG;QAAE,UAAU,EAAE,cAAc,CAAA;KAAE;CAKpE"}
|
|
@@ -7,7 +7,7 @@ exports.isOutputOfType = isOutputOfType;
|
|
|
7
7
|
/**
|
|
8
8
|
* Determines if the given output is of the specified type.
|
|
9
9
|
*
|
|
10
|
-
* @
|
|
10
|
+
* @typeParam T - The type to check against, which extends one of the possible output parent types.
|
|
11
11
|
* @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.
|
|
12
12
|
* @param type - The type to check the action against.
|
|
13
13
|
* @returns A boolean indicating whether the action is of the specified type.
|
|
@@ -21,14 +21,17 @@ var connectionToolType;
|
|
|
21
21
|
/** Bing grounding search tool */
|
|
22
22
|
connectionToolType["BingGrounding"] = "bing_grounding";
|
|
23
23
|
/** Microsoft Fabric tool */
|
|
24
|
-
connectionToolType["MicrosoftFabric"] = "
|
|
24
|
+
connectionToolType["MicrosoftFabric"] = "fabric_dataagent";
|
|
25
25
|
/** Sharepoint tool */
|
|
26
26
|
connectionToolType["SharepointGrounding"] = "sharepoint_grounding";
|
|
27
|
+
/** Azure Function tool */
|
|
28
|
+
connectionToolType["AzureFunction"] = "azure_function";
|
|
27
29
|
})(connectionToolType || (exports.connectionToolType = connectionToolType = {}));
|
|
28
30
|
const toolMap = {
|
|
29
31
|
bing_grounding: "bingGrounding",
|
|
30
|
-
|
|
32
|
+
fabric_dataagent: "fabric_dataagent",
|
|
31
33
|
sharepoint_grounding: "sharepointGrounding",
|
|
34
|
+
azure_function: "azureFunction",
|
|
32
35
|
};
|
|
33
36
|
/**
|
|
34
37
|
* Utility class for creating various tools.
|
|
@@ -83,6 +86,29 @@ class ToolUtility {
|
|
|
83
86
|
resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },
|
|
84
87
|
};
|
|
85
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Creates an Azure Function tool
|
|
91
|
+
* @param name - The name of the Azure Function.
|
|
92
|
+
* @param description - The description of the Azure Function.
|
|
93
|
+
* @param parameters - The parameters of the Azure Function.
|
|
94
|
+
* @param inputQueue - The input queue configuration.
|
|
95
|
+
* @param outputQueue - The output queue configuration.
|
|
96
|
+
* @returns An object containing the definition and resources for the Azure Function tool.
|
|
97
|
+
*/
|
|
98
|
+
static createAzureFunctionTool(name, description, parameters, inputQueue, outputQueue, definitionDetails) {
|
|
99
|
+
return {
|
|
100
|
+
definition: { type: "azure_function", azureFunction: definitionDetails },
|
|
101
|
+
resources: {
|
|
102
|
+
azureFunction: {
|
|
103
|
+
name: name,
|
|
104
|
+
description: description,
|
|
105
|
+
parameters: parameters,
|
|
106
|
+
inputQueue: inputQueue,
|
|
107
|
+
outputQueue: outputQueue,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
}
|
|
86
112
|
/**
|
|
87
113
|
* Creates an Azure AI search tool
|
|
88
114
|
*
|
|
@@ -101,6 +127,22 @@ class ToolUtility {
|
|
|
101
127
|
},
|
|
102
128
|
};
|
|
103
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Creates a Microsoft Fabric tool
|
|
132
|
+
*
|
|
133
|
+
* @param connectionIds - A list of the IDs of the Fabric connections to use.
|
|
134
|
+
* @returns An object containing the definition for the Microsoft Fabric tool
|
|
135
|
+
*/
|
|
136
|
+
static createFabricTool(connectionId) {
|
|
137
|
+
return {
|
|
138
|
+
definition: {
|
|
139
|
+
type: "fabric_dataagent",
|
|
140
|
+
fabricDataAgent: {
|
|
141
|
+
connections: [{ connectionId: connectionId }],
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
}
|
|
104
146
|
/**
|
|
105
147
|
* Creates a function tool
|
|
106
148
|
*
|
|
@@ -116,6 +158,21 @@ class ToolUtility {
|
|
|
116
158
|
},
|
|
117
159
|
};
|
|
118
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* Creates an OpenApi tool
|
|
163
|
+
*
|
|
164
|
+
* @param openApiFunctionDefinition - The OpenApi function definition to use.
|
|
165
|
+
*
|
|
166
|
+
* @returns An object containing the definition for the OpenApi tool.
|
|
167
|
+
*/
|
|
168
|
+
static createOpenApiTool(openApiFunctionDefinition) {
|
|
169
|
+
return {
|
|
170
|
+
definition: {
|
|
171
|
+
type: "openapi",
|
|
172
|
+
openapi: openApiFunctionDefinition,
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
}
|
|
119
176
|
}
|
|
120
177
|
exports.ToolUtility = ToolUtility;
|
|
121
178
|
/**
|
|
@@ -184,6 +241,46 @@ class ToolSet {
|
|
|
184
241
|
this.toolResources = Object.assign(Object.assign({}, this.toolResources), tool.resources);
|
|
185
242
|
return tool;
|
|
186
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* Adds an OpenApi tool to the tool set.
|
|
246
|
+
*
|
|
247
|
+
* @param openApiFunctionDefinition - The OpenApi function definition to use.
|
|
248
|
+
*
|
|
249
|
+
* @returns An object containing the definition for the OpenApi tool
|
|
250
|
+
*/
|
|
251
|
+
addOpenApiTool(openApiFunctionDefinition) {
|
|
252
|
+
const tool = ToolUtility.createOpenApiTool(openApiFunctionDefinition);
|
|
253
|
+
this.toolDefinitions.push(tool.definition);
|
|
254
|
+
return tool;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Adds an Azure Function tool to the tool set.
|
|
258
|
+
*
|
|
259
|
+
* @param name - The name of the Azure Function.
|
|
260
|
+
* @param description - The description of the Azure Function.
|
|
261
|
+
* @param parameters - The parameters of the Azure Function.
|
|
262
|
+
* @param inputQueue - The input queue configuration.
|
|
263
|
+
* @param outputQueue - The output queue configuration.
|
|
264
|
+
*
|
|
265
|
+
* @returns An object containing the definition and resources for the Azure Function tool.
|
|
266
|
+
*/
|
|
267
|
+
addAzureFunctionTool(name, description, parameters, inputQueue, outputQueue, definitionDetails) {
|
|
268
|
+
const tool = ToolUtility.createAzureFunctionTool(name, description, parameters, inputQueue, outputQueue, definitionDetails);
|
|
269
|
+
this.toolDefinitions.push(tool.definition);
|
|
270
|
+
this.toolResources = Object.assign(Object.assign({}, this.toolResources), tool.resources);
|
|
271
|
+
return tool;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Adds a Microsoft Fabric tool to the tool set.
|
|
275
|
+
*
|
|
276
|
+
* @param connectionId - The ID of the Fabric connection to use.
|
|
277
|
+
* @returns An object containing the definition for the Microsoft Fabric tool
|
|
278
|
+
*/
|
|
279
|
+
addFabricTool(connectionId) {
|
|
280
|
+
const tool = ToolUtility.createFabricTool(connectionId);
|
|
281
|
+
this.toolDefinitions.push(tool.definition);
|
|
282
|
+
return tool;
|
|
283
|
+
}
|
|
187
284
|
}
|
|
188
285
|
exports.ToolSet = ToolSet;
|
|
189
286
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA0BlC,wCAKC;AAbD;;;;;;;GAOG;AACH,SAAgB,cAAc,CAC5B,MAAkF,EAClF,IAAY;IAEZ,OAAO,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAC9B,CAAC;AAED,2DAA2D;AAC3D,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,iCAAiC;IACjC,sDAAgC,CAAA;I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AAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;OAOG;IACH,sBAAsB,CACpB,OAAkB,EAClB,WAA0C;QAE1C,MAAM,IAAI,GAAG,WAAW,CAAC,yBAAyB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QACzE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;OAOG;IACH,oBAAoB,CAClB,iBAAyB,EACzB,SAAiB;QAEjB,MAAM,IAAI,GAAG,WAAW,CAAC,uBAAuB,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;QAC/E,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,mCAAQ,IAAI,CAAC,aAAa,GAAK,IAAI,CAAC,SAAS,CAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA/ED,0BA+EC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AzureAISearchToolDefinition,\n CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n RequiredActionOutput,\n RequiredToolCallOutput,\n ToolDefinition,\n ToolDefinitionOutputParent,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n} from \"./inputOutputs.js\";\n\n/**\n * Determines if the given output is of the specified type.\n *\n * @template T - The type to check against, which extends one of the possible output parent types.\n * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.\n * @param type - The type to check the action against.\n * @returns A boolean indicating whether the action is of the specified type.\n */\nexport function isOutputOfType<T extends { type: string }>(\n output: RequiredActionOutput | RequiredToolCallOutput | ToolDefinitionOutputParent,\n type: string,\n): output is T {\n return output.type === type;\n}\n\n/** Types of connection tools used to configure an agent */\nexport enum connectionToolType {\n /** Bing grounding search tool */\n BingGrounding = \"bing_grounding\",\n /** Microsoft Fabric tool */\n MicrosoftFabric = \"microsoft_fabric\",\n /** Sharepoint tool */\n SharepointGrounding = \"sharepoint_grounding\",\n}\n\nconst toolMap = {\n bing_grounding: \"bingGrounding\",\n microsoft_fabric: \"microsoftFabric\",\n sharepoint_grounding: \"sharepointGrounding\",\n};\n\n/**\n * Utility class for creating various tools.\n */\nexport class ToolUtility {\n /**\n * Creates a connection tool\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n * @returns An object containing the definition for the connection tool\n */\n static createConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n return {\n definition: {\n type: toolType,\n [toolMap[toolType]]: {\n connections: connectionIds.map((connectionId) => ({ connectionId: connectionId })),\n },\n },\n };\n }\n\n /**\n * Creates a file search tool\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n static createFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"file_search\", fileSearch: definitionDetails },\n resources: { fileSearch: { vectorStoreIds: vectorStoreIds, vectorStores: vectorStores } },\n };\n }\n\n /**\n * Creates a code interpreter tool\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool.\n */\n static createCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n if (fileIds && dataSources) {\n throw new Error(\"Cannot specify both fileIds and dataSources\");\n }\n\n return {\n definition: { type: \"code_interpreter\" },\n resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },\n };\n }\n\n /**\n * Creates an Azure AI search tool\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool.\n */\n static createAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexes: [{ indexConnectionId: indexConnectionId, indexName: indexName }],\n },\n },\n };\n }\n\n /**\n * Creates a function tool\n *\n * @param functionDefinition - The function definition to use.\n *\n * @returns An object containing the definition for the function tool.\n */\n static createFunctionTool(functionDefinition: FunctionDefinition): {\n definition: FunctionToolDefinition;\n } {\n return {\n definition: {\n type: \"function\",\n function: functionDefinition,\n },\n };\n }\n}\n\n/**\n * Represents a set of tools with their definitions and resources.\n */\nexport class ToolSet {\n /** A list of tool definitions that have been added to the tool set. */\n toolDefinitions: ToolDefinition[] = [];\n\n /** A collection of resources associated with the tools in the tool set. */\n toolResources: ToolResources = {};\n\n /**\n * Adds a connection tool to the tool set.\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n *\n * @returns An object containing the definition for the connection tool\n */\n addConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n const tool = ToolUtility.createConnectionTool(toolType, connectionIds);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds a file search tool to the tool set.\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n addFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createFileSearchTool(vectorStoreIds, vectorStores, definitionDetails);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds a code interpreter tool to the tool set.\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool\n */\n addCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createCodeInterpreterTool(fileIds, dataSources);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds an Azure AI search tool to the tool set.\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool\n */\n addAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createAzureAISearchTool(indexConnectionId, indexName);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":";AAAA,uCAA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AI,CAAC;IACd,CAAC;IACD;;;;;OAKG;IACH,aAAa,CAAC,YAAoB;QAChC,MAAM,IAAI,GAAG,WAAW,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;QACxD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAzID,0BAyIC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AzureAISearchToolDefinition,\n AzureFunctionToolDefinition,\n CodeInterpreterToolDefinition,\n FileSearchToolDefinition,\n FileSearchToolDefinitionDetails,\n FunctionDefinition,\n FunctionToolDefinition,\n OpenApiFunctionDefinition,\n OpenApiToolDefinition,\n RequiredActionOutput,\n RequiredToolCallOutput,\n ToolDefinition,\n ToolDefinitionOutputParent,\n ToolResources,\n VectorStoreConfigurations,\n VectorStoreDataSource,\n AzureFunctionStorageQueue,\n AzureFunctionDefinition,\n} from \"./inputOutputs.js\";\n\n/**\n * Determines if the given output is of the specified type.\n *\n * @typeParam T - The type to check against, which extends one of the possible output parent types.\n * @param output - The action to check, which can be of type `RequiredActionOutput`, `RequiredToolCallOutput`, or `ToolDefinitionOutputParent`.\n * @param type - The type to check the action against.\n * @returns A boolean indicating whether the action is of the specified type.\n */\nexport function isOutputOfType<T extends { type: string }>(\n output: RequiredActionOutput | RequiredToolCallOutput | ToolDefinitionOutputParent,\n type: string,\n): output is T {\n return output.type === type;\n}\n\n/** Types of connection tools used to configure an agent */\nexport enum connectionToolType {\n /** Bing grounding search tool */\n BingGrounding = \"bing_grounding\",\n /** Microsoft Fabric tool */\n MicrosoftFabric = \"fabric_dataagent\",\n /** Sharepoint tool */\n SharepointGrounding = \"sharepoint_grounding\",\n /** Azure Function tool */\n AzureFunction = \"azure_function\",\n}\n\nconst toolMap = {\n bing_grounding: \"bingGrounding\",\n fabric_dataagent: \"fabric_dataagent\",\n sharepoint_grounding: \"sharepointGrounding\",\n azure_function: \"azureFunction\",\n};\n\n/**\n * Utility class for creating various tools.\n */\nexport class ToolUtility {\n /**\n * Creates a connection tool\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n * @returns An object containing the definition for the connection tool\n */\n static createConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n return {\n definition: {\n type: toolType,\n [toolMap[toolType]]: {\n connections: connectionIds.map((connectionId) => ({ connectionId: connectionId })),\n },\n },\n };\n }\n\n /**\n * Creates a file search tool\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n static createFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"file_search\", fileSearch: definitionDetails },\n resources: { fileSearch: { vectorStoreIds: vectorStoreIds, vectorStores: vectorStores } },\n };\n }\n\n /**\n * Creates a code interpreter tool\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool.\n */\n static createCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n if (fileIds && dataSources) {\n throw new Error(\"Cannot specify both fileIds and dataSources\");\n }\n\n return {\n definition: { type: \"code_interpreter\" },\n resources: { codeInterpreter: { fileIds: fileIds, dataSources: dataSources } },\n };\n }\n\n /**\n * Creates an Azure Function tool\n * @param name - The name of the Azure Function.\n * @param description - The description of the Azure Function.\n * @param parameters - The parameters of the Azure Function.\n * @param inputQueue - The input queue configuration.\n * @param outputQueue - The output queue configuration.\n * @returns An object containing the definition and resources for the Azure Function tool.\n */\n static createAzureFunctionTool(\n name: string,\n description: string,\n parameters: unknown,\n inputQueue: AzureFunctionStorageQueue,\n outputQueue: AzureFunctionStorageQueue,\n definitionDetails: AzureFunctionDefinition,\n ): { definition: AzureFunctionToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_function\", azureFunction: definitionDetails },\n resources: {\n azureFunction: {\n name: name,\n description: description,\n parameters: parameters,\n inputQueue: inputQueue,\n outputQueue: outputQueue,\n },\n },\n };\n }\n /**\n * Creates an Azure AI search tool\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool.\n */\n static createAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n return {\n definition: { type: \"azure_ai_search\" },\n resources: {\n azureAISearch: {\n indexes: [{ indexConnectionId: indexConnectionId, indexName: indexName }],\n },\n },\n };\n }\n\n /**\n * Creates a Microsoft Fabric tool\n *\n * @param connectionIds - A list of the IDs of the Fabric connections to use.\n * @returns An object containing the definition for the Microsoft Fabric tool\n */\n static createFabricTool(connectionId: string): { definition: ToolDefinition } {\n return {\n definition: {\n type: \"fabric_dataagent\",\n fabricDataAgent: {\n connections: [{ connectionId: connectionId }],\n },\n },\n };\n }\n\n /**\n * Creates a function tool\n *\n * @param functionDefinition - The function definition to use.\n *\n * @returns An object containing the definition for the function tool.\n */\n static createFunctionTool(functionDefinition: FunctionDefinition): {\n definition: FunctionToolDefinition;\n } {\n return {\n definition: {\n type: \"function\",\n function: functionDefinition,\n },\n };\n }\n\n /**\n * Creates an OpenApi tool\n *\n * @param openApiFunctionDefinition - The OpenApi function definition to use.\n *\n * @returns An object containing the definition for the OpenApi tool.\n */\n static createOpenApiTool(openApiFunctionDefinition: OpenApiFunctionDefinition): {\n definition: OpenApiToolDefinition;\n } {\n return {\n definition: {\n type: \"openapi\",\n openapi: openApiFunctionDefinition,\n },\n };\n }\n}\n\n/**\n * Represents a set of tools with their definitions and resources.\n */\nexport class ToolSet {\n /** A list of tool definitions that have been added to the tool set. */\n toolDefinitions: ToolDefinition[] = [];\n\n /** A collection of resources associated with the tools in the tool set. */\n toolResources: ToolResources = {};\n\n /**\n * Adds a connection tool to the tool set.\n *\n * @param toolType - The type of the connection tool.\n * @param connectionIds - A list of the IDs of the connections to use.\n *\n * @returns An object containing the definition for the connection tool\n */\n addConnectionTool(\n toolType: connectionToolType,\n connectionIds: string[],\n ): { definition: ToolDefinition } {\n const tool = ToolUtility.createConnectionTool(toolType, connectionIds);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds a file search tool to the tool set.\n *\n * @param vectorStoreIds - The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.\n * @param vectorStores - The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.\n * @param definitionDetails - The input definition information for a file search tool as used to configure an agent.\n *\n * @returns An object containing the definition and resources for the file search tool\n */\n addFileSearchTool(\n vectorStoreIds?: string[],\n vectorStores?: Array<VectorStoreConfigurations>,\n definitionDetails?: FileSearchToolDefinitionDetails,\n ): { definition: FileSearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createFileSearchTool(vectorStoreIds, vectorStores, definitionDetails);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds a code interpreter tool to the tool set.\n *\n * @param fileIds - A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n * @param dataSources - The data sources to be used. This option is mutually exclusive with fileIds.\n *\n * @returns An object containing the definition and resources for the code interpreter tool\n */\n addCodeInterpreterTool(\n fileIds?: string[],\n dataSources?: Array<VectorStoreDataSource>,\n ): { definition: CodeInterpreterToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createCodeInterpreterTool(fileIds, dataSources);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds an Azure AI search tool to the tool set.\n *\n * @param indexConnectionId - The connection ID of the Azure AI search index.\n * @param indexName - The name of the Azure AI search index.\n *\n * @returns An object containing the definition and resources for the Azure AI search tool\n */\n addAzureAISearchTool(\n indexConnectionId: string,\n indexName: string,\n ): { definition: AzureAISearchToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createAzureAISearchTool(indexConnectionId, indexName);\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n\n /**\n * Adds an OpenApi tool to the tool set.\n *\n * @param openApiFunctionDefinition - The OpenApi function definition to use.\n *\n * @returns An object containing the definition for the OpenApi tool\n */\n addOpenApiTool(openApiFunctionDefinition: OpenApiFunctionDefinition): {\n definition: OpenApiToolDefinition;\n } {\n const tool = ToolUtility.createOpenApiTool(openApiFunctionDefinition);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n\n /**\n * Adds an Azure Function tool to the tool set.\n *\n * @param name - The name of the Azure Function.\n * @param description - The description of the Azure Function.\n * @param parameters - The parameters of the Azure Function.\n * @param inputQueue - The input queue configuration.\n * @param outputQueue - The output queue configuration.\n *\n * @returns An object containing the definition and resources for the Azure Function tool.\n */\n addAzureFunctionTool(\n name: string,\n description: string,\n parameters: unknown,\n inputQueue: AzureFunctionStorageQueue,\n outputQueue: AzureFunctionStorageQueue,\n definitionDetails: AzureFunctionDefinition,\n ): { definition: AzureFunctionToolDefinition; resources: ToolResources } {\n const tool = ToolUtility.createAzureFunctionTool(\n name,\n description,\n parameters,\n inputQueue,\n outputQueue,\n definitionDetails,\n );\n this.toolDefinitions.push(tool.definition);\n this.toolResources = { ...this.toolResources, ...tool.resources };\n return tool;\n }\n /**\n * Adds a Microsoft Fabric tool to the tool set.\n *\n * @param connectionId - The ID of the Fabric connection to use.\n * @returns An object containing the definition for the Microsoft Fabric tool\n */\n addFabricTool(connectionId: string): { definition: ToolDefinition } {\n const tool = ToolUtility.createFabricTool(connectionId);\n this.toolDefinitions.push(tool.definition);\n return tool;\n }\n}\n"]}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { Client } from "@azure-rest/core-client";
|
|
2
2
|
import type { OpenAIPageableListOfVectorStoreOutput, VectorStoreDeletionStatusOutput, VectorStoreOutput } from "../customization/outputModels.js";
|
|
3
|
-
import type { CreateVectorStoreWithPollingOptionalParams } from "./customModels.js";
|
|
4
3
|
import { type CreateVectorStoreOptionalParams, type DeleteVectorStoreOptionalParams, type GetVectorStoreOptionalParams, type ListVectorStoresOptionalParams, type UpdateVectorStoreOptionalParams } from "./customModels.js";
|
|
5
|
-
import type {
|
|
4
|
+
import type { OperationState, PollerLike } from "@azure/core-lro";
|
|
6
5
|
/** Returns a list of vector stores. */
|
|
7
6
|
export declare function listVectorStores(context: Client, options?: ListVectorStoresOptionalParams): Promise<OpenAIPageableListOfVectorStoreOutput>;
|
|
8
7
|
/** Creates a vector store. */
|
|
9
|
-
export declare function createVectorStore(context: Client, options?: CreateVectorStoreOptionalParams):
|
|
8
|
+
export declare function createVectorStore(context: Client, options?: CreateVectorStoreOptionalParams): PollerLike<OperationState<VectorStoreOutput>, VectorStoreOutput>;
|
|
10
9
|
/** Returns the vector store object matching the specified ID. */
|
|
11
10
|
export declare function getVectorStore(context: Client, vectorStoreId: string, options?: GetVectorStoreOptionalParams): Promise<VectorStoreOutput>;
|
|
12
11
|
/** The ID of the vector store to modify. */
|
|
@@ -16,5 +15,5 @@ export declare function deleteVectorStore(context: Client, vectorStoreId: string
|
|
|
16
15
|
/**
|
|
17
16
|
* Creates a vector store and poll.
|
|
18
17
|
*/
|
|
19
|
-
export declare function createVectorStoreAndPoll(context: Client, options?:
|
|
18
|
+
export declare function createVectorStoreAndPoll(context: Client, options?: CreateVectorStoreOptionalParams): PollerLike<OperationState<VectorStoreOutput>, VectorStoreOutput>;
|
|
20
19
|
//# sourceMappingURL=vectorStores.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectorStores.d.ts","sourceRoot":"","sources":["../../../src/agents/vectorStores.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAOtD,OAAO,KAAK,EACV,qCAAqC,EACrC,+BAA+B,EAC/B,iBAAiB,EAClB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,
|
|
1
|
+
{"version":3,"file":"vectorStores.d.ts","sourceRoot":"","sources":["../../../src/agents/vectorStores.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAOtD,OAAO,KAAK,EACV,qCAAqC,EACrC,+BAA+B,EAC/B,iBAAiB,EAClB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACrC,MAAM,mBAAmB,CAAC;AAY3B,OAAO,KAAK,EAAE,cAAc,EAAmB,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAInF,uCAAuC;AACvC,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,8BAAmC,GAC3C,OAAO,CAAC,qCAAqC,CAAC,CAahD;AAED,8BAA8B;AAC9B,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,+BAAoC,GAC5C,UAAU,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,CAWlE;AAED,iEAAiE;AACjE,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,4BAAiC,GACzC,OAAO,CAAC,iBAAiB,CAAC,CAc5B;AAED,4CAA4C;AAC5C,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,+BAAoC,GAC5C,OAAO,CAAC,iBAAiB,CAAC,CAgB5B;AAED,iEAAiE;AACjE,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,+BAAoC,GAC5C,OAAO,CAAC,+BAA+B,CAAC,CAc1C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,+BAAoC,GAC5C,UAAU,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,CAWlE"}
|
|
@@ -28,14 +28,18 @@ async function listVectorStores(context, options = {}) {
|
|
|
28
28
|
return ConvertFromWire.convertOpenAIPageableListOfVectorStoreOutput(result.body);
|
|
29
29
|
}
|
|
30
30
|
/** Creates a vector store. */
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
function createVectorStore(context, options = {}) {
|
|
32
|
+
var _a;
|
|
33
|
+
return (0, poller_js_1.createPoller)({
|
|
34
|
+
initOperation: async () => {
|
|
35
|
+
return createVectorStoreInternal(context, options);
|
|
36
|
+
},
|
|
37
|
+
pollOperation: async (currentResult) => {
|
|
38
|
+
return getVectorStore(context, currentResult.id, options);
|
|
39
|
+
},
|
|
40
|
+
getOperationStatus: getLroOperationStatus,
|
|
41
|
+
intervalInMs: (_a = options.pollingOptions) === null || _a === void 0 ? void 0 : _a.sleepIntervalInMs,
|
|
42
|
+
});
|
|
39
43
|
}
|
|
40
44
|
/** Returns the vector store object matching the specified ID. */
|
|
41
45
|
async function getVectorStore(context, vectorStoreId, options = {}) {
|
|
@@ -78,25 +82,39 @@ async function deleteVectorStore(context, vectorStoreId, options = {}) {
|
|
|
78
82
|
* Creates a vector store and poll.
|
|
79
83
|
*/
|
|
80
84
|
function createVectorStoreAndPoll(context, options = {}) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
result: vectorStore,
|
|
92
|
-
completed: vectorStore.status !== "in_progress",
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
return new poller_js_1.AgentsPoller({
|
|
96
|
-
update: updateCreateVectorStorePoll,
|
|
97
|
-
pollingOptions: options.pollingOptions,
|
|
85
|
+
var _a;
|
|
86
|
+
return (0, poller_js_1.createPoller)({
|
|
87
|
+
initOperation: async () => {
|
|
88
|
+
return createVectorStoreInternal(context, options);
|
|
89
|
+
},
|
|
90
|
+
pollOperation: async (currentResult) => {
|
|
91
|
+
return getVectorStore(context, currentResult.id, options);
|
|
92
|
+
},
|
|
93
|
+
getOperationStatus: getLroOperationStatus,
|
|
94
|
+
intervalInMs: (_a = options.pollingOptions) === null || _a === void 0 ? void 0 : _a.sleepIntervalInMs,
|
|
98
95
|
});
|
|
99
96
|
}
|
|
97
|
+
async function createVectorStoreInternal(context, options = {}) {
|
|
98
|
+
const createOptions = Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { body: ConvertToWire.convertVectorStoreOptions(options) });
|
|
99
|
+
validateCreateVectorStoreParameters(createOptions);
|
|
100
|
+
const result = await context.path("/vector_stores").post(createOptions);
|
|
101
|
+
if (!expectedStatuses.includes(result.status)) {
|
|
102
|
+
throw (0, openAIError_js_1.createOpenAIError)(result);
|
|
103
|
+
}
|
|
104
|
+
return ConvertFromWire.convertVectorStoreOutput(result.body);
|
|
105
|
+
}
|
|
106
|
+
function getLroOperationStatus(result) {
|
|
107
|
+
switch (result.status) {
|
|
108
|
+
case "in_progress":
|
|
109
|
+
return "running";
|
|
110
|
+
case "completed":
|
|
111
|
+
return "succeeded";
|
|
112
|
+
case "expired":
|
|
113
|
+
return "failed";
|
|
114
|
+
default:
|
|
115
|
+
return "failed";
|
|
116
|
+
}
|
|
117
|
+
}
|
|
100
118
|
function validateListVectorStoresParameters(options) {
|
|
101
119
|
var _a, _b;
|
|
102
120
|
if ((_a = options === null || options === void 0 ? void 0 : options.queryParameters) === null || _a === void 0 ? void 0 : _a.limit) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectorStores.js","sourceRoot":"","sources":["../../../src/agents/vectorStores.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAuClC,4CAgBC;AAGD,8CAgBC;AAGD,wCAkBC;AAGD,8CAoBC;AAGD,8CAkBC;AAKD,4DA0BC;;AAvKD,yDAA8E;AAW9E,2CAA2C;AAS3C,+DAK+B;AAE/B,yGAAmF;AACnF,gGAA0E;AAC1E,4FAA2F;AAC3F,qDAAqD;AAGrD,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;AAEjC,uCAAuC;AAChC,KAAK,UAAU,gBAAgB,CACpC,OAAe,EACf,UAA0C,EAAE;IAE5C,MAAM,WAAW,mCACZ,IAAA,iDAAmC,EAAC,OAAO,CAAC,KAC/C,eAAe,EAAE,IAAA,yDAA4B,EAAC,OAAO,CAAC,GACvD,CAAC;IAEF,kCAAkC,CAAC,WAAW,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAErE,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAA,kCAAiB,EAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,eAAe,CAAC,4CAA4C,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACnF,CAAC;AAED,8BAA8B;AACvB,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C;QAC5B,IAAA,sCAAgB,EAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC;AAED,SAAS,mCAAmC,CAAC,OAAqC;;IAChF,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,QAAQ,EAAE,CAAC;QAC5B,IAAA,sCAAgB,EAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1C,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 ListVectorStoresParameters,\n CreateVectorStoreParameters,\n ModifyVectorStoreParameters,\n} from \"../generated/src/parameters.js\";\nimport type {\n OpenAIPageableListOfVectorStoreOutput,\n VectorStoreDeletionStatusOutput,\n VectorStoreOutput,\n} from \"../customization/outputModels.js\";\nimport { AgentsPoller } from \"./poller.js\";\nimport type { CreateVectorStoreWithPollingOptionalParams } from \"./customModels.js\";\nimport {\n type CreateVectorStoreOptionalParams,\n type DeleteVectorStoreOptionalParams,\n type GetVectorStoreOptionalParams,\n type ListVectorStoresOptionalParams,\n type UpdateVectorStoreOptionalParams,\n} from \"./customModels.js\";\nimport {\n validateLimit,\n validateMetadata,\n validateOrder,\n validateVectorStoreId,\n} from \"./inputValidations.js\";\nimport type * as GeneratedParameters from \"../generated/src/parameters.js\";\nimport * as ConvertFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport * as ConvertToWire from \"../customization/convertModelsToWrite.js\";\nimport { convertToListQueryParameters } from \"../customization/convertParametersToWire.js\";\nimport { createOpenAIError } from \"./openAIError.js\";\nimport type { PollerLike, PollOperationState } from \"@azure/core-lro\";\n\nconst expectedStatuses = [\"200\"];\n\n/** Returns a list of vector stores. */\nexport async function listVectorStores(\n context: Client,\n options: ListVectorStoresOptionalParams = {},\n): Promise<OpenAIPageableListOfVectorStoreOutput> {\n const listOptions: GeneratedParameters.ListVectorStoresParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: convertToListQueryParameters(options),\n };\n\n validateListVectorStoresParameters(listOptions);\n const result = await context.path(\"/vector_stores\").get(listOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertOpenAIPageableListOfVectorStoreOutput(result.body);\n}\n\n/** Creates a vector store. */\nexport async function createVectorStore(\n context: Client,\n options: CreateVectorStoreOptionalParams = {},\n): Promise<VectorStoreOutput> {\n const createOptions: GeneratedParameters.CreateVectorStoreParameters = {\n ...operationOptionsToRequestParameters(options),\n body: ConvertToWire.convertVectorStoreOptions(options),\n };\n\n validateCreateVectorStoreParameters(createOptions);\n const result = await context.path(\"/vector_stores\").post(createOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreOutput(result.body);\n}\n\n/** Returns the vector store object matching the specified ID. */\nexport async function getVectorStore(\n context: Client,\n vectorStoreId: string,\n options: GetVectorStoreOptionalParams = {},\n): Promise<VectorStoreOutput> {\n const getOptions: GeneratedParameters.GetVectorStoreParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateVectorStoreId(vectorStoreId);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}\", vectorStoreId)\n .get(getOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreOutput(result.body);\n}\n\n/** The ID of the vector store to modify. */\nexport async function modifyVectorStore(\n context: Client,\n vectorStoreId: string,\n options: UpdateVectorStoreOptionalParams = {},\n): Promise<VectorStoreOutput> {\n const modifyOptions: GeneratedParameters.ModifyVectorStoreParameters = {\n ...operationOptionsToRequestParameters(options),\n body: ConvertToWire.convertVectorStoreUpdateOptions(options),\n };\n\n validateVectorStoreId(vectorStoreId);\n validateModifyVectorStoreParameters(modifyOptions);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}\", vectorStoreId)\n .post(modifyOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreOutput(result.body);\n}\n\n/** Deletes the vector store object matching the specified ID. */\nexport async function deleteVectorStore(\n context: Client,\n vectorStoreId: string,\n options: DeleteVectorStoreOptionalParams = {},\n): Promise<VectorStoreDeletionStatusOutput> {\n const deleteOptions: GeneratedParameters.DeleteVectorStoreParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateVectorStoreId(vectorStoreId);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}\", vectorStoreId)\n .delete(deleteOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreDeletionStatusOutput(result.body);\n}\n\n/**\n * Creates a vector store and poll.\n */\nexport function createVectorStoreAndPoll(\n context: Client,\n options: CreateVectorStoreWithPollingOptionalParams = {},\n): PollerLike<PollOperationState<VectorStoreOutput>, VectorStoreOutput> {\n async function updateCreateVectorStorePoll(\n currentResult?: VectorStoreOutput,\n ): Promise<{ result: VectorStoreOutput; completed: boolean }> {\n let vectorStore: VectorStoreOutput;\n if (!currentResult) {\n vectorStore = await createVectorStore(context, options);\n } else {\n const getOptions: GetVectorStoreOptionalParams = {\n ...operationOptionsToRequestParameters(options),\n };\n vectorStore = await getVectorStore(context, currentResult.id, getOptions);\n }\n return {\n result: vectorStore,\n completed: vectorStore.status !== \"in_progress\",\n };\n }\n\n return new AgentsPoller<VectorStoreOutput>({\n update: updateCreateVectorStorePoll,\n pollingOptions: options.pollingOptions,\n });\n}\n\nfunction validateListVectorStoresParameters(options?: ListVectorStoresParameters): 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 validateCreateVectorStoreParameters(options?: CreateVectorStoreParameters): void {\n if (\n options?.body?.chunking_strategy &&\n (!options.body.file_ids || options.body.file_ids.length === 0)\n ) {\n throw new Error(\"Chunking strategy is only applicable if fileIds is non-empty\");\n }\n if (options?.body?.metadata) {\n validateMetadata(options.body.metadata);\n }\n}\n\nfunction validateModifyVectorStoreParameters(options?: ModifyVectorStoreParameters): void {\n if (options?.body?.metadata) {\n validateMetadata(options.body.metadata);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"vectorStores.js","sourceRoot":"","sources":["../../../src/agents/vectorStores.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAsClC,4CAgBC;AAGD,8CAcC;AAGD,wCAkBC;AAGD,8CAoBC;AAGD,8CAkBC;AAKD,4DAcC;;AAxJD,yDAA8E;AAW9E,2CAA2C;AAQ3C,+DAK+B;AAE/B,yGAAmF;AACnF,gGAA0E;AAC1E,4FAA2F;AAC3F,qDAAqD;AAGrD,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;AAEjC,uCAAuC;AAChC,KAAK,UAAU,gBAAgB,CACpC,OAAe,EACf,UAA0C,EAAE;IAE5C,MAAM,WAAW,mCACZ,IAAA,iDAAmC,EAAC,OAAO,CAAC,KAC/C,eAAe,EAAE,IAAA,yDAA4B,EAAC,OAAO,CAAC,GACvD,CAAC;IAEF,kCAAkC,CAAC,WAAW,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAErE,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAA,kCAAiB,EAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,eAAe,CAAC,4CAA4C,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACnF,CAAC;AAED,8BAA8B;AAC9B,SAAgB,iBAAiB,CAC/B,OAAe,EACf,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a,EAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC;AAED,SAAS,mCAAmC,CAAC,OAAqC;;IAChF,IACE,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,iBAAiB;QAChC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,EAC9D,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;IAClF,CAAC;IACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,QAAQ,EAAE,CAAC;QAC5B,IAAA,sCAAgB,EAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC;AAED,SAAS,mCAAmC,CAAC,OAAqC;;IAChF,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,QAAQ,EAAE,CAAC;QAC5B,IAAA,sCAAgB,EAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1C,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 ListVectorStoresParameters,\n CreateVectorStoreParameters,\n ModifyVectorStoreParameters,\n} from \"../generated/src/parameters.js\";\nimport type {\n OpenAIPageableListOfVectorStoreOutput,\n VectorStoreDeletionStatusOutput,\n VectorStoreOutput,\n} from \"../customization/outputModels.js\";\nimport { createPoller } from \"./poller.js\";\nimport {\n type CreateVectorStoreOptionalParams,\n type DeleteVectorStoreOptionalParams,\n type GetVectorStoreOptionalParams,\n type ListVectorStoresOptionalParams,\n type UpdateVectorStoreOptionalParams,\n} from \"./customModels.js\";\nimport {\n validateLimit,\n validateMetadata,\n validateOrder,\n validateVectorStoreId,\n} from \"./inputValidations.js\";\nimport type * as GeneratedParameters from \"../generated/src/parameters.js\";\nimport * as ConvertFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport * as ConvertToWire from \"../customization/convertModelsToWrite.js\";\nimport { convertToListQueryParameters } from \"../customization/convertParametersToWire.js\";\nimport { createOpenAIError } from \"./openAIError.js\";\nimport type { OperationState, OperationStatus, PollerLike } from \"@azure/core-lro\";\n\nconst expectedStatuses = [\"200\"];\n\n/** Returns a list of vector stores. */\nexport async function listVectorStores(\n context: Client,\n options: ListVectorStoresOptionalParams = {},\n): Promise<OpenAIPageableListOfVectorStoreOutput> {\n const listOptions: GeneratedParameters.ListVectorStoresParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: convertToListQueryParameters(options),\n };\n\n validateListVectorStoresParameters(listOptions);\n const result = await context.path(\"/vector_stores\").get(listOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertOpenAIPageableListOfVectorStoreOutput(result.body);\n}\n\n/** Creates a vector store. */\nexport function createVectorStore(\n context: Client,\n options: CreateVectorStoreOptionalParams = {},\n): PollerLike<OperationState<VectorStoreOutput>, VectorStoreOutput> {\n return createPoller<VectorStoreOutput>({\n initOperation: async () => {\n return createVectorStoreInternal(context, options);\n },\n pollOperation: async (currentResult: VectorStoreOutput) => {\n return getVectorStore(context, currentResult.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n intervalInMs: options.pollingOptions?.sleepIntervalInMs,\n });\n}\n\n/** Returns the vector store object matching the specified ID. */\nexport async function getVectorStore(\n context: Client,\n vectorStoreId: string,\n options: GetVectorStoreOptionalParams = {},\n): Promise<VectorStoreOutput> {\n const getOptions: GeneratedParameters.GetVectorStoreParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateVectorStoreId(vectorStoreId);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}\", vectorStoreId)\n .get(getOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreOutput(result.body);\n}\n\n/** The ID of the vector store to modify. */\nexport async function modifyVectorStore(\n context: Client,\n vectorStoreId: string,\n options: UpdateVectorStoreOptionalParams = {},\n): Promise<VectorStoreOutput> {\n const modifyOptions: GeneratedParameters.ModifyVectorStoreParameters = {\n ...operationOptionsToRequestParameters(options),\n body: ConvertToWire.convertVectorStoreUpdateOptions(options),\n };\n\n validateVectorStoreId(vectorStoreId);\n validateModifyVectorStoreParameters(modifyOptions);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}\", vectorStoreId)\n .post(modifyOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreOutput(result.body);\n}\n\n/** Deletes the vector store object matching the specified ID. */\nexport async function deleteVectorStore(\n context: Client,\n vectorStoreId: string,\n options: DeleteVectorStoreOptionalParams = {},\n): Promise<VectorStoreDeletionStatusOutput> {\n const deleteOptions: GeneratedParameters.DeleteVectorStoreParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateVectorStoreId(vectorStoreId);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}\", vectorStoreId)\n .delete(deleteOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreDeletionStatusOutput(result.body);\n}\n\n/**\n * Creates a vector store and poll.\n */\nexport function createVectorStoreAndPoll(\n context: Client,\n options: CreateVectorStoreOptionalParams = {},\n): PollerLike<OperationState<VectorStoreOutput>, VectorStoreOutput> {\n return createPoller<VectorStoreOutput>({\n initOperation: async () => {\n return createVectorStoreInternal(context, options);\n },\n pollOperation: async (currentResult: VectorStoreOutput) => {\n return getVectorStore(context, currentResult.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n intervalInMs: options.pollingOptions?.sleepIntervalInMs,\n });\n}\n\nasync function createVectorStoreInternal(\n context: Client,\n options: CreateVectorStoreOptionalParams = {},\n): Promise<VectorStoreOutput> {\n const createOptions: GeneratedParameters.CreateVectorStoreParameters = {\n ...operationOptionsToRequestParameters(options),\n body: ConvertToWire.convertVectorStoreOptions(options),\n };\n\n validateCreateVectorStoreParameters(createOptions);\n const result = await context.path(\"/vector_stores\").post(createOptions);\n\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreOutput(result.body);\n}\n\nfunction getLroOperationStatus(result: VectorStoreOutput): OperationStatus {\n switch (result.status) {\n case \"in_progress\":\n return \"running\";\n case \"completed\":\n return \"succeeded\";\n case \"expired\":\n return \"failed\";\n default:\n return \"failed\";\n }\n}\n\nfunction validateListVectorStoresParameters(options?: ListVectorStoresParameters): 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 validateCreateVectorStoreParameters(options?: CreateVectorStoreParameters): void {\n if (\n options?.body?.chunking_strategy &&\n (!options.body.file_ids || options.body.file_ids.length === 0)\n ) {\n throw new Error(\"Chunking strategy is only applicable if fileIds is non-empty\");\n }\n if (options?.body?.metadata) {\n validateMetadata(options.body.metadata);\n }\n}\n\nfunction validateModifyVectorStoreParameters(options?: ModifyVectorStoreParameters): void {\n if (options?.body?.metadata) {\n validateMetadata(options.body.metadata);\n }\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Client } from "@azure-rest/core-client";
|
|
2
2
|
import type { OpenAIPageableListOfVectorStoreFileOutput, VectorStoreFileBatchOutput } from "../customization/outputModels.js";
|
|
3
|
-
import type { CancelVectorStoreFileBatchOptionalParams, CreateVectorStoreFileBatchOptionalParams,
|
|
4
|
-
import type { PollerLike,
|
|
3
|
+
import type { CancelVectorStoreFileBatchOptionalParams, CreateVectorStoreFileBatchOptionalParams, GetVectorStoreFileBatchOptionalParams, ListVectorStoreFileBatchFilesOptionalParams } from "./customModels.js";
|
|
4
|
+
import type { PollerLike, OperationState } from "@azure/core-lro";
|
|
5
5
|
/** Create a vector store file batch. */
|
|
6
|
-
export declare function createVectorStoreFileBatch(context: Client, vectorStoreId: string, options?: CreateVectorStoreFileBatchOptionalParams):
|
|
6
|
+
export declare function createVectorStoreFileBatch(context: Client, vectorStoreId: string, options?: CreateVectorStoreFileBatchOptionalParams): PollerLike<OperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput>;
|
|
7
7
|
/** Retrieve a vector store file batch. */
|
|
8
8
|
export declare function getVectorStoreFileBatch(context: Client, vectorStoreId: string, batchId: string, options?: GetVectorStoreFileBatchOptionalParams): Promise<VectorStoreFileBatchOutput>;
|
|
9
9
|
/** Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. */
|
|
@@ -11,5 +11,6 @@ export declare function cancelVectorStoreFileBatch(context: Client, vectorStoreI
|
|
|
11
11
|
/** Returns a list of vector store files in a batch. */
|
|
12
12
|
export declare function listVectorStoreFileBatchFiles(context: Client, vectorStoreId: string, batchId: string, options?: ListVectorStoreFileBatchFilesOptionalParams): Promise<OpenAIPageableListOfVectorStoreFileOutput>;
|
|
13
13
|
/** Create a vector store file batch and poll. */
|
|
14
|
-
export declare function createVectorStoreFileBatchAndPoll(context: Client, vectorStoreId: string, options?:
|
|
14
|
+
export declare function createVectorStoreFileBatchAndPoll(context: Client, vectorStoreId: string, options?: CreateVectorStoreFileBatchOptionalParams): PollerLike<OperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput>;
|
|
15
|
+
export declare function createVectorStoreFileBatchInternal(context: Client, vectorStoreId: string, options?: CreateVectorStoreFileBatchOptionalParams): Promise<VectorStoreFileBatchOutput>;
|
|
15
16
|
//# sourceMappingURL=vectorStoresFileBatches.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectorStoresFileBatches.d.ts","sourceRoot":"","sources":["../../../src/agents/vectorStoresFileBatches.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EACV,yCAAyC,EACzC,0BAA0B,EAC3B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EACV,wCAAwC,EACxC,wCAAwC,EACxC,
|
|
1
|
+
{"version":3,"file":"vectorStoresFileBatches.d.ts","sourceRoot":"","sources":["../../../src/agents/vectorStoresFileBatches.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EACV,yCAAyC,EACzC,0BAA0B,EAC3B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EACV,wCAAwC,EACxC,wCAAwC,EACxC,qCAAqC,EACrC,2CAA2C,EAC5C,MAAM,mBAAmB,CAAC;AAc3B,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAmB,MAAM,iBAAiB,CAAC;AAInF,wCAAwC;AACxC,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,wCAA6C,GACrD,UAAU,CAAC,cAAc,CAAC,0BAA0B,CAAC,EAAE,0BAA0B,CAAC,CAWpF;AAED,0CAA0C;AAC1C,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,qCAA0C,GAClD,OAAO,CAAC,0BAA0B,CAAC,CASrC;AAED,2HAA2H;AAC3H,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,wCAA6C,GACrD,OAAO,CAAC,0BAA0B,CAAC,CASrC;AAED,uDAAuD;AACvD,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,MAAM,EACf,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