@azure/ai-projects 1.0.0-alpha.20250527.1 → 1.0.0-alpha.20250529.1
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/README.md +2 -1
- package/dist/browser/aiProjectClient.d.ts +1 -0
- package/dist/browser/aiProjectClient.d.ts.map +1 -1
- package/dist/browser/aiProjectClient.js +5 -4
- package/dist/browser/aiProjectClient.js.map +1 -1
- package/dist/browser/api/datasets/operations.d.ts +3 -3
- package/dist/browser/api/datasets/operations.d.ts.map +1 -1
- package/dist/browser/api/datasets/operations.js +11 -8
- package/dist/browser/api/datasets/operations.js.map +1 -1
- package/dist/browser/api/evaluations/operations.js +2 -2
- package/dist/browser/api/evaluations/operations.js.map +1 -1
- package/dist/browser/api/index.d.ts +7 -1
- package/dist/browser/api/index.d.ts.map +1 -1
- package/dist/browser/api/index.js +1 -3
- package/dist/browser/api/index.js.map +1 -1
- package/dist/browser/api/inference/index.d.ts +5 -0
- package/dist/browser/api/inference/index.d.ts.map +1 -0
- package/dist/browser/api/inference/index.js +7 -0
- package/dist/browser/api/inference/index.js.map +1 -0
- package/dist/browser/classic/datasets/index.d.ts +2 -2
- package/dist/browser/classic/datasets/index.d.ts.map +1 -1
- package/dist/browser/classic/datasets/index.js +5 -5
- package/dist/browser/classic/datasets/index.js.map +1 -1
- package/dist/commonjs/aiProjectClient.d.ts +1 -0
- package/dist/commonjs/aiProjectClient.d.ts.map +1 -1
- package/dist/commonjs/aiProjectClient.js +5 -4
- package/dist/commonjs/aiProjectClient.js.map +1 -1
- package/dist/commonjs/api/datasets/operations.d.ts +3 -3
- package/dist/commonjs/api/datasets/operations.d.ts.map +1 -1
- package/dist/commonjs/api/datasets/operations.js +11 -8
- package/dist/commonjs/api/datasets/operations.js.map +1 -1
- package/dist/commonjs/api/evaluations/operations.js +2 -2
- package/dist/commonjs/api/evaluations/operations.js.map +1 -1
- package/dist/commonjs/api/index.d.ts +7 -1
- package/dist/commonjs/api/index.d.ts.map +1 -1
- package/dist/commonjs/api/index.js +0 -2
- package/dist/commonjs/api/index.js.map +1 -1
- package/dist/commonjs/api/inference/index.d.ts +5 -0
- package/dist/commonjs/api/inference/index.d.ts.map +1 -0
- package/dist/commonjs/api/inference/index.js +11 -0
- package/dist/commonjs/api/inference/index.js.map +1 -0
- package/dist/commonjs/classic/datasets/index.d.ts +2 -2
- package/dist/commonjs/classic/datasets/index.d.ts.map +1 -1
- package/dist/commonjs/classic/datasets/index.js +5 -5
- package/dist/commonjs/classic/datasets/index.js.map +1 -1
- package/dist/esm/aiProjectClient.d.ts +1 -0
- package/dist/esm/aiProjectClient.d.ts.map +1 -1
- package/dist/esm/aiProjectClient.js +5 -4
- package/dist/esm/aiProjectClient.js.map +1 -1
- package/dist/esm/api/datasets/operations.d.ts +3 -3
- package/dist/esm/api/datasets/operations.d.ts.map +1 -1
- package/dist/esm/api/datasets/operations.js +11 -8
- package/dist/esm/api/datasets/operations.js.map +1 -1
- package/dist/esm/api/evaluations/operations.js +2 -2
- package/dist/esm/api/evaluations/operations.js.map +1 -1
- package/dist/esm/api/index.d.ts +7 -1
- package/dist/esm/api/index.d.ts.map +1 -1
- package/dist/esm/api/index.js +1 -3
- package/dist/esm/api/index.js.map +1 -1
- package/dist/esm/api/inference/index.d.ts +5 -0
- package/dist/esm/api/inference/index.d.ts.map +1 -0
- package/dist/esm/api/inference/index.js +7 -0
- package/dist/esm/api/inference/index.js.map +1 -0
- package/dist/esm/classic/datasets/index.d.ts +2 -2
- package/dist/esm/classic/datasets/index.d.ts.map +1 -1
- package/dist/esm/classic/datasets/index.js +5 -5
- package/dist/esm/classic/datasets/index.js.map +1 -1
- package/dist/react-native/aiProjectClient.d.ts +1 -0
- package/dist/react-native/aiProjectClient.d.ts.map +1 -1
- package/dist/react-native/aiProjectClient.js +5 -4
- package/dist/react-native/aiProjectClient.js.map +1 -1
- package/dist/react-native/api/datasets/operations.d.ts +3 -3
- package/dist/react-native/api/datasets/operations.d.ts.map +1 -1
- package/dist/react-native/api/datasets/operations.js +11 -8
- package/dist/react-native/api/datasets/operations.js.map +1 -1
- package/dist/react-native/api/evaluations/operations.js +2 -2
- package/dist/react-native/api/evaluations/operations.js.map +1 -1
- package/dist/react-native/api/index.d.ts +7 -1
- package/dist/react-native/api/index.d.ts.map +1 -1
- package/dist/react-native/api/index.js +1 -3
- package/dist/react-native/api/index.js.map +1 -1
- package/dist/react-native/api/inference/index.d.ts +5 -0
- package/dist/react-native/api/inference/index.d.ts.map +1 -0
- package/dist/react-native/api/inference/index.js +7 -0
- package/dist/react-native/api/inference/index.js.map +1 -0
- package/dist/react-native/classic/datasets/index.d.ts +2 -2
- package/dist/react-native/classic/datasets/index.d.ts.map +1 -1
- package/dist/react-native/classic/datasets/index.js +5 -5
- package/dist/react-native/classic/datasets/index.js.map +1 -1
- package/package.json +21 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
/* eslint-disable tsdoc/syntax */
|
|
4
|
+
import { __rest } from "tslib";
|
|
4
5
|
import { AgentsClient } from "@azure/ai-agents";
|
|
5
6
|
import { createAIProject } from "./api/index.js";
|
|
6
7
|
import { _getRedTeamsOperations } from "./classic/redTeams/index.js";
|
|
@@ -35,6 +36,7 @@ export class AIProjectClient {
|
|
|
35
36
|
var _a;
|
|
36
37
|
this._endpoint = endpointParam;
|
|
37
38
|
this._credential = credential;
|
|
39
|
+
this._options = options;
|
|
38
40
|
const prefixFromOptions = (_a = options === null || options === void 0 ? void 0 : options.userAgentOptions) === null || _a === void 0 ? void 0 : _a.userAgentPrefix;
|
|
39
41
|
const userAgentPrefix = prefixFromOptions
|
|
40
42
|
? `${prefixFromOptions} azsdk-js-client`
|
|
@@ -45,7 +47,7 @@ export class AIProjectClient {
|
|
|
45
47
|
this.redTeams = _getRedTeamsOperations(this._azureScopeClient);
|
|
46
48
|
this.deployments = _getDeploymentsOperations(this._azureScopeClient);
|
|
47
49
|
this.indexes = _getIndexesOperations(this._azureScopeClient);
|
|
48
|
-
this.datasets = _getDatasetsOperations(this._azureScopeClient);
|
|
50
|
+
this.datasets = _getDatasetsOperations(this._azureScopeClient, this._options);
|
|
49
51
|
this.evaluations = _getEvaluationsOperations(this._azureScopeClient);
|
|
50
52
|
this.connections = _getConnectionsOperations(this._azureScopeClient);
|
|
51
53
|
this.inference = _getInferenceOperations(this._cognitiveScopeClient, this.connections);
|
|
@@ -75,10 +77,9 @@ export class AIProjectClient {
|
|
|
75
77
|
*/
|
|
76
78
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients
|
|
77
79
|
get agents() {
|
|
80
|
+
const _a = this._options, { apiVersion } = _a, clientOptions = __rest(_a, ["apiVersion"]);
|
|
78
81
|
if (!this._agents) {
|
|
79
|
-
this._agents = new AgentsClient(this._endpoint, this._credential, {
|
|
80
|
-
userAgentOptions: this._cognitiveScopeClient.getUserAgent(),
|
|
81
|
-
});
|
|
82
|
+
this._agents = new AgentsClient(this._endpoint, this._credential, Object.assign(Object.assign({}, clientOptions), { userAgentOptions: this._cognitiveScopeClient.getUserAgent() }));
|
|
82
83
|
}
|
|
83
84
|
return this._agents;
|
|
84
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiProjectClient.js","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,iCAAiC
|
|
1
|
+
{"version":3,"file":"aiProjectClient.js","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,iCAAiC;;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAmD,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAsB,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAyB,yBAAyB,EA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AAW,kCAC3D,aAAa,KAChB,gBAAgB,EAAE,IAAI,CAAC,qBAAqB,CAAC,YAAY,EAAE,IAC3D,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/* eslint-disable tsdoc/syntax */\n\nimport { AgentsClient } from \"@azure/ai-agents\";\nimport { createAIProject, AIProjectContext, AIProjectClientOptionalParams } from \"./api/index.js\";\nimport { RedTeamsOperations, _getRedTeamsOperations } from \"./classic/redTeams/index.js\";\nimport { DeploymentsOperations, _getDeploymentsOperations } from \"./classic/deployments/index.js\";\nimport { IndexesOperations, _getIndexesOperations } from \"./classic/indexes/index.js\";\nimport { DatasetsOperations, _getDatasetsOperations } from \"./classic/datasets/index.js\";\nimport { EvaluationsOperations, _getEvaluationsOperations } from \"./classic/evaluations/index.js\";\nimport { ConnectionsOperations, _getConnectionsOperations } from \"./classic/connections/index.js\";\nimport { InferenceOperations, _getInferenceOperations } from \"./classic/inference/index.js\";\nimport {\n TelemetryOperations,\n _getTelemetryOperations,\n enableTelemetry,\n EnableTelemetryType,\n} from \"./classic/telemetry/index.js\";\nimport type { Pipeline } from \"@azure/core-rest-pipeline\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\nexport { AIProjectClientOptionalParams } from \"./api/aiProjectContext.js\";\n\n/**\n * The main client for the AIProjectClient service. It provides access to the various operations available in the service.\n * @class AIProjectClient\n * @extends {AIProjectContext}\n * @description The main client for the AIProjectClient\n * @constructor\n * @param {string} endpoint - The endpoint to use\n * @param {TokenCredential} credential - The credential to use\n * @param {AIProjectClientOptionalParams} [options] - Optional parameters for the client.\n * @property {RedTeamsOperations} redTeams - The operation groups for redTeams\n * @property {DeploymentsOperations} deployments - The operation groups for deployments\n * @property {IndexesOperations} indexes - The operation groups for indexes\n * @property {DatasetsOperations} datasets - The operation groups for datasets\n * @property {EvaluationsOperations} evaluations - The operation groups for evaluations\n * @property {ConnectionsOperations} connections - The operation groups for connections\n * @property {InferenceOperations} inference - The operation groups for inference\n * @property {TelemetryOperations} telemetry - The operation groups for telemetry\n * @property {EnableTelemetryType} enableTelemetry - The operation groups for enabling telemetry\n */\nexport class AIProjectClient {\n private _cognitiveScopeClient: AIProjectContext;\n private _azureScopeClient: AIProjectContext;\n private _endpoint: string;\n private _credential: TokenCredential;\n private _agents: AgentsClient | undefined;\n private _options: AIProjectClientOptionalParams;\n /** The pipeline used by this client to make requests */\n public readonly pipeline: Pipeline;\n\n constructor(\n endpointParam: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n ) {\n this._endpoint = endpointParam;\n this._credential = credential;\n this._options = options;\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._cognitiveScopeClient = createAIProject(endpointParam, credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n\n this._azureScopeClient = createAIProject(endpointParam, credential, {\n ...options,\n credentials: {\n ...options.credentials,\n scopes: [\"https://ai.azure.com/.default\"],\n },\n userAgentOptions: { userAgentPrefix },\n });\n\n this.pipeline = this._cognitiveScopeClient.pipeline;\n this.redTeams = _getRedTeamsOperations(this._azureScopeClient);\n this.deployments = _getDeploymentsOperations(this._azureScopeClient);\n this.indexes = _getIndexesOperations(this._azureScopeClient);\n this.datasets = _getDatasetsOperations(this._azureScopeClient, this._options);\n this.evaluations = _getEvaluationsOperations(this._azureScopeClient);\n this.connections = _getConnectionsOperations(this._azureScopeClient);\n this.inference = _getInferenceOperations(this._cognitiveScopeClient, this.connections);\n this.telemetry = _getTelemetryOperations(this.connections);\n this.enableTelemetry = enableTelemetry;\n }\n\n /** The operation groups for redTeams */\n public readonly redTeams: RedTeamsOperations;\n /** The operation groups for deployments */\n public readonly deployments: DeploymentsOperations;\n /** The operation groups for indexes */\n public readonly indexes: IndexesOperations;\n /** The operation groups for datasets */\n public readonly datasets: DatasetsOperations;\n /** The operation groups for evaluations */\n public readonly evaluations: EvaluationsOperations;\n /** The operation groups for connections */\n public readonly connections: ConnectionsOperations;\n /** The operation groups for inference */\n public readonly inference: InferenceOperations;\n /** The operation groups for telemetry */\n public readonly telemetry: TelemetryOperations;\n /** The operation groups for enabling telemetry */\n public readonly enableTelemetry: EnableTelemetryType;\n\n /**\n * gets the endpoint of the client\n * @returns the endpoint of the client\n */\n public getEndpointUrl(): string {\n return this._endpoint;\n }\n\n /**\n * Creates a new instance of AzureAIProjectClient\n * @param endpoint - The endpoint to use\n * @param credential - The credential to use\n * @param options - The parameter for all optional parameters\n */\n static fromEndpoint(\n endpoint: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n ): AIProjectClient {\n return new AIProjectClient(endpoint, credential, options);\n }\n\n /**\n * Get the AgentsClient associated with this AIProjectClient.\n *\n * @returns The AgentsClient associated with this AIProjectClient\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients\n public get agents(): AgentsClient {\n const { apiVersion, ...clientOptions } = this._options;\n\n if (!this._agents) {\n this._agents = new AgentsClient(this._endpoint, this._credential, {\n ...clientOptions,\n userAgentOptions: this._cognitiveScopeClient.getUserAgent(),\n });\n }\n return this._agents;\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AIProjectContext as Client } from "../index.js";
|
|
1
|
+
import { DatasetUploadOptionalParams, AIProjectContext as Client } from "../index.js";
|
|
2
2
|
import { _PagedDatasetVersion, DatasetVersionUnion, PendingUploadRequest, PendingUploadResponse, AssetCredentialResponse } from "../../models/models.js";
|
|
3
3
|
import { DatasetsGetCredentialsOptionalParams, DatasetsPendingUploadOptionalParams, DatasetsCreateOrUpdateOptionalParams, DatasetsDeleteOptionalParams, DatasetsGetOptionalParams, DatasetsListOptionalParams, DatasetsListVersionsOptionalParams } from "./options.js";
|
|
4
4
|
import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js";
|
|
@@ -11,8 +11,8 @@ export declare function _pendingUploadSend(context: Client, name: string, versio
|
|
|
11
11
|
export declare function _pendingUploadDeserialize(result: PathUncheckedResponse): Promise<PendingUploadResponse>;
|
|
12
12
|
/** Start a new or get an existing pending upload of a dataset for a specific version. */
|
|
13
13
|
export declare function pendingUpload(context: Client, name: string, version: string, body: PendingUploadRequest, options?: DatasetsPendingUploadOptionalParams): Promise<PendingUploadResponse>;
|
|
14
|
-
export declare function uploadFile(context: Client, name: string, version: string, filePath: string,
|
|
15
|
-
export declare function uploadFolder(context: Client, name: string, version: string, folderPath: string,
|
|
14
|
+
export declare function uploadFile(context: Client, name: string, version: string, filePath: string, options?: DatasetUploadOptionalParams): Promise<DatasetVersionUnion>;
|
|
15
|
+
export declare function uploadFolder(context: Client, name: string, version: string, folderPath: string, options?: DatasetUploadOptionalParams): Promise<DatasetVersionUnion>;
|
|
16
16
|
export declare function _createOrUpdateSend(context: Client, name: string, version: string, body: DatasetVersionUnion, options?: DatasetsCreateOrUpdateOptionalParams): StreamableMethod;
|
|
17
17
|
export declare function _createOrUpdateDeserialize(result: PathUncheckedResponse): Promise<DatasetVersionUnion>;
|
|
18
18
|
/** Create a new or update an existing DatasetVersion with the given version id */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/api/datasets/operations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/api/datasets/operations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,2BAA2B,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AACtF,OAAO,EACL,oBAAoB,EAIpB,mBAAmB,EACnB,oBAAoB,EAEpB,qBAAqB,EAErB,uBAAuB,EAExB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,oCAA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BAAgB,CAmBlB;AAED,wBAAsB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAOjG;AAED,qDAAqD;AACrD,wBAAsB,GAAG,CACvB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,yBAAkD,GAC1D,OAAO,CAAC,mBAAmB,CAAC,CAG9B;AAED,wBAAgB,SAAS,CACvB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,0BAAmD,GAC3D,gBAAgB,CAiBlB;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CAO/B;AAED,qDAAqD;AACrD,wBAAgB,IAAI,CAClB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,0BAAmD,GAC3D,0BAA0B,CAAC,mBAAmB,CAAC,CAQjD;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,kCAA2D,GACnE,gBAAgB,CAkBlB;AAED,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CAO/B;AAED,oDAAoD;AACpD,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,kCAA2D,GACnE,0BAA0B,CAAC,mBAAmB,CAAC,CAQjD"}
|
|
@@ -55,10 +55,9 @@ export async function pendingUpload(context, name, version, body, options = { re
|
|
|
55
55
|
return _pendingUploadDeserialize(result);
|
|
56
56
|
}
|
|
57
57
|
// Internal helper method to create a new dataset and return a ContainerClient from azure-storage-blob package, to the dataset's blob storage.
|
|
58
|
-
async function createDatasetAndGetItsContainer(context, name, version,
|
|
59
|
-
|
|
60
|
-
connectionName
|
|
61
|
-
var _a;
|
|
58
|
+
async function createDatasetAndGetItsContainer(context, name, version, options) {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
const { connectionName, projectOptions = {} } = options || {};
|
|
62
61
|
// Start a pending upload to get the container URL with SAS token
|
|
63
62
|
const pendingUploadResponse = await pendingUpload(context, name, version, {
|
|
64
63
|
pendingUploadType: "BlobReference",
|
|
@@ -87,12 +86,16 @@ connectionName) {
|
|
|
87
86
|
console.debug(`[createDatasetAndGetItsContainer] blobReference.credential.type = ${blobReference.credential.type}`);
|
|
88
87
|
// Create container client from the blob URI (which includes the SAS token)
|
|
89
88
|
const containerClient = new ContainerClient(blobReference.credential.sasUri);
|
|
89
|
+
const pipeline = containerClient["storageClientContext"].pipeline;
|
|
90
|
+
for (const { policy } of (_b = projectOptions.additionalPolicies) !== null && _b !== void 0 ? _b : []) {
|
|
91
|
+
pipeline.addPolicy(policy, { afterPhase: "Sign" });
|
|
92
|
+
}
|
|
90
93
|
return {
|
|
91
94
|
containerClient,
|
|
92
95
|
version,
|
|
93
96
|
};
|
|
94
97
|
}
|
|
95
|
-
export async function uploadFile(context, name, version, filePath,
|
|
98
|
+
export async function uploadFile(context, name, version, filePath, options) {
|
|
96
99
|
// if file does not exist
|
|
97
100
|
const fileExists = fs.existsSync(filePath);
|
|
98
101
|
if (!fileExists) {
|
|
@@ -103,7 +106,7 @@ export async function uploadFile(context, name, version, filePath, connectionNam
|
|
|
103
106
|
if (isDirectory) {
|
|
104
107
|
throw new Error(`The provided file is actually a folder. Use method uploadFolder instead`);
|
|
105
108
|
}
|
|
106
|
-
const { containerClient, version: outputVersion } = await createDatasetAndGetItsContainer(context, name, version,
|
|
109
|
+
const { containerClient, version: outputVersion } = await createDatasetAndGetItsContainer(context, name, version, options);
|
|
107
110
|
// file name as blob name
|
|
108
111
|
const blobName = nodePath.basename(filePath);
|
|
109
112
|
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
|
|
@@ -116,7 +119,7 @@ export async function uploadFile(context, name, version, filePath, connectionNam
|
|
|
116
119
|
});
|
|
117
120
|
return datasetVersion;
|
|
118
121
|
}
|
|
119
|
-
export async function uploadFolder(context, name, version, folderPath,
|
|
122
|
+
export async function uploadFolder(context, name, version, folderPath, options) {
|
|
120
123
|
// Check if the folder exists
|
|
121
124
|
const folderExists = fs.existsSync(folderPath);
|
|
122
125
|
if (!folderExists) {
|
|
@@ -127,7 +130,7 @@ export async function uploadFolder(context, name, version, folderPath, connectio
|
|
|
127
130
|
if (isFile) {
|
|
128
131
|
throw new Error(`The provided path is actually a file. Use method uploadFile instead`);
|
|
129
132
|
}
|
|
130
|
-
const { containerClient, version: outputVersion } = await createDatasetAndGetItsContainer(context, name, version,
|
|
133
|
+
const { containerClient, version: outputVersion } = await createDatasetAndGetItsContainer(context, name, version, options);
|
|
131
134
|
// Helper function to recursively get all files in a directory
|
|
132
135
|
async function getAllFiles(dir, fileList = []) {
|
|
133
136
|
const files = await fs.promises.readdir(dir);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/datasets/operations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,iCAAiC;AAEjC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,QAAQ,MAAM,MAAM,CAAC;AAEjC,OAAO,EAEL,gCAAgC,EAChC,6BAA6B,EAC7B,+BAA+B,EAG/B,8BAA8B,EAE9B,iCAAiC,EAEjC,mCAAmC,GACpC,MAAM,wBAAwB,CAAC;AAUhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAEL,uBAAuB,GACxB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAGL,eAAe,EACf,mCAAmC,GACpC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,UAAU,mBAAmB,CACjC,OAAe,EACf,IAAY,EACZ,OAAe,EACf,UAAgD,EAAE,cAAc,EAAE,E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C,CAAC;IACjC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,gCAAgC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,YAAY,CAC1B,OAAe,EACf,IAAY,EACZ,UAA8C,EAAE,cAAc,EAAE,EAAE,EAAE;IAEpE,OAAO,uBAAuB,CAC5B,OAAO,EACP,GAAG,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,EAC/C,wBAAwB,EACxB,CAAC,KAAK,CAAC,EACP,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAChD,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/* eslint-disable tsdoc/syntax */\n\nimport * as fs from \"fs\";\nimport * as nodePath from \"path\";\nimport { AIProjectContext as Client } from \"../index.js\";\nimport {\n _PagedDatasetVersion,\n _pagedDatasetVersionDeserializer,\n datasetVersionUnionSerializer,\n datasetVersionUnionDeserializer,\n DatasetVersionUnion,\n PendingUploadRequest,\n pendingUploadRequestSerializer,\n PendingUploadResponse,\n pendingUploadResponseDeserializer,\n AssetCredentialResponse,\n assetCredentialResponseDeserializer,\n} from \"../../models/models.js\";\nimport {\n DatasetsGetCredentialsOptionalParams,\n DatasetsPendingUploadOptionalParams,\n DatasetsCreateOrUpdateOptionalParams,\n DatasetsDeleteOptionalParams,\n DatasetsGetOptionalParams,\n DatasetsListOptionalParams,\n DatasetsListVersionsOptionalParams,\n} from \"./options.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport {\n PagedAsyncIterableIterator,\n buildPagedAsyncIterator,\n} from \"../../static-helpers/pagingHelpers.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\nimport { ContainerClient } from \"@azure/storage-blob\";\n\nexport function _getCredentialsSend(\n context: Client,\n name: string,\n version: string,\n options: DatasetsGetCredentialsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}/credentials{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getCredentialsDeserialize(\n result: PathUncheckedResponse,\n): Promise<AssetCredentialResponse> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return assetCredentialResponseDeserializer(result.body);\n}\n\n/** Get the SAS credential to access the storage account associated with a Dataset version. */\nexport async function getCredentials(\n context: Client,\n name: string,\n version: string,\n options: DatasetsGetCredentialsOptionalParams = { requestOptions: {} },\n): Promise<AssetCredentialResponse> {\n const result = await _getCredentialsSend(context, name, version, options);\n return _getCredentialsDeserialize(result);\n}\n\nexport function _pendingUploadSend(\n context: Client,\n name: string,\n version: string,\n body: PendingUploadRequest,\n options: DatasetsPendingUploadOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}/startPendingUpload{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: pendingUploadRequestSerializer(body),\n });\n}\n\nexport async function _pendingUploadDeserialize(\n result: PathUncheckedResponse,\n): Promise<PendingUploadResponse> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return pendingUploadResponseDeserializer(result.body);\n}\n\n/** Start a new or get an existing pending upload of a dataset for a specific version. */\nexport async function pendingUpload(\n context: Client,\n name: string,\n version: string,\n body: PendingUploadRequest,\n options: DatasetsPendingUploadOptionalParams = { requestOptions: {} },\n): Promise<PendingUploadResponse> {\n const result = await _pendingUploadSend(context, name, version, body, options);\n return _pendingUploadDeserialize(result);\n}\n\n// Internal helper method to create a new dataset and return a ContainerClient from azure-storage-blob package, to the dataset's blob storage.\nasync function createDatasetAndGetItsContainer(\n context: Client,\n name: string,\n version: string,\n // Optional connection name for the storage account to be used\n connectionName?: string,\n): Promise<{ containerClient: ContainerClient; version: string }> {\n // Start a pending upload to get the container URL with SAS token\n const pendingUploadResponse = await pendingUpload(context, name, version, {\n pendingUploadType: \"BlobReference\",\n connectionName,\n } as PendingUploadRequest);\n\n const blobReference = pendingUploadResponse.blobReference;\n // Validate the response\n if (!blobReference) {\n throw new Error(\"Blob reference for consumption is not present\");\n }\n\n if (!blobReference.credential?.type) {\n throw new Error(\"Credential type is not present\");\n }\n\n if (blobReference.credential.type !== \"SAS\") {\n throw new Error(\"Credential type is not SAS\");\n }\n\n if (!blobReference.blobUri) {\n throw new Error(\"Blob URI is not present or empty\");\n }\n\n // Optional debug logging\n console.debug(\n `[createDatasetAndGetItsContainer] pendingUploadResponse.pendingUploadId = ${pendingUploadResponse.pendingUploadId}`,\n );\n console.debug(\n `[createDatasetAndGetItsContainer] pendingUploadResponse.pendingUploadType = ${pendingUploadResponse.pendingUploadType}`,\n );\n console.debug(\n `[createDatasetAndGetItsContainer] blobReference.blobUri = ${blobReference.blobUri}`,\n );\n console.debug(\n `[createDatasetAndGetItsContainer] blobReference.storageAccountArmId = ${blobReference.storageAccountArmId}`,\n );\n console.debug(\n `[createDatasetAndGetItsContainer] blobReference.credential.sasUri = ${blobReference.credential.sasUri}`,\n );\n console.debug(\n `[createDatasetAndGetItsContainer] blobReference.credential.type = ${blobReference.credential.type}`,\n );\n\n // Create container client from the blob URI (which includes the SAS token)\n const containerClient = new ContainerClient(blobReference.credential.sasUri);\n\n return {\n containerClient,\n version,\n };\n}\n\nexport async function uploadFile(\n context: Client,\n name: string,\n version: string,\n filePath: string,\n connectionName?: string,\n): Promise<DatasetVersionUnion> {\n // if file does not exist\n\n const fileExists = fs.existsSync(filePath);\n if (!fileExists) {\n throw new Error(`File does not exist at path: ${filePath}`);\n }\n // Check if the file is a directory\n const isDirectory = fs.lstatSync(filePath).isDirectory();\n if (isDirectory) {\n throw new Error(`The provided file is actually a folder. Use method uploadFolder instead`);\n }\n\n const { containerClient, version: outputVersion } = await createDatasetAndGetItsContainer(\n context,\n name,\n version,\n connectionName,\n );\n // file name as blob name\n const blobName = nodePath.basename(filePath);\n const blockBlobClient = containerClient.getBlockBlobClient(blobName);\n await blockBlobClient.uploadStream(fs.createReadStream(filePath));\n\n const datasetVersion = await createOrUpdate(context, name, outputVersion, {\n name: name,\n version: outputVersion,\n type: \"uri_file\",\n dataUri: blockBlobClient.url,\n });\n return datasetVersion;\n}\n\nexport async function uploadFolder(\n context: Client,\n name: string,\n version: string,\n folderPath: string,\n connectionName?: string,\n): Promise<DatasetVersionUnion> {\n // Check if the folder exists\n const folderExists = fs.existsSync(folderPath);\n if (!folderExists) {\n throw new Error(`Folder does not exist at path: ${folderPath}`);\n }\n // Check if the folder is a file\n const isFile = fs.lstatSync(folderPath).isFile();\n if (isFile) {\n throw new Error(`The provided path is actually a file. Use method uploadFile instead`);\n }\n\n const { containerClient, version: outputVersion } = await createDatasetAndGetItsContainer(\n context,\n name,\n version,\n connectionName,\n );\n\n // Helper function to recursively get all files in a directory\n async function getAllFiles(dir: string, fileList: string[] = []): Promise<string[]> {\n const files = await fs.promises.readdir(dir);\n\n for (const file of files) {\n const filePath = `${dir}/${file}`;\n const stat = await fs.promises.lstat(filePath);\n\n if (stat.isDirectory()) {\n await getAllFiles(filePath, fileList);\n } else {\n fileList.push(filePath);\n }\n }\n\n return fileList;\n }\n\n // Get all files in the folder\n const allFiles = await getAllFiles(folderPath);\n if (allFiles.length === 0) {\n throw new Error(\"The provided folder is empty.\");\n }\n\n // Upload each file to blob storage while maintaining relative paths\n for (const filePath of allFiles) {\n // Create blob name as relative path from the base folder\n const relativePath = nodePath.relative(folderPath, filePath).split(nodePath.sep).join(\"/\");\n\n console.debug(\n `[uploadFolderAndCreate] Start uploading file '${filePath}' as blob '${relativePath}'`,\n );\n\n // Get a block blob client for the relative path\n const blobClient = containerClient.getBlockBlobClient(relativePath);\n\n // Upload the file using a readable stream for better performance\n const fileStream = fs.createReadStream(filePath);\n await blobClient.uploadStream(fileStream);\n console.debug(\n `[uploadFolderAndCreate] Done uploading file '${filePath}' as blob '${relativePath}'`,\n );\n }\n\n // Create dataset version that references this folder\n const datasetVersion = await createOrUpdate(context, name, outputVersion, {\n name: name,\n version: outputVersion,\n type: \"uri_folder\",\n dataUri: containerClient.url,\n });\n\n return datasetVersion;\n}\n\nexport function _createOrUpdateSend(\n context: Client,\n name: string,\n version: string,\n body: DatasetVersionUnion,\n options: DatasetsCreateOrUpdateOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).patch({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/merge-patch+json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: datasetVersionUnionSerializer(body),\n });\n}\n\nexport async function _createOrUpdateDeserialize(\n result: PathUncheckedResponse,\n): Promise<DatasetVersionUnion> {\n const expectedStatuses = [\"201\", \"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return datasetVersionUnionDeserializer(result.body);\n}\n\n/** Create a new or update an existing DatasetVersion with the given version id */\nexport async function createOrUpdate(\n context: Client,\n name: string,\n version: string,\n body: DatasetVersionUnion,\n options: DatasetsCreateOrUpdateOptionalParams = { requestOptions: {} },\n): Promise<DatasetVersionUnion> {\n const result = await _createOrUpdateSend(context, name, version, body, options);\n return _createOrUpdateDeserialize(result);\n}\n\nexport function _$deleteSend(\n context: Client,\n name: string,\n version: string,\n options: DatasetsDeleteOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).delete({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _$deleteDeserialize(result: PathUncheckedResponse): Promise<void> {\n const expectedStatuses = [\"204\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return;\n}\n\n/** Delete the specific version of the DatasetVersion */\n/**\n * @fixme delete is a reserved word that cannot be used as an operation name.\n * Please add @clientName(\"clientName\") or @clientName(\"<JS-Specific-Name>\", \"javascript\")\n * to the operation to override the generated name.\n */\nexport async function $delete(\n context: Client,\n name: string,\n version: string,\n options: DatasetsDeleteOptionalParams = { requestOptions: {} },\n): Promise<void> {\n const result = await _$deleteSend(context, name, version, options);\n return _$deleteDeserialize(result);\n}\n\nexport function _getSend(\n context: Client,\n name: string,\n version: string,\n options: DatasetsGetOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getDeserialize(result: PathUncheckedResponse): Promise<DatasetVersionUnion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return datasetVersionUnionDeserializer(result.body);\n}\n\n/** Get the specific version of the DatasetVersion */\nexport async function get(\n context: Client,\n name: string,\n version: string,\n options: DatasetsGetOptionalParams = { requestOptions: {} },\n): Promise<DatasetVersionUnion> {\n const result = await _getSend(context, name, version, options);\n return _getDeserialize(result);\n}\n\nexport function _listSend(\n context: Client,\n options: DatasetsListOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets{?api-version}\",\n {\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listDeserialize(\n result: PathUncheckedResponse,\n): Promise<_PagedDatasetVersion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedDatasetVersionDeserializer(result.body);\n}\n\n/** List the latest version of each DatasetVersion */\nexport function list(\n context: Client,\n options: DatasetsListOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<DatasetVersionUnion> {\n return buildPagedAsyncIterator(\n context,\n () => _listSend(context, options),\n _listDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\" },\n );\n}\n\nexport function _listVersionsSend(\n context: Client,\n name: string,\n options: DatasetsListVersionsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions{?api-version}\",\n {\n name: name,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listVersionsDeserialize(\n result: PathUncheckedResponse,\n): Promise<_PagedDatasetVersion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedDatasetVersionDeserializer(result.body);\n}\n\n/** List all versions of the given DatasetVersion */\nexport function listVersions(\n context: Client,\n name: string,\n options: DatasetsListVersionsOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<DatasetVersionUnion> {\n return buildPagedAsyncIterator(\n context,\n () => _listVersionsSend(context, name, options),\n _listVersionsDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\" },\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/datasets/operations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,iCAAiC;AAEjC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,QAAQ,MAAM,MAAM,CAAC;AAEjC,OAAO,EAEL,gCAAgC,EAChC,6BAA6B,EAC7B,+BAA+B,EAG/B,8BAA8B,EAE9B,iCAAiC,EAEjC,mCAAmC,GACpC,MAAM,wBAAwB,CAAC;AAUhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAEL,uBAAuB,GACxB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAGL,eAAe,EACf,mCAAmC,GACpC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,UAAU,mBAAmB,CACjC,OAAe,EACf,IAAY,EACZ,OAAe,EACf,UAAgD,EAAE,cAAc,EAAE,EAAE,EAAE;;IAEtE,MAAM,IAAI,GAAG,iBAAiB,CAC5B,+DAA+D,EAC/D;QACE,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,OAAO;QAChB,aAAa,EAAE,OAAO,CAAC,UAAU;KAClC,EACD;QACE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IACvB,MAAA,OAAO,CAAC,cAAc,0CAAE,OAAO,KAEpC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,MAA6B;IAE7B,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,gCAAgC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,YAAY,CAC1B,OAAe,EACf,IAAY,EACZ,UAA8C,EAAE,cAAc,EAAE,EAAE,EAAE;IAEpE,OAAO,uBAAuB,CAC5B,OAAO,EACP,GAAG,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,EAC/C,wBAAwB,EACxB,CAAC,KAAK,CAAC,EACP,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAChD,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/* eslint-disable tsdoc/syntax */\n\nimport * as fs from \"fs\";\nimport * as nodePath from \"path\";\nimport { DatasetUploadOptionalParams, AIProjectContext as Client } from \"../index.js\";\nimport {\n _PagedDatasetVersion,\n _pagedDatasetVersionDeserializer,\n datasetVersionUnionSerializer,\n datasetVersionUnionDeserializer,\n DatasetVersionUnion,\n PendingUploadRequest,\n pendingUploadRequestSerializer,\n PendingUploadResponse,\n pendingUploadResponseDeserializer,\n AssetCredentialResponse,\n assetCredentialResponseDeserializer,\n} from \"../../models/models.js\";\nimport {\n DatasetsGetCredentialsOptionalParams,\n DatasetsPendingUploadOptionalParams,\n DatasetsCreateOrUpdateOptionalParams,\n DatasetsDeleteOptionalParams,\n DatasetsGetOptionalParams,\n DatasetsListOptionalParams,\n DatasetsListVersionsOptionalParams,\n} from \"./options.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport {\n PagedAsyncIterableIterator,\n buildPagedAsyncIterator,\n} from \"../../static-helpers/pagingHelpers.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\nimport { ContainerClient } from \"@azure/storage-blob\";\n\nexport function _getCredentialsSend(\n context: Client,\n name: string,\n version: string,\n options: DatasetsGetCredentialsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}/credentials{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getCredentialsDeserialize(\n result: PathUncheckedResponse,\n): Promise<AssetCredentialResponse> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return assetCredentialResponseDeserializer(result.body);\n}\n\n/** Get the SAS credential to access the storage account associated with a Dataset version. */\nexport async function getCredentials(\n context: Client,\n name: string,\n version: string,\n options: DatasetsGetCredentialsOptionalParams = { requestOptions: {} },\n): Promise<AssetCredentialResponse> {\n const result = await _getCredentialsSend(context, name, version, options);\n return _getCredentialsDeserialize(result);\n}\n\nexport function _pendingUploadSend(\n context: Client,\n name: string,\n version: string,\n body: PendingUploadRequest,\n options: DatasetsPendingUploadOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}/startPendingUpload{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: pendingUploadRequestSerializer(body),\n });\n}\n\nexport async function _pendingUploadDeserialize(\n result: PathUncheckedResponse,\n): Promise<PendingUploadResponse> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return pendingUploadResponseDeserializer(result.body);\n}\n\n/** Start a new or get an existing pending upload of a dataset for a specific version. */\nexport async function pendingUpload(\n context: Client,\n name: string,\n version: string,\n body: PendingUploadRequest,\n options: DatasetsPendingUploadOptionalParams = { requestOptions: {} },\n): Promise<PendingUploadResponse> {\n const result = await _pendingUploadSend(context, name, version, body, options);\n return _pendingUploadDeserialize(result);\n}\n\n// Internal helper method to create a new dataset and return a ContainerClient from azure-storage-blob package, to the dataset's blob storage.\nasync function createDatasetAndGetItsContainer(\n context: Client,\n name: string,\n version: string,\n options?: DatasetUploadOptionalParams,\n): Promise<{ containerClient: ContainerClient; version: string }> {\n const { connectionName, projectOptions = {} } = options || {};\n // Start a pending upload to get the container URL with SAS token\n const pendingUploadResponse = await pendingUpload(context, name, version, {\n pendingUploadType: \"BlobReference\",\n connectionName,\n } as PendingUploadRequest);\n\n const blobReference = pendingUploadResponse.blobReference;\n // Validate the response\n if (!blobReference) {\n throw new Error(\"Blob reference for consumption is not present\");\n }\n\n if (!blobReference.credential?.type) {\n throw new Error(\"Credential type is not present\");\n }\n\n if (blobReference.credential.type !== \"SAS\") {\n throw new Error(\"Credential type is not SAS\");\n }\n\n if (!blobReference.blobUri) {\n throw new Error(\"Blob URI is not present or empty\");\n }\n\n // Optional debug logging\n console.debug(\n `[createDatasetAndGetItsContainer] pendingUploadResponse.pendingUploadId = ${pendingUploadResponse.pendingUploadId}`,\n );\n console.debug(\n `[createDatasetAndGetItsContainer] pendingUploadResponse.pendingUploadType = ${pendingUploadResponse.pendingUploadType}`,\n );\n console.debug(\n `[createDatasetAndGetItsContainer] blobReference.blobUri = ${blobReference.blobUri}`,\n );\n console.debug(\n `[createDatasetAndGetItsContainer] blobReference.storageAccountArmId = ${blobReference.storageAccountArmId}`,\n );\n console.debug(\n `[createDatasetAndGetItsContainer] blobReference.credential.sasUri = ${blobReference.credential.sasUri}`,\n );\n console.debug(\n `[createDatasetAndGetItsContainer] blobReference.credential.type = ${blobReference.credential.type}`,\n );\n\n // Create container client from the blob URI (which includes the SAS token)\n const containerClient = new ContainerClient(blobReference.credential.sasUri);\n\n const pipeline = containerClient[\"storageClientContext\"].pipeline;\n for (const { policy } of projectOptions.additionalPolicies ?? []) {\n pipeline.addPolicy(policy, { afterPhase: \"Sign\" });\n }\n\n return {\n containerClient,\n version,\n };\n}\n\nexport async function uploadFile(\n context: Client,\n name: string,\n version: string,\n filePath: string,\n options?: DatasetUploadOptionalParams,\n): Promise<DatasetVersionUnion> {\n // if file does not exist\n\n const fileExists = fs.existsSync(filePath);\n if (!fileExists) {\n throw new Error(`File does not exist at path: ${filePath}`);\n }\n // Check if the file is a directory\n const isDirectory = fs.lstatSync(filePath).isDirectory();\n if (isDirectory) {\n throw new Error(`The provided file is actually a folder. Use method uploadFolder instead`);\n }\n\n const { containerClient, version: outputVersion } = await createDatasetAndGetItsContainer(\n context,\n name,\n version,\n options,\n );\n // file name as blob name\n const blobName = nodePath.basename(filePath);\n const blockBlobClient = containerClient.getBlockBlobClient(blobName);\n await blockBlobClient.uploadStream(fs.createReadStream(filePath));\n\n const datasetVersion = await createOrUpdate(context, name, outputVersion, {\n name: name,\n version: outputVersion,\n type: \"uri_file\",\n dataUri: blockBlobClient.url,\n });\n return datasetVersion;\n}\n\nexport async function uploadFolder(\n context: Client,\n name: string,\n version: string,\n folderPath: string,\n options?: DatasetUploadOptionalParams,\n): Promise<DatasetVersionUnion> {\n // Check if the folder exists\n const folderExists = fs.existsSync(folderPath);\n if (!folderExists) {\n throw new Error(`Folder does not exist at path: ${folderPath}`);\n }\n // Check if the folder is a file\n const isFile = fs.lstatSync(folderPath).isFile();\n if (isFile) {\n throw new Error(`The provided path is actually a file. Use method uploadFile instead`);\n }\n\n const { containerClient, version: outputVersion } = await createDatasetAndGetItsContainer(\n context,\n name,\n version,\n options,\n );\n\n // Helper function to recursively get all files in a directory\n async function getAllFiles(dir: string, fileList: string[] = []): Promise<string[]> {\n const files = await fs.promises.readdir(dir);\n\n for (const file of files) {\n const filePath = `${dir}/${file}`;\n const stat = await fs.promises.lstat(filePath);\n\n if (stat.isDirectory()) {\n await getAllFiles(filePath, fileList);\n } else {\n fileList.push(filePath);\n }\n }\n\n return fileList;\n }\n\n // Get all files in the folder\n const allFiles = await getAllFiles(folderPath);\n if (allFiles.length === 0) {\n throw new Error(\"The provided folder is empty.\");\n }\n\n // Upload each file to blob storage while maintaining relative paths\n for (const filePath of allFiles) {\n // Create blob name as relative path from the base folder\n const relativePath = nodePath.relative(folderPath, filePath).split(nodePath.sep).join(\"/\");\n\n console.debug(\n `[uploadFolderAndCreate] Start uploading file '${filePath}' as blob '${relativePath}'`,\n );\n\n // Get a block blob client for the relative path\n const blobClient = containerClient.getBlockBlobClient(relativePath);\n\n // Upload the file using a readable stream for better performance\n const fileStream = fs.createReadStream(filePath);\n await blobClient.uploadStream(fileStream);\n console.debug(\n `[uploadFolderAndCreate] Done uploading file '${filePath}' as blob '${relativePath}'`,\n );\n }\n\n // Create dataset version that references this folder\n const datasetVersion = await createOrUpdate(context, name, outputVersion, {\n name: name,\n version: outputVersion,\n type: \"uri_folder\",\n dataUri: containerClient.url,\n });\n\n return datasetVersion;\n}\n\nexport function _createOrUpdateSend(\n context: Client,\n name: string,\n version: string,\n body: DatasetVersionUnion,\n options: DatasetsCreateOrUpdateOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).patch({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/merge-patch+json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: datasetVersionUnionSerializer(body),\n });\n}\n\nexport async function _createOrUpdateDeserialize(\n result: PathUncheckedResponse,\n): Promise<DatasetVersionUnion> {\n const expectedStatuses = [\"201\", \"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return datasetVersionUnionDeserializer(result.body);\n}\n\n/** Create a new or update an existing DatasetVersion with the given version id */\nexport async function createOrUpdate(\n context: Client,\n name: string,\n version: string,\n body: DatasetVersionUnion,\n options: DatasetsCreateOrUpdateOptionalParams = { requestOptions: {} },\n): Promise<DatasetVersionUnion> {\n const result = await _createOrUpdateSend(context, name, version, body, options);\n return _createOrUpdateDeserialize(result);\n}\n\nexport function _$deleteSend(\n context: Client,\n name: string,\n version: string,\n options: DatasetsDeleteOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).delete({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _$deleteDeserialize(result: PathUncheckedResponse): Promise<void> {\n const expectedStatuses = [\"204\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return;\n}\n\n/** Delete the specific version of the DatasetVersion */\n/**\n * @fixme delete is a reserved word that cannot be used as an operation name.\n * Please add @clientName(\"clientName\") or @clientName(\"<JS-Specific-Name>\", \"javascript\")\n * to the operation to override the generated name.\n */\nexport async function $delete(\n context: Client,\n name: string,\n version: string,\n options: DatasetsDeleteOptionalParams = { requestOptions: {} },\n): Promise<void> {\n const result = await _$deleteSend(context, name, version, options);\n return _$deleteDeserialize(result);\n}\n\nexport function _getSend(\n context: Client,\n name: string,\n version: string,\n options: DatasetsGetOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getDeserialize(result: PathUncheckedResponse): Promise<DatasetVersionUnion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return datasetVersionUnionDeserializer(result.body);\n}\n\n/** Get the specific version of the DatasetVersion */\nexport async function get(\n context: Client,\n name: string,\n version: string,\n options: DatasetsGetOptionalParams = { requestOptions: {} },\n): Promise<DatasetVersionUnion> {\n const result = await _getSend(context, name, version, options);\n return _getDeserialize(result);\n}\n\nexport function _listSend(\n context: Client,\n options: DatasetsListOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets{?api-version}\",\n {\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listDeserialize(\n result: PathUncheckedResponse,\n): Promise<_PagedDatasetVersion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedDatasetVersionDeserializer(result.body);\n}\n\n/** List the latest version of each DatasetVersion */\nexport function list(\n context: Client,\n options: DatasetsListOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<DatasetVersionUnion> {\n return buildPagedAsyncIterator(\n context,\n () => _listSend(context, options),\n _listDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\" },\n );\n}\n\nexport function _listVersionsSend(\n context: Client,\n name: string,\n options: DatasetsListVersionsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions{?api-version}\",\n {\n name: name,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listVersionsDeserialize(\n result: PathUncheckedResponse,\n): Promise<_PagedDatasetVersion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedDatasetVersionDeserializer(result.body);\n}\n\n/** List all versions of the given DatasetVersion */\nexport function listVersions(\n context: Client,\n name: string,\n options: DatasetsListVersionsOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<DatasetVersionUnion> {\n return buildPagedAsyncIterator(\n context,\n () => _listVersionsSend(context, name, options),\n _listVersionsDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\" },\n );\n}\n"]}
|
|
@@ -8,8 +8,8 @@ export function _createAgentEvaluationSend(context, evaluation, options = {
|
|
|
8
8
|
requestOptions: {},
|
|
9
9
|
}) {
|
|
10
10
|
var _a, _b;
|
|
11
|
-
const path = expandUrlTemplate("/evaluations/runs:runAgent{?api
|
|
12
|
-
"api
|
|
11
|
+
const path = expandUrlTemplate("/evaluations/runs:runAgent{?api-version}", {
|
|
12
|
+
"api-version": context.apiVersion,
|
|
13
13
|
}, {
|
|
14
14
|
allowReserved: (_a = options === null || options === void 0 ? void 0 : options.requestOptions) === null || _a === void 0 ? void 0 : _a.skipUrlEncoding,
|
|
15
15
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/evaluations/operations.ts"],"names":[],"mappings":"AAAA,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AY,EACZ,UAAwC,EAAE,cAAc,EAAE,EAAE,EAAE;IAE9D,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACtD,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AIProjectContext as Client } from \"../index.js\";\nimport {\n Evaluation,\n EvaluationWithOptionalName,\n evaluationSerializer,\n evaluationDeserializer,\n _PagedEvaluation,\n _pagedEvaluationDeserializer,\n AgentEvaluationRequest,\n agentEvaluationRequestSerializer,\n AgentEvaluation,\n agentEvaluationDeserializer,\n} from \"../../models/models.js\";\nimport {\n EvaluationsCreateAgentEvaluationOptionalParams,\n EvaluationsCreateOptionalParams,\n EvaluationsListOptionalParams,\n EvaluationsGetOptionalParams,\n} from \"./options.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport {\n PagedAsyncIterableIterator,\n buildPagedAsyncIterator,\n} from \"../../static-helpers/pagingHelpers.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\n\nexport function _createAgentEvaluationSend(\n context: Client,\n evaluation: AgentEvaluationRequest,\n options: EvaluationsCreateAgentEvaluationOptionalParams = {\n requestOptions: {},\n },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/evaluations/runs:runAgent{?api%2Dversion}\",\n {\n \"api%2Dversion\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: agentEvaluationRequestSerializer(evaluation),\n });\n}\n\nexport async function _createAgentEvaluationDeserialize(\n result: PathUncheckedResponse,\n): Promise<AgentEvaluation> {\n const expectedStatuses = [\"201\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return agentEvaluationDeserializer(result.body);\n}\n\n/** Creates an agent evaluation run. */\nexport async function createAgentEvaluation(\n context: Client,\n evaluation: AgentEvaluationRequest,\n options: EvaluationsCreateAgentEvaluationOptionalParams = {\n requestOptions: {},\n },\n): Promise<AgentEvaluation> {\n const result = await _createAgentEvaluationSend(context, evaluation, options);\n return _createAgentEvaluationDeserialize(result);\n}\n\nexport function _createSend(\n context: Client,\n evaluation: EvaluationWithOptionalName,\n options: EvaluationsCreateOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/evaluations/runs:run{?api-version}\",\n {\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: evaluationSerializer(evaluation),\n });\n}\n\nexport async function _createDeserialize(result: PathUncheckedResponse): Promise<Evaluation> {\n const expectedStatuses = [\"201\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return evaluationDeserializer(result.body);\n}\n\n/** Creates an evaluation run. */\nexport async function create(\n context: Client,\n evaluation: EvaluationWithOptionalName,\n options: EvaluationsCreateOptionalParams = { requestOptions: {} },\n): Promise<Evaluation> {\n const result = await _createSend(context, evaluation, options);\n return _createDeserialize(result);\n}\n\nexport function _listSend(\n context: Client,\n options: EvaluationsListOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/evaluations/runs{?api-version}\",\n {\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n ...(options?.clientRequestId !== undefined\n ? { \"x-ms-client-request-id\": options?.clientRequestId }\n : {}),\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listDeserialize(result: PathUncheckedResponse): Promise<_PagedEvaluation> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedEvaluationDeserializer(result.body);\n}\n\n/** List evaluation runs */\nexport function list(\n context: Client,\n options: EvaluationsListOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<Evaluation> {\n return buildPagedAsyncIterator(\n context,\n () => _listSend(context, options),\n _listDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\" },\n );\n}\n\nexport function _getSend(\n context: Client,\n name: string,\n options: EvaluationsGetOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/evaluations/runs/{name}{?api-version}\",\n {\n name: name,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n ...(options?.clientRequestId !== undefined\n ? { \"x-ms-client-request-id\": options?.clientRequestId }\n : {}),\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getDeserialize(result: PathUncheckedResponse): Promise<Evaluation> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return evaluationDeserializer(result.body);\n}\n\n/** Get an evaluation run by name. */\nexport async function get(\n context: Client,\n name: string,\n options: EvaluationsGetOptionalParams = { requestOptions: {} },\n): Promise<Evaluation> {\n const result = await _getSend(context, name, options);\n return _getDeserialize(result);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/evaluations/operations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAGL,oBAAoB,EACpB,sBAAsB,EAEtB,4BAA4B,EAE5B,gCAAgC,EAEhC,2BAA2B,GAC5B,MA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CAAC,CAAC;IACtD,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AIProjectContext as Client } from \"../index.js\";\nimport {\n Evaluation,\n EvaluationWithOptionalName,\n evaluationSerializer,\n evaluationDeserializer,\n _PagedEvaluation,\n _pagedEvaluationDeserializer,\n AgentEvaluationRequest,\n agentEvaluationRequestSerializer,\n AgentEvaluation,\n agentEvaluationDeserializer,\n} from \"../../models/models.js\";\nimport {\n EvaluationsCreateAgentEvaluationOptionalParams,\n EvaluationsCreateOptionalParams,\n EvaluationsListOptionalParams,\n EvaluationsGetOptionalParams,\n} from \"./options.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport {\n PagedAsyncIterableIterator,\n buildPagedAsyncIterator,\n} from \"../../static-helpers/pagingHelpers.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\n\nexport function _createAgentEvaluationSend(\n context: Client,\n evaluation: AgentEvaluationRequest,\n options: EvaluationsCreateAgentEvaluationOptionalParams = {\n requestOptions: {},\n },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/evaluations/runs:runAgent{?api-version}\",\n {\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: agentEvaluationRequestSerializer(evaluation),\n });\n}\n\nexport async function _createAgentEvaluationDeserialize(\n result: PathUncheckedResponse,\n): Promise<AgentEvaluation> {\n const expectedStatuses = [\"201\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return agentEvaluationDeserializer(result.body);\n}\n\n/** Creates an agent evaluation run. */\nexport async function createAgentEvaluation(\n context: Client,\n evaluation: AgentEvaluationRequest,\n options: EvaluationsCreateAgentEvaluationOptionalParams = {\n requestOptions: {},\n },\n): Promise<AgentEvaluation> {\n const result = await _createAgentEvaluationSend(context, evaluation, options);\n return _createAgentEvaluationDeserialize(result);\n}\n\nexport function _createSend(\n context: Client,\n evaluation: EvaluationWithOptionalName,\n options: EvaluationsCreateOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/evaluations/runs:run{?api-version}\",\n {\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: evaluationSerializer(evaluation),\n });\n}\n\nexport async function _createDeserialize(result: PathUncheckedResponse): Promise<Evaluation> {\n const expectedStatuses = [\"201\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return evaluationDeserializer(result.body);\n}\n\n/** Creates an evaluation run. */\nexport async function create(\n context: Client,\n evaluation: EvaluationWithOptionalName,\n options: EvaluationsCreateOptionalParams = { requestOptions: {} },\n): Promise<Evaluation> {\n const result = await _createSend(context, evaluation, options);\n return _createDeserialize(result);\n}\n\nexport function _listSend(\n context: Client,\n options: EvaluationsListOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/evaluations/runs{?api-version}\",\n {\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n ...(options?.clientRequestId !== undefined\n ? { \"x-ms-client-request-id\": options?.clientRequestId }\n : {}),\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listDeserialize(result: PathUncheckedResponse): Promise<_PagedEvaluation> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedEvaluationDeserializer(result.body);\n}\n\n/** List evaluation runs */\nexport function list(\n context: Client,\n options: EvaluationsListOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<Evaluation> {\n return buildPagedAsyncIterator(\n context,\n () => _listSend(context, options),\n _listDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\" },\n );\n}\n\nexport function _getSend(\n context: Client,\n name: string,\n options: EvaluationsGetOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/evaluations/runs/{name}{?api-version}\",\n {\n name: name,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n ...(options?.clientRequestId !== undefined\n ? { \"x-ms-client-request-id\": options?.clientRequestId }\n : {}),\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getDeserialize(result: PathUncheckedResponse): Promise<Evaluation> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return evaluationDeserializer(result.body);\n}\n\n/** Get an evaluation run by name. */\nexport async function get(\n context: Client,\n name: string,\n options: EvaluationsGetOptionalParams = { requestOptions: {} },\n): Promise<Evaluation> {\n const result = await _getSend(context, name, options);\n return _getDeserialize(result);\n}\n"]}
|
package/dist/esm/api/index.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { AIProjectClientOptionalParams } from "./aiProjectContext.js";
|
|
2
|
+
export { createAIProject, AIProjectContext } from "./aiProjectContext.js";
|
|
3
|
+
export { AIProjectClientOptionalParams };
|
|
4
|
+
export interface DatasetUploadOptionalParams {
|
|
5
|
+
connectionName?: string;
|
|
6
|
+
projectOptions?: AIProjectClientOptionalParams;
|
|
7
|
+
}
|
|
2
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE1E,OAAO,EAAE,6BAA6B,EAAE,CAAC;AAEzC,MAAM,WAAW,2BAA2B;IAE1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,6BAA6B,CAAC;CAChD"}
|
package/dist/esm/api/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAoB,MAAM,uBAAuB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { AIProjectClientOptionalParams } from \"./aiProjectContext.js\";\nexport { createAIProject, AIProjectContext } from \"./aiProjectContext.js\";\n\nexport { AIProjectClientOptionalParams };\n\nexport interface DatasetUploadOptionalParams {\n // Optional connection name for the storage account to be used\n connectionName?: string;\n projectOptions?: AIProjectClientOptionalParams;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/inference/index.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/inference/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * used for checking if the inference response is unexpected.\n */\nexport { isUnexpected } from \"@azure-rest/ai-inference\";\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AIProjectContext } from "../../api/aiProjectContext.js";
|
|
1
|
+
import { AIProjectClientOptionalParams, AIProjectContext } from "../../api/aiProjectContext.js";
|
|
2
2
|
import { DatasetVersionUnion, PendingUploadRequest, PendingUploadResponse, AssetCredentialResponse } from "../../models/models.js";
|
|
3
3
|
import { DatasetsGetCredentialsOptionalParams, DatasetsPendingUploadOptionalParams, DatasetsCreateOrUpdateOptionalParams, DatasetsDeleteOptionalParams, DatasetsGetOptionalParams, DatasetsListOptionalParams, DatasetsListVersionsOptionalParams } from "../../api/datasets/options.js";
|
|
4
4
|
import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js";
|
|
@@ -28,5 +28,5 @@ export interface DatasetsOperations {
|
|
|
28
28
|
/** Upload a folder to the DatasetVersion */
|
|
29
29
|
uploadFolder: (name: string, version: string, folderPath: string, connectionName?: string) => Promise<DatasetVersionUnion>;
|
|
30
30
|
}
|
|
31
|
-
export declare function _getDatasetsOperations(context: AIProjectContext): DatasetsOperations;
|
|
31
|
+
export declare function _getDatasetsOperations(context: AIProjectContext, projectOptions?: AIProjectClientOptionalParams): DatasetsOperations;
|
|
32
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/classic/datasets/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/classic/datasets/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAA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AE,CAAC,OAAO,CAAC,EAAE,0BAA0B,KAAK,0BAA0B,CAAC,mBAAmB,CAAC,CAAC;IAChG,oDAAoD;IACpD,YAAY,EAAE,CACZ,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,kCAAkC,KACzC,0BAA0B,CAAC,mBAAmB,CAAC,CAAC;IACrD,0CAA0C;IAC1C,UAAU,EAAE,CACV,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,cAAc,CAAC,EAAE,MAAM,KACpB,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAClC,4CAA4C;IAC5C,YAAY,EAAE,CACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,cAAc,CAAC,EAAE,MAAM,KACpB,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACnC;AAsCD,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,gBAAgB,EACzB,cAAc,GAAE,6BAAkC,GACjD,kBAAkB,CAIpB"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
/* eslint-disable tsdoc/syntax */
|
|
4
4
|
import { getCredentials, pendingUpload, createOrUpdate, $delete, get, list, listVersions, uploadFile, uploadFolder, } from "../../api/datasets/operations.js";
|
|
5
|
-
function _getDatasets(context) {
|
|
5
|
+
function _getDatasets(context, projectOptions = {}) {
|
|
6
6
|
return {
|
|
7
7
|
getCredentials: (name, version, options) => getCredentials(context, name, version, options),
|
|
8
8
|
pendingUpload: (name, version, body, options) => pendingUpload(context, name, version, body, options),
|
|
@@ -11,11 +11,11 @@ function _getDatasets(context) {
|
|
|
11
11
|
get: (name, version, options) => get(context, name, version, options),
|
|
12
12
|
list: (options) => list(context, options),
|
|
13
13
|
listVersions: (name, options) => listVersions(context, name, options),
|
|
14
|
-
uploadFile: (name, version, filePath, connectionName) => uploadFile(context, name, version, filePath, connectionName),
|
|
15
|
-
uploadFolder: (name, version, folderPath, connectionName) => uploadFolder(context, name, version, folderPath, connectionName),
|
|
14
|
+
uploadFile: (name, version, filePath, connectionName) => uploadFile(context, name, version, filePath, { connectionName, projectOptions }),
|
|
15
|
+
uploadFolder: (name, version, folderPath, connectionName) => uploadFolder(context, name, version, folderPath, { connectionName, projectOptions }),
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
export function _getDatasetsOperations(context) {
|
|
19
|
-
return Object.assign({}, _getDatasets(context));
|
|
18
|
+
export function _getDatasetsOperations(context, projectOptions = {}) {
|
|
19
|
+
return Object.assign({}, _getDatasets(context, projectOptions));
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/datasets/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,iCAAiC;AAkBjC,OAAO,EACL,cAAc,EACd,aAAa,EACb,cAAc,EACd,OAAO,EACP,GAAG,EACH,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,YAAY,GACb,MAAM,kCAAkC,CAAC;AA6D1C,SAAS,YAAY,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/datasets/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,iCAAiC;AAkBjC,OAAO,EACL,cAAc,EACd,aAAa,EACb,cAAc,EACd,OAAO,EACP,GAAG,EACH,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,YAAY,GACb,MAAM,kCAAkC,CAAC;AA6D1C,SAAS,YAAY,CACnB,OAAyB,EACzB,iBAAgD,EAAE;IAElD,OAAO;QACL,cAAc,EAAE,CACd,IAAY,EACZ,OAAe,EACf,OAA8C,EAC9C,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC;QACpD,aAAa,EAAE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AY,CAAC,OAAO,EAAE,cAAc,CAAC,EACxC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/* eslint-disable tsdoc/syntax */\n\nimport { AIProjectClientOptionalParams, AIProjectContext } from \"../../api/aiProjectContext.js\";\nimport {\n DatasetVersionUnion,\n PendingUploadRequest,\n PendingUploadResponse,\n AssetCredentialResponse,\n} from \"../../models/models.js\";\nimport {\n DatasetsGetCredentialsOptionalParams,\n DatasetsPendingUploadOptionalParams,\n DatasetsCreateOrUpdateOptionalParams,\n DatasetsDeleteOptionalParams,\n DatasetsGetOptionalParams,\n DatasetsListOptionalParams,\n DatasetsListVersionsOptionalParams,\n} from \"../../api/datasets/options.js\";\nimport {\n getCredentials,\n pendingUpload,\n createOrUpdate,\n $delete,\n get,\n list,\n listVersions,\n uploadFile,\n uploadFolder,\n} from \"../../api/datasets/operations.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\n\n/** Interface representing a Datasets operations. */\nexport interface DatasetsOperations {\n /** Get the SAS credential to access the storage account associated with a Dataset version. */\n getCredentials: (\n name: string,\n version: string,\n options?: DatasetsGetCredentialsOptionalParams,\n ) => Promise<AssetCredentialResponse>;\n /** Start a new or get an existing pending upload of a dataset for a specific version. */\n pendingUpload: (\n name: string,\n version: string,\n body: PendingUploadRequest,\n options?: DatasetsPendingUploadOptionalParams,\n ) => Promise<PendingUploadResponse>;\n /** Create a new or update an existing DatasetVersion with the given version id */\n createOrUpdate: (\n name: string,\n version: string,\n body: DatasetVersionUnion,\n options?: DatasetsCreateOrUpdateOptionalParams,\n ) => Promise<DatasetVersionUnion>;\n /** Delete the specific version of the DatasetVersion */\n /**\n * @fixme delete is a reserved word that cannot be used as an operation name.\n * Please add @clientName(\"clientName\") or @clientName(\"<JS-Specific-Name>\", \"javascript\")\n * to the operation to override the generated name.\n */\n delete: (name: string, version: string, options?: DatasetsDeleteOptionalParams) => Promise<void>;\n /** Get the specific version of the DatasetVersion */\n get: (\n name: string,\n version: string,\n options?: DatasetsGetOptionalParams,\n ) => Promise<DatasetVersionUnion>;\n /** List the latest version of each DatasetVersion */\n list: (options?: DatasetsListOptionalParams) => PagedAsyncIterableIterator<DatasetVersionUnion>;\n /** List all versions of the given DatasetVersion */\n listVersions: (\n name: string,\n options?: DatasetsListVersionsOptionalParams,\n ) => PagedAsyncIterableIterator<DatasetVersionUnion>;\n /** Upload a file to the DatasetVersion */\n uploadFile: (\n name: string,\n version: string,\n filePath: string,\n connectionName?: string,\n ) => Promise<DatasetVersionUnion>;\n /** Upload a folder to the DatasetVersion */\n uploadFolder: (\n name: string,\n version: string,\n folderPath: string,\n connectionName?: string,\n ) => Promise<DatasetVersionUnion>;\n}\n\nfunction _getDatasets(\n context: AIProjectContext,\n projectOptions: AIProjectClientOptionalParams = {},\n) {\n return {\n getCredentials: (\n name: string,\n version: string,\n options?: DatasetsGetCredentialsOptionalParams,\n ) => getCredentials(context, name, version, options),\n pendingUpload: (\n name: string,\n version: string,\n body: PendingUploadRequest,\n options?: DatasetsPendingUploadOptionalParams,\n ) => pendingUpload(context, name, version, body, options),\n createOrUpdate: (\n name: string,\n version: string,\n body: DatasetVersionUnion,\n options?: DatasetsCreateOrUpdateOptionalParams,\n ) => createOrUpdate(context, name, version, body, options),\n delete: (name: string, version: string, options?: DatasetsDeleteOptionalParams) =>\n $delete(context, name, version, options),\n get: (name: string, version: string, options?: DatasetsGetOptionalParams) =>\n get(context, name, version, options),\n list: (options?: DatasetsListOptionalParams) => list(context, options),\n listVersions: (name: string, options?: DatasetsListVersionsOptionalParams) =>\n listVersions(context, name, options),\n uploadFile: (name: string, version: string, filePath: string, connectionName?: string) =>\n uploadFile(context, name, version, filePath, { connectionName, projectOptions }),\n uploadFolder: (name: string, version: string, folderPath: string, connectionName?: string) =>\n uploadFolder(context, name, version, folderPath, { connectionName, projectOptions }),\n };\n}\n\nexport function _getDatasetsOperations(\n context: AIProjectContext,\n projectOptions: AIProjectClientOptionalParams = {},\n): DatasetsOperations {\n return {\n ..._getDatasets(context, projectOptions),\n };\n}\n"]}
|
|
@@ -36,6 +36,7 @@ export declare class AIProjectClient {
|
|
|
36
36
|
private _endpoint;
|
|
37
37
|
private _credential;
|
|
38
38
|
private _agents;
|
|
39
|
+
private _options;
|
|
39
40
|
/** The pipeline used by this client to make requests */
|
|
40
41
|
readonly pipeline: Pipeline;
|
|
41
42
|
constructor(endpointParam: string, credential: TokenCredential, options?: AIProjectClientOptionalParams);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiProjectClient.d.ts","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAqC,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAE,kBAAkB,EAA0B,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAA6B,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAyB,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAA0B,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAA6B,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAE,qBAAqB,EAA6B,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAA2B,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EACL,mBAAmB,EAGnB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAE1E;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,qBAAqB,CAAmB;IAChD,OAA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AW,CAAkB;IACrC,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,QAAQ,CAAgC;IAChD,wDAAwD;IACxD,SAAgB,QAAQ,EAAE,QAAQ,CAAC;gBAGjC,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,eAAe,EAC3B,OAAO,GAAE,6BAAkC;IAmC7C,wCAAwC;IACxC,SAAgB,QAAQ,EAAE,kBAAkB,CAAC;IAC7C,2CAA2C;IAC3C,SAAgB,WAAW,EAAE,qBAAqB,CAAC;IACnD,uCAAuC;IACvC,SAAgB,OAAO,EAAE,iBAAiB,CAAC;IAC3C,wCAAwC;IACxC,SAAgB,QAAQ,EAAE,kBAAkB,CAAC;IAC7C,2CAA2C;IAC3C,SAAgB,WAAW,EAAE,qBAAqB,CAAC;IACnD,2CAA2C;IAC3C,SAAgB,WAAW,EAAE,qBAAqB,CAAC;IACnD,yCAAyC;IACzC,SAAgB,SAAS,EAAE,mBAAmB,CAAC;IAC/C,yCAAyC;IACzC,SAAgB,SAAS,EAAE,mBAAmB,CAAC;IAC/C,kDAAkD;IAClD,SAAgB,eAAe,EAAE,mBAAmB,CAAC;IAErD;;;OAGG;IACI,cAAc,IAAI,MAAM;IAI/B;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CACjB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,eAAe,EAC3B,OAAO,GAAE,6BAAkC,GAC1C,eAAe;IAIlB;;;;OAIG;IAEH,IAAW,MAAM,IAAI,YAAY,CAUhC;CACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
/* eslint-disable tsdoc/syntax */
|
|
4
|
+
import { __rest } from "tslib";
|
|
4
5
|
import { AgentsClient } from "@azure/ai-agents";
|
|
5
6
|
import { createAIProject } from "./api/index.js";
|
|
6
7
|
import { _getRedTeamsOperations } from "./classic/redTeams/index.js";
|
|
@@ -35,6 +36,7 @@ export class AIProjectClient {
|
|
|
35
36
|
var _a;
|
|
36
37
|
this._endpoint = endpointParam;
|
|
37
38
|
this._credential = credential;
|
|
39
|
+
this._options = options;
|
|
38
40
|
const prefixFromOptions = (_a = options === null || options === void 0 ? void 0 : options.userAgentOptions) === null || _a === void 0 ? void 0 : _a.userAgentPrefix;
|
|
39
41
|
const userAgentPrefix = prefixFromOptions
|
|
40
42
|
? `${prefixFromOptions} azsdk-js-client`
|
|
@@ -45,7 +47,7 @@ export class AIProjectClient {
|
|
|
45
47
|
this.redTeams = _getRedTeamsOperations(this._azureScopeClient);
|
|
46
48
|
this.deployments = _getDeploymentsOperations(this._azureScopeClient);
|
|
47
49
|
this.indexes = _getIndexesOperations(this._azureScopeClient);
|
|
48
|
-
this.datasets = _getDatasetsOperations(this._azureScopeClient);
|
|
50
|
+
this.datasets = _getDatasetsOperations(this._azureScopeClient, this._options);
|
|
49
51
|
this.evaluations = _getEvaluationsOperations(this._azureScopeClient);
|
|
50
52
|
this.connections = _getConnectionsOperations(this._azureScopeClient);
|
|
51
53
|
this.inference = _getInferenceOperations(this._cognitiveScopeClient, this.connections);
|
|
@@ -75,10 +77,9 @@ export class AIProjectClient {
|
|
|
75
77
|
*/
|
|
76
78
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients
|
|
77
79
|
get agents() {
|
|
80
|
+
const _a = this._options, { apiVersion } = _a, clientOptions = __rest(_a, ["apiVersion"]);
|
|
78
81
|
if (!this._agents) {
|
|
79
|
-
this._agents = new AgentsClient(this._endpoint, this._credential, {
|
|
80
|
-
userAgentOptions: this._cognitiveScopeClient.getUserAgent(),
|
|
81
|
-
});
|
|
82
|
+
this._agents = new AgentsClient(this._endpoint, this._credential, Object.assign(Object.assign({}, clientOptions), { userAgentOptions: this._cognitiveScopeClient.getUserAgent() }));
|
|
82
83
|
}
|
|
83
84
|
return this._agents;
|
|
84
85
|
}
|