@azure/ai-projects 2.0.0-alpha.20260105.1 → 2.0.0-alpha.20260108.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.
Files changed (66) hide show
  1. package/README.md +1 -1
  2. package/dist/browser/aiProjectClient.d.ts.map +1 -1
  3. package/dist/browser/aiProjectClient.js +6 -0
  4. package/dist/browser/aiProjectClient.js.map +1 -1
  5. package/dist/browser/api/aiProjectContext.js +1 -1
  6. package/dist/browser/api/aiProjectContext.js.map +1 -1
  7. package/dist/browser/constants.d.ts +1 -1
  8. package/dist/browser/constants.js +1 -1
  9. package/dist/browser/constants.js.map +1 -1
  10. package/dist/browser/getCustomFetch-browser.d.mts.map +1 -0
  11. package/dist/browser/getCustomFetch-browser.mjs.map +1 -0
  12. package/dist/browser/getCustomFetch.d.ts +13 -0
  13. package/dist/browser/getCustomFetch.js +40 -0
  14. package/dist/browser/models/models.d.ts +1 -1
  15. package/dist/browser/models/models.d.ts.map +1 -1
  16. package/dist/browser/models/models.js +1 -1
  17. package/dist/browser/models/models.js.map +1 -1
  18. package/dist/commonjs/aiProjectClient.d.ts.map +1 -1
  19. package/dist/commonjs/aiProjectClient.js +6 -0
  20. package/dist/commonjs/aiProjectClient.js.map +1 -1
  21. package/dist/commonjs/api/aiProjectContext.js +1 -1
  22. package/dist/commonjs/api/aiProjectContext.js.map +1 -1
  23. package/dist/commonjs/constants.d.ts +1 -1
  24. package/dist/commonjs/constants.js +1 -1
  25. package/dist/commonjs/constants.js.map +1 -1
  26. package/dist/commonjs/getCustomFetch.d.ts +13 -0
  27. package/dist/commonjs/getCustomFetch.d.ts.map +1 -0
  28. package/dist/commonjs/getCustomFetch.js +45 -0
  29. package/dist/commonjs/getCustomFetch.js.map +1 -0
  30. package/dist/commonjs/models/models.d.ts +1 -1
  31. package/dist/commonjs/models/models.d.ts.map +1 -1
  32. package/dist/commonjs/models/models.js +1 -1
  33. package/dist/commonjs/models/models.js.map +1 -1
  34. package/dist/esm/aiProjectClient.d.ts.map +1 -1
  35. package/dist/esm/aiProjectClient.js +6 -0
  36. package/dist/esm/aiProjectClient.js.map +1 -1
  37. package/dist/esm/api/aiProjectContext.js +1 -1
  38. package/dist/esm/api/aiProjectContext.js.map +1 -1
  39. package/dist/esm/constants.d.ts +1 -1
  40. package/dist/esm/constants.js +1 -1
  41. package/dist/esm/constants.js.map +1 -1
  42. package/dist/esm/getCustomFetch.d.ts +13 -0
  43. package/dist/esm/getCustomFetch.d.ts.map +1 -0
  44. package/dist/esm/getCustomFetch.js +42 -0
  45. package/dist/esm/getCustomFetch.js.map +1 -0
  46. package/dist/esm/models/models.d.ts +1 -1
  47. package/dist/esm/models/models.d.ts.map +1 -1
  48. package/dist/esm/models/models.js +1 -1
  49. package/dist/esm/models/models.js.map +1 -1
  50. package/dist/react-native/aiProjectClient.d.ts.map +1 -1
  51. package/dist/react-native/aiProjectClient.js +6 -0
  52. package/dist/react-native/aiProjectClient.js.map +1 -1
  53. package/dist/react-native/api/aiProjectContext.js +1 -1
  54. package/dist/react-native/api/aiProjectContext.js.map +1 -1
  55. package/dist/react-native/constants.d.ts +1 -1
  56. package/dist/react-native/constants.js +1 -1
  57. package/dist/react-native/constants.js.map +1 -1
  58. package/dist/react-native/getCustomFetch.d.ts +13 -0
  59. package/dist/react-native/getCustomFetch.d.ts.map +1 -0
  60. package/dist/react-native/getCustomFetch.js +42 -0
  61. package/dist/react-native/getCustomFetch.js.map +1 -0
  62. package/dist/react-native/models/models.d.ts +1 -1
  63. package/dist/react-native/models/models.d.ts.map +1 -1
  64. package/dist/react-native/models/models.js +1 -1
  65. package/dist/react-native/models/models.js.map +1 -1
  66. package/package.json +5 -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,gBAAg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CAAwC;IACxC,SAAgB,QAAQ,EAAE,kBAAkB,CAAC;IAC7C,2CAA2C;IAC3C,SAAgB,WAAW,EAAE,qBAAqB,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"}
