@azure/ai-projects 1.0.0-beta.1 → 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4 -4
- package/README.md +244 -183
- package/dist/browser/agents/assistants.d.ts.map +1 -1
- package/dist/browser/agents/assistants.js +3 -1
- 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 +2 -1
- 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/openAIError.d.ts.map +1 -1
- package/dist/browser/agents/openAIError.js +7 -1
- package/dist/browser/agents/openAIError.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 +53 -3
- package/dist/browser/agents/utils.d.ts.map +1 -1
- package/dist/browser/agents/utils.js +77 -2
- 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 +42 -93
- 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 +51 -9
- 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/models.d.ts +131 -150
- 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 +187 -36
- 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 +27 -2
- package/dist/browser/generated/src/paginateHelper.d.ts.map +1 -1
- package/dist/browser/generated/src/paginateHelper.js +98 -1
- package/dist/browser/generated/src/paginateHelper.js.map +1 -1
- package/dist/browser/generated/src/projectsClient.d.ts +2 -2
- 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/commonjs/agents/assistants.d.ts.map +1 -1
- package/dist/commonjs/agents/assistants.js +3 -1
- 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 +2 -1
- 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/openAIError.d.ts.map +1 -1
- package/dist/commonjs/agents/openAIError.js +7 -1
- package/dist/commonjs/agents/openAIError.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 +53 -3
- package/dist/commonjs/agents/utils.d.ts.map +1 -1
- package/dist/commonjs/agents/utils.js +77 -2
- 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 +42 -93
- 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 +51 -9
- 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/models.d.ts +131 -150
- 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 +187 -36
- 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 +27 -2
- 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/projectsClient.d.ts +2 -2
- 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/tsdoc-metadata.json +1 -1
- package/dist/esm/agents/assistants.d.ts.map +1 -1
- package/dist/esm/agents/assistants.js +3 -1
- 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 +2 -1
- 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/openAIError.d.ts.map +1 -1
- package/dist/esm/agents/openAIError.js +7 -1
- package/dist/esm/agents/openAIError.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 +53 -3
- package/dist/esm/agents/utils.d.ts.map +1 -1
- package/dist/esm/agents/utils.js +77 -2
- 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 +42 -93
- 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 +51 -9
- 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/models.d.ts +131 -150
- 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 +187 -36
- 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 +27 -2
- package/dist/esm/generated/src/paginateHelper.d.ts.map +1 -1
- package/dist/esm/generated/src/paginateHelper.js +98 -1
- package/dist/esm/generated/src/paginateHelper.js.map +1 -1
- package/dist/esm/generated/src/projectsClient.d.ts +2 -2
- 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/react-native/agents/assistants.d.ts.map +1 -1
- package/dist/react-native/agents/assistants.js +3 -1
- 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 +2 -1
- 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/openAIError.d.ts.map +1 -1
- package/dist/react-native/agents/openAIError.js +7 -1
- package/dist/react-native/agents/openAIError.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 +53 -3
- package/dist/react-native/agents/utils.d.ts.map +1 -1
- package/dist/react-native/agents/utils.js +77 -2
- 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 +42 -93
- 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 +51 -9
- 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/models.d.ts +131 -150
- 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 +187 -36
- 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 +27 -2
- package/dist/react-native/generated/src/paginateHelper.d.ts.map +1 -1
- package/dist/react-native/generated/src/paginateHelper.js +98 -1
- package/dist/react-native/generated/src/paginateHelper.js.map +1 -1
- package/dist/react-native/generated/src/projectsClient.d.ts +2 -2
- 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/package.json +33 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3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OAA8C;;IAE9C,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;AACH,CAAC;AAED,SAAS,+CAA+C,CACtD,OAAiD;;IAEjD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,MAAM,EAAE,CAAC;QACrC,IAAA,8CAAwB,EAAC,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,IAAA,mCAAa,EAAC,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,IAAA,mCAAa,EAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,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 OpenAIPageableListOfVectorStoreFileOutput,\n VectorStoreFileBatchOutput,\n} from \"../customization/outputModels.js\";\nimport { AgentsPoller } from \"./poller.js\";\nimport type {\n CancelVectorStoreFileBatchOptionalParams,\n CreateVectorStoreFileBatchOptionalParams,\n CreateVectorStoreFileBatchWithPollingOptionalParams,\n GetVectorStoreFileBatchOptionalParams,\n ListVectorStoreFileBatchFilesOptionalParams,\n} from \"./customModels.js\";\nimport {\n validateFileStatusFilter,\n validateLimit,\n validateOrder,\n validateVectorStoreId,\n} from \"./inputValidations.js\";\nimport type {\n CreateVectorStoreFileBatchParameters,\n ListVectorStoreFileBatchFilesParameters,\n} from \"../generated/src/parameters.js\";\nimport * as ConvertFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport * as ConvertParamsToWire from \"../customization/convertParametersToWire.js\";\nimport { createOpenAIError } from \"./openAIError.js\";\nimport type { PollerLike, PollOperationState } from \"@azure/core-lro\";\n\nconst expectedStatuses = [\"200\"];\n\n/** Create a vector store file batch. */\nexport async function createVectorStoreFileBatch(\n context: Client,\n vectorStoreId: string,\n options: CreateVectorStoreFileBatchOptionalParams = {},\n): Promise<VectorStoreFileBatchOutput> {\n const createOptions: CreateVectorStoreFileBatchParameters = {\n ...operationOptionsToRequestParameters(options),\n ...ConvertParamsToWire.convertCreateVectorStoreFileBatchParam({ body: options }),\n };\n\n validateVectorStoreId(vectorStoreId);\n validateCreateVectorStoreFileBatchParameters(createOptions);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/file_batches\", vectorStoreId)\n .post(createOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreFileBatchOutput(result.body);\n}\n\n/** Retrieve a vector store file batch. */\nexport async function getVectorStoreFileBatch(\n context: Client,\n vectorStoreId: string,\n batchId: string,\n options: GetVectorStoreFileBatchOptionalParams = {},\n): Promise<VectorStoreFileBatchOutput> {\n validateVectorStoreId(vectorStoreId);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/file_batches/{batchId}\", vectorStoreId, batchId)\n .get(options);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreFileBatchOutput(result.body);\n}\n\n/** Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. */\nexport async function cancelVectorStoreFileBatch(\n context: Client,\n vectorStoreId: string,\n batchId: string,\n options: CancelVectorStoreFileBatchOptionalParams = {},\n): Promise<VectorStoreFileBatchOutput> {\n validateVectorStoreId(vectorStoreId);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/file_batches/{batchId}/cancel\", vectorStoreId, batchId)\n .post(options);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreFileBatchOutput(result.body);\n}\n\n/** Returns a list of vector store files in a batch. */\nexport async function listVectorStoreFileBatchFiles(\n context: Client,\n vectorStoreId: string,\n batchId: string,\n options: ListVectorStoreFileBatchFilesOptionalParams = {},\n): Promise<OpenAIPageableListOfVectorStoreFileOutput> {\n const listOptions: ListVectorStoreFileBatchFilesParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: ConvertParamsToWire.convertListVectorStoreFileBatchFilesQueryParamProperties(\n options,\n ) as Record<string, string>,\n };\n\n validateVectorStoreId(vectorStoreId);\n validateBatchId(batchId);\n validateListVectorStoreFileBatchFilesParameters(listOptions);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/file_batches/{batchId}/files\", vectorStoreId, batchId)\n .get(listOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertOpenAIPageableListOfVectorStoreFileOutput(result.body);\n}\n\n/** Create a vector store file batch and poll. */\nexport function createVectorStoreFileBatchAndPoll(\n context: Client,\n vectorStoreId: string,\n options: CreateVectorStoreFileBatchWithPollingOptionalParams = {},\n): PollerLike<PollOperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput> {\n async function updateCreateVectorStoreFileBatchPoll(\n currentResult?: VectorStoreFileBatchOutput,\n ): Promise<{ result: VectorStoreFileBatchOutput; completed: boolean }> {\n let vectorStore: VectorStoreFileBatchOutput;\n if (!currentResult) {\n vectorStore = await createVectorStoreFileBatch(context, vectorStoreId, options);\n } else {\n vectorStore = await getVectorStoreFileBatch(\n context,\n vectorStoreId,\n currentResult.id,\n options,\n );\n }\n return {\n result: vectorStore,\n completed: vectorStore.status !== \"in_progress\",\n };\n }\n\n async function cancelCreateVectorStoreFileBatchPoll(\n currentResult: VectorStoreFileBatchOutput,\n ): Promise<boolean> {\n const result = await cancelVectorStoreFileBatch(context, vectorStoreId, currentResult.id);\n return result.status === \"cancelled\";\n }\n\n return new AgentsPoller<VectorStoreFileBatchOutput>({\n update: updateCreateVectorStoreFileBatchPoll,\n cancel: cancelCreateVectorStoreFileBatchPoll,\n pollingOptions: options.pollingOptions,\n });\n}\n\nfunction validateBatchId(batchId: string): void {\n if (!batchId) {\n throw new Error(\"Batch ID is required\");\n }\n}\n\nfunction validateCreateVectorStoreFileBatchParameters(\n options?: CreateVectorStoreFileBatchParameters,\n): 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 are included\");\n }\n}\n\nfunction validateListVectorStoreFileBatchFilesParameters(\n options?: ListVectorStoreFileBatchFilesParameters,\n): void {\n if (options?.queryParameters?.filter) {\n validateFileStatusFilter(options.queryParameters.filter);\n }\n if (options?.queryParameters?.limit) {\n validateLimit(options.queryParameters.limit);\n }\n if (options?.queryParameters?.order) {\n validateOrder(options.queryParameters.order);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"vectorStoresFileBatches.js","sourceRoot":"","sources":["../../../src/agents/vectorStoresFileBatches.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAiClC,gEAeC;AAGD,0DAcC;AAGD,gEAcC;AAGD,sEAuBC;AAGD,8EAeC;AAED,gFAmBC;;AAhJD,yDAA8E;AAK9E,2CAA2C;AAO3C,+DAK+B;AAK/B,yGAAmF;AACnF,yGAAmF;AACnF,qDAAqD;AAGrD,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;AAEjC,wCAAwC;AACxC,SAAgB,0BAA0B,CACxC,OAAe,EACf,aAAqB,EACrB,UAAoD,EAAE;;IAEtD,OAA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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;AACH,CAAC;AAED,SAAS,+CAA+C,CACtD,OAAiD;;IAEjD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,MAAM,EAAE,CAAC;QACrC,IAAA,8CAAwB,EAAC,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,IAAA,mCAAa,EAAC,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,IAAA,mCAAa,EAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,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 OpenAIPageableListOfVectorStoreFileOutput,\n VectorStoreFileBatchOutput,\n} from \"../customization/outputModels.js\";\nimport { createPoller } from \"./poller.js\";\nimport type {\n CancelVectorStoreFileBatchOptionalParams,\n CreateVectorStoreFileBatchOptionalParams,\n GetVectorStoreFileBatchOptionalParams,\n ListVectorStoreFileBatchFilesOptionalParams,\n} from \"./customModels.js\";\nimport {\n validateFileStatusFilter,\n validateLimit,\n validateOrder,\n validateVectorStoreId,\n} from \"./inputValidations.js\";\nimport type {\n CreateVectorStoreFileBatchParameters,\n ListVectorStoreFileBatchFilesParameters,\n} from \"../generated/src/parameters.js\";\nimport * as ConvertFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport * as ConvertParamsToWire from \"../customization/convertParametersToWire.js\";\nimport { createOpenAIError } from \"./openAIError.js\";\nimport type { PollerLike, OperationState, OperationStatus } from \"@azure/core-lro\";\n\nconst expectedStatuses = [\"200\"];\n\n/** Create a vector store file batch. */\nexport function createVectorStoreFileBatch(\n context: Client,\n vectorStoreId: string,\n options: CreateVectorStoreFileBatchOptionalParams = {},\n): PollerLike<OperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput> {\n return createPoller<VectorStoreFileBatchOutput>({\n initOperation: async () => {\n return createVectorStoreFileBatchInternal(context, vectorStoreId, options);\n },\n pollOperation: async (currentResult: VectorStoreFileBatchOutput) => {\n return getVectorStoreFileBatch(context, vectorStoreId, currentResult.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n intervalInMs: options.pollingOptions?.sleepIntervalInMs,\n });\n}\n\n/** Retrieve a vector store file batch. */\nexport async function getVectorStoreFileBatch(\n context: Client,\n vectorStoreId: string,\n batchId: string,\n options: GetVectorStoreFileBatchOptionalParams = {},\n): Promise<VectorStoreFileBatchOutput> {\n validateVectorStoreId(vectorStoreId);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/file_batches/{batchId}\", vectorStoreId, batchId)\n .get(options);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreFileBatchOutput(result.body);\n}\n\n/** Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. */\nexport async function cancelVectorStoreFileBatch(\n context: Client,\n vectorStoreId: string,\n batchId: string,\n options: CancelVectorStoreFileBatchOptionalParams = {},\n): Promise<VectorStoreFileBatchOutput> {\n validateVectorStoreId(vectorStoreId);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/file_batches/{batchId}/cancel\", vectorStoreId, batchId)\n .post(options);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreFileBatchOutput(result.body);\n}\n\n/** Returns a list of vector store files in a batch. */\nexport async function listVectorStoreFileBatchFiles(\n context: Client,\n vectorStoreId: string,\n batchId: string,\n options: ListVectorStoreFileBatchFilesOptionalParams = {},\n): Promise<OpenAIPageableListOfVectorStoreFileOutput> {\n const listOptions: ListVectorStoreFileBatchFilesParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: ConvertParamsToWire.convertListVectorStoreFileBatchFilesQueryParamProperties(\n options,\n ) as Record<string, string>,\n };\n\n validateVectorStoreId(vectorStoreId);\n validateBatchId(batchId);\n validateListVectorStoreFileBatchFilesParameters(listOptions);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/file_batches/{batchId}/files\", vectorStoreId, batchId)\n .get(listOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertOpenAIPageableListOfVectorStoreFileOutput(result.body);\n}\n\n/** Create a vector store file batch and poll. */\nexport function createVectorStoreFileBatchAndPoll(\n context: Client,\n vectorStoreId: string,\n options: CreateVectorStoreFileBatchOptionalParams = {},\n): PollerLike<OperationState<VectorStoreFileBatchOutput>, VectorStoreFileBatchOutput> {\n return createPoller<VectorStoreFileBatchOutput>({\n initOperation: async () => {\n return createVectorStoreFileBatchInternal(context, vectorStoreId, options);\n },\n pollOperation: async (currentResult: VectorStoreFileBatchOutput) => {\n return getVectorStoreFileBatch(context, vectorStoreId, currentResult.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n intervalInMs: options.pollingOptions?.sleepIntervalInMs,\n });\n}\n\nexport async function createVectorStoreFileBatchInternal(\n context: Client,\n vectorStoreId: string,\n options: CreateVectorStoreFileBatchOptionalParams = {},\n): Promise<VectorStoreFileBatchOutput> {\n const createOptions: CreateVectorStoreFileBatchParameters = {\n ...operationOptionsToRequestParameters(options),\n ...ConvertParamsToWire.convertCreateVectorStoreFileBatchParam({ body: options }),\n };\n\n validateVectorStoreId(vectorStoreId);\n validateCreateVectorStoreFileBatchParameters(createOptions);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/file_batches\", vectorStoreId)\n .post(createOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreFileBatchOutput(result.body);\n}\n\nfunction getLroOperationStatus(result: VectorStoreFileBatchOutput): OperationStatus {\n switch (result.status) {\n case \"in_progress\":\n return \"running\";\n case \"completed\":\n return \"succeeded\";\n case \"cancelled\":\n return \"canceled\";\n default:\n return \"failed\";\n }\n}\n\nfunction validateBatchId(batchId: string): void {\n if (!batchId) {\n throw new Error(\"Batch ID is required\");\n }\n}\n\nfunction validateCreateVectorStoreFileBatchParameters(\n options?: CreateVectorStoreFileBatchParameters,\n): 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 are included\");\n }\n}\n\nfunction validateListVectorStoreFileBatchFilesParameters(\n options?: ListVectorStoreFileBatchFilesParameters,\n): void {\n if (options?.queryParameters?.filter) {\n validateFileStatusFilter(options.queryParameters.filter);\n }\n if (options?.queryParameters?.limit) {\n validateLimit(options.queryParameters.limit);\n }\n if (options?.queryParameters?.order) {\n validateOrder(options.queryParameters.order);\n }\n}\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Client } from "@azure-rest/core-client";
|
|
2
2
|
import type { OpenAIPageableListOfVectorStoreFileOutput, VectorStoreFileDeletionStatusOutput, VectorStoreFileOutput } from "../customization/outputModels.js";
|
|
3
|
-
import type { CreateVectorStoreFileOptionalParams,
|
|
4
|
-
import type {
|
|
3
|
+
import type { CreateVectorStoreFileOptionalParams, DeleteVectorStoreFileOptionalParams, GetVectorStoreFileOptionalParams, ListVectorStoreFilesOptionalParams } from "./customModels.js";
|
|
4
|
+
import type { OperationState, PollerLike } from "@azure/core-lro";
|
|
5
5
|
/** Returns a list of vector store files. */
|
|
6
6
|
export declare function listVectorStoreFiles(context: Client, vectorStoreId: string, options?: ListVectorStoreFilesOptionalParams): Promise<OpenAIPageableListOfVectorStoreFileOutput>;
|
|
7
7
|
/** Create a vector store file by attaching a file to a vector store. */
|
|
8
|
-
export declare function createVectorStoreFile(context: Client, vectorStoreId: string, options?: CreateVectorStoreFileOptionalParams):
|
|
8
|
+
export declare function createVectorStoreFile(context: Client, vectorStoreId: string, options?: CreateVectorStoreFileOptionalParams): PollerLike<OperationState<VectorStoreFileOutput>, VectorStoreFileOutput>;
|
|
9
9
|
/** Retrieves a vector store file. */
|
|
10
10
|
export declare function getVectorStoreFile(context: Client, vectorStoreId: string, fileId: string, options?: GetVectorStoreFileOptionalParams): Promise<VectorStoreFileOutput>;
|
|
11
11
|
/**
|
|
@@ -14,5 +14,5 @@ export declare function getVectorStoreFile(context: Client, vectorStoreId: strin
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function deleteVectorStoreFile(context: Client, vectorStoreId: string, fileId: string, options?: DeleteVectorStoreFileOptionalParams): Promise<VectorStoreFileDeletionStatusOutput>;
|
|
16
16
|
/** Create a vector store file by attaching a file to a vector store and poll. */
|
|
17
|
-
export declare function createVectorStoreFileAndPoll(context: Client, vectorStoreId: string, options?:
|
|
17
|
+
export declare function createVectorStoreFileAndPoll(context: Client, vectorStoreId: string, options?: CreateVectorStoreFileOptionalParams): PollerLike<OperationState<VectorStoreFileOutput>, VectorStoreFileOutput>;
|
|
18
18
|
//# sourceMappingURL=vectorStoresFiles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectorStoresFiles.d.ts","sourceRoot":"","sources":["../../../src/agents/vectorStoresFiles.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAMtD,OAAO,KAAK,EACV,yCAAyC,EACzC,mCAAmC,EACnC,qBAAqB,EACtB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EACV,mCAAmC,EACnC,
|
|
1
|
+
{"version":3,"file":"vectorStoresFiles.d.ts","sourceRoot":"","sources":["../../../src/agents/vectorStoresFiles.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAMtD,OAAO,KAAK,EACV,yCAAyC,EACzC,mCAAmC,EACnC,qBAAqB,EACtB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EACV,mCAAmC,EACnC,mCAAmC,EACnC,gCAAgC,EAChC,kCAAkC,EACnC,MAAM,mBAAmB,CAAC;AAa3B,OAAO,KAAK,EAAE,cAAc,EAAmB,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAInF,4CAA4C;AAC5C,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,kCAAuC,GAC/C,OAAO,CAAC,yCAAyC,CAAC,CAgBpD;AAED,wEAAwE;AACxE,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,mCAAwC,GAChD,UAAU,CAAC,cAAc,CAAC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC,CAkB1E;AAED,qCAAqC;AACrC,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,gCAAqC,GAC7C,OAAO,CAAC,qBAAqB,CAAC,CAchC;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,mCAAwC,GAChD,OAAO,CAAC,mCAAmC,CAAC,CAa9C;AAED,iFAAiF;AACjF,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,mCAAwC,GAChD,UAAU,CAAC,cAAc,CAAC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC,CAkB1E"}
|
|
@@ -30,17 +30,23 @@ async function listVectorStoreFiles(context, vectorStoreId, options = {}) {
|
|
|
30
30
|
return ConvertFromWire.convertOpenAIPageableListOfVectorStoreFileOutput(result.body);
|
|
31
31
|
}
|
|
32
32
|
/** Create a vector store file by attaching a file to a vector store. */
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
(0,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
function createVectorStoreFile(context, vectorStoreId, options = {}) {
|
|
34
|
+
var _a;
|
|
35
|
+
return (0, poller_js_1.createPoller)({
|
|
36
|
+
initOperation: async () => {
|
|
37
|
+
return createVectorStoreFileInternal(context, vectorStoreId, options);
|
|
38
|
+
},
|
|
39
|
+
pollOperation: async (currentResult) => {
|
|
40
|
+
return getVectorStoreFile(context, vectorStoreId, currentResult.id, options);
|
|
41
|
+
},
|
|
42
|
+
getOperationStatus: getLroOperationStatus,
|
|
43
|
+
getOperationError: (result) => {
|
|
44
|
+
return result.status === "failed" && result.lastError
|
|
45
|
+
? new Error(`Operation failed with code ${result.lastError.code}: ${result.lastError.message}`)
|
|
46
|
+
: undefined;
|
|
47
|
+
},
|
|
48
|
+
intervalInMs: (_a = options.pollingOptions) === null || _a === void 0 ? void 0 : _a.sleepIntervalInMs,
|
|
49
|
+
});
|
|
44
50
|
}
|
|
45
51
|
/** Retrieves a vector store file. */
|
|
46
52
|
async function getVectorStoreFile(context, vectorStoreId, fileId, options = {}) {
|
|
@@ -73,24 +79,47 @@ async function deleteVectorStoreFile(context, vectorStoreId, fileId, options = {
|
|
|
73
79
|
}
|
|
74
80
|
/** Create a vector store file by attaching a file to a vector store and poll. */
|
|
75
81
|
function createVectorStoreFileAndPoll(context, vectorStoreId, options = {}) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
pollingOptions: options.pollingOptions,
|
|
82
|
+
var _a;
|
|
83
|
+
return (0, poller_js_1.createPoller)({
|
|
84
|
+
initOperation: async () => {
|
|
85
|
+
return createVectorStoreFileInternal(context, vectorStoreId, options);
|
|
86
|
+
},
|
|
87
|
+
pollOperation: async (currentResult) => {
|
|
88
|
+
return getVectorStoreFile(context, vectorStoreId, currentResult.id, options);
|
|
89
|
+
},
|
|
90
|
+
getOperationStatus: getLroOperationStatus,
|
|
91
|
+
getOperationError: (result) => {
|
|
92
|
+
return result.status === "failed" && result.lastError
|
|
93
|
+
? new Error(`Operation failed with code ${result.lastError.code}: ${result.lastError.message}`)
|
|
94
|
+
: undefined;
|
|
95
|
+
},
|
|
96
|
+
intervalInMs: (_a = options.pollingOptions) === null || _a === void 0 ? void 0 : _a.sleepIntervalInMs,
|
|
92
97
|
});
|
|
93
98
|
}
|
|
99
|
+
async function createVectorStoreFileInternal(context, vectorStoreId, options = {}) {
|
|
100
|
+
const createOptions = Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), ConvertParamsToWire.convertCreateVectorStoreFileParam({ body: options }));
|
|
101
|
+
(0, inputValidations_js_1.validateVectorStoreId)(vectorStoreId);
|
|
102
|
+
validateCreateVectorStoreFileParameters(createOptions);
|
|
103
|
+
const result = await context
|
|
104
|
+
.path("/vector_stores/{vectorStoreId}/files", vectorStoreId)
|
|
105
|
+
.post(createOptions);
|
|
106
|
+
if (!expectedStatuses.includes(result.status)) {
|
|
107
|
+
throw (0, openAIError_js_1.createOpenAIError)(result);
|
|
108
|
+
}
|
|
109
|
+
return ConvertFromWire.convertVectorStoreFileOutput(result.body);
|
|
110
|
+
}
|
|
111
|
+
function getLroOperationStatus(result) {
|
|
112
|
+
switch (result.status) {
|
|
113
|
+
case "in_progress":
|
|
114
|
+
return "running";
|
|
115
|
+
case "completed":
|
|
116
|
+
return "succeeded";
|
|
117
|
+
case "cancelled":
|
|
118
|
+
return "canceled";
|
|
119
|
+
default:
|
|
120
|
+
return "failed";
|
|
121
|
+
}
|
|
122
|
+
}
|
|
94
123
|
function validateListVectorStoreFilesParameters(options) {
|
|
95
124
|
var _a, _b, _c;
|
|
96
125
|
if ((_a = options === null || options === void 0 ? void 0 : options.queryParameters) === null || _a === void 0 ? void 0 : _a.filter) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectorStoresFiles.js","sourceRoot":"","sources":["../../../src/agents/vectorStoresFiles.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAsClC,oDAoBC;AAGD,sDAmBC;AAGD,gDAmBC;AAMD,sDAkBC;AAGD,oEAwBC;;AAtJD,yDAA8E;AAU9E,2CAA2C;AAQ3C,+DAM+B;AAC/B,4FAA2F;AAE3F,yGAAmF;AACnF,yGAAmF;AACnF,qDAAqD;AAGrD,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;AAEjC,4CAA4C;AACrC,KAAK,UAAU,oBAAoB,CACxC,OAAe,EACf,aAAqB,EACrB,UAA8C,EAAE;IAEhD,IAAA,2CAAqB,EAAC,aAAa,CAAC,CAAC;IAErC,MAAM,WAAW,mCACZ,IAAA,iDAAmC,EAAC,OAAO,CAAC,KAC/C,eAAe,EAAE,IAAA,yDAA4B,EAAC,OAAO,CAAC,GACvD,CAAC;IAEF,sCAAsC,CAAC,WAAW,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,MAAM,OAAO;SACzB,IAAI,CAAC,sCAAsC,EAAE,aAAa,CAAC;SAC3D,GAAG,CAAC,WAAW,CAAC,CAAC;IACpB,IAAI,CAAC,gBAAgB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AC;QACD,OAAO;YACL,MAAM,EAAE,eAAe;YACvB,SAAS,EAAE,eAAe,CAAC,MAAM,KAAK,aAAa;SACpD,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,wBAAY,CAAwB;QAC7C,MAAM,EAAE,+BAA+B;QACvC,cAAc,EAAE,OAAO,CAAC,cAAc;KACvC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,sCAAsC,CAAC,OAAwC;;IACtF,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,MAAM,EAAE,CAAC;QACrC,IAAA,8CAAwB,EAAC,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,IAAA,mCAAa,EAAC,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,IAAA,mCAAa,EAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC;AAED,SAAS,uCAAuC,CAAC,OAAyC;;IACxF,IAAI,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,iBAAiB,KAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QAC9D,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAChF,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 ListVectorStoreFilesParameters,\n CreateVectorStoreFileParameters,\n} from \"../generated/src/parameters.js\";\nimport type {\n OpenAIPageableListOfVectorStoreFileOutput,\n VectorStoreFileDeletionStatusOutput,\n VectorStoreFileOutput,\n} from \"../customization/outputModels.js\";\nimport { AgentsPoller } from \"./poller.js\";\nimport type {\n CreateVectorStoreFileOptionalParams,\n CreateVectorStoreFileWithPollingOptionalParams,\n DeleteVectorStoreFileOptionalParams,\n GetVectorStoreFileOptionalParams,\n ListVectorStoreFilesOptionalParams,\n} from \"./customModels.js\";\nimport {\n validateFileId,\n validateFileStatusFilter,\n validateLimit,\n validateOrder,\n validateVectorStoreId,\n} from \"./inputValidations.js\";\nimport { convertToListQueryParameters } from \"../customization/convertParametersToWire.js\";\nimport type * as GeneratedParameters from \"../generated/src/parameters.js\";\nimport * as ConvertFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport * as ConvertParamsToWire 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 store files. */\nexport async function listVectorStoreFiles(\n context: Client,\n vectorStoreId: string,\n options: ListVectorStoreFilesOptionalParams = {},\n): Promise<OpenAIPageableListOfVectorStoreFileOutput> {\n validateVectorStoreId(vectorStoreId);\n\n const listOptions: GeneratedParameters.ListVectorStoreFilesParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: convertToListQueryParameters(options),\n };\n\n validateListVectorStoreFilesParameters(listOptions);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/files\", vectorStoreId)\n .get(listOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertOpenAIPageableListOfVectorStoreFileOutput(result.body);\n}\n\n/** Create a vector store file by attaching a file to a vector store. */\nexport async function createVectorStoreFile(\n context: Client,\n vectorStoreId: string,\n options: CreateVectorStoreFileOptionalParams = {},\n): Promise<VectorStoreFileOutput> {\n const createOptions: CreateVectorStoreFileParameters = {\n ...operationOptionsToRequestParameters(options),\n ...ConvertParamsToWire.convertCreateVectorStoreFileParam({ body: options }),\n };\n\n validateVectorStoreId(vectorStoreId);\n validateCreateVectorStoreFileParameters(createOptions);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/files\", vectorStoreId)\n .post(createOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreFileOutput(result.body);\n}\n\n/** Retrieves a vector store file. */\nexport async function getVectorStoreFile(\n context: Client,\n vectorStoreId: string,\n fileId: string,\n options: GetVectorStoreFileOptionalParams = {},\n): Promise<VectorStoreFileOutput> {\n const getOptions: GeneratedParameters.GetVectorStoreFileParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateVectorStoreId(vectorStoreId);\n validateFileId(fileId);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/files/{fileId}\", vectorStoreId, fileId)\n .get(getOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreFileOutput(result.body);\n}\n\n/**\n * Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted.\n * To delete the file, use the delete file endpoint.\n */\nexport async function deleteVectorStoreFile(\n context: Client,\n vectorStoreId: string,\n fileId: string,\n options: DeleteVectorStoreFileOptionalParams = {},\n): Promise<VectorStoreFileDeletionStatusOutput> {\n validateVectorStoreId(vectorStoreId);\n validateFileId(fileId);\n const deleteOptions: GeneratedParameters.GetVectorStoreFileParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/files/{fileId}\", vectorStoreId, fileId)\n .delete(deleteOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreFileDeletionStatusOutput(result.body);\n}\n\n/** Create a vector store file by attaching a file to a vector store and poll. */\nexport function createVectorStoreFileAndPoll(\n context: Client,\n vectorStoreId: string,\n options: CreateVectorStoreFileWithPollingOptionalParams = {},\n): PollerLike<PollOperationState<VectorStoreFileOutput>, VectorStoreFileOutput> {\n async function updateCreateVectorStoreFilePoll(\n currentResult?: VectorStoreFileOutput,\n ): Promise<{ result: VectorStoreFileOutput; completed: boolean }> {\n let vectorStoreFile: VectorStoreFileOutput;\n if (!currentResult) {\n vectorStoreFile = await createVectorStoreFile(context, vectorStoreId, options);\n } else {\n vectorStoreFile = await getVectorStoreFile(context, vectorStoreId, currentResult.id, options);\n }\n return {\n result: vectorStoreFile,\n completed: vectorStoreFile.status !== \"in_progress\",\n };\n }\n\n return new AgentsPoller<VectorStoreFileOutput>({\n update: updateCreateVectorStoreFilePoll,\n pollingOptions: options.pollingOptions,\n });\n}\n\nfunction validateListVectorStoreFilesParameters(options?: ListVectorStoreFilesParameters): void {\n if (options?.queryParameters?.filter) {\n validateFileStatusFilter(options.queryParameters.filter);\n }\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 validateCreateVectorStoreFileParameters(options?: CreateVectorStoreFileParameters): void {\n if (options?.body?.chunking_strategy && !options.body.file_id) {\n throw new Error(\"Chunking strategy is only applicable if fileId is included\");\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"vectorStoresFiles.js","sourceRoot":"","sources":["../../../src/agents/vectorStoresFiles.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAqClC,oDAoBC;AAGD,sDAsBC;AAGD,gDAmBC;AAMD,sDAkBC;AAGD,oEAsBC;;AAtJD,yDAA8E;AAU9E,2CAA2C;AAO3C,+DAM+B;AAC/B,4FAA2F;AAE3F,yGAAmF;AACnF,yGAAmF;AACnF,qDAAqD;AAGrD,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;AAEjC,4CAA4C;AACrC,KAAK,UAAU,oBAAoB,CACxC,OAAe,EACf,aAAqB,EACrB,UAA8C,EAAE;IAEhD,IAAA,2CAAqB,E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C,4DAA4D,CAAC,CAAC;IAChF,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 ListVectorStoreFilesParameters,\n CreateVectorStoreFileParameters,\n} from \"../generated/src/parameters.js\";\nimport type {\n OpenAIPageableListOfVectorStoreFileOutput,\n VectorStoreFileDeletionStatusOutput,\n VectorStoreFileOutput,\n} from \"../customization/outputModels.js\";\nimport { createPoller } from \"./poller.js\";\nimport type {\n CreateVectorStoreFileOptionalParams,\n DeleteVectorStoreFileOptionalParams,\n GetVectorStoreFileOptionalParams,\n ListVectorStoreFilesOptionalParams,\n} from \"./customModels.js\";\nimport {\n validateFileId,\n validateFileStatusFilter,\n validateLimit,\n validateOrder,\n validateVectorStoreId,\n} from \"./inputValidations.js\";\nimport { convertToListQueryParameters } from \"../customization/convertParametersToWire.js\";\nimport type * as GeneratedParameters from \"../generated/src/parameters.js\";\nimport * as ConvertFromWire from \"../customization/convertOutputModelsFromWire.js\";\nimport * as ConvertParamsToWire 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 store files. */\nexport async function listVectorStoreFiles(\n context: Client,\n vectorStoreId: string,\n options: ListVectorStoreFilesOptionalParams = {},\n): Promise<OpenAIPageableListOfVectorStoreFileOutput> {\n validateVectorStoreId(vectorStoreId);\n\n const listOptions: GeneratedParameters.ListVectorStoreFilesParameters = {\n ...operationOptionsToRequestParameters(options),\n queryParameters: convertToListQueryParameters(options),\n };\n\n validateListVectorStoreFilesParameters(listOptions);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/files\", vectorStoreId)\n .get(listOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertOpenAIPageableListOfVectorStoreFileOutput(result.body);\n}\n\n/** Create a vector store file by attaching a file to a vector store. */\nexport function createVectorStoreFile(\n context: Client,\n vectorStoreId: string,\n options: CreateVectorStoreFileOptionalParams = {},\n): PollerLike<OperationState<VectorStoreFileOutput>, VectorStoreFileOutput> {\n return createPoller<VectorStoreFileOutput>({\n initOperation: async () => {\n return createVectorStoreFileInternal(context, vectorStoreId, options);\n },\n pollOperation: async (currentResult: VectorStoreFileOutput) => {\n return getVectorStoreFile(context, vectorStoreId, currentResult.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n getOperationError: (result: VectorStoreFileOutput) => {\n return result.status === \"failed\" && result.lastError\n ? new Error(\n `Operation failed with code ${result.lastError.code}: ${result.lastError.message}`,\n )\n : undefined;\n },\n intervalInMs: options.pollingOptions?.sleepIntervalInMs,\n });\n}\n\n/** Retrieves a vector store file. */\nexport async function getVectorStoreFile(\n context: Client,\n vectorStoreId: string,\n fileId: string,\n options: GetVectorStoreFileOptionalParams = {},\n): Promise<VectorStoreFileOutput> {\n const getOptions: GeneratedParameters.GetVectorStoreFileParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n\n validateVectorStoreId(vectorStoreId);\n validateFileId(fileId);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/files/{fileId}\", vectorStoreId, fileId)\n .get(getOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreFileOutput(result.body);\n}\n\n/**\n * Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted.\n * To delete the file, use the delete file endpoint.\n */\nexport async function deleteVectorStoreFile(\n context: Client,\n vectorStoreId: string,\n fileId: string,\n options: DeleteVectorStoreFileOptionalParams = {},\n): Promise<VectorStoreFileDeletionStatusOutput> {\n validateVectorStoreId(vectorStoreId);\n validateFileId(fileId);\n const deleteOptions: GeneratedParameters.GetVectorStoreFileParameters = {\n ...operationOptionsToRequestParameters(options),\n };\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/files/{fileId}\", vectorStoreId, fileId)\n .delete(deleteOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreFileDeletionStatusOutput(result.body);\n}\n\n/** Create a vector store file by attaching a file to a vector store and poll. */\nexport function createVectorStoreFileAndPoll(\n context: Client,\n vectorStoreId: string,\n options: CreateVectorStoreFileOptionalParams = {},\n): PollerLike<OperationState<VectorStoreFileOutput>, VectorStoreFileOutput> {\n return createPoller<VectorStoreFileOutput>({\n initOperation: async () => {\n return createVectorStoreFileInternal(context, vectorStoreId, options);\n },\n pollOperation: async (currentResult: VectorStoreFileOutput) => {\n return getVectorStoreFile(context, vectorStoreId, currentResult.id, options);\n },\n getOperationStatus: getLroOperationStatus,\n getOperationError: (result: VectorStoreFileOutput) => {\n return result.status === \"failed\" && result.lastError\n ? new Error(\n `Operation failed with code ${result.lastError.code}: ${result.lastError.message}`,\n )\n : undefined;\n },\n intervalInMs: options.pollingOptions?.sleepIntervalInMs,\n });\n}\n\nasync function createVectorStoreFileInternal(\n context: Client,\n vectorStoreId: string,\n options: CreateVectorStoreFileOptionalParams = {},\n): Promise<VectorStoreFileOutput> {\n const createOptions: CreateVectorStoreFileParameters = {\n ...operationOptionsToRequestParameters(options),\n ...ConvertParamsToWire.convertCreateVectorStoreFileParam({ body: options }),\n };\n\n validateVectorStoreId(vectorStoreId);\n validateCreateVectorStoreFileParameters(createOptions);\n const result = await context\n .path(\"/vector_stores/{vectorStoreId}/files\", vectorStoreId)\n .post(createOptions);\n if (!expectedStatuses.includes(result.status)) {\n throw createOpenAIError(result);\n }\n return ConvertFromWire.convertVectorStoreFileOutput(result.body);\n}\n\nfunction getLroOperationStatus(result: VectorStoreFileOutput): OperationStatus {\n switch (result.status) {\n case \"in_progress\":\n return \"running\";\n case \"completed\":\n return \"succeeded\";\n case \"cancelled\":\n return \"canceled\";\n default:\n return \"failed\";\n }\n}\n\nfunction validateListVectorStoreFilesParameters(options?: ListVectorStoreFilesParameters): void {\n if (options?.queryParameters?.filter) {\n validateFileStatusFilter(options.queryParameters.filter);\n }\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 validateCreateVectorStoreFileParameters(options?: CreateVectorStoreFileParameters): void {\n if (options?.body?.chunking_strategy && !options.body.file_id) {\n throw new Error(\"Chunking strategy is only applicable if fileId is included\");\n }\n}\n"]}
|
|
@@ -6,7 +6,7 @@ exports.PACKAGE_NAME = exports.SDK_VERSION = void 0;
|
|
|
6
6
|
/**
|
|
7
7
|
* Current version of the `@azure/ai-projects` package.
|
|
8
8
|
*/
|
|
9
|
-
exports.SDK_VERSION = `1.0.0-beta.
|
|
9
|
+
exports.SDK_VERSION = `1.0.0-beta.3`;
|
|
10
10
|
/**
|
|
11
11
|
* The package name of the `@azure/ai-projects` package.
|
|
12
12
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;GAEG;AACU,QAAA,WAAW,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACU,QAAA,YAAY,GAAG,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Current version of the `@azure/ai-projects` package.\n */\nexport const SDK_VERSION = `1.0.0-beta.
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;GAEG;AACU,QAAA,WAAW,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACU,QAAA,YAAY,GAAG,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Current version of the `@azure/ai-projects` package.\n */\nexport const SDK_VERSION = `1.0.0-beta.3`;\n\n/**\n * The package name of the `@azure/ai-projects` package.\n */\nexport const PACKAGE_NAME = \"@azure/ai-projects\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertModelsToWrite.d.ts","sourceRoot":"","sources":["../../../src/customization/convertModelsToWrite.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,YAAY,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,KAAK,eAAe,MAAM,4BAA4B,CAAC;AAGnE,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,YAAY,CAAC,kBAAkB,GACtC,eAAe,CAAC,kBAAkB,CAapC;
|
|
1
|
+
{"version":3,"file":"convertModelsToWrite.d.ts","sourceRoot":"","sources":["../../../src/customization/convertModelsToWrite.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,YAAY,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,KAAK,eAAe,MAAM,4BAA4B,CAAC;AAGnE,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,YAAY,CAAC,kBAAkB,GACtC,eAAe,CAAC,kBAAkB,CAapC;AAsKD,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,YAAY,CAAC,qBAAqB,GACzC,eAAe,CAAC,qBAAqB,CAKvC;AA4ED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,YAAY,CAAC,kBAAkB,GACtC,eAAe,CAAC,kBAAkB,CAapC;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,YAAY,CAAC,0BAA0B,GAC9C,eAAe,CAAC,0BAA0B,CAM5C;AAED,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,YAAY,CAAC,wBAAwB,GAC5C,eAAe,CAAC,wBAAwB,CAK1C;AAyBD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,YAAY,CAAC,gBAAgB,GACpC,eAAe,CAAC,gBAAgB,CA0BlC;AA2CD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,CAAC,UAAU,GAAG,eAAe,CAAC,UAAU,CAK7F;AAED,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,YAAY,CAAC,yBAAyB,GAC7C,eAAe,CAAC,yBAAyB,CAwB3C;AAWD,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,YAAY,CAAC,kBAAkB,GACtC,eAAe,CAAC,kBAAkB,CAepC;AAED,wBAAgB,yCAAyC,CACvD,MAAM,EAAE,YAAY,CAAC,kCAAkC,GACtD,eAAe,CAAC,kCAAkC,CAWpD;AAoBD,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,YAAY,CAAC,wBAAwB,GAC5C,eAAe,CAAC,wBAAwB,CAQ1C"}
|
|
@@ -18,10 +18,12 @@ function convertCreateAgentOptions(source) {
|
|
|
18
18
|
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ model: source.model }, (source.name && { name: source.name })), (source.description && { description: source.description })), (source.instructions && { instructions: source.instructions })), (source.tools && { tools: source.tools.map(convertToolDefinition) })), (source.toolResources && { tool_resources: convertToolResources(source.toolResources) })), (source.temperature !== undefined && { temperature: source.temperature })), (source.topP !== undefined && { top_p: source.topP })), (source.responseFormat && { response_format: source.responseFormat })), (source.metadata && { metadata: source.metadata }));
|
|
19
19
|
}
|
|
20
20
|
function convertToolResources(source) {
|
|
21
|
-
return Object.assign(Object.assign(Object.assign({}, (source.codeInterpreter && {
|
|
21
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, (source.codeInterpreter && {
|
|
22
22
|
code_interpreter: convertCodeInterpreterToolResource(source.codeInterpreter),
|
|
23
23
|
})), (source.fileSearch && { file_search: convertFileSearchToolResource(source.fileSearch) })), (source.azureAISearch && {
|
|
24
24
|
azure_ai_search: convertAzureAISearchResource(source.azureAISearch),
|
|
25
|
+
})), (source.azureFunction && {
|
|
26
|
+
name: source.azureFunction.name,
|
|
25
27
|
}));
|
|
26
28
|
}
|
|
27
29
|
function convertMessageAttachmentToolDefinition(source) {
|
|
@@ -50,6 +52,10 @@ function convertToolDefinition(source) {
|
|
|
50
52
|
return convertSharepointToolDefinition(source);
|
|
51
53
|
case "azure_ai_search":
|
|
52
54
|
return convertAzureAISearchToolDefinition(source);
|
|
55
|
+
case "openapi":
|
|
56
|
+
return convertOpenApiToolDefinition(source);
|
|
57
|
+
case "azure_function":
|
|
58
|
+
return convertAzureFunctionToolDefinition(source);
|
|
53
59
|
default:
|
|
54
60
|
throw new Error(`Unknown tool type: ${source.type}`);
|
|
55
61
|
}
|
|
@@ -79,7 +85,7 @@ function convertBingGroundingToolDefinition(source) {
|
|
|
79
85
|
function convertMicrosoftFabricToolDefinition(source) {
|
|
80
86
|
return {
|
|
81
87
|
type: source.type,
|
|
82
|
-
|
|
88
|
+
fabric_aiskill: convertToolConnectionList(source.fabricAISkill),
|
|
83
89
|
};
|
|
84
90
|
}
|
|
85
91
|
function convertSharepointToolDefinition(source) {
|
|
@@ -93,6 +99,12 @@ function convertAzureAISearchToolDefinition(source) {
|
|
|
93
99
|
type: source.type,
|
|
94
100
|
};
|
|
95
101
|
}
|
|
102
|
+
function convertOpenApiToolDefinition(source) {
|
|
103
|
+
return {
|
|
104
|
+
type: source.type,
|
|
105
|
+
openapi: source.openapi,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
96
108
|
function convertFileSearchToolDefinitionDetails(source) {
|
|
97
109
|
return Object.assign(Object.assign({}, (source.maxNumResults && { max_num_results: source.maxNumResults })), (source.rankingOptions && {
|
|
98
110
|
ranking_options: convertFileSearchRankingOptions(source.rankingOptions),
|
|
@@ -120,6 +132,31 @@ function convertFileSearchToolResource(source) {
|
|
|
120
132
|
vector_stores: source.vectorStores.map(convertVectorStoreConfigurations),
|
|
121
133
|
}));
|
|
122
134
|
}
|
|
135
|
+
function convertAzureFunctionToolDefinition(source) {
|
|
136
|
+
return {
|
|
137
|
+
type: source.type,
|
|
138
|
+
azure_function: convertAzureFunctionDefinition(source.azureFunction),
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function convertAzureFunctionDefinition(source) {
|
|
142
|
+
return {
|
|
143
|
+
function: source.function,
|
|
144
|
+
input_binding: {
|
|
145
|
+
type: source.inputBinding.type,
|
|
146
|
+
storage_queue: {
|
|
147
|
+
queue_service_endpoint: source.inputBinding.storageQueue.queueServiceEndpoint,
|
|
148
|
+
queue_name: source.inputBinding.storageQueue.queueName,
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
output_binding: {
|
|
152
|
+
type: source.outputBinding.type,
|
|
153
|
+
storage_queue: {
|
|
154
|
+
queue_service_endpoint: source.outputBinding.storageQueue.queueServiceEndpoint,
|
|
155
|
+
queue_name: source.outputBinding.storageQueue.queueName,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
}
|
|
123
160
|
function convertVectorStoreConfigurations(source) {
|
|
124
161
|
return {
|
|
125
162
|
name: source.name,
|
|
@@ -153,15 +190,15 @@ function convertThreadMessageOptions(source) {
|
|
|
153
190
|
return Object.assign(Object.assign({ role: source.role, content: source.content }, (source.attachments && { attachments: source.attachments.map(convertMessageAttachment) })), (source.metadata && { metadata: source.metadata }));
|
|
154
191
|
}
|
|
155
192
|
function convertMessageAttachment(source) {
|
|
156
|
-
return Object.assign(Object.assign({ file_id: source.fileId }, (source.
|
|
157
|
-
|
|
193
|
+
return Object.assign(Object.assign({ file_id: source.fileId }, (source.dataSource && {
|
|
194
|
+
data_source: convertVectorStoreDataSource(source.dataSource),
|
|
158
195
|
})), (source.tools && { tools: source.tools.map(convertMessageAttachmentToolDefinition) }));
|
|
159
196
|
}
|
|
160
197
|
function convertCreateRunOptions(source) {
|
|
161
198
|
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ assistant_id: source.assistantId }, (source.model && { model: source.model })), (source.instructions && { instructions: source.instructions })), (source.additionalInstructions && {
|
|
162
199
|
additional_instructions: source.additionalInstructions,
|
|
163
200
|
})), (source.additionalMessages && {
|
|
164
|
-
additional_messages: source.additionalMessages.map(
|
|
201
|
+
additional_messages: source.additionalMessages.map(convertThreadMessageOptions),
|
|
165
202
|
})), (source.tools && { tools: source.tools.map(convertToolDefinition) })), (source.stream !== undefined && { stream: source.stream })), (source.temperature !== undefined && { temperature: source.temperature })), (source.topP !== undefined && { top_p: source.topP })), (source.maxPromptTokens !== undefined && { max_prompt_tokens: source.maxPromptTokens })), (source.maxCompletionTokens !== undefined && {
|
|
166
203
|
max_completion_tokens: source.maxCompletionTokens,
|
|
167
204
|
})), (source.truncationStrategy && {
|
|
@@ -248,92 +285,4 @@ function convertToolConnection(source) {
|
|
|
248
285
|
connection_id: source.connectionId,
|
|
249
286
|
};
|
|
250
287
|
}
|
|
251
|
-
function convertThreadMessage(source) {
|
|
252
|
-
var _a;
|
|
253
|
-
return {
|
|
254
|
-
id: source.id,
|
|
255
|
-
object: source.object,
|
|
256
|
-
created_at: source.createdAt,
|
|
257
|
-
thread_id: source.threadId,
|
|
258
|
-
status: source.status,
|
|
259
|
-
incomplete_details: !source.incompleteDetails
|
|
260
|
-
? source.incompleteDetails
|
|
261
|
-
: convertMessageIncompleteDetails(source.incompleteDetails),
|
|
262
|
-
completed_at: source.completedAt,
|
|
263
|
-
incomplete_at: source.incompleteAt,
|
|
264
|
-
role: source.role,
|
|
265
|
-
content: source.content.map(convertMessageContent),
|
|
266
|
-
assistant_id: source.assistantId,
|
|
267
|
-
run_id: source.runId,
|
|
268
|
-
attachments: !source.attachments
|
|
269
|
-
? source.attachments
|
|
270
|
-
: (_a = source.attachments) === null || _a === void 0 ? void 0 : _a.map(convertMessageAttachment),
|
|
271
|
-
metadata: source.metadata,
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
function convertMessageIncompleteDetails(source) {
|
|
275
|
-
return {
|
|
276
|
-
reason: source.reason,
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
function convertMessageContent(source) {
|
|
280
|
-
switch (source.type) {
|
|
281
|
-
case "text":
|
|
282
|
-
return convertMessageTextContent(source);
|
|
283
|
-
case "image_file":
|
|
284
|
-
return convertMessageImageFileContent(source);
|
|
285
|
-
default:
|
|
286
|
-
throw new Error(`Unknown message content type: ${source.type}`);
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
function convertMessageTextContent(source) {
|
|
290
|
-
return {
|
|
291
|
-
type: "text",
|
|
292
|
-
text: convertMessageTextDetails(source.text),
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
function convertMessageTextDetails(source) {
|
|
296
|
-
return {
|
|
297
|
-
value: source.value,
|
|
298
|
-
annotations: source.annotations.map(convertMessageTextAnnotation),
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
function convertMessageTextAnnotation(source) {
|
|
302
|
-
switch (source.type) {
|
|
303
|
-
case "file_citation":
|
|
304
|
-
return convertMessageTextFileCitationAnnotation(source);
|
|
305
|
-
case "file_path":
|
|
306
|
-
return convertMessageTextFilePathAnnotation(source);
|
|
307
|
-
default:
|
|
308
|
-
throw new Error(`Unknown message text annotation type: ${source.type}`);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
function convertMessageTextFileCitationAnnotation(source) {
|
|
312
|
-
return Object.assign(Object.assign({ text: source.text, type: "file_citation", file_citation: convertMessageTextFileCitationDetails(source.fileCitation) }, (source.startIndex && { start_index: source.startIndex })), (source.endIndex && { end_index: source.endIndex }));
|
|
313
|
-
}
|
|
314
|
-
function convertMessageTextFileCitationDetails(source) {
|
|
315
|
-
return {
|
|
316
|
-
file_id: source.fileId,
|
|
317
|
-
quote: source.quote,
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
function convertMessageTextFilePathAnnotation(source) {
|
|
321
|
-
return Object.assign(Object.assign({ text: source.text, type: "file_path", file_path: convertMessageTextFilePathDetails(source.filePath) }, (source.startIndex && { start_index: source.startIndex })), (source.endIndex && { end_index: source.endIndex }));
|
|
322
|
-
}
|
|
323
|
-
function convertMessageTextFilePathDetails(source) {
|
|
324
|
-
return {
|
|
325
|
-
file_id: source.fileId,
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
function convertMessageImageFileContent(source) {
|
|
329
|
-
return {
|
|
330
|
-
type: "image_file",
|
|
331
|
-
image_file: convertMessageImageFileDetails(source.imageFile),
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
function convertMessageImageFileDetails(source) {
|
|
335
|
-
return {
|
|
336
|
-
file_id: source.fileId,
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
288
|
//# sourceMappingURL=convertModelsToWrite.js.map
|