@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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AC;AAED,SAAS,eAAe,CAAC,OAAe;IACtC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC;AAED,SAAS,4CAA4C,CACnD,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,wBAAwB,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,aAAa,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,aAAa,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC","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;AAGlC,OAAO,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAC;AAK9E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAO3C,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,aAAa,EACb,qBAAqB,GACtB,M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rB,KAAK,WAAW;YACd,OAAO,UAAU,CAAC;QACpB;YACE,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,OAAe;IACtC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC;AAED,SAAS,4CAA4C,CACnD,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,wBAAwB,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,aAAa,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,aAAa,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC","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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { operationOptionsToRequestParameters } from "@azure-rest/core-client";
|
|
4
|
-
import {
|
|
4
|
+
import { createPoller } from "./poller.js";
|
|
5
5
|
import { validateFileId, validateFileStatusFilter, validateLimit, validateOrder, validateVectorStoreId, } from "./inputValidations.js";
|
|
6
6
|
import { convertToListQueryParameters } from "../customization/convertParametersToWire.js";
|
|
7
7
|
import * as ConvertFromWire from "../customization/convertOutputModelsFromWire.js";
|
|
@@ -22,17 +22,23 @@ export async function listVectorStoreFiles(context, vectorStoreId, options = {})
|
|
|
22
22
|
return ConvertFromWire.convertOpenAIPageableListOfVectorStoreFileOutput(result.body);
|
|
23
23
|
}
|
|
24
24
|
/** Create a vector store file by attaching a file to a vector store. */
|
|
25
|
-
export
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
export function createVectorStoreFile(context, vectorStoreId, options = {}) {
|
|
26
|
+
var _a;
|
|
27
|
+
return createPoller({
|
|
28
|
+
initOperation: async () => {
|
|
29
|
+
return createVectorStoreFileInternal(context, vectorStoreId, options);
|
|
30
|
+
},
|
|
31
|
+
pollOperation: async (currentResult) => {
|
|
32
|
+
return getVectorStoreFile(context, vectorStoreId, currentResult.id, options);
|
|
33
|
+
},
|
|
34
|
+
getOperationStatus: getLroOperationStatus,
|
|
35
|
+
getOperationError: (result) => {
|
|
36
|
+
return result.status === "failed" && result.lastError
|
|
37
|
+
? new Error(`Operation failed with code ${result.lastError.code}: ${result.lastError.message}`)
|
|
38
|
+
: undefined;
|
|
39
|
+
},
|
|
40
|
+
intervalInMs: (_a = options.pollingOptions) === null || _a === void 0 ? void 0 : _a.sleepIntervalInMs,
|
|
41
|
+
});
|
|
36
42
|
}
|
|
37
43
|
/** Retrieves a vector store file. */
|
|
38
44
|
export async function getVectorStoreFile(context, vectorStoreId, fileId, options = {}) {
|
|
@@ -65,24 +71,47 @@ export async function deleteVectorStoreFile(context, vectorStoreId, fileId, opti
|
|
|
65
71
|
}
|
|
66
72
|
/** Create a vector store file by attaching a file to a vector store and poll. */
|
|
67
73
|
export function createVectorStoreFileAndPoll(context, vectorStoreId, options = {}) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
pollingOptions: options.pollingOptions,
|
|
74
|
+
var _a;
|
|
75
|
+
return createPoller({
|
|
76
|
+
initOperation: async () => {
|
|
77
|
+
return createVectorStoreFileInternal(context, vectorStoreId, options);
|
|
78
|
+
},
|
|
79
|
+
pollOperation: async (currentResult) => {
|
|
80
|
+
return getVectorStoreFile(context, vectorStoreId, currentResult.id, options);
|
|
81
|
+
},
|
|
82
|
+
getOperationStatus: getLroOperationStatus,
|
|
83
|
+
getOperationError: (result) => {
|
|
84
|
+
return result.status === "failed" && result.lastError
|
|
85
|
+
? new Error(`Operation failed with code ${result.lastError.code}: ${result.lastError.message}`)
|
|
86
|
+
: undefined;
|
|
87
|
+
},
|
|
88
|
+
intervalInMs: (_a = options.pollingOptions) === null || _a === void 0 ? void 0 : _a.sleepIntervalInMs,
|
|
84
89
|
});
|
|
85
90
|
}
|
|
91
|
+
async function createVectorStoreFileInternal(context, vectorStoreId, options = {}) {
|
|
92
|
+
const createOptions = Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), ConvertParamsToWire.convertCreateVectorStoreFileParam({ body: options }));
|
|
93
|
+
validateVectorStoreId(vectorStoreId);
|
|
94
|
+
validateCreateVectorStoreFileParameters(createOptions);
|
|
95
|
+
const result = await context
|
|
96
|
+
.path("/vector_stores/{vectorStoreId}/files", vectorStoreId)
|
|
97
|
+
.post(createOptions);
|
|
98
|
+
if (!expectedStatuses.includes(result.status)) {
|
|
99
|
+
throw createOpenAIError(result);
|
|
100
|
+
}
|
|
101
|
+
return ConvertFromWire.convertVectorStoreFileOutput(result.body);
|
|
102
|
+
}
|
|
103
|
+
function getLroOperationStatus(result) {
|
|
104
|
+
switch (result.status) {
|
|
105
|
+
case "in_progress":
|
|
106
|
+
return "running";
|
|
107
|
+
case "completed":
|
|
108
|
+
return "succeeded";
|
|
109
|
+
case "cancelled":
|
|
110
|
+
return "canceled";
|
|
111
|
+
default:
|
|
112
|
+
return "failed";
|
|
113
|
+
}
|
|
114
|
+
}
|
|
86
115
|
function validateListVectorStoreFilesParameters(options) {
|
|
87
116
|
var _a, _b, _c;
|
|
88
117
|
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;AAGlC,OAAO,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAC;AAU9E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA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,0CAAE,KAAK,EAAE,CAAC;QACpC,aAAa,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,aAAa,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC;AAED,SAAS,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;AAGlC,OAAO,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAC;AAU9E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAO3C,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,aAAa,EACb,aAAa,EACb,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAE3F,OAAO,KAAK,eAAe,MAAM,iDAAiD,CAAC;AACnF,OAAO,KAAK,mBAAmB,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;AAEjC,4CAA4C;AAC5C,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,OAAe,EACf,aAAqB,EACrB,UAA8C,EAAE;IAEhD,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAErC,MAAM,WAAW,mCACZ,mCAAmC,CAAC,OAAO,CAAC,KAC/C,eAAe,EAAE,4BAA4B,CAAC,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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C;QACnB,KAAK,WAAW;YACd,OAAO,WAAW,CAAC;QACrB,KAAK,WAAW;YACd,OAAO,UAAU,CAAC;QACpB;YACE,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC;AAED,SAAS,sCAAsC,CAAC,OAAwC;;IACtF,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,MAAM,EAAE,CAAC;QACrC,wBAAwB,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,aAAa,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IACD,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAC;QACpC,aAAa,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC;AAED,SAAS,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 { 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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,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;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,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"}
|
|
@@ -5,10 +5,12 @@ export function convertCreateAgentOptions(source) {
|
|
|
5
5
|
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 }));
|
|
6
6
|
}
|
|
7
7
|
function convertToolResources(source) {
|
|
8
|
-
return Object.assign(Object.assign(Object.assign({}, (source.codeInterpreter && {
|
|
8
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, (source.codeInterpreter && {
|
|
9
9
|
code_interpreter: convertCodeInterpreterToolResource(source.codeInterpreter),
|
|
10
10
|
})), (source.fileSearch && { file_search: convertFileSearchToolResource(source.fileSearch) })), (source.azureAISearch && {
|
|
11
11
|
azure_ai_search: convertAzureAISearchResource(source.azureAISearch),
|
|
12
|
+
})), (source.azureFunction && {
|
|
13
|
+
name: source.azureFunction.name,
|
|
12
14
|
}));
|
|
13
15
|
}
|
|
14
16
|
function convertMessageAttachmentToolDefinition(source) {
|
|
@@ -37,6 +39,10 @@ function convertToolDefinition(source) {
|
|
|
37
39
|
return convertSharepointToolDefinition(source);
|
|
38
40
|
case "azure_ai_search":
|
|
39
41
|
return convertAzureAISearchToolDefinition(source);
|
|
42
|
+
case "openapi":
|
|
43
|
+
return convertOpenApiToolDefinition(source);
|
|
44
|
+
case "azure_function":
|
|
45
|
+
return convertAzureFunctionToolDefinition(source);
|
|
40
46
|
default:
|
|
41
47
|
throw new Error(`Unknown tool type: ${source.type}`);
|
|
42
48
|
}
|
|
@@ -66,7 +72,7 @@ function convertBingGroundingToolDefinition(source) {
|
|
|
66
72
|
function convertMicrosoftFabricToolDefinition(source) {
|
|
67
73
|
return {
|
|
68
74
|
type: source.type,
|
|
69
|
-
|
|
75
|
+
fabric_aiskill: convertToolConnectionList(source.fabricAISkill),
|
|
70
76
|
};
|
|
71
77
|
}
|
|
72
78
|
function convertSharepointToolDefinition(source) {
|
|
@@ -80,6 +86,12 @@ function convertAzureAISearchToolDefinition(source) {
|
|
|
80
86
|
type: source.type,
|
|
81
87
|
};
|
|
82
88
|
}
|
|
89
|
+
function convertOpenApiToolDefinition(source) {
|
|
90
|
+
return {
|
|
91
|
+
type: source.type,
|
|
92
|
+
openapi: source.openapi,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
83
95
|
function convertFileSearchToolDefinitionDetails(source) {
|
|
84
96
|
return Object.assign(Object.assign({}, (source.maxNumResults && { max_num_results: source.maxNumResults })), (source.rankingOptions && {
|
|
85
97
|
ranking_options: convertFileSearchRankingOptions(source.rankingOptions),
|
|
@@ -107,6 +119,31 @@ function convertFileSearchToolResource(source) {
|
|
|
107
119
|
vector_stores: source.vectorStores.map(convertVectorStoreConfigurations),
|
|
108
120
|
}));
|
|
109
121
|
}
|
|
122
|
+
function convertAzureFunctionToolDefinition(source) {
|
|
123
|
+
return {
|
|
124
|
+
type: source.type,
|
|
125
|
+
azure_function: convertAzureFunctionDefinition(source.azureFunction),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function convertAzureFunctionDefinition(source) {
|
|
129
|
+
return {
|
|
130
|
+
function: source.function,
|
|
131
|
+
input_binding: {
|
|
132
|
+
type: source.inputBinding.type,
|
|
133
|
+
storage_queue: {
|
|
134
|
+
queue_service_endpoint: source.inputBinding.storageQueue.queueServiceEndpoint,
|
|
135
|
+
queue_name: source.inputBinding.storageQueue.queueName,
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
output_binding: {
|
|
139
|
+
type: source.outputBinding.type,
|
|
140
|
+
storage_queue: {
|
|
141
|
+
queue_service_endpoint: source.outputBinding.storageQueue.queueServiceEndpoint,
|
|
142
|
+
queue_name: source.outputBinding.storageQueue.queueName,
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
}
|
|
110
147
|
function convertVectorStoreConfigurations(source) {
|
|
111
148
|
return {
|
|
112
149
|
name: source.name,
|
|
@@ -140,15 +177,15 @@ function convertThreadMessageOptions(source) {
|
|
|
140
177
|
return Object.assign(Object.assign({ role: source.role, content: source.content }, (source.attachments && { attachments: source.attachments.map(convertMessageAttachment) })), (source.metadata && { metadata: source.metadata }));
|
|
141
178
|
}
|
|
142
179
|
function convertMessageAttachment(source) {
|
|
143
|
-
return Object.assign(Object.assign({ file_id: source.fileId }, (source.
|
|
144
|
-
|
|
180
|
+
return Object.assign(Object.assign({ file_id: source.fileId }, (source.dataSource && {
|
|
181
|
+
data_source: convertVectorStoreDataSource(source.dataSource),
|
|
145
182
|
})), (source.tools && { tools: source.tools.map(convertMessageAttachmentToolDefinition) }));
|
|
146
183
|
}
|
|
147
184
|
export function convertCreateRunOptions(source) {
|
|
148
185
|
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 && {
|
|
149
186
|
additional_instructions: source.additionalInstructions,
|
|
150
187
|
})), (source.additionalMessages && {
|
|
151
|
-
additional_messages: source.additionalMessages.map(
|
|
188
|
+
additional_messages: source.additionalMessages.map(convertThreadMessageOptions),
|
|
152
189
|
})), (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 && {
|
|
153
190
|
max_completion_tokens: source.maxCompletionTokens,
|
|
154
191
|
})), (source.truncationStrategy && {
|
|
@@ -235,92 +272,4 @@ function convertToolConnection(source) {
|
|
|
235
272
|
connection_id: source.connectionId,
|
|
236
273
|
};
|
|
237
274
|
}
|
|
238
|
-
function convertThreadMessage(source) {
|
|
239
|
-
var _a;
|
|
240
|
-
return {
|
|
241
|
-
id: source.id,
|
|
242
|
-
object: source.object,
|
|
243
|
-
created_at: source.createdAt,
|
|
244
|
-
thread_id: source.threadId,
|
|
245
|
-
status: source.status,
|
|
246
|
-
incomplete_details: !source.incompleteDetails
|
|
247
|
-
? source.incompleteDetails
|
|
248
|
-
: convertMessageIncompleteDetails(source.incompleteDetails),
|
|
249
|
-
completed_at: source.completedAt,
|
|
250
|
-
incomplete_at: source.incompleteAt,
|
|
251
|
-
role: source.role,
|
|
252
|
-
content: source.content.map(convertMessageContent),
|
|
253
|
-
assistant_id: source.assistantId,
|
|
254
|
-
run_id: source.runId,
|
|
255
|
-
attachments: !source.attachments
|
|
256
|
-
? source.attachments
|
|
257
|
-
: (_a = source.attachments) === null || _a === void 0 ? void 0 : _a.map(convertMessageAttachment),
|
|
258
|
-
metadata: source.metadata,
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
function convertMessageIncompleteDetails(source) {
|
|
262
|
-
return {
|
|
263
|
-
reason: source.reason,
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
function convertMessageContent(source) {
|
|
267
|
-
switch (source.type) {
|
|
268
|
-
case "text":
|
|
269
|
-
return convertMessageTextContent(source);
|
|
270
|
-
case "image_file":
|
|
271
|
-
return convertMessageImageFileContent(source);
|
|
272
|
-
default:
|
|
273
|
-
throw new Error(`Unknown message content type: ${source.type}`);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
function convertMessageTextContent(source) {
|
|
277
|
-
return {
|
|
278
|
-
type: "text",
|
|
279
|
-
text: convertMessageTextDetails(source.text),
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
function convertMessageTextDetails(source) {
|
|
283
|
-
return {
|
|
284
|
-
value: source.value,
|
|
285
|
-
annotations: source.annotations.map(convertMessageTextAnnotation),
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
function convertMessageTextAnnotation(source) {
|
|
289
|
-
switch (source.type) {
|
|
290
|
-
case "file_citation":
|
|
291
|
-
return convertMessageTextFileCitationAnnotation(source);
|
|
292
|
-
case "file_path":
|
|
293
|
-
return convertMessageTextFilePathAnnotation(source);
|
|
294
|
-
default:
|
|
295
|
-
throw new Error(`Unknown message text annotation type: ${source.type}`);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
function convertMessageTextFileCitationAnnotation(source) {
|
|
299
|
-
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 }));
|
|
300
|
-
}
|
|
301
|
-
function convertMessageTextFileCitationDetails(source) {
|
|
302
|
-
return {
|
|
303
|
-
file_id: source.fileId,
|
|
304
|
-
quote: source.quote,
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
function convertMessageTextFilePathAnnotation(source) {
|
|
308
|
-
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 }));
|
|
309
|
-
}
|
|
310
|
-
function convertMessageTextFilePathDetails(source) {
|
|
311
|
-
return {
|
|
312
|
-
file_id: source.fileId,
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
function convertMessageImageFileContent(source) {
|
|
316
|
-
return {
|
|
317
|
-
type: "image_file",
|
|
318
|
-
image_file: convertMessageImageFileDetails(source.imageFile),
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
function convertMessageImageFileDetails(source) {
|
|
322
|
-
return {
|
|
323
|
-
file_id: source.fileId,
|
|
324
|
-
};
|
|
325
|
-
}
|
|
326
275
|
//# sourceMappingURL=convertModelsToWrite.js.map
|