@azure/ai-projects 2.0.0-beta.2 → 2.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/README.md +212 -8
- package/dist/browser/aiProjectClient.d.ts.map +1 -1
- package/dist/browser/aiProjectClient.js +6 -0
- package/dist/browser/aiProjectClient.js.map +1 -1
- package/dist/browser/api/aiProjectContext.js +1 -1
- package/dist/browser/api/aiProjectContext.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/getCustomFetch-browser.d.mts.map +1 -0
- package/dist/browser/getCustomFetch-browser.mjs.map +1 -0
- package/dist/browser/getCustomFetch.d.ts +13 -0
- package/dist/browser/getCustomFetch.js +40 -0
- package/dist/browser/models/models.d.ts +10 -10
- package/dist/browser/models/models.d.ts.map +1 -1
- package/dist/browser/models/models.js +1 -1
- package/dist/browser/models/models.js.map +1 -1
- package/dist/commonjs/aiProjectClient.d.ts.map +1 -1
- package/dist/commonjs/aiProjectClient.js +6 -0
- package/dist/commonjs/aiProjectClient.js.map +1 -1
- package/dist/commonjs/api/aiProjectContext.js +1 -1
- package/dist/commonjs/api/aiProjectContext.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/getCustomFetch.d.ts +13 -0
- package/dist/commonjs/getCustomFetch.d.ts.map +1 -0
- package/dist/commonjs/getCustomFetch.js +45 -0
- package/dist/commonjs/getCustomFetch.js.map +1 -0
- package/dist/commonjs/models/models.d.ts +10 -10
- package/dist/commonjs/models/models.d.ts.map +1 -1
- package/dist/commonjs/models/models.js +1 -1
- package/dist/commonjs/models/models.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/esm/aiProjectClient.d.ts.map +1 -1
- package/dist/esm/aiProjectClient.js +6 -0
- package/dist/esm/aiProjectClient.js.map +1 -1
- package/dist/esm/api/aiProjectContext.js +1 -1
- package/dist/esm/api/aiProjectContext.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/getCustomFetch.d.ts +13 -0
- package/dist/esm/getCustomFetch.d.ts.map +1 -0
- package/dist/esm/getCustomFetch.js +42 -0
- package/dist/esm/getCustomFetch.js.map +1 -0
- package/dist/esm/models/models.d.ts +10 -10
- package/dist/esm/models/models.d.ts.map +1 -1
- package/dist/esm/models/models.js +1 -1
- package/dist/esm/models/models.js.map +1 -1
- package/dist/react-native/aiProjectClient.d.ts.map +1 -1
- package/dist/react-native/aiProjectClient.js +6 -0
- package/dist/react-native/aiProjectClient.js.map +1 -1
- package/dist/react-native/api/aiProjectContext.js +1 -1
- package/dist/react-native/api/aiProjectContext.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/getCustomFetch.d.ts +13 -0
- package/dist/react-native/getCustomFetch.d.ts.map +1 -0
- package/dist/react-native/getCustomFetch.js +42 -0
- package/dist/react-native/getCustomFetch.js.map +1 -0
- package/dist/react-native/models/models.d.ts +10 -10
- package/dist/react-native/models/models.d.ts.map +1 -1
- package/dist/react-native/models/models.js +1 -1
- package/dist/react-native/models/models.js.map +1 -1
- package/package.json +6 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiProjectClient.d.ts","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":"AAIA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAqC,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAwB,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAA6B,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAE,kB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BAAqB,CAAC;IACnD,4CAA4C;IAC5C,SAAgB,YAAY,EAAE,sBAAsB,CAAC;IACrD,sCAAsC;IACtC,SAAgB,MAAM,EAAE,gBAAgB,CAAC;IACzC,yCAAyC;IACzC,SAAgB,SAAS,EAAE,mBAAmB,CAAC;IAC/C;;;OAGG;IACU,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC;IAsB/C;;;OAGG;IACH,IAAW,QAAQ,IAAI,MAAM,CAE5B;CACF"}
|
|
@@ -22,6 +22,7 @@ const index_js_12 = require("./classic/telemetry/index.js");
|
|
|
22
22
|
const index_js_13 = require("./classic/redTeams/index.js");
|
|
23
23
|
const index_js_14 = require("./classic/schedules/index.js");
|
|
24
24
|
const overwriteOpenAIClient_js_1 = require("./overwriteOpenAIClient.js");
|
|
25
|
+
const getCustomFetch_js_1 = require("./getCustomFetch.js");
|
|
25
26
|
/**
|
|
26
27
|
* The main client for the AIProjectClient service. It provides access to the various operations available in the service.
|
|
27
28
|
* @class AIProjectClient
|
|
@@ -115,11 +116,16 @@ class AIProjectClient {
|
|
|
115
116
|
async getOpenAIClient() {
|
|
116
117
|
const scope = "https://ai.azure.com/.default";
|
|
117
118
|
const azureADTokenProvider = await (0, identity_1.getBearerTokenProvider)(this._credential, scope);
|
|
119
|
+
let customFetch;
|
|
120
|
+
if (this._options.additionalPolicies?.find((policy) => policy.policy.name === "recording policy")) {
|
|
121
|
+
customFetch = (0, getCustomFetch_js_1.getCustomFetch)(this._azureScopeClient.pipeline, this._options.httpClient);
|
|
122
|
+
}
|
|
118
123
|
const openAIOptions = {
|
|
119
124
|
apiKey: azureADTokenProvider,
|
|
120
125
|
baseURL: `${this._endpoint}/openai`,
|
|
121
126
|
defaultQuery: { "api-version": this._options?.apiVersion || "2025-11-15-preview" },
|
|
122
127
|
dangerouslyAllowBrowser: true,
|
|
128
|
+
fetch: customFetch,
|
|
123
129
|
};
|
|
124
130
|
const openaiClient = new openai_1.default(openAIOptions);
|
|
125
131
|
return (0, overwriteOpenAIClient_js_1.overwriteOpenAIClient)(openaiClient);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiProjectClient.js","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAClC,iCAAiC;;;;AAEjC,4DAA4B;AAC5B,8CAAyD;AACzD,6CAAkG;AAClG,wDAAmF;AACnF,6DAAkG;AAClG,0DAAyF;AACzF,6DAAkG;AAClG,iEAG4C;AAC5C,sEAGiD;AACjD,4DAA+F;AAC/F,yDAAsF;AACtF,2DAAyF;AACzF,+DAGyC;AACzC,4DAA4F;AAC5F,2DAAyF;AACzF,4DAA4F;AAE5F,yEAAmE;AAInE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,eAAe;IAClB,qBAAqB,CAAmB;IACxC,iBAAiB,CAAmB;IACpC,SAAS,CAAS;IAClB,WAAW,CAAkB;IAC7B,QAAQ,CAAgC;IAEhD,YACE,QAAgB,EAChB,UAA2B,EAC3B,UAAyC,EAAE;QAE3C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,MAAM,iBAAiB,GAAG,OAAO,EAAE,gBAAgB,EAAE,eAAe,CAAC;QACrE,MAAM,eAAe,GAAG,iBAAiB;YACvC,CAAC,CAAC,GAAG,iBAAiB,kBAAkB;YACxC,CAAC,CAAC,iBAAiB,CAAC;QACtB,IAAI,CAAC,qBAAqB,GAAG,IAAA,0BAAe,EAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,EAAE;YACvE,GAAG,OAAO;YACV,gBAAgB,EAAE,EAAE,eAAe,EAAE;YACrC,WAAW,EAAE;gBACX,GAAG,OAAO,CAAC,WAAW;gBACtB,MAAM,EAAE,CAAC,+BAA+B,CAAC;aAC1C;SACF,CAAC,CAAC;QACH,IAAI,CAAC,iBAA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AAC,CAAC;IAC7D,CAAC;IAED,yCAAyC;IACzB,SAAS,CAAsB;IAC/C,wCAAwC;IACxB,QAAQ,CAAqB;IAC7C,0CAA0C;IAC1B,UAAU,CAAuB;IACjD,oDAAoD;IACpC,oBAAoB,CAAiC;IACrE,+CAA+C;IAC/B,eAAe,CAA4B;IAC3D,wCAAwC;IACxB,QAAQ,CAAqB;IAC7C,2CAA2C;IAC3B,WAAW,CAAwB;IACnD,uCAAuC;IACvB,OAAO,CAAoB;IAC3C,wCAAwC;IACxB,QAAQ,CAAqB;IAC7C,2CAA2C;IAC3B,WAAW,CAAwB;IACnD,4CAA4C;IAC5B,YAAY,CAAyB;IACrD,sCAAsC;IACtB,MAAM,CAAmB;IACzC,yCAAyC;IACzB,SAAS,CAAsB;IAC/C;;;OAGG;IACI,KAAK,CAAC,eAAe;QAC1B,MAAM,KAAK,GAAG,+BAA+B,CAAC;QAC9C,MAAM,oBAAoB,GAAG,MAAM,IAAA,iCAAsB,EAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QAEnF,MAAM,aAAa,GAA4C;YAC7D,MAAM,EAAE,oBAAoB;YAC5B,OAAO,EAAE,GAAG,IAAI,CAAC,SAAS,SAAS;YACnC,YAAY,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,IAAI,oBAAoB,EAAE;YAClF,uBAAuB,EAAE,IAAI;SAC9B,CAAC;QAEF,MAAM,YAAY,GAAG,IAAI,gBAAM,CAAC,aAAa,CAAC,CAAC;QAC/C,OAAO,IAAA,gDAAqB,EAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;IACD;;;OAGG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF;AAlGD,0CAkGC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/* eslint-disable tsdoc/syntax */\n\nimport OpenAI from \"openai\";\nimport { getBearerTokenProvider } from \"@azure/identity\";\nimport { createAIProject, AIProjectContext, AIProjectClientOptionalParams } from \"./api/index.js\";\nimport { AgentsOperations, _getAgentsOperations } from \"./classic/agents/index.js\";\nimport { ConnectionsOperations, _getConnectionsOperations } from \"./classic/connections/index.js\";\nimport { DatasetsOperations, _getDatasetsOperations } from \"./classic/datasets/index.js\";\nimport { DeploymentsOperations, _getDeploymentsOperations } from \"./classic/deployments/index.js\";\nimport {\n EvaluationRulesOperations,\n _getEvaluationRulesOperations,\n} from \"./classic/evaluationRules/index.js\";\nimport {\n EvaluationTaxonomiesOperations,\n _getEvaluationTaxonomiesOperations,\n} from \"./classic/evaluationTaxonomies/index.js\";\nimport { EvaluatorsOperations, _getEvaluatorsOperations } from \"./classic/evaluators/index.js\";\nimport { IndexesOperations, _getIndexesOperations } from \"./classic/indexes/index.js\";\nimport { InsightsOperations, _getInsightsOperations } from \"./classic/insights/index.js\";\nimport {\n MemoryStoresOperations,\n _getMemoryStoresOperations,\n} from \"./classic/memoryStores/index.js\";\nimport { TelemetryOperations, _getTelemetryOperations } from \"./classic/telemetry/index.js\";\nimport { RedTeamsOperations, _getRedTeamsOperations } from \"./classic/redTeams/index.js\";\nimport { SchedulesOperations, _getSchedulesOperations } from \"./classic/schedules/index.js\";\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { overwriteOpenAIClient } from \"./overwriteOpenAIClient.js\";\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 {ConnectionsOperations} connections - The operation groups for connections\n * @property {MemoryStoresOperations} memoryStores - The operation groups for memoryStores\n * @property {AgentsOperations} agents - The operation groups for agents\n * @property {TelemetryOperations} telemetry - The operation groups for telemetry\n * @property {getEndpointUrl} getEndpointUrl - gets the endpoint of the client\n * @property {getOpenAIClient} getOpenAIClient - gets the OpenAI client\n */\nexport class AIProjectClient {\n private _cognitiveScopeClient: AIProjectContext;\n private _azureScopeClient: AIProjectContext;\n private _endpoint: string;\n private _credential: TokenCredential;\n private _options: AIProjectClientOptionalParams;\n\n constructor(\n endpoint: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n ) {\n this._endpoint = endpoint;\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(endpoint, this._credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n credentials: {\n ...options.credentials,\n scopes: [\"https://ai.azure.com/.default\"],\n },\n });\n this._azureScopeClient = createAIProject(endpoint, credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n\n this.schedules = _getSchedulesOperations(this._cognitiveScopeClient);\n this.insights = _getInsightsOperations(this._cognitiveScopeClient);\n this.evaluators = _getEvaluatorsOperations(this._cognitiveScopeClient);\n this.evaluationTaxonomies = _getEvaluationTaxonomiesOperations(this._cognitiveScopeClient);\n this.evaluationRules = _getEvaluationRulesOperations(this._cognitiveScopeClient);\n this.redTeams = _getRedTeamsOperations(this._cognitiveScopeClient);\n this.deployments = _getDeploymentsOperations(this._azureScopeClient);\n this.indexes = _getIndexesOperations(this._azureScopeClient);\n this.datasets = _getDatasetsOperations(this._azureScopeClient, this._options);\n this.connections = _getConnectionsOperations(this._azureScopeClient);\n this.memoryStores = _getMemoryStoresOperations(this._cognitiveScopeClient);\n this.agents = _getAgentsOperations(this._azureScopeClient);\n this.telemetry = _getTelemetryOperations(this.connections);\n }\n\n /** The operation groups for schedules */\n public readonly schedules: SchedulesOperations;\n /** The operation groups for insights */\n public readonly insights: InsightsOperations;\n /** The operation groups for evaluators */\n public readonly evaluators: EvaluatorsOperations;\n /** The operation groups for evaluationTaxonomies */\n public readonly evaluationTaxonomies: EvaluationTaxonomiesOperations;\n /** The operation groups for evaluationRules */\n public readonly evaluationRules: EvaluationRulesOperations;\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 connections */\n public readonly connections: ConnectionsOperations;\n /** The operation groups for memoryStores */\n public readonly memoryStores: MemoryStoresOperations;\n /** The operation groups for agents */\n public readonly agents: AgentsOperations;\n /** The operation groups for telemetry */\n public readonly telemetry: TelemetryOperations;\n /**\n * gets the OpenAI client\n * @returns the OpenAI client\n */\n public async getOpenAIClient(): Promise<OpenAI> {\n const scope = \"https://ai.azure.com/.default\";\n const azureADTokenProvider = await getBearerTokenProvider(this._credential, scope);\n\n const openAIOptions: ConstructorParameters<typeof OpenAI>[0] = {\n apiKey: azureADTokenProvider,\n baseURL: `${this._endpoint}/openai`,\n defaultQuery: { \"api-version\": this._options?.apiVersion || \"2025-11-15-preview\" },\n dangerouslyAllowBrowser: true,\n };\n\n const openaiClient = new OpenAI(openAIOptions);\n return overwriteOpenAIClient(openaiClient);\n }\n /**\n * gets the endpoint of the client\n * @returns the endpoint of the client\n */\n public get endpoint(): string {\n return this._endpoint;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"aiProjectClient.js","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAClC,iCAAiC;;;;AAEjC,4DAA4B;AAC5B,8CAAyD;AACzD,6CAAkG;AAClG,wDAAmF;AACnF,6DA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ation.\n// Licensed under the MIT License.\n/* eslint-disable tsdoc/syntax */\n\nimport OpenAI from \"openai\";\nimport { getBearerTokenProvider } from \"@azure/identity\";\nimport { createAIProject, AIProjectContext, AIProjectClientOptionalParams } from \"./api/index.js\";\nimport { AgentsOperations, _getAgentsOperations } from \"./classic/agents/index.js\";\nimport { ConnectionsOperations, _getConnectionsOperations } from \"./classic/connections/index.js\";\nimport { DatasetsOperations, _getDatasetsOperations } from \"./classic/datasets/index.js\";\nimport { DeploymentsOperations, _getDeploymentsOperations } from \"./classic/deployments/index.js\";\nimport {\n EvaluationRulesOperations,\n _getEvaluationRulesOperations,\n} from \"./classic/evaluationRules/index.js\";\nimport {\n EvaluationTaxonomiesOperations,\n _getEvaluationTaxonomiesOperations,\n} from \"./classic/evaluationTaxonomies/index.js\";\nimport { EvaluatorsOperations, _getEvaluatorsOperations } from \"./classic/evaluators/index.js\";\nimport { IndexesOperations, _getIndexesOperations } from \"./classic/indexes/index.js\";\nimport { InsightsOperations, _getInsightsOperations } from \"./classic/insights/index.js\";\nimport {\n MemoryStoresOperations,\n _getMemoryStoresOperations,\n} from \"./classic/memoryStores/index.js\";\nimport { TelemetryOperations, _getTelemetryOperations } from \"./classic/telemetry/index.js\";\nimport { RedTeamsOperations, _getRedTeamsOperations } from \"./classic/redTeams/index.js\";\nimport { SchedulesOperations, _getSchedulesOperations } from \"./classic/schedules/index.js\";\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { overwriteOpenAIClient } from \"./overwriteOpenAIClient.js\";\nimport { getCustomFetch } from \"./getCustomFetch.js\";\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 {ConnectionsOperations} connections - The operation groups for connections\n * @property {MemoryStoresOperations} memoryStores - The operation groups for memoryStores\n * @property {AgentsOperations} agents - The operation groups for agents\n * @property {TelemetryOperations} telemetry - The operation groups for telemetry\n * @property {getEndpointUrl} getEndpointUrl - gets the endpoint of the client\n * @property {getOpenAIClient} getOpenAIClient - gets the OpenAI client\n */\nexport class AIProjectClient {\n private _cognitiveScopeClient: AIProjectContext;\n private _azureScopeClient: AIProjectContext;\n private _endpoint: string;\n private _credential: TokenCredential;\n private _options: AIProjectClientOptionalParams;\n\n constructor(\n endpoint: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n ) {\n this._endpoint = endpoint;\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(endpoint, this._credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n credentials: {\n ...options.credentials,\n scopes: [\"https://ai.azure.com/.default\"],\n },\n });\n this._azureScopeClient = createAIProject(endpoint, credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n\n this.schedules = _getSchedulesOperations(this._cognitiveScopeClient);\n this.insights = _getInsightsOperations(this._cognitiveScopeClient);\n this.evaluators = _getEvaluatorsOperations(this._cognitiveScopeClient);\n this.evaluationTaxonomies = _getEvaluationTaxonomiesOperations(this._cognitiveScopeClient);\n this.evaluationRules = _getEvaluationRulesOperations(this._cognitiveScopeClient);\n this.redTeams = _getRedTeamsOperations(this._cognitiveScopeClient);\n this.deployments = _getDeploymentsOperations(this._azureScopeClient);\n this.indexes = _getIndexesOperations(this._azureScopeClient);\n this.datasets = _getDatasetsOperations(this._azureScopeClient, this._options);\n this.connections = _getConnectionsOperations(this._azureScopeClient);\n this.memoryStores = _getMemoryStoresOperations(this._cognitiveScopeClient);\n this.agents = _getAgentsOperations(this._azureScopeClient);\n this.telemetry = _getTelemetryOperations(this.connections);\n }\n\n /** The operation groups for schedules */\n public readonly schedules: SchedulesOperations;\n /** The operation groups for insights */\n public readonly insights: InsightsOperations;\n /** The operation groups for evaluators */\n public readonly evaluators: EvaluatorsOperations;\n /** The operation groups for evaluationTaxonomies */\n public readonly evaluationTaxonomies: EvaluationTaxonomiesOperations;\n /** The operation groups for evaluationRules */\n public readonly evaluationRules: EvaluationRulesOperations;\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 connections */\n public readonly connections: ConnectionsOperations;\n /** The operation groups for memoryStores */\n public readonly memoryStores: MemoryStoresOperations;\n /** The operation groups for agents */\n public readonly agents: AgentsOperations;\n /** The operation groups for telemetry */\n public readonly telemetry: TelemetryOperations;\n /**\n * gets the OpenAI client\n * @returns the OpenAI client\n */\n public async getOpenAIClient(): Promise<OpenAI> {\n const scope = \"https://ai.azure.com/.default\";\n const azureADTokenProvider = await getBearerTokenProvider(this._credential, scope);\n let customFetch: NonNullable<ConstructorParameters<typeof OpenAI>[0]>[\"fetch\"];\n\n if (\n this._options.additionalPolicies?.find((policy) => policy.policy.name === \"recording policy\")\n ) {\n customFetch = getCustomFetch(this._azureScopeClient.pipeline, this._options.httpClient);\n }\n\n const openAIOptions: ConstructorParameters<typeof OpenAI>[0] = {\n apiKey: azureADTokenProvider,\n baseURL: `${this._endpoint}/openai`,\n defaultQuery: { \"api-version\": this._options?.apiVersion || \"2025-11-15-preview\" },\n dangerouslyAllowBrowser: true,\n fetch: customFetch,\n };\n\n const openaiClient = new OpenAI(openAIOptions);\n return overwriteOpenAIClient(openaiClient);\n }\n /**\n * gets the endpoint of the client\n * @returns the endpoint of the client\n */\n public get endpoint(): string {\n return this._endpoint;\n }\n}\n"]}
|
|
@@ -9,7 +9,7 @@ const core_client_1 = require("@azure-rest/core-client");
|
|
|
9
9
|
function createAIProject(endpoint, credential, options = {}) {
|
|
10
10
|
const endpointUrl = options.endpoint ?? String(endpoint);
|
|
11
11
|
const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
|
|
12
|
-
const userAgentInfo = `azsdk-js-ai-projects/2.0.0-beta.
|
|
12
|
+
const userAgentInfo = `azsdk-js-ai-projects/2.0.0-beta.3`;
|
|
13
13
|
const userAgentPrefix = prefixFromOptions
|
|
14
14
|
? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`
|
|
15
15
|
: `azsdk-js-api ${userAgentInfo}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiProjectContext.js","sourceRoot":"","sources":["../../../src/api/aiProjectContext.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAoBlC,0CAsCC;AAxDD,4CAAsC;AACtC,mDAAuD;AACvD,yDAA2E;AAgB3E,SAAgB,eAAe,CAC7B,QAAgB,EAChB,UAA2B,EAC3B,UAAyC,EAAE;IAE3C,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;IACzD,MAAM,iBAAiB,GAAG,OAAO,EAAE,gBAAgB,EAAE,eAAe,CAAC;IACrE,MAAM,aAAa,GAAG,mCAAmC,CAAC;IAC1D,MAAM,eAAe,GAAG,iBAAiB;QACvC,CAAC,CAAC,GAAG,iBAAiB,iBAAiB,aAAa,EAAE;QACtD,CAAC,CAAC,gBAAgB,aAAa,EAAE,CAAC;IACpC,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,GAAG;QAC3C,GAAG,OAAO;QACV,gBAAgB,EAAE,EAAE,eAAe,EAAE;QACrC,cAAc,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,IAAI,kBAAM,CAAC,IAAI,EAAE;QACzE,WAAW,EAAE;YACX,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC,+BAA+B,CAAC;SACzE;KACF,CAAC;IACF,MAAM,aAAa,GAAG,IAAA,uBAAS,EAAC,WAAW,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;IACzE,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAClE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,4BAAgB,CAAC,mBAAmB,CAAC;IAC9E,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC/B,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;gBACzC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,EAAE,GAAG,aAAa,EAAE,UAAU,EAAsB,CAAC;AAC9D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownApiVersions } from \"../models/models.js\";\nimport { Client, ClientOptions, getClient } from \"@azure-rest/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\nexport interface AIProjectContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownApiVersions} that the service accepts. */\n apiVersion: KnownApiVersions;\n}\n\n/** Optional parameters for the client. */\nexport interface AIProjectClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownApiVersions} that the service accepts. */\n apiVersion?: KnownApiVersions;\n}\n\nexport function createAIProject(\n endpoint: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n): AIProjectContext {\n const endpointUrl = options.endpoint ?? String(endpoint);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-ai-projects/2.0.0-beta.
|
|
1
|
+
{"version":3,"file":"aiProjectContext.js","sourceRoot":"","sources":["../../../src/api/aiProjectContext.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAoBlC,0CAsCC;AAxDD,4CAAsC;AACtC,mDAAuD;AACvD,yDAA2E;AAgB3E,SAAgB,eAAe,CAC7B,QAAgB,EAChB,UAA2B,EAC3B,UAAyC,EAAE;IAE3C,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;IACzD,MAAM,iBAAiB,GAAG,OAAO,EAAE,gBAAgB,EAAE,eAAe,CAAC;IACrE,MAAM,aAAa,GAAG,mCAAmC,CAAC;IAC1D,MAAM,eAAe,GAAG,iBAAiB;QACvC,CAAC,CAAC,GAAG,iBAAiB,iBAAiB,aAAa,EAAE;QACtD,CAAC,CAAC,gBAAgB,aAAa,EAAE,CAAC;IACpC,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,GAAG;QAC3C,GAAG,OAAO;QACV,gBAAgB,EAAE,EAAE,eAAe,EAAE;QACrC,cAAc,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,IAAI,kBAAM,CAAC,IAAI,EAAE;QACzE,WAAW,EAAE;YACX,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC,+BAA+B,CAAC;SACzE;KACF,CAAC;IACF,MAAM,aAAa,GAAG,IAAA,uBAAS,EAAC,WAAW,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;IACzE,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAClE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,4BAAgB,CAAC,mBAAmB,CAAC;IAC9E,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC/B,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;gBACzC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,EAAE,GAAG,aAAa,EAAE,UAAU,EAAsB,CAAC;AAC9D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownApiVersions } from \"../models/models.js\";\nimport { Client, ClientOptions, getClient } from \"@azure-rest/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\nexport interface AIProjectContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownApiVersions} that the service accepts. */\n apiVersion: KnownApiVersions;\n}\n\n/** Optional parameters for the client. */\nexport interface AIProjectClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownApiVersions} that the service accepts. */\n apiVersion?: KnownApiVersions;\n}\n\nexport function createAIProject(\n endpoint: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n): AIProjectContext {\n const endpointUrl = options.endpoint ?? String(endpoint);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-ai-projects/2.0.0-beta.3`;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`\n : `azsdk-js-api ${userAgentInfo}`;\n const { apiVersion: _, ...updatedOptions } = {\n ...options,\n userAgentOptions: { userAgentPrefix },\n loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://ai.azure.com/.default\"],\n },\n };\n const clientContext = getClient(endpointUrl, credential, updatedOptions);\n clientContext.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n const apiVersion = options.apiVersion ?? KnownApiVersions.v2025_11_15_preview;\n clientContext.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\")) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n return { ...clientContext, apiVersion } as AIProjectContext;\n}\n"]}
|
|
@@ -6,7 +6,7 @@ exports.PACKAGE_NAME = exports.SDK_VERSION = void 0;
|
|
|
6
6
|
/**
|
|
7
7
|
* Current version of the `@azure/ai-projects` package.
|
|
8
8
|
*/
|
|
9
|
-
exports.SDK_VERSION = `2.0.0-beta.
|
|
9
|
+
exports.SDK_VERSION = `2.0.0-beta.3`;
|
|
10
10
|
/**
|
|
11
11
|
* The package name of the `@azure/ai-projects` package.
|
|
12
12
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;GAEG;AACU,QAAA,WAAW,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACU,QAAA,YAAY,GAAG,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Current version of the `@azure/ai-projects` package.\n */\nexport const SDK_VERSION = `2.0.0-beta.
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;GAEG;AACU,QAAA,WAAW,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACU,QAAA,YAAY,GAAG,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Current version of the `@azure/ai-projects` package.\n */\nexport const SDK_VERSION = `2.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"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type OpenAI from "openai";
|
|
2
|
+
import type { Pipeline, HttpClient } from "@azure/core-rest-pipeline";
|
|
3
|
+
type FetchFn = NonNullable<NonNullable<ConstructorParameters<typeof OpenAI>[0]>["fetch"]>;
|
|
4
|
+
/**
|
|
5
|
+
* A custom `fetch` implementation that forwards requests to an Azure Core Pipeline.
|
|
6
|
+
* This allows us to send traffic to the test proxy for recording and playback.
|
|
7
|
+
* @param pipeline - The pipeline to use
|
|
8
|
+
* @param customHttpClient - The http client to make requests with
|
|
9
|
+
* @returns A fetch-compatible function.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getCustomFetch(pipeline: Pipeline, customHttpClient?: HttpClient): FetchFn;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=getCustomFetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCustomFetch.d.ts","sourceRoot":"","sources":["../../src/getCustomFetch.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAe,MAAM,2BAA2B,CAAC;AASnF,KAAK,OAAO,GAAG,WAAW,CAAC,WAAW,CAAC,qBAAqB,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AAE1F;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,CAAC,EAAE,UAAU,GAAG,OAAO,CA6BzF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getCustomFetch = getCustomFetch;
|
|
6
|
+
const core_rest_pipeline_1 = require("@azure/core-rest-pipeline");
|
|
7
|
+
const node_stream_1 = require("node:stream");
|
|
8
|
+
/**
|
|
9
|
+
* A custom `fetch` implementation that forwards requests to an Azure Core Pipeline.
|
|
10
|
+
* This allows us to send traffic to the test proxy for recording and playback.
|
|
11
|
+
* @param pipeline - The pipeline to use
|
|
12
|
+
* @param customHttpClient - The http client to make requests with
|
|
13
|
+
* @returns A fetch-compatible function.
|
|
14
|
+
*/
|
|
15
|
+
function getCustomFetch(pipeline, customHttpClient) {
|
|
16
|
+
return async function (resource, options) {
|
|
17
|
+
const fetchRequest = new Request(resource, options);
|
|
18
|
+
const rawHeaders = {};
|
|
19
|
+
for (const [key, value] of fetchRequest.headers) {
|
|
20
|
+
rawHeaders[key] = value;
|
|
21
|
+
}
|
|
22
|
+
const httpClient = customHttpClient ?? (0, core_rest_pipeline_1.createDefaultHttpClient)();
|
|
23
|
+
const requestBody = fetchRequest.body
|
|
24
|
+
? node_stream_1.Readable.fromWeb(fetchRequest.body)
|
|
25
|
+
: undefined;
|
|
26
|
+
const request = (0, core_rest_pipeline_1.createPipelineRequest)({
|
|
27
|
+
url: fetchRequest.url,
|
|
28
|
+
body: requestBody,
|
|
29
|
+
headers: (0, core_rest_pipeline_1.createHttpHeaders)(rawHeaders),
|
|
30
|
+
method: fetchRequest.method,
|
|
31
|
+
abortSignal: fetchRequest.signal,
|
|
32
|
+
streamResponseStatusCodes: new Set([Number.POSITIVE_INFINITY]),
|
|
33
|
+
});
|
|
34
|
+
const response = await pipeline.sendRequest(httpClient, request);
|
|
35
|
+
const body = response.readableStreamBody
|
|
36
|
+
? node_stream_1.Readable.toWeb(node_stream_1.Readable.from(response.readableStreamBody))
|
|
37
|
+
: null;
|
|
38
|
+
const fetchResponse = new Response(body, {
|
|
39
|
+
status: response.status,
|
|
40
|
+
headers: response.headers.toJSON({ preserveCase: true }),
|
|
41
|
+
});
|
|
42
|
+
return fetchResponse;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=getCustomFetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCustomFetch.js","sourceRoot":"","sources":["../../src/getCustomFetch.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAqBlC,wCA6BC;AA9CD,kEAImC;AACnC,6CAAuC;AAKvC;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,QAAkB,EAAE,gBAA6B;IAC9E,OAAO,KAAK,WAAW,QAAQ,EAAE,OAAO;QACtC,MAAM,YAAY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C,CAAC;QACH,OAAO,aAAa,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type OpenAI from \"openai\";\nimport type { Pipeline, HttpClient, HttpMethods } from \"@azure/core-rest-pipeline\";\nimport {\n createDefaultHttpClient,\n createPipelineRequest,\n createHttpHeaders,\n} from \"@azure/core-rest-pipeline\";\nimport { Readable } from \"node:stream\";\nimport type { ReadableStream as WebReadableStream } from \"node:stream/web\";\n\ntype FetchFn = NonNullable<NonNullable<ConstructorParameters<typeof OpenAI>[0]>[\"fetch\"]>;\n\n/**\n * A custom `fetch` implementation that forwards requests to an Azure Core Pipeline.\n * This allows us to send traffic to the test proxy for recording and playback.\n * @param pipeline - The pipeline to use\n * @param customHttpClient - The http client to make requests with\n * @returns A fetch-compatible function.\n */\nexport function getCustomFetch(pipeline: Pipeline, customHttpClient?: HttpClient): FetchFn {\n return async function (resource, options): Promise<Response> {\n const fetchRequest = new Request(resource, options);\n const rawHeaders: Record<string, string> = {};\n for (const [key, value] of fetchRequest.headers) {\n rawHeaders[key] = value;\n }\n const httpClient = customHttpClient ?? createDefaultHttpClient();\n const requestBody = fetchRequest.body\n ? Readable.fromWeb(fetchRequest.body as WebReadableStream<Uint8Array>)\n : undefined;\n const request = createPipelineRequest({\n url: fetchRequest.url,\n body: requestBody,\n headers: createHttpHeaders(rawHeaders),\n method: fetchRequest.method as HttpMethods,\n abortSignal: fetchRequest.signal,\n streamResponseStatusCodes: new Set([Number.POSITIVE_INFINITY]),\n });\n const response = await pipeline.sendRequest(httpClient, request);\n const body = response.readableStreamBody\n ? (Readable.toWeb(Readable.from(response.readableStreamBody)) as ReadableStream<Uint8Array>)\n : null;\n const fetchResponse = new Response(body, {\n status: response.status,\n headers: response.headers.toJSON({ preserveCase: true }),\n });\n return fetchResponse;\n };\n}\n"]}
|
|
@@ -1056,7 +1056,7 @@ export interface ResponseTextFormatConfigurationJsonSchema extends ResponseTextF
|
|
|
1056
1056
|
*/
|
|
1057
1057
|
export interface ResponseFormatJsonSchemaSchema {
|
|
1058
1058
|
/** Additional properties */
|
|
1059
|
-
additionalProperties?:
|
|
1059
|
+
additionalProperties?: boolean;
|
|
1060
1060
|
}
|
|
1061
1061
|
export declare function responseFormatJsonSchemaSchemaSerializer(item: ResponseFormatJsonSchemaSchema): any;
|
|
1062
1062
|
export declare function responseFormatJsonSchemaSchemaDeserializer(item: any): ResponseFormatJsonSchemaSchema;
|
|
@@ -2784,17 +2784,17 @@ export interface EvaluatorVersion {
|
|
|
2784
2784
|
/** Definition of the evaluator */
|
|
2785
2785
|
definition: EvaluatorDefinitionUnion;
|
|
2786
2786
|
/** Creator of the evaluator */
|
|
2787
|
-
readonly created_by
|
|
2787
|
+
readonly created_by?: string;
|
|
2788
2788
|
/** Creation date/time of the evaluator */
|
|
2789
|
-
readonly created_at
|
|
2789
|
+
readonly created_at?: number;
|
|
2790
2790
|
/** Last modified date/time of the evaluator */
|
|
2791
|
-
readonly modified_at
|
|
2791
|
+
readonly modified_at?: number;
|
|
2792
2792
|
/** Asset ID, a unique identifier for the asset */
|
|
2793
2793
|
readonly id?: string;
|
|
2794
2794
|
/** The name of the resource */
|
|
2795
2795
|
readonly name: string;
|
|
2796
2796
|
/** The version of the resource */
|
|
2797
|
-
readonly version
|
|
2797
|
+
readonly version?: string;
|
|
2798
2798
|
/** The asset description text. */
|
|
2799
2799
|
description?: string;
|
|
2800
2800
|
/** Tag dictionary. Tags can be added, removed, and updated. */
|
|
@@ -2866,11 +2866,11 @@ export declare function promptBasedEvaluatorDefinitionDeserializer(item: any): P
|
|
|
2866
2866
|
/** The response body for cluster insights. */
|
|
2867
2867
|
export interface Insight {
|
|
2868
2868
|
/** The unique identifier for the insights report. */
|
|
2869
|
-
readonly id
|
|
2869
|
+
readonly id?: string;
|
|
2870
2870
|
/** Metadata about the insights report. */
|
|
2871
|
-
readonly metadata
|
|
2871
|
+
readonly metadata?: InsightsMetadata;
|
|
2872
2872
|
/** The current state of the insights. */
|
|
2873
|
-
readonly state
|
|
2873
|
+
readonly state?: OperationState;
|
|
2874
2874
|
/** User friendly display name for the insight. */
|
|
2875
2875
|
displayName: string;
|
|
2876
2876
|
/** Request for the insights analysis. */
|
|
@@ -3163,7 +3163,7 @@ export declare function insightArrayDeserializer(result: Array<Insight>): any[];
|
|
|
3163
3163
|
/** Schedule model. */
|
|
3164
3164
|
export interface Schedule {
|
|
3165
3165
|
/** Identifier of the schedule. */
|
|
3166
|
-
readonly id
|
|
3166
|
+
readonly id?: string;
|
|
3167
3167
|
/** Name of the schedule. */
|
|
3168
3168
|
displayName?: string;
|
|
3169
3169
|
/** Description of the schedule. */
|
|
@@ -3181,7 +3181,7 @@ export interface Schedule {
|
|
|
3181
3181
|
/** Schedule's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. */
|
|
3182
3182
|
properties?: Record<string, string>;
|
|
3183
3183
|
/** System metadata for the resource. */
|
|
3184
|
-
readonly systemData
|
|
3184
|
+
readonly systemData?: Record<string, string>;
|
|
3185
3185
|
}
|
|
3186
3186
|
export declare function scheduleSerializer(item: Schedule): any;
|
|
3187
3187
|
export declare function scheduleDeserializer(item: any): Schedule;
|