modelfusion 0.27.2 → 0.27.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.
@@ -6,20 +6,29 @@ const loadApiKey_js_1 = require("../../util/api/loadApiKey.cjs");
6
6
  /**
7
7
  * Cconfiguration for the Azure OpenAI API. This class is responsible for constructing URLs specific to the Azure OpenAI deployment.
8
8
  * It creates URLs of the form
9
- * `[baseUrl]/[path]?api-version=[apiVersion]`
10
- *
11
- * The `baseUrl` should have a format similar to: `https://${resourceName}.openai.azure.com/openai/deployments/${deploymentId}`
12
- * (no trailing slash).
9
+ * `https://[resourceName].openai.azure.com/openai/deployments/[deploymentId]/[path]?api-version=[apiVersion]`
13
10
  *
14
11
  * @see https://learn.microsoft.com/en-us/azure/ai-services/openai/reference
15
12
  */
16
13
  class AzureOpenAIApiConfiguration extends BasicApiConfiguration_js_1.BasicApiConfiguration {
17
- constructor({ baseUrl, apiVersion, apiKey, retry, throttle, }) {
14
+ constructor({ resourceName, deploymentId, apiVersion, apiKey, retry, throttle, }) {
18
15
  super({
19
- baseUrl,
16
+ baseUrl: `https://${resourceName}.openai.azure.com/openai/deployments/${deploymentId}`,
20
17
  retry,
21
18
  throttle,
22
19
  });
20
+ Object.defineProperty(this, "resourceName", {
21
+ enumerable: true,
22
+ configurable: true,
23
+ writable: true,
24
+ value: void 0
25
+ });
26
+ Object.defineProperty(this, "deploymentId", {
27
+ enumerable: true,
28
+ configurable: true,
29
+ writable: true,
30
+ value: void 0
31
+ });
23
32
  Object.defineProperty(this, "apiVersion", {
24
33
  enumerable: true,
25
34
  configurable: true,
@@ -32,6 +41,8 @@ class AzureOpenAIApiConfiguration extends BasicApiConfiguration_js_1.BasicApiCon
32
41
  writable: true,
33
42
  value: void 0
34
43
  });
44
+ this.resourceName = resourceName;
45
+ this.deploymentId = deploymentId;
35
46
  this.apiVersion = apiVersion;
36
47
  this.apiKey = (0, loadApiKey_js_1.loadApiKey)({
37
48
  apiKey,
@@ -4,18 +4,18 @@ import { ThrottleFunction } from "../../util/api/ThrottleFunction.js";
4
4
  /**
5
5
  * Cconfiguration for the Azure OpenAI API. This class is responsible for constructing URLs specific to the Azure OpenAI deployment.
6
6
  * It creates URLs of the form
7
- * `[baseUrl]/[path]?api-version=[apiVersion]`
8
- *
9
- * The `baseUrl` should have a format similar to: `https://${resourceName}.openai.azure.com/openai/deployments/${deploymentId}`
10
- * (no trailing slash).
7
+ * `https://[resourceName].openai.azure.com/openai/deployments/[deploymentId]/[path]?api-version=[apiVersion]`
11
8
  *
12
9
  * @see https://learn.microsoft.com/en-us/azure/ai-services/openai/reference
13
10
  */
14
11
  export declare class AzureOpenAIApiConfiguration extends BasicApiConfiguration {
12
+ readonly resourceName: string;
13
+ readonly deploymentId: string;
15
14
  readonly apiVersion: string;
16
15
  readonly apiKey: string;
17
- constructor({ baseUrl, apiVersion, apiKey, retry, throttle, }: {
18
- baseUrl: string;
16
+ constructor({ resourceName, deploymentId, apiVersion, apiKey, retry, throttle, }: {
17
+ resourceName: string;
18
+ deploymentId: string;
19
19
  apiVersion: string;
20
20
  apiKey?: string;
21
21
  retry?: RetryFunction;
@@ -3,20 +3,29 @@ import { loadApiKey } from "../../util/api/loadApiKey.js";
3
3
  /**
4
4
  * Cconfiguration for the Azure OpenAI API. This class is responsible for constructing URLs specific to the Azure OpenAI deployment.
5
5
  * It creates URLs of the form
6
- * `[baseUrl]/[path]?api-version=[apiVersion]`
7
- *
8
- * The `baseUrl` should have a format similar to: `https://${resourceName}.openai.azure.com/openai/deployments/${deploymentId}`
9
- * (no trailing slash).
6
+ * `https://[resourceName].openai.azure.com/openai/deployments/[deploymentId]/[path]?api-version=[apiVersion]`
10
7
  *
11
8
  * @see https://learn.microsoft.com/en-us/azure/ai-services/openai/reference
12
9
  */
13
10
  export class AzureOpenAIApiConfiguration extends BasicApiConfiguration {
14
- constructor({ baseUrl, apiVersion, apiKey, retry, throttle, }) {
11
+ constructor({ resourceName, deploymentId, apiVersion, apiKey, retry, throttle, }) {
15
12
  super({
16
- baseUrl,
13
+ baseUrl: `https://${resourceName}.openai.azure.com/openai/deployments/${deploymentId}`,
17
14
  retry,
18
15
  throttle,
19
16
  });
17
+ Object.defineProperty(this, "resourceName", {
18
+ enumerable: true,
19
+ configurable: true,
20
+ writable: true,
21
+ value: void 0
22
+ });
23
+ Object.defineProperty(this, "deploymentId", {
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true,
27
+ value: void 0
28
+ });
20
29
  Object.defineProperty(this, "apiVersion", {
21
30
  enumerable: true,
22
31
  configurable: true,
@@ -29,6 +38,8 @@ export class AzureOpenAIApiConfiguration extends BasicApiConfiguration {
29
38
  writable: true,
30
39
  value: void 0
31
40
  });
41
+ this.resourceName = resourceName;
42
+ this.deploymentId = deploymentId;
32
43
  this.apiVersion = apiVersion;
33
44
  this.apiKey = loadApiKey({
34
45
  apiKey,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modelfusion",
3
3
  "description": "Build AI applications, chatbots, and agents with JavaScript and TypeScript.",
4
- "version": "0.27.2",
4
+ "version": "0.27.3",
5
5
  "author": "Lars Grammel",
6
6
  "license": "MIT",
7
7
  "keywords": [