modelfusion 0.27.1 → 0.27.2

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,29 +6,20 @@ 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
- * `https://[resourceName].openai.azure.com/openai/deployments/[deploymentId]/[path]?api-version=[apiVersion]`
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).
10
13
  *
11
14
  * @see https://learn.microsoft.com/en-us/azure/ai-services/openai/reference
12
15
  */
13
16
  class AzureOpenAIApiConfiguration extends BasicApiConfiguration_js_1.BasicApiConfiguration {
14
- constructor({ resourceName, deploymentId, apiVersion, apiKey, retry, throttle, }) {
17
+ constructor({ baseUrl, apiVersion, apiKey, retry, throttle, }) {
15
18
  super({
16
- baseUrl: `https://${resourceName}.openai.azure.com/openai/deployments/${deploymentId}`,
19
+ baseUrl,
17
20
  retry,
18
21
  throttle,
19
22
  });
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
- });
32
23
  Object.defineProperty(this, "apiVersion", {
33
24
  enumerable: true,
34
25
  configurable: true,
@@ -41,8 +32,6 @@ class AzureOpenAIApiConfiguration extends BasicApiConfiguration_js_1.BasicApiCon
41
32
  writable: true,
42
33
  value: void 0
43
34
  });
44
- this.resourceName = resourceName;
45
- this.deploymentId = deploymentId;
46
35
  this.apiVersion = apiVersion;
47
36
  this.apiKey = (0, loadApiKey_js_1.loadApiKey)({
48
37
  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
- * `https://[resourceName].openai.azure.com/openai/deployments/[deploymentId]/[path]?api-version=[apiVersion]`
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).
8
11
  *
9
12
  * @see https://learn.microsoft.com/en-us/azure/ai-services/openai/reference
10
13
  */
11
14
  export declare class AzureOpenAIApiConfiguration extends BasicApiConfiguration {
12
- readonly resourceName: string;
13
- readonly deploymentId: string;
14
15
  readonly apiVersion: string;
15
16
  readonly apiKey: string;
16
- constructor({ resourceName, deploymentId, apiVersion, apiKey, retry, throttle, }: {
17
- resourceName: string;
18
- deploymentId: string;
17
+ constructor({ baseUrl, apiVersion, apiKey, retry, throttle, }: {
18
+ baseUrl: string;
19
19
  apiVersion: string;
20
20
  apiKey?: string;
21
21
  retry?: RetryFunction;
@@ -3,29 +3,20 @@ 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
- * `https://[resourceName].openai.azure.com/openai/deployments/[deploymentId]/[path]?api-version=[apiVersion]`
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).
7
10
  *
8
11
  * @see https://learn.microsoft.com/en-us/azure/ai-services/openai/reference
9
12
  */
10
13
  export class AzureOpenAIApiConfiguration extends BasicApiConfiguration {
11
- constructor({ resourceName, deploymentId, apiVersion, apiKey, retry, throttle, }) {
14
+ constructor({ baseUrl, apiVersion, apiKey, retry, throttle, }) {
12
15
  super({
13
- baseUrl: `https://${resourceName}.openai.azure.com/openai/deployments/${deploymentId}`,
16
+ baseUrl,
14
17
  retry,
15
18
  throttle,
16
19
  });
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
- });
29
20
  Object.defineProperty(this, "apiVersion", {
30
21
  enumerable: true,
31
22
  configurable: true,
@@ -38,8 +29,6 @@ export class AzureOpenAIApiConfiguration extends BasicApiConfiguration {
38
29
  writable: true,
39
30
  value: void 0
40
31
  });
41
- this.resourceName = resourceName;
42
- this.deploymentId = deploymentId;
43
32
  this.apiVersion = apiVersion;
44
33
  this.apiKey = loadApiKey({
45
34
  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.1",
4
+ "version": "0.27.2",
5
5
  "author": "Lars Grammel",
6
6
  "license": "MIT",
7
7
  "keywords": [