@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,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;AAQ3C,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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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,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,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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertModelsToWrite.js","sourceRoot":"","sources":["../../../src/customization/convertModelsToWrite.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,uBAAuB;AACvB,MAAM,UAAU,yBAAyB,CACvC,MAAuC;IAEvC,uIACE,KAAK,EAAE,MAAM,CAAC,KAAK,IAChB,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,GACtC,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC,GAC3D,CAAC,MAAM,CAAC,YAAY,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,GAC9D,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,qBAAqB,CAAC,EAAE,CAAC,GACpE,CAA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,EAAE,MAAM,CAAC,MAAM;KACvB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type * as PublicModels from \"./models.js\";\nimport type * as GeneratedModels from \"../generated/src/models.js\";\n\n// Conversion functions\nexport function convertCreateAgentOptions(\n source: PublicModels.CreateAgentOptions,\n): GeneratedModels.CreateAgentOptions {\n return {\n model: source.model,\n ...(source.name && { name: source.name }),\n ...(source.description && { description: source.description }),\n ...(source.instructions && { instructions: source.instructions }),\n ...(source.tools && { tools: source.tools.map(convertToolDefinition) }),\n ...(source.toolResources && { tool_resources: convertToolResources(source.toolResources) }),\n ...(source.temperature !== undefined && { temperature: source.temperature }),\n ...(source.topP !== undefined && { top_p: source.topP }),\n ...(source.responseFormat && { response_format: source.responseFormat }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertToolResources(source: PublicModels.ToolResources): GeneratedModels.ToolResources {\n return {\n ...(source.codeInterpreter && {\n code_interpreter: convertCodeInterpreterToolResource(source.codeInterpreter),\n }),\n ...(source.fileSearch && { file_search: convertFileSearchToolResource(source.fileSearch) }),\n ...(source.azureAISearch && {\n azure_ai_search: convertAzureAISearchResource(source.azureAISearch),\n }),\n };\n}\n\nfunction convertMessageAttachmentToolDefinition(\n source: PublicModels.MessageAttachmentToolDefinition,\n): GeneratedModels.MessageAttachmentToolDefinition {\n switch (source.type) {\n case \"code_interpreter\":\n return convertCodeInterpreterToolDefinition(\n source as PublicModels.CodeInterpreterToolDefinition,\n );\n case \"file_search\":\n return convertFileSearchToolDefinition(source as PublicModels.FileSearchToolDefinition);\n default:\n throw new Error(`Unknown tool type: ${source}`);\n }\n}\n\nfunction convertToolDefinition(\n source: PublicModels.ToolDefinition,\n): GeneratedModels.ToolDefinition {\n switch (source.type) {\n case \"code_interpreter\":\n return convertCodeInterpreterToolDefinition(\n source as PublicModels.CodeInterpreterToolDefinition,\n );\n case \"file_search\":\n return convertFileSearchToolDefinition(source as PublicModels.FileSearchToolDefinition);\n case \"function\":\n return convertFunctionToolDefinition(source as PublicModels.FunctionToolDefinition);\n case \"bing_grounding\":\n return convertBingGroundingToolDefinition(source as PublicModels.BingGroundingToolDefinition);\n case \"microsoft_fabric\":\n return convertMicrosoftFabricToolDefinition(\n source as PublicModels.MicrosoftFabricToolDefinition,\n );\n case \"sharepoint_grounding\":\n return convertSharepointToolDefinition(source as PublicModels.SharepointToolDefinition);\n case \"azure_ai_search\":\n return convertAzureAISearchToolDefinition(source as PublicModels.AzureAISearchToolDefinition);\n default:\n throw new Error(`Unknown tool type: ${source.type}`);\n }\n}\n\nfunction convertCodeInterpreterToolDefinition(\n source: PublicModels.CodeInterpreterToolDefinition,\n): GeneratedModels.CodeInterpreterToolDefinition {\n return {\n type: source.type,\n };\n}\n\nfunction convertFileSearchToolDefinition(\n source: PublicModels.FileSearchToolDefinition,\n): GeneratedModels.FileSearchToolDefinition {\n return {\n type: source.type,\n ...(source.fileSearch && {\n file_search: convertFileSearchToolDefinitionDetails(source.fileSearch),\n }),\n };\n}\n\nfunction convertFunctionToolDefinition(\n source: PublicModels.FunctionToolDefinition,\n): GeneratedModels.FunctionToolDefinition {\n return {\n type: source.type,\n function: convertFunctionDefinition(source.function),\n };\n}\n\nfunction convertBingGroundingToolDefinition(\n source: PublicModels.BingGroundingToolDefinition,\n): GeneratedModels.BingGroundingToolDefinition {\n return {\n type: source.type,\n bing_grounding: convertToolConnectionList(source.bingGrounding),\n };\n}\n\nfunction convertMicrosoftFabricToolDefinition(\n source: PublicModels.MicrosoftFabricToolDefinition,\n): GeneratedModels.MicrosoftFabricToolDefinition {\n return {\n type: source.type,\n microsoft_fabric: convertToolConnectionList(source.microsoftFabric),\n };\n}\n\nfunction convertSharepointToolDefinition(\n source: PublicModels.SharepointToolDefinition,\n): GeneratedModels.SharepointToolDefinition {\n return {\n type: source.type,\n sharepoint_grounding: convertToolConnectionList(source.sharepointGrounding),\n };\n}\n\nfunction convertAzureAISearchToolDefinition(\n source: PublicModels.AzureAISearchToolDefinition,\n): GeneratedModels.AzureAISearchToolDefinition {\n return {\n type: source.type,\n };\n}\n\nfunction convertFileSearchToolDefinitionDetails(\n source: PublicModels.FileSearchToolDefinitionDetails,\n): GeneratedModels.FileSearchToolDefinitionDetails {\n return {\n ...(source.maxNumResults && { max_num_results: source.maxNumResults }),\n ...(source.rankingOptions && {\n ranking_options: convertFileSearchRankingOptions(source.rankingOptions),\n }),\n };\n}\n\nfunction convertFileSearchRankingOptions(\n source: PublicModels.FileSearchRankingOptions,\n): GeneratedModels.FileSearchRankingOptions {\n return {\n ranker: source.ranker,\n score_threshold: source.scoreThreshold,\n };\n}\n\nfunction convertCodeInterpreterToolResource(\n source: PublicModels.CodeInterpreterToolResource,\n): GeneratedModels.CodeInterpreterToolResource {\n return {\n file_ids: source.fileIds,\n ...(source.dataSources && {\n data_sources: source.dataSources.map(convertVectorStoreDataSource),\n }),\n };\n}\n\nexport function convertVectorStoreDataSource(\n source: PublicModels.VectorStoreDataSource,\n): GeneratedModels.VectorStoreDataSource {\n return {\n uri: source.uri,\n type: source.type,\n };\n}\n\nfunction convertFileSearchToolResource(\n source: PublicModels.FileSearchToolResource,\n): GeneratedModels.FileSearchToolResource {\n return {\n ...(source.vectorStoreIds && { vector_store_ids: source.vectorStoreIds }),\n ...(source.vectorStores && {\n vector_stores: source.vectorStores.map(convertVectorStoreConfigurations),\n }),\n };\n}\n\nfunction convertVectorStoreConfigurations(\n source: PublicModels.VectorStoreConfigurations,\n): GeneratedModels.VectorStoreConfigurations {\n return {\n name: source.name,\n configuration: convertVectorStoreConfiguration(source.configuration),\n };\n}\n\nfunction convertVectorStoreConfiguration(\n source: PublicModels.VectorStoreConfiguration,\n): GeneratedModels.VectorStoreConfiguration {\n return {\n data_sources: source.dataSources.map(convertVectorStoreDataSource),\n };\n}\n\nfunction convertAzureAISearchResource(\n source: PublicModels.AzureAISearchResource,\n): GeneratedModels.AzureAISearchResource {\n return {\n ...(source.indexes && { indexes: source.indexes.map(convertIndexResource) }),\n };\n}\n\nfunction convertIndexResource(source: PublicModels.IndexResource): GeneratedModels.IndexResource {\n return {\n index_connection_id: source.indexConnectionId,\n index_name: source.indexName,\n };\n}\n\nexport function convertUpdateAgentOptions(\n source: PublicModels.UpdateAgentOptions,\n): GeneratedModels.UpdateAgentOptions {\n return {\n ...(source.model && { model: source.model }),\n ...(source.name && { name: source.name }),\n ...(source.description && { description: source.description }),\n ...(source.instructions && { instructions: source.instructions }),\n ...(source.tools && { tools: source.tools.map(convertToolDefinition) }),\n ...(source.toolResources && { tool_resources: convertToolResources(source.toolResources) }),\n ...(source.temperature !== undefined && { temperature: source.temperature }),\n ...(source.topP !== undefined && { top_p: source.topP }),\n ...(source.responseFormat && { response_format: source.responseFormat }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nexport function convertAgentThreadCreationOptions(\n source: PublicModels.AgentThreadCreationOptions,\n): GeneratedModels.AgentThreadCreationOptions {\n return {\n ...(source.messages && { messages: source.messages.map(convertThreadMessageOptions) }),\n ...(source.toolResources && { tool_resources: convertToolResources(source.toolResources) }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nexport function convertAgentThreadUpdateOptions(\n source: PublicModels.UpdateAgentThreadOptions,\n): GeneratedModels.UpdateAgentThreadOptions {\n return {\n ...(source.toolResources && { tool_resources: convertToolResources(source.toolResources) }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertThreadMessageOptions(\n source: PublicModels.ThreadMessageOptions,\n): GeneratedModels.ThreadMessageOptions {\n return {\n role: source.role,\n content: source.content,\n ...(source.attachments && { attachments: source.attachments.map(convertMessageAttachment) }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertMessageAttachment(\n source: PublicModels.MessageAttachment,\n): GeneratedModels.MessageAttachment {\n return {\n file_id: source.fileId,\n ...(source.dataSources && {\n data_sources: source.dataSources.map(convertVectorStoreDataSource),\n }),\n ...(source.tools && { tools: source.tools.map(convertMessageAttachmentToolDefinition) }),\n };\n}\n\nexport function convertCreateRunOptions(\n source: PublicModels.CreateRunOptions,\n): GeneratedModels.CreateRunOptions {\n return {\n assistant_id: source.assistantId,\n ...(source.model && { model: source.model }),\n ...(source.instructions && { instructions: source.instructions }),\n ...(source.additionalInstructions && {\n additional_instructions: source.additionalInstructions,\n }),\n ...(source.additionalMessages && {\n additional_messages: source.additionalMessages.map(convertThreadMessage),\n }),\n ...(source.tools && { tools: source.tools.map(convertToolDefinition) }),\n ...(source.stream !== undefined && { stream: source.stream }),\n ...(source.temperature !== undefined && { temperature: source.temperature }),\n ...(source.topP !== undefined && { top_p: source.topP }),\n ...(source.maxPromptTokens !== undefined && { max_prompt_tokens: source.maxPromptTokens }),\n ...(source.maxCompletionTokens !== undefined && {\n max_completion_tokens: source.maxCompletionTokens,\n }),\n ...(source.truncationStrategy && {\n truncation_strategy: convertTruncationObject(source.truncationStrategy),\n }),\n ...(source.toolChoice && { tool_choice: source.toolChoice }),\n ...(source.responseFormat && { response_format: source.responseFormat }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertTruncationObject(\n source: PublicModels.TruncationObject,\n): GeneratedModels.TruncationObject {\n return {\n type: source.type,\n ...(source.lastMessages !== undefined && { last_messages: source.lastMessages }),\n };\n}\n\nfunction convertUpdateToolResourcesOptions(\n source: PublicModels.UpdateToolResourcesOptions,\n): GeneratedModels.UpdateToolResourcesOptions {\n return {\n ...(source.codeInterpreter && {\n code_interpreter: convertUpdateCodeInterpreterToolResourceOptions(source.codeInterpreter),\n }),\n ...(source.fileSearch && {\n file_search: convertUpdateFileSearchToolResourceOptions(source.fileSearch),\n }),\n ...(source.azureAISearch && {\n azure_ai_search: convertAzureAISearchResource(source.azureAISearch),\n }),\n };\n}\n\nfunction convertUpdateCodeInterpreterToolResourceOptions(\n source: PublicModels.UpdateCodeInterpreterToolResourceOptions,\n): GeneratedModels.UpdateCodeInterpreterToolResourceOptions {\n return {\n ...(source.fileIds && { file_ids: source.fileIds }),\n };\n}\n\nfunction convertUpdateFileSearchToolResourceOptions(\n source: PublicModels.UpdateFileSearchToolResourceOptions,\n): GeneratedModels.UpdateFileSearchToolResourceOptions {\n return {\n ...(source.vectorStoreIds && { vector_store_ids: source.vectorStoreIds }),\n };\n}\n\nexport function convertToolOutput(source: PublicModels.ToolOutput): GeneratedModels.ToolOutput {\n return {\n ...(source.toolCallId !== undefined && { tool_call_id: source.toolCallId }),\n ...(source.output !== undefined && { output: source.output }),\n };\n}\n\nexport function convertCreateAndRunThreadOptions(\n source: PublicModels.CreateAndRunThreadOptions,\n): GeneratedModels.CreateAndRunThreadOptions {\n return {\n assistant_id: source.assistantId,\n ...(source.thread && { thread: convertAgentThreadCreationOptions(source.thread) }),\n ...(source.model && { model: source.model }),\n ...(source.instructions && { instructions: source.instructions }),\n ...(source.tools && { tools: source.tools.map(convertToolDefinition) }),\n ...(source.toolResources && {\n tool_resources: convertUpdateToolResourcesOptions(source.toolResources),\n }),\n ...(source.stream !== undefined && { stream: source.stream }),\n ...(source.temperature !== undefined && { temperature: source.temperature }),\n ...(source.topP !== undefined && { top_p: source.topP }),\n ...(source.maxPromptTokens !== undefined && { max_prompt_tokens: source.maxPromptTokens }),\n ...(source.maxCompletionTokens !== undefined && {\n max_completion_tokens: source.maxCompletionTokens,\n }),\n ...(source.truncationStrategy && {\n truncation_strategy: convertTruncationObject(source.truncationStrategy),\n }),\n ...(source.toolChoice && { tool_choice: source.toolChoice }),\n ...(source.responseFormat && { response_format: source.responseFormat }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertVectorStoreExpirationPolicy(\n source: PublicModels.VectorStoreExpirationPolicy,\n): GeneratedModels.VectorStoreExpirationPolicy {\n return {\n anchor: source.anchor,\n days: source.days,\n };\n}\n\nexport function convertVectorStoreOptions(\n source: PublicModels.VectorStoreOptions,\n): GeneratedModels.VectorStoreOptions {\n return {\n ...(source.fileIds && { file_ids: source.fileIds }),\n ...(source.name && { name: source.name }),\n ...(source.configuration && {\n configuration: convertVectorStoreConfiguration(source.configuration),\n }),\n ...(source.expiresAfter && {\n expires_after: convertVectorStoreExpirationPolicy(source.expiresAfter),\n }),\n ...(source.chunkingStrategy && {\n chunking_strategy: convertVectorStoreChunkingStrategyRequest(source.chunkingStrategy),\n }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nexport function convertVectorStoreChunkingStrategyRequest(\n source: PublicModels.VectorStoreChunkingStrategyRequest,\n): GeneratedModels.VectorStoreChunkingStrategyRequest {\n switch (source.type) {\n case \"auto\":\n return source as GeneratedModels.VectorStoreAutoChunkingStrategyRequest;\n case \"static\":\n return convertVectorStoreStaticChunkingStrategyRequest(\n source as PublicModels.VectorStoreStaticChunkingStrategyRequest,\n );\n default:\n throw new Error(`Unknown chunking strategy type: ${source.type}`);\n }\n}\n\nfunction convertVectorStoreStaticChunkingStrategyRequest(\n source: PublicModels.VectorStoreStaticChunkingStrategyRequest,\n): GeneratedModels.VectorStoreStaticChunkingStrategyRequest {\n return {\n ...source,\n static: convertVectorStoreStaticChunkingStrategyOptions(source.static),\n };\n}\n\nfunction convertVectorStoreStaticChunkingStrategyOptions(\n source: PublicModels.VectorStoreStaticChunkingStrategyOptions,\n): GeneratedModels.VectorStoreStaticChunkingStrategyOptions {\n return {\n max_chunk_size_tokens: source.maxChunkSizeTokens,\n chunk_overlap_tokens: source.chunkOverlapTokens,\n };\n}\n\nexport function convertVectorStoreUpdateOptions(\n source: PublicModels.VectorStoreUpdateOptions,\n): GeneratedModels.VectorStoreUpdateOptions {\n return {\n ...(source.name && { name: source.name }),\n ...(source.expiresAfter && {\n expires_after: convertVectorStoreExpirationPolicy(source.expiresAfter),\n }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertFunctionDefinition(\n source: PublicModels.FunctionDefinition,\n): GeneratedModels.FunctionDefinition {\n return {\n name: source.name,\n ...(source.description && { description: source.description }),\n parameters: source.parameters,\n };\n}\n\nfunction convertToolConnectionList(\n source: PublicModels.ToolConnectionList,\n): GeneratedModels.ToolConnectionList {\n return {\n ...(source.connections && { connections: source.connections.map(convertToolConnection) }),\n };\n}\n\nfunction convertToolConnection(\n source: PublicModels.ToolConnection,\n): GeneratedModels.ToolConnection {\n return {\n connection_id: source.connectionId,\n };\n}\n\nfunction convertThreadMessage(source: PublicModels.ThreadMessage): GeneratedModels.ThreadMessage {\n return {\n id: source.id,\n object: source.object,\n created_at: source.createdAt,\n thread_id: source.threadId,\n status: source.status,\n incomplete_details: !source.incompleteDetails\n ? source.incompleteDetails\n : convertMessageIncompleteDetails(source.incompleteDetails),\n completed_at: source.completedAt,\n incomplete_at: source.incompleteAt,\n role: source.role,\n content: source.content.map(convertMessageContent),\n assistant_id: source.assistantId,\n run_id: source.runId,\n attachments: !source.attachments\n ? source.attachments\n : source.attachments?.map(convertMessageAttachment),\n metadata: source.metadata,\n };\n}\n\nfunction convertMessageIncompleteDetails(\n source: PublicModels.MessageIncompleteDetails,\n): GeneratedModels.MessageIncompleteDetails {\n return {\n reason: source.reason,\n };\n}\n\nfunction convertMessageContent(\n source: PublicModels.MessageContent,\n): GeneratedModels.MessageContent {\n switch (source.type) {\n case \"text\":\n return convertMessageTextContent(source as PublicModels.MessageTextContent);\n case \"image_file\":\n return convertMessageImageFileContent(source as PublicModels.MessageImageFileContent);\n default:\n throw new Error(`Unknown message content type: ${source.type}`);\n }\n}\n\nfunction convertMessageTextContent(\n source: PublicModels.MessageTextContent,\n): GeneratedModels.MessageTextContent {\n return {\n type: \"text\",\n text: convertMessageTextDetails(source.text),\n };\n}\n\nfunction convertMessageTextDetails(\n source: PublicModels.MessageTextDetails,\n): GeneratedModels.MessageTextDetails {\n return {\n value: source.value,\n annotations: source.annotations.map(convertMessageTextAnnotation),\n };\n}\n\nfunction convertMessageTextAnnotation(\n source: PublicModels.MessageTextAnnotation,\n): GeneratedModels.MessageTextAnnotation {\n switch (source.type) {\n case \"file_citation\":\n return convertMessageTextFileCitationAnnotation(\n source as PublicModels.MessageTextFileCitationAnnotation,\n );\n case \"file_path\":\n return convertMessageTextFilePathAnnotation(\n source as PublicModels.MessageTextFilePathAnnotation,\n );\n default:\n throw new Error(`Unknown message text annotation type: ${source.type}`);\n }\n}\n\nfunction convertMessageTextFileCitationAnnotation(\n source: PublicModels.MessageTextFileCitationAnnotation,\n): GeneratedModels.MessageTextFileCitationAnnotation {\n return {\n text: source.text,\n type: \"file_citation\",\n file_citation: convertMessageTextFileCitationDetails(source.fileCitation),\n ...(source.startIndex && { start_index: source.startIndex }),\n ...(source.endIndex && { end_index: source.endIndex }),\n };\n}\n\nfunction convertMessageTextFileCitationDetails(\n source: PublicModels.MessageTextFileCitationDetails,\n): GeneratedModels.MessageTextFileCitationDetails {\n return {\n file_id: source.fileId,\n quote: source.quote,\n };\n}\n\nfunction convertMessageTextFilePathAnnotation(\n source: PublicModels.MessageTextFilePathAnnotation,\n): GeneratedModels.MessageTextFilePathAnnotation {\n return {\n text: source.text,\n type: \"file_path\",\n file_path: convertMessageTextFilePathDetails(source.filePath),\n ...(source.startIndex && { start_index: source.startIndex }),\n ...(source.endIndex && { end_index: source.endIndex }),\n };\n}\n\nfunction convertMessageTextFilePathDetails(\n source: PublicModels.MessageTextFilePathDetails,\n): GeneratedModels.MessageTextFilePathDetails {\n return {\n file_id: source.fileId,\n };\n}\n\nfunction convertMessageImageFileContent(\n source: PublicModels.MessageImageFileContent,\n): GeneratedModels.MessageImageFileContent {\n return {\n type: \"image_file\",\n image_file: convertMessageImageFileDetails(source.imageFile),\n };\n}\n\nfunction convertMessageImageFileDetails(\n source: PublicModels.MessageImageFileDetails,\n): GeneratedModels.MessageImageFileDetails {\n return {\n file_id: source.fileId,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"convertModelsToWrite.js","sourceRoot":"","sources":["../../../src/customization/convertModelsToWrite.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,uBAAuB;AACvB,MAAM,UAAU,yBAAyB,CACvC,M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AE,MAAM,CAAC,kBAAkB;QAChD,oBAAoB,EAAE,MAAM,CAAC,kBAAkB;KAChD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,+BAA+B,CAC7C,MAA6C;IAE7C,qDACK,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,GACtC,CAAC,MAAM,CAAC,YAAY,IAAI;QACzB,aAAa,EAAE,kCAAkC,CAAC,MAAM,CAAC,YAAY,CAAC;KACvE,CAAC,GACC,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,EACrD;AACJ,CAAC;AAED,SAAS,yBAAyB,CAChC,MAAuC;IAEvC,qCACE,IAAI,EAAE,MAAM,CAAC,IAAI,IACd,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC,KAC9D,UAAU,EAAE,MAAM,CAAC,UAAU,IAC7B;AACJ,CAAC;AAED,SAAS,yBAAyB,CAChC,MAAuC;IAEvC,yBACK,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,qBAAqB,CAAC,EAAE,CAAC,EACzF;AACJ,CAAC;AAED,SAAS,qBAAqB,CAC5B,MAAmC;IAEnC,OAAO;QACL,aAAa,EAAE,MAAM,CAAC,YAAY;KACnC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type * as PublicModels from \"./models.js\";\nimport type * as GeneratedModels from \"../generated/src/models.js\";\n\n// Conversion functions\nexport function convertCreateAgentOptions(\n source: PublicModels.CreateAgentOptions,\n): GeneratedModels.CreateAgentOptions {\n return {\n model: source.model,\n ...(source.name && { name: source.name }),\n ...(source.description && { description: source.description }),\n ...(source.instructions && { instructions: source.instructions }),\n ...(source.tools && { tools: source.tools.map(convertToolDefinition) }),\n ...(source.toolResources && { tool_resources: convertToolResources(source.toolResources) }),\n ...(source.temperature !== undefined && { temperature: source.temperature }),\n ...(source.topP !== undefined && { top_p: source.topP }),\n ...(source.responseFormat && { response_format: source.responseFormat }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertToolResources(source: PublicModels.ToolResources): GeneratedModels.ToolResources {\n return {\n ...(source.codeInterpreter && {\n code_interpreter: convertCodeInterpreterToolResource(source.codeInterpreter),\n }),\n ...(source.fileSearch && { file_search: convertFileSearchToolResource(source.fileSearch) }),\n ...(source.azureAISearch && {\n azure_ai_search: convertAzureAISearchResource(source.azureAISearch),\n }),\n ...(source.azureFunction && {\n name: source.azureFunction.name,\n }),\n };\n}\n\nfunction convertMessageAttachmentToolDefinition(\n source: PublicModels.MessageAttachmentToolDefinition,\n): GeneratedModels.MessageAttachmentToolDefinition {\n switch (source.type) {\n case \"code_interpreter\":\n return convertCodeInterpreterToolDefinition(\n source as PublicModels.CodeInterpreterToolDefinition,\n );\n case \"file_search\":\n return convertFileSearchToolDefinition(source as PublicModels.FileSearchToolDefinition);\n default:\n throw new Error(`Unknown tool type: ${source}`);\n }\n}\n\nfunction convertToolDefinition(\n source: PublicModels.ToolDefinition,\n): GeneratedModels.ToolDefinition {\n switch (source.type) {\n case \"code_interpreter\":\n return convertCodeInterpreterToolDefinition(\n source as PublicModels.CodeInterpreterToolDefinition,\n );\n case \"file_search\":\n return convertFileSearchToolDefinition(source as PublicModels.FileSearchToolDefinition);\n case \"function\":\n return convertFunctionToolDefinition(source as PublicModels.FunctionToolDefinition);\n case \"bing_grounding\":\n return convertBingGroundingToolDefinition(source as PublicModels.BingGroundingToolDefinition);\n case \"microsoft_fabric\":\n return convertMicrosoftFabricToolDefinition(\n source as PublicModels.MicrosoftFabricToolDefinition,\n );\n case \"sharepoint_grounding\":\n return convertSharepointToolDefinition(source as PublicModels.SharepointToolDefinition);\n case \"azure_ai_search\":\n return convertAzureAISearchToolDefinition(source as PublicModels.AzureAISearchToolDefinition);\n case \"openapi\":\n return convertOpenApiToolDefinition(source as PublicModels.OpenApiToolDefinition);\n case \"azure_function\":\n return convertAzureFunctionToolDefinition(source as PublicModels.AzureFunctionToolDefinition);\n default:\n throw new Error(`Unknown tool type: ${source.type}`);\n }\n}\n\nfunction convertCodeInterpreterToolDefinition(\n source: PublicModels.CodeInterpreterToolDefinition,\n): GeneratedModels.CodeInterpreterToolDefinition {\n return {\n type: source.type,\n };\n}\n\nfunction convertFileSearchToolDefinition(\n source: PublicModels.FileSearchToolDefinition,\n): GeneratedModels.FileSearchToolDefinition {\n return {\n type: source.type,\n ...(source.fileSearch && {\n file_search: convertFileSearchToolDefinitionDetails(source.fileSearch),\n }),\n };\n}\n\nfunction convertFunctionToolDefinition(\n source: PublicModels.FunctionToolDefinition,\n): GeneratedModels.FunctionToolDefinition {\n return {\n type: source.type,\n function: convertFunctionDefinition(source.function),\n };\n}\n\nfunction convertBingGroundingToolDefinition(\n source: PublicModels.BingGroundingToolDefinition,\n): GeneratedModels.BingGroundingToolDefinition {\n return {\n type: source.type,\n bing_grounding: convertToolConnectionList(source.bingGrounding),\n };\n}\n\nfunction convertMicrosoftFabricToolDefinition(\n source: PublicModels.MicrosoftFabricToolDefinition,\n): GeneratedModels.MicrosoftFabricToolDefinition {\n return {\n type: source.type,\n fabric_aiskill: convertToolConnectionList(source.fabricAISkill),\n };\n}\n\nfunction convertSharepointToolDefinition(\n source: PublicModels.SharepointToolDefinition,\n): GeneratedModels.SharepointToolDefinition {\n return {\n type: source.type,\n sharepoint_grounding: convertToolConnectionList(source.sharepointGrounding),\n };\n}\n\nfunction convertAzureAISearchToolDefinition(\n source: PublicModels.AzureAISearchToolDefinition,\n): GeneratedModels.AzureAISearchToolDefinition {\n return {\n type: source.type,\n };\n}\n\nfunction convertOpenApiToolDefinition(\n source: PublicModels.OpenApiToolDefinition,\n): GeneratedModels.OpenApiToolDefinition {\n return {\n type: source.type,\n openapi: source.openapi,\n };\n}\n\nfunction convertFileSearchToolDefinitionDetails(\n source: PublicModels.FileSearchToolDefinitionDetails,\n): GeneratedModels.FileSearchToolDefinitionDetails {\n return {\n ...(source.maxNumResults && { max_num_results: source.maxNumResults }),\n ...(source.rankingOptions && {\n ranking_options: convertFileSearchRankingOptions(source.rankingOptions),\n }),\n };\n}\n\nfunction convertFileSearchRankingOptions(\n source: PublicModels.FileSearchRankingOptions,\n): GeneratedModels.FileSearchRankingOptions {\n return {\n ranker: source.ranker,\n score_threshold: source.scoreThreshold,\n };\n}\n\nfunction convertCodeInterpreterToolResource(\n source: PublicModels.CodeInterpreterToolResource,\n): GeneratedModels.CodeInterpreterToolResource {\n return {\n file_ids: source.fileIds,\n ...(source.dataSources && {\n data_sources: source.dataSources.map(convertVectorStoreDataSource),\n }),\n };\n}\n\nexport function convertVectorStoreDataSource(\n source: PublicModels.VectorStoreDataSource,\n): GeneratedModels.VectorStoreDataSource {\n return {\n uri: source.uri,\n type: source.type,\n };\n}\n\nfunction convertFileSearchToolResource(\n source: PublicModels.FileSearchToolResource,\n): GeneratedModels.FileSearchToolResource {\n return {\n ...(source.vectorStoreIds && { vector_store_ids: source.vectorStoreIds }),\n ...(source.vectorStores && {\n vector_stores: source.vectorStores.map(convertVectorStoreConfigurations),\n }),\n };\n}\n\nfunction convertAzureFunctionToolDefinition(\n source: PublicModels.AzureFunctionToolDefinition,\n): GeneratedModels.AzureFunctionToolDefinition {\n return {\n type: source.type,\n azure_function: convertAzureFunctionDefinition(source.azureFunction),\n };\n}\n\nfunction convertAzureFunctionDefinition(\n source: PublicModels.AzureFunctionDefinition,\n): GeneratedModels.AzureFunctionDefinition {\n return {\n function: source.function,\n input_binding: {\n type: source.inputBinding.type,\n storage_queue: {\n queue_service_endpoint: source.inputBinding.storageQueue.queueServiceEndpoint,\n queue_name: source.inputBinding.storageQueue.queueName,\n },\n },\n output_binding: {\n type: source.outputBinding.type,\n storage_queue: {\n queue_service_endpoint: source.outputBinding.storageQueue.queueServiceEndpoint,\n queue_name: source.outputBinding.storageQueue.queueName,\n },\n },\n };\n}\n\nfunction convertVectorStoreConfigurations(\n source: PublicModels.VectorStoreConfigurations,\n): GeneratedModels.VectorStoreConfigurations {\n return {\n name: source.name,\n configuration: convertVectorStoreConfiguration(source.configuration),\n };\n}\n\nfunction convertVectorStoreConfiguration(\n source: PublicModels.VectorStoreConfiguration,\n): GeneratedModels.VectorStoreConfiguration {\n return {\n data_sources: source.dataSources.map(convertVectorStoreDataSource),\n };\n}\n\nfunction convertAzureAISearchResource(\n source: PublicModels.AzureAISearchResource,\n): GeneratedModels.AzureAISearchResource {\n return {\n ...(source.indexes && { indexes: source.indexes.map(convertIndexResource) }),\n };\n}\n\nfunction convertIndexResource(source: PublicModels.IndexResource): GeneratedModels.IndexResource {\n return {\n index_connection_id: source.indexConnectionId,\n index_name: source.indexName,\n };\n}\n\nexport function convertUpdateAgentOptions(\n source: PublicModels.UpdateAgentOptions,\n): GeneratedModels.UpdateAgentOptions {\n return {\n ...(source.model && { model: source.model }),\n ...(source.name && { name: source.name }),\n ...(source.description && { description: source.description }),\n ...(source.instructions && { instructions: source.instructions }),\n ...(source.tools && { tools: source.tools.map(convertToolDefinition) }),\n ...(source.toolResources && { tool_resources: convertToolResources(source.toolResources) }),\n ...(source.temperature !== undefined && { temperature: source.temperature }),\n ...(source.topP !== undefined && { top_p: source.topP }),\n ...(source.responseFormat && { response_format: source.responseFormat }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nexport function convertAgentThreadCreationOptions(\n source: PublicModels.AgentThreadCreationOptions,\n): GeneratedModels.AgentThreadCreationOptions {\n return {\n ...(source.messages && { messages: source.messages.map(convertThreadMessageOptions) }),\n ...(source.toolResources && { tool_resources: convertToolResources(source.toolResources) }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nexport function convertAgentThreadUpdateOptions(\n source: PublicModels.UpdateAgentThreadOptions,\n): GeneratedModels.UpdateAgentThreadOptions {\n return {\n ...(source.toolResources && { tool_resources: convertToolResources(source.toolResources) }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertThreadMessageOptions(\n source: PublicModels.ThreadMessageOptions,\n): GeneratedModels.ThreadMessageOptions {\n return {\n role: source.role,\n content: source.content,\n ...(source.attachments && { attachments: source.attachments.map(convertMessageAttachment) }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertMessageAttachment(\n source: PublicModels.MessageAttachment,\n): GeneratedModels.MessageAttachment {\n return {\n file_id: source.fileId,\n ...(source.dataSource && {\n data_source: convertVectorStoreDataSource(source.dataSource),\n }),\n ...(source.tools && { tools: source.tools.map(convertMessageAttachmentToolDefinition) }),\n };\n}\n\nexport function convertCreateRunOptions(\n source: PublicModels.CreateRunOptions,\n): GeneratedModels.CreateRunOptions {\n return {\n assistant_id: source.assistantId,\n ...(source.model && { model: source.model }),\n ...(source.instructions && { instructions: source.instructions }),\n ...(source.additionalInstructions && {\n additional_instructions: source.additionalInstructions,\n }),\n ...(source.additionalMessages && {\n additional_messages: source.additionalMessages.map(convertThreadMessageOptions),\n }),\n ...(source.tools && { tools: source.tools.map(convertToolDefinition) }),\n ...(source.stream !== undefined && { stream: source.stream }),\n ...(source.temperature !== undefined && { temperature: source.temperature }),\n ...(source.topP !== undefined && { top_p: source.topP }),\n ...(source.maxPromptTokens !== undefined && { max_prompt_tokens: source.maxPromptTokens }),\n ...(source.maxCompletionTokens !== undefined && {\n max_completion_tokens: source.maxCompletionTokens,\n }),\n ...(source.truncationStrategy && {\n truncation_strategy: convertTruncationObject(source.truncationStrategy),\n }),\n ...(source.toolChoice && { tool_choice: source.toolChoice }),\n ...(source.responseFormat && { response_format: source.responseFormat }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertTruncationObject(\n source: PublicModels.TruncationObject,\n): GeneratedModels.TruncationObject {\n return {\n type: source.type,\n ...(source.lastMessages !== undefined && { last_messages: source.lastMessages }),\n };\n}\n\nfunction convertUpdateToolResourcesOptions(\n source: PublicModels.UpdateToolResourcesOptions,\n): GeneratedModels.UpdateToolResourcesOptions {\n return {\n ...(source.codeInterpreter && {\n code_interpreter: convertUpdateCodeInterpreterToolResourceOptions(source.codeInterpreter),\n }),\n ...(source.fileSearch && {\n file_search: convertUpdateFileSearchToolResourceOptions(source.fileSearch),\n }),\n ...(source.azureAISearch && {\n azure_ai_search: convertAzureAISearchResource(source.azureAISearch),\n }),\n };\n}\n\nfunction convertUpdateCodeInterpreterToolResourceOptions(\n source: PublicModels.UpdateCodeInterpreterToolResourceOptions,\n): GeneratedModels.UpdateCodeInterpreterToolResourceOptions {\n return {\n ...(source.fileIds && { file_ids: source.fileIds }),\n };\n}\n\nfunction convertUpdateFileSearchToolResourceOptions(\n source: PublicModels.UpdateFileSearchToolResourceOptions,\n): GeneratedModels.UpdateFileSearchToolResourceOptions {\n return {\n ...(source.vectorStoreIds && { vector_store_ids: source.vectorStoreIds }),\n };\n}\n\nexport function convertToolOutput(source: PublicModels.ToolOutput): GeneratedModels.ToolOutput {\n return {\n ...(source.toolCallId !== undefined && { tool_call_id: source.toolCallId }),\n ...(source.output !== undefined && { output: source.output }),\n };\n}\n\nexport function convertCreateAndRunThreadOptions(\n source: PublicModels.CreateAndRunThreadOptions,\n): GeneratedModels.CreateAndRunThreadOptions {\n return {\n assistant_id: source.assistantId,\n ...(source.thread && { thread: convertAgentThreadCreationOptions(source.thread) }),\n ...(source.model && { model: source.model }),\n ...(source.instructions && { instructions: source.instructions }),\n ...(source.tools && { tools: source.tools.map(convertToolDefinition) }),\n ...(source.toolResources && {\n tool_resources: convertUpdateToolResourcesOptions(source.toolResources),\n }),\n ...(source.stream !== undefined && { stream: source.stream }),\n ...(source.temperature !== undefined && { temperature: source.temperature }),\n ...(source.topP !== undefined && { top_p: source.topP }),\n ...(source.maxPromptTokens !== undefined && { max_prompt_tokens: source.maxPromptTokens }),\n ...(source.maxCompletionTokens !== undefined && {\n max_completion_tokens: source.maxCompletionTokens,\n }),\n ...(source.truncationStrategy && {\n truncation_strategy: convertTruncationObject(source.truncationStrategy),\n }),\n ...(source.toolChoice && { tool_choice: source.toolChoice }),\n ...(source.responseFormat && { response_format: source.responseFormat }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertVectorStoreExpirationPolicy(\n source: PublicModels.VectorStoreExpirationPolicy,\n): GeneratedModels.VectorStoreExpirationPolicy {\n return {\n anchor: source.anchor,\n days: source.days,\n };\n}\n\nexport function convertVectorStoreOptions(\n source: PublicModels.VectorStoreOptions,\n): GeneratedModels.VectorStoreOptions {\n return {\n ...(source.fileIds && { file_ids: source.fileIds }),\n ...(source.name && { name: source.name }),\n ...(source.configuration && {\n configuration: convertVectorStoreConfiguration(source.configuration),\n }),\n ...(source.expiresAfter && {\n expires_after: convertVectorStoreExpirationPolicy(source.expiresAfter),\n }),\n ...(source.chunkingStrategy && {\n chunking_strategy: convertVectorStoreChunkingStrategyRequest(source.chunkingStrategy),\n }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nexport function convertVectorStoreChunkingStrategyRequest(\n source: PublicModels.VectorStoreChunkingStrategyRequest,\n): GeneratedModels.VectorStoreChunkingStrategyRequest {\n switch (source.type) {\n case \"auto\":\n return source as GeneratedModels.VectorStoreAutoChunkingStrategyRequest;\n case \"static\":\n return convertVectorStoreStaticChunkingStrategyRequest(\n source as PublicModels.VectorStoreStaticChunkingStrategyRequest,\n );\n default:\n throw new Error(`Unknown chunking strategy type: ${source.type}`);\n }\n}\n\nfunction convertVectorStoreStaticChunkingStrategyRequest(\n source: PublicModels.VectorStoreStaticChunkingStrategyRequest,\n): GeneratedModels.VectorStoreStaticChunkingStrategyRequest {\n return {\n ...source,\n static: convertVectorStoreStaticChunkingStrategyOptions(source.static),\n };\n}\n\nfunction convertVectorStoreStaticChunkingStrategyOptions(\n source: PublicModels.VectorStoreStaticChunkingStrategyOptions,\n): GeneratedModels.VectorStoreStaticChunkingStrategyOptions {\n return {\n max_chunk_size_tokens: source.maxChunkSizeTokens,\n chunk_overlap_tokens: source.chunkOverlapTokens,\n };\n}\n\nexport function convertVectorStoreUpdateOptions(\n source: PublicModels.VectorStoreUpdateOptions,\n): GeneratedModels.VectorStoreUpdateOptions {\n return {\n ...(source.name && { name: source.name }),\n ...(source.expiresAfter && {\n expires_after: convertVectorStoreExpirationPolicy(source.expiresAfter),\n }),\n ...(source.metadata && { metadata: source.metadata }),\n };\n}\n\nfunction convertFunctionDefinition(\n source: PublicModels.FunctionDefinition,\n): GeneratedModels.FunctionDefinition {\n return {\n name: source.name,\n ...(source.description && { description: source.description }),\n parameters: source.parameters,\n };\n}\n\nfunction convertToolConnectionList(\n source: PublicModels.ToolConnectionList,\n): GeneratedModels.ToolConnectionList {\n return {\n ...(source.connections && { connections: source.connections.map(convertToolConnection) }),\n };\n}\n\nfunction convertToolConnection(\n source: PublicModels.ToolConnection,\n): GeneratedModels.ToolConnection {\n return {\n connection_id: source.connectionId,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertOutputModelsFromWire.d.ts","sourceRoot":"","sources":["../../../src/customization/convertOutputModelsFromWire.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,eAAe,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,KAAK,YAAY,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,KAAK,mBAAmB,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,KAAK,qBAAqB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"convertOutputModelsFromWire.d.ts","sourceRoot":"","sources":["../../../src/customization/convertOutputModelsFromWire.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,eAAe,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,KAAK,YAAY,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,KAAK,mBAAmB,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,KAAK,qBAAqB,MAAM,sBAAsB,C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