@@ -18,6 +18,7 @@ import { _getTelemetryOperations } from "./classic/telemetry/index.js";
18
18
  import { _getRedTeamsOperations } from "./classic/redTeams/index.js";
19
19
  import { _getSchedulesOperations } from "./classic/schedules/index.js";
20
20
  import { overwriteOpenAIClient } from "./overwriteOpenAIClient.js";
21
+ import { getCustomFetch } from "./getCustomFetch.js";
21
22
  /**
22
23
  * The main client for the AIProjectClient service. It provides access to the various operations available in the service.
23
24
  * @class AIProjectClient
@@ -111,11 +112,16 @@ export class AIProjectClient {
111
112
  async getOpenAIClient() {
112
113
  const scope = "https://ai.azure.com/.default";
113
114
  const azureADTokenProvider = await getBearerTokenProvider(this._credential, scope);
115
+ let customFetch;
116
+ if (this._options.additionalPolicies?.find((policy) => policy.policy.name === "recording policy")) {
117
+ customFetch = getCustomFetch(this._azureScopeClient.pipeline, this._options.httpClient);
118
+ }
114
119
  const openAIOptions = {
115
120
  apiKey: azureADTokenProvider,
116
121
  baseURL: `${this._endpoint}/openai`,
117
122
  defaultQuery: { "api-version": this._options?.apiVersion || "2025-11-15-preview" },
118
123
  dangerouslyAllowBrowser: true,
124
+ fetch: customFetch,
119
125
  };
120
126
  const openaiClient = new OpenAI(openAIOptions);
121
127
  return overwriteOpenAIClient(openaiClient);
@@ -1 +1 @@
1
- {"version":3,"file":"aiProjectClient.js","sourceRoot":"","sources":["../../src/aiProjectClient.ts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,QAAQ,EAAE,UAAU,IAAI,oBAAoB,EAAE;YAClF,uBAAuB,EAAE,IAAI;SAC9B,CAAC;QAEF,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC;QAC/C,OAAO,qBAAqB,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;IACD;;;OAGG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF","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,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAmD,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAoB,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAyB,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAsB,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAyB,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAEL,6BAA6B,GAC9B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAEL,kCAAkC,GACnC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAwB,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC/F,OAAO,EAAqB,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAsB,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAEL,0BAA0B,GAC3B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAuB,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EAAsB,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAuB,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAE5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACn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C/C;;;OAGG;IACI,KAAK,CAAC,eAAe;QAC1B,MAAM,KAAK,GAAG,+BAA+B,CAAC;QAC9C,MAAM,oBAAoB,GAAG,MAAM,sBAAsB,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QACnF,IAAI,WAA0E,CAAC;QAE/E,IACE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,kBAAkB,CAAC,EAC7F,CAAC;YACD,WAAW,GAAG,cAAc,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QAC1F,CAAC;QAED,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;YAC7B,KAAK,EAAE,WAAW;SACnB,CAAC;QAEF,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC;QAC/C,OAAO,qBAAqB,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;IACD;;;OAGG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF","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\";\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"]}
@@ -6,7 +6,7 @@ import { getClient } from "@azure-rest/core-client";
6
6
  export function createAIProject(endpoint, credential, options = {}) {
7
7
  const endpointUrl = options.endpoint ?? String(endpoint);
8
8
  const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
9
- const userAgentInfo = `azsdk-js-ai-projects/2.0.0-beta.2`;
9
+ const userAgentInfo = `azsdk-js-ai-projects/2.0.0-beta.3`;
10
10
  const userAgentPrefix = prefixFromOptions
11
11
  ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`
12
12
  : `azsdk-js-api ${userAgentInfo}`;
@@ -1 +1 @@
1
- {"version":3,"file":"aiProjectContext.js","sourceRoot":"","sources":["../../../src/api/aiProjectContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAyB,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAgB3E,MAAM,UAAU,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,MAAM,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,SAAS,CAAC,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,gBAAgB,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.2`;\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"]}
1
+ {"version":3,"file":"aiProjectContext.js","sourceRoot":"","sources":["../../../src/api/aiProjectContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAyB,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAgB3E,MAAM,UAAU,eAAe,CAC7B,QAAgB,EAChB,UAA2B,E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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"]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Current version of the `@azure/ai-projects` package.
3
3
  */
4
- export declare const SDK_VERSION = "2.0.0-beta.2";
4
+ export declare const SDK_VERSION = "2.0.0-beta.3";
5
5
  /**
6
6
  * The package name of the `@azure/ai-projects` package.
7
7
  */
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Current version of the `@azure/ai-projects` package.
5
5
  */
6
- export const SDK_VERSION = `2.0.0-beta.2`;
6
+ export const SDK_VERSION = `2.0.0-beta.3`;
7
7
  /**
8
8
  * The package name of the `@azure/ai-projects` package.
9
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Current version of the `@azure/ai-projects` package.\n */\nexport const SDK_VERSION = `2.0.0-beta.2`;\n\n/**\n * The package name of the `@azure/ai-projects` package.\n */\nexport const PACKAGE_NAME = \"@azure/ai-projects\";\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Current version of the `@azure/ai-projects` package.\n */\nexport const SDK_VERSION = `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,42 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { createDefaultHttpClient, createPipelineRequest, createHttpHeaders, } from "@azure/core-rest-pipeline";
4
+ import { Readable } from "node:stream";
5
+ /**
6
+ * A custom `fetch` implementation that forwards requests to an Azure Core Pipeline.
7
+ * This allows us to send traffic to the test proxy for recording and playback.
8
+ * @param pipeline - The pipeline to use
9
+ * @param customHttpClient - The http client to make requests with
10
+ * @returns A fetch-compatible function.
11
+ */
12
+ export function getCustomFetch(pipeline, customHttpClient) {
13
+ return async function (resource, options) {
14
+ const fetchRequest = new Request(resource, options);
15
+ const rawHeaders = {};
16
+ for (const [key, value] of fetchRequest.headers) {
17
+ rawHeaders[key] = value;
18
+ }
19
+ const httpClient = customHttpClient ?? createDefaultHttpClient();
20
+ const requestBody = fetchRequest.body
21
+ ? Readable.fromWeb(fetchRequest.body)
22
+ : undefined;
23
+ const request = createPipelineRequest({
24
+ url: fetchRequest.url,
25
+ body: requestBody,
26
+ headers: createHttpHeaders(rawHeaders),
27
+ method: fetchRequest.method,
28
+ abortSignal: fetchRequest.signal,
29
+ streamResponseStatusCodes: new Set([Number.POSITIVE_INFINITY]),
30
+ });
31
+ const response = await pipeline.sendRequest(httpClient, request);
32
+ const body = response.readableStreamBody
33
+ ? Readable.toWeb(Readable.from(response.readableStreamBody))
34
+ : null;
35
+ const fetchResponse = new Response(body, {
36
+ status: response.status,
37
+ headers: response.headers.toJSON({ preserveCase: true }),
38
+ });
39
+ return fetchResponse;
40
+ };
41
+ }
42
+ //# sourceMappingURL=getCustomFetch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCustomFetch.js","sourceRoot":"","sources":["../../src/getCustomFetch.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAC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CAAC,IAAI,EAAE;YACvC,MAAM,EAAE,QAAQ,CAAC,MAAM;YACvB,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;SACzD,CAAC,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?: Record<string, any>;
1059
+ additionalProperties?: boolean;
1060
1060
  }
1061
1061
  export declare function responseFormatJsonSchemaSchemaSerializer(item: ResponseFormatJsonSchemaSchema): any;
1062
1062
  export declare function responseFormatJsonSchemaSchemaDeserializer(item: any): ResponseFormatJsonSchemaSchema